-!function(){"use strict";angular.module("app.auth",[])}(),function(){"use strict";angular.module("app.core",["ngAnimate","ngAria","ngCookies","ngMessages","ngResource","ngSanitize","ngMaterial","pascalprecht.translate","ui.router","gridster","ds.clock","angucomplete-alt"])}(),function(){"use strict";function e(e,t){e.state("app.errors_error-404",{url:"/errors/error-404",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-404":{templateUrl:"app/errors/404/error-404.html",controller:"Error404Controller as vm"}},params:{status:404,statusText:"",data:{},config:{}},bodyClass:"error-404"}),t.addPart("app/errors/404")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-404",[]).config(e)}(),function(){"use strict";function e(e,t){e.state("app.errors_error-500",{url:"/errors/error-500",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-500":{templateUrl:"app/errors/500/error-500.html",controller:"Error500Controller as vm"}},params:{status:500,statusText:"",data:{},config:{}},bodyClass:"error-500"}),t.addPart("app/errors/500")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-500",[]).config(e)}(),function(){"use strict";angular.module("app.errors",["app.errors.error-404","app.errors.error-500"])}(),function(){"use strict";function e(e){e.addPart("app/footer")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.footer",[]).config(e)}(),function(){"use strict";function e(e,t){e.state("app.forgot",{url:"/forgot",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.forgot":{templateUrl:"app/forgot/forgot.html",controller:"ForgotPasswordController as vm"}},bodyClass:"forgot"}),t.addPart("app/forgot")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.forgot",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/header")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.header",[]).config(e)}(),function(){"use strict";angular.module("motion",["angular-toasty","app.core","app.auth","app.navigation","app.toolbar","app.quick-panel","app.header","app.footer","app.dashboards","app.staff","app.contactmanager","app.voice","app.chat","app.mail","app.sms","app.openchannel","app.fax","app.tools","app.callysquare","app.analytics","app.integrations","app.settings","app.help","app.motiondialer","app.jscripty","app.login","app.forgot","app.reset","app.errors"])}(),function(){"use strict";function e(e,t){e.state("app.login",{url:"/login?token&userId",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.login":{templateUrl:"app/login/login.html",controller:"LoginController as vm"}},bodyClass:"login"}),t.addPart("app/login")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.login",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.analytics",{abstract:!0,url:"/analytics"}).state("app.analytics.metrics",{url:"/metrics",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/metrics/metrics.html",controller:"MetricsController as vm"}},resolve:{metrics:["apiResolver",function(e){return e.resolve("analyticMetric@get",{fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1201,bodyClass:"analytics"}).state("app.analytics.extractedReports",{url:"/extractedReports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/extractedReports/extractedReports.html",controller:"ExtractedReportsController as vm"}},resolve:{extractedReports:["apiResolver",function(e){return e.resolve("analyticExtractedReport@get",{fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,createdAt,status,output",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1202,bodyClass:"analytics"}),t.addPart("app/main/apps/analytics")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.analytics",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.analytics.reports"]).config(e)}(),function(){"use strict";function e(e){e.state("app.analytics.reports",{url:"/reports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/reports.html",controller:"ReportsController as vm"}},resolve:{treeReports:["apiResolver",function(e){return e.resolve("analyticTreeReport@get",{fields:"id,tree",limit:10,offset:0})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"}).state("app.analytics.reports.edit",{url:"/:id?tab",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/edit/view.html",controller:"ReportController as vm"}},resolve:{report:["apiResolver","$stateParams","$q","describeTable",function(e,t,a,i){var o;return e.resolve("analyticCustomReport@get",{fields:"createdAt,updatedAt,id,name,description,table,conditions,joins",id:t.id}).then(function(e){var t=[];if((o=e).joins)try{o.joins=JSON.parse(o.joins);for(var n=0;n<o.joins.length;n+=1)t.push(i.getColumns(o.joins[n].foreignTable))}catch(e){console.log(e)}return a.all(t)}).then(function(e){for(var t=0;t<e.length;t+=1)o.joins[t].foreignTableFields=_.difference(_.keys(e[t]),["$promise","$resolved"]);return o})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"})}e.$inject=["$stateProvider"],angular.module("app.analytics.reports",["ngJsTree"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.callysquare",{abstract:!0,url:"/callysquare"}).state("app.callysquare.odbcs",{url:"/odbcs",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/odbcs/odbcs.html",controller:"OdbcsController as vm"}},resolve:{odbcs:["apiResolver",function(e){return e.resolve("squareOdbc@get",{fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1101,bodyClass:"callysquare"}).state("app.callysquare.squareRecordings",{url:"/squareRecordings",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",controller:"SquareRecordingsController as vm"}},resolve:{squareRecordings:["apiResolver",function(e){return e.resolve("squareRecording@get",{fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,createdAt",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1102,bodyClass:"callysquare"}),t.addPart("app/main/apps/callysquare")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.callysquare",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.callysquare.projects"]).config(e)}(),function(){"use strict";function e(e){e.state("app.callysquare.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/projects.html",controller:"ProjectsController as vm"}},resolve:{projects:["apiResolver",function(e){return e.resolve("squareProject@get",{fields:"id,name,description,notes",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"}).state("app.callysquare.projects.edit",{url:"/:id?tab",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/edit/view.html",controller:"ProjectController as vm"}},resolve:{project:["apiResolver","$stateParams",function(e,t){return e.resolve("squareProject@get",{id:t.id})}],users:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,fullname,role",sort:"name",nolimit:!0})}],trunks:["apiResolver",function(e){return e.resolve("trunk@get",{fields:"id,name",sort:"name",nolimit:!0})}],queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"name",nolimit:!0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,type:"inbound",fields:"id,name",sort:"name",nolimit:!0,channel:"voice"})}],sounds:["apiResolver",function(e){return e.resolve("sound@get",{fields:"id,name",sort:"name",nolimit:!0})}],variables:["apiResolver",function(e){return e.resolve("variable@get",{fields:"id,name",sort:"name",nolimit:!0})}],databases:["apiResolver",function(e){return e.resolve("squareOdbc@get",{fields:"id,name",sort:"name",nolimit:!0})}],projects:["apiResolver",function(e){return e.resolve("squareProject@get",{fields:"id,name",sort:"name",nolimit:!0})}],contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"id,name",sort:"name",nolimit:!0})}],intervals:["apiResolver",function(e){return e.resolve("interval@get",{fields:"id,name,IntervalId",sort:"name",nolimit:!0})}],mailAccounts:["apiResolver",function(e){return e.resolve("mailAccount@get",{fields:"id,name",sort:"name",nolimit:!0})}],templates:["apiResolver",function(e){return e.resolve("template@get",{fields:"id,name",sort:"name",nolimit:!0})}],lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0})}],smsAccounts:["apiResolver",function(e){return e.resolve("smsAccount@get",{fields:"id,name",sort:"name",nolimit:!0})}],pauses:["apiResolver",function(e){return e.resolve("pause@get",{fields:"id,name",sort:"name",nolimit:!0})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"})}e.$inject=["$stateProvider"],angular.module("app.callysquare.projects",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.chat",{abstract:!0,url:"/chat"}).state("app.chat.chatQueues",{url:"/chatQueues",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/chatQueues.html",controller:"ChatQueuesController as vm"}},resolve:{chatQueues:["apiResolver",function(e){return e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatQueues.edit",{url:"/:id?tab",params:{chatQueue:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/edit/view.html",controller:"ChatQueueController as vm"}},resolve:{chatQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatWebsites",{url:"/chatWebsites",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/chatWebsites.html",controller:"ChatWebsitesController as vm"}},resolve:{chatWebsites:["apiResolver",function(e){return e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,fontSize,header_shape,showAgentAvatar,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,header_offline,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardTranscript,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}).state("app.chat.chatWebsites.edit",{url:"/:id?tab",params:{chatWebsite:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/edit/view.html",controller:"ChatWebsiteController as vm"}},resolve:{chatWebsite:["apiResolver","$stateParams",function(e,t){return e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,fontSize,header_shape,showAgentAvatar,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,header_offline,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardTranscript,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",id:t.id})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}),t.addPart("app/main/apps/chat")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.chat",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.chat.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.chat.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/chat/views/realtime/realtime.html",controller:"ChatRealtimeController as vm"}},authenticate:!0,permissionId:510}).state("app.chat.realtime.agents",{url:"/agents",controller:"AgentsChatRealtimeController as vm",templateUrl:"app/main/apps/chat/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:510}).state("app.chat.realtime.queues",{url:"/queues",controller:"QueuesChatRealtimeController as vm",templateUrl:"app/main/apps/chat/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("chatQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"chat",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getChatQueues")}]},authenticate:!0,permissionId:510})}e.$inject=["$stateProvider"],angular.module("app.chat.realtime",["timer"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.contactmanager",{abstract:!0,url:"/contactmanager"}).state("app.contactmanager.lists",{url:"/lists",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/lists.html",controller:"ListsController as vm"}},resolve:{lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.lists.edit",{url:"/:id?tab",params:{list:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/edit/view.html",controller:"ListController as vm"}},resolve:{list:["apiResolver","$stateParams",function(e,t){return e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",id:t.id})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.companies",{url:"/companies",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/companies.html",controller:"CompaniesController as vm"}},resolve:{companies:["apiResolver",function(e){return e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.companies.edit",{url:"/:id?tab",params:{company:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/edit/view.html",controller:"CompanyController as vm"}},resolve:{company:["apiResolver","$stateParams",function(e,t){return e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",id:t.id})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.globalCustomFields",{url:"/globalCustomFields",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",controller:"GlobalCustomFieldsController as vm"}},resolve:{globalCustomFields:["apiResolver",function(e){return e.resolve("cmCustomField@get",{fields:"createdAt,updatedAt,id,alias,type,values,required",sort:"-updatedAt",ListId:"null",limit:10,offset:0})}]},authenticate:!0,permissionId:304,bodyClass:"contactmanager"}),t.addPart("app/main/apps/contactmanager")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.contactmanager",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.contactmanager.contacts"]).config(e)}(),function(){"use strict";function e(e){e.state("app.contactmanager.contacts",{url:"/contacts?ListId&CompanyId",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/contacts.html",controller:"ContactsController as vm"}},resolve:{contacts:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@get",_.merge({sort:"-updatedAt",limit:10,offset:0},t))}],lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0})}],listsMap:["lists",function(e){for(var t={},n=0;n<e.rows.length;n++)t[e.rows[n].id]=e.rows[n].name;return t}],companies:["apiResolver",function(e){return e.resolve("cmCompany@get",{fields:"id,name",sort:"name",nolimit:!0})}],companiesMap:["companies",function(e){for(var t={},n=0;n<e.rows.length;n++)t[e.rows[n].id]=e.rows[n].name;return t}],tags:["apiResolver",function(e){return e.resolve("tag@get",{fields:"id,name",sort:"name",nolimit:!0})}]},authenticate:!0,permissionId:300,bodyClass:"contactmanager"}).state("app.contactmanager.contacts.edit",{url:"/:id?tab",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/edit/view.html",controller:"ContactController as vm"}},resolve:{contact:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@get",{id:t.id}).then(function(e){return e.dateOfBirth&&(e.dateOfBirth=new Date(e.dateOfBirth)),e}).catch(function(e){console.error(e)})}],hoppers:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getHoppers",{id:t.id,fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,offset:0})}],finals:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getHopperFinals",{id:t.id,fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-updatedAt",limit:10,offset:0})}],histories:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getHopperHistories",{id:t.id,fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,offset:0})}],jscriptySessions:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getJscriptySessions",{id:t.id,fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,offset:0})}],companies:["apiResolver","$stateParams",function(e,t){return e.resolve("cmCompany@get")}],lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0})}],customFields:["apiResolver","contact",function(e,t){return t.ListId?e.resolve("cmList@getCustomFields",{id:t.ListId}):null}],tags:["apiResolver","$stateParams",function(e,t){return e.resolve("tag@get")}]},authenticate:!0,permissionId:300,bodyClass:"contactmanager"})}e.$inject=["$stateProvider"],angular.module("app.contactmanager.contacts",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.dashboards",{abstract:!0,url:"/dashboards"}),t.addPart("app/main/apps/dashboards")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.dashboards",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.dashboards.general","app.dashboards.custom"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.custom",{url:"/custom/:id",views:{"content@app":{templateUrl:"app/main/apps/dashboards/views/custom/custom.html",controller:"DashboardCustomController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(t,e){var a;return(e.hasRole("admin")?t.resolve("voiceQueue@get",{fields:"id,name",nolimit:!0}):t.resolve("user@getQueues",{id:e.getCurrentUser().id,fields:"id,name",channel:"voice",nolimit:!0})).then(function(e){return a=e,t.resolve("rpc@getVoiceQueues")}).then(function(e){if(e)for(var t,n=0;n<e.rows.length;n+=1)(t=_.find(a.rows,{id:e.rows[n].id}))&&_.merge(t,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return a})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.custom",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general",{url:"/general",data:{selectedTab:0},views:{"content@app":{templateProvider:["$stateParams","$templateFactory","Auth",function(e,t,n){var a=n.getCurrentUser();return a&&"agent"===a.role?t.fromUrl("app/main/apps/dashboards/views/general/agent/agent.general.html",e):t.fromUrl("app/main/apps/dashboards/views/general/user/user.general.html",e)}],controllerProvider:["Auth",function(e){var t=e.getCurrentUser();return t&&"agent"===t.role?"AgentDashboardGeneralController as vm":"UserDashboardGeneralController as vm"}]}},resolve:{globalUserLists:["apiResolver","Auth",function(e,t){return e.resolve("user@getLists",{id:t.getCurrentUser().id,sort:"name",nolimit:!0})}],globalLists:["apiResolver","Auth",function(e,t){return e.resolve("cmList@get",{sort:"name",nolimit:!0})}],globalTags:["apiResolver",function(e){return e.resolve("tag@get",{sort:"name",nolimit:!0})}],globalCompanies:["apiResolver",function(e){return e.resolve("cmCompany@get",{sort:"name",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general",["ngMaterialDateRangePicker","app.dashboards.general.user"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general.voice",{url:"/voice",data:{selectedTab:0},views:{voice:{templateUrl:"app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",controller:"UserVoiceDashboardGeneralController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],inboundQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"inbound",nolimit:!0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0})}],outbound:["apiResolver",function(e){return e.resolve("rpc@getOutbound")}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.dialer",{url:"/dialer",data:{selectedTab:1},views:{dialer:{templateUrl:"app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",controller:"UserVoiceDashboardDialerController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],outboundQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"outbound",nolimit:!0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general.user",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.fax",{abstract:!0,url:"/fax"}).state("app.fax.faxQueues",{url:"/faxQueues",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/faxQueues.html",controller:"FaxQueuesController as vm"}},resolve:{faxQueues:["apiResolver",function(e){return e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxQueues.edit",{url:"/:id?tab",params:{faxQueue:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/edit/view.html",controller:"FaxQueueController as vm"}},resolve:{faxQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxAccounts",{url:"/faxAccounts",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/faxAccounts.html",controller:"FaxAccountsController as vm"}},resolve:{faxAccounts:["apiResolver",function(e){return e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}).state("app.fax.faxAccounts.edit",{url:"/:id?tab",params:{faxAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/edit/view.html",controller:"FaxAccountController as vm"}},resolve:{faxAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,notificationSound,notificationShake,notificationTemplate",id:t.id})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}),t.addPart("app/main/apps/fax")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.fax",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.fax.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.fax.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/fax/views/realtime/realtime.html",controller:"FaxRealtimeController as vm"}},authenticate:!0,permissionId:910}).state("app.fax.realtime.agents",{url:"/agents",controller:"AgentsFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.trunks",{url:"/trunks",controller:"TrunksFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver",function(e){return e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.queues",{url:"/queues",controller:"QueuesFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("faxQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"fax",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getFaxQueues")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.accounts",{url:"/accounts",controller:"FaxAccountsRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/accounts/view.html",resolve:{faxAccounts:["apiResolver",function(e){return e.resolve("faxAccount@get",{sort:"-name",limit:10,offset:0})}],rpcFaxAccounts:["apiResolver",function(e){return e.resolve("rpc@getFaxAccounts")}]},authenticate:!0,permissionId:910})}e.$inject=["$stateProvider"],angular.module("app.fax.realtime",["timer"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.help",{abstract:!0,url:"/help"}),t.addPart("app/main/apps/help")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.help",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.help.about"]).config(e)}(),function(){"use strict";function e(e){e.state("app.help.about",{url:"/about",views:{"content@app":{templateUrl:"app/main/apps/help/views/about/about.html",controller:"AboutController as vm"}},resolve:{info:["apiResolver",function(e){return e.resolve("version@get")}]},authenticate:!0,permissionId:1405,bodyClass:"help"})}e.$inject=["$stateProvider"],angular.module("app.help.about",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.integrations",{abstract:!0,url:"/integrations"}).state("app.integrations.zendeskAccounts",{url:"/zendeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",controller:"ZendeskAccountsController as vm"}},resolve:{zendeskAccounts:["apiResolver",function(e){return e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",limit:10,offset:0})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.zendeskAccounts.edit",{url:"/:id?tab",params:{zendeskAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/view.html",controller:"ZendeskAccountController as vm"}},resolve:{zendeskAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",id:t.id})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts",{url:"/salesforceAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",controller:"SalesforceAccountsController as vm"}},resolve:{salesforceAccounts:["apiResolver",function(e){return e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",limit:10,offset:0})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts.edit",{url:"/:id?tab",params:{salesforceAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/view.html",controller:"SalesforceAccountController as vm"}},resolve:{salesforceAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",id:t.id})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts",{url:"/freshdeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",controller:"FreshdeskAccountsController as vm"}},resolve:{freshdeskAccounts:["apiResolver",function(e){return e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",limit:10,offset:0})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts.edit",{url:"/:id?tab",params:{freshdeskAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",controller:"FreshdeskAccountController as vm"}},resolve:{freshdeskAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",id:t.id})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts",{url:"/sugarcrmAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",controller:"SugarcrmAccountsController as vm"}},resolve:{sugarcrmAccounts:["apiResolver",function(e){return e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",limit:10,offset:0})}]},authenticate:!0,permissionId:1304,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts.edit",{url:"/:id?tab",params:{sugarcrmAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",controller:"SugarcrmAccountController as vm"}},resolve:{sugarcrmAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",id:t.id})}]},authenticate:!0,permissionId:1304,bodyClass:"integrations"}).state("app.integrations.deskAccounts",{url:"/deskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/deskAccounts.html",controller:"DeskAccountsController as vm"}},resolve:{deskAccounts:["apiResolver",function(e){return e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",limit:10,offset:0})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.deskAccounts.edit",{url:"/:id?tab",params:{deskAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/view.html",controller:"DeskAccountController as vm"}},resolve:{deskAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",id:t.id})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.zohoAccounts",{url:"/zohoAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",controller:"ZohoAccountsController as vm"}},resolve:{zohoAccounts:["apiResolver",function(e){return e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,authToken,serverUrl,description",limit:10,offset:0})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.zohoAccounts.edit",{url:"/:id?tab",params:{zohoAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/view.html",controller:"ZohoAccountController as vm"}},resolve:{zohoAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,authToken,serverUrl,description",id:t.id})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}),t.addPart("app/main/apps/integrations")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.integrations",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.jscripty",{abstract:!0,url:"/jscripty"}).state("app.jscripty.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/projects.html",controller:"JscriptyProjectsController as vm"}},resolve:{projects:["apiResolver",function(e){return e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,description,createdAt,formData",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}).state("app.jscripty.projects.edit",{url:"/:id?tab",params:{project:void 0},views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/edit/view.html",controller:"JscriptyProjectController as vm"}},resolve:{project:["apiResolver","$stateParams",function(e,t){return e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,description,createdAt,formData",id:t.id})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}),t.addPart("app/main/apps/jscripty")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.jscripty",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.mail",{abstract:!0,url:"/mail"}).state("app.mail.mailQueues",{url:"/mailQueues",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/mailQueues.html",controller:"MailQueuesController as vm"}},resolve:{mailQueues:["apiResolver",function(e){return e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailQueues.edit",{url:"/:id?tab",params:{mailQueue:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/edit/view.html",controller:"MailQueueController as vm"}},resolve:{mailQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailAccounts",{url:"/mailAccounts",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/mailAccounts.html",controller:"MailAccountsController as vm"}},resolve:{mailAccounts:["apiResolver",function(e){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailAccounts.edit",{url:"/:id?tab",params:{mailAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/edit/view.html",controller:"MailAccountController as vm"}},resolve:{mailAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",id:t.id})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailSubtatuses",{url:"/mailSubtatuses",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",controller:"MailSubstatusesController as vm"}},resolve:{mailSubtatuses:["apiResolver",function(e){return e.resolve("mailSubstatus@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:603,bodyClass:"mail"}),t.addPart("app/main/apps/mail")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.mail",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.mail.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.mail.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/mail/views/realtime/realtime.html",controller:"MailRealtimeController as vm"}},authenticate:!0,permissionId:610}).state("app.mail.realtime.agents",{url:"/agents",controller:"AgentsMailRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.queues",{url:"/queues",controller:"QueuesMailRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("mailQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"mail",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getMailQueues")}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.accounts",{url:"/accounts",controller:"MailAccountsRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/accounts/view.html",resolve:{mailAccounts:["apiResolver",function(e){return e.resolve("mailAccount@get",{sort:"-name",limit:10,offset:0})}],rpcMailAccounts:["apiResolver",function(e){return e.resolve("rpc@getMailAccounts")}]},authenticate:!0,permissionId:610})}e.$inject=["$stateProvider"],angular.module("app.mail.realtime",["timer"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.motiondialer",{abstract:!0,url:"/motiondialer"}).state("app.motiondialer.queueCampaigns",{url:"/queueCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",controller:"QueueCampaignsController as vm"}},resolve:{queueCampaigns:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.queueCampaigns.edit",{url:"/:id?tab",params:{queueCampaign:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",controller:"QueueCampaignController as vm"}},resolve:{queueCampaign:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description",id:t.id})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns",{url:"/ivrCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",controller:"IvrCampaignsController as vm"}},resolve:{ivrCampaigns:["apiResolver",function(e){return e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns.edit",{url:"/:id?tab",params:{ivrCampaign:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",controller:"IvrCampaignController as vm"}},resolve:{ivrCampaign:["apiResolver","$stateParams",function(e,t){return e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",id:t.id})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}),t.addPart("app/main/apps/motiondialer")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.motiondialer",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.motiondialer.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.motiondialer.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/realtime/realtime.html",controller:"MotionDialerRealtimeController as vm"}},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.agents",{url:"/agents",controller:"AgentsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queues",{url:"/queues",controller:"QueuesMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"voice",type:"outbound",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_calls",{url:"/queue_calls",controller:"QueueCallsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queue_calls/view.html",resolve:{agents:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,name,role",role:"agent",nolimit:!0})}],rpcVoiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,name,role",role:"agent",nolimit:!0})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"voice",type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.ivr_campaigns",{url:"/ivr_campaigns",controller:"IvrCampaignsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",resolve:{campaigns:["apiResolver",function(e){return e.resolve("campaign@get",{sort:"-updatedAt",limit:10,offset:0})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,permissionId:1510})}e.$inject=["$stateProvider"],angular.module("app.motiondialer.realtime",["timer"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.openchannel",{abstract:!0,url:"/openchannel"}).state("app.openchannel.openchannelQueues",{url:"/openchannelQueues",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",controller:"OpenchannelQueuesController as vm"}},resolve:{openchannelQueues:["apiResolver",function(e){return e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelQueues.edit",{url:"/:id?tab",params:{openchannelQueue:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/view.html",controller:"OpenchannelQueueController as vm"}},resolve:{openchannelQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts",{url:"/openchannelAccounts",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",controller:"OpenchannelAccountsController as vm"}},resolve:{openchannelAccounts:["apiResolver",function(e){return e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,replyUri,ListId,waitForTheAssignedAgent,description,receiveUri,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts.edit",{url:"/:id?tab",params:{openchannelAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",controller:"OpenchannelAccountController as vm"}},resolve:{openchannelAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,replyUri,ListId,waitForTheAssignedAgent,description,receiveUri,notificationSound,notificationShake,notificationTemplate",id:t.id})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}),t.addPart("app/main/apps/openchannel")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.openchannel",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.openchannel.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.openchannel.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/realtime/realtime.html",controller:"OpenchannelRealtimeController as vm"}},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.agents",{url:"/agents",controller:"AgentsOpenchannelRealtimeController as vm",templateUrl:"app/main/apps/openchannel/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.queues",{url:"/queues",controller:"QueuesOpenchannelRealtimeController as vm",templateUrl:"app/main/apps/openchannel/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("openchannelQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"openchannel",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getOpenchannelQueues")}]},authenticate:!0,permissionId:810})}e.$inject=["$stateProvider"],angular.module("app.openchannel.realtime",["timer"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.settings",{abstract:!0,url:"/settings"}).state("app.settings.generals",{url:"/generals",views:{"content@app":{templateUrl:"app/main/apps/settings/views/generals/generals.html",controller:"GeneralsController as vm"}},resolve:{generals:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,min_internal,securePassword,callRecordingEncryption,stunaddr,turnaddr,turnusername,turnpassword,phoneBarAutoUpdater,phoneBarAutoUpdaterUrl",limit:10,offset:0})}]},authenticate:!0,permissionId:1401,bodyClass:"settings"}).state("app.settings.smtps",{url:"/smtps",views:{"content@app":{templateUrl:"app/main/apps/settings/views/smtps/smtps.html",controller:"SmtpController as vm"}},resolve:{smtps:["apiResolver",function(e){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,service,name,email,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,description",service:"1",limit:10,offset:0})}]},authenticate:!0,permissionId:1402,bodyClass:"settings"}).state("app.settings.networks",{url:"/networks",views:{"content@app":{templateUrl:"app/main/apps/settings/views/networks/networks.html",controller:"NetworksController as vm"}},resolve:{networks:["apiResolver",function(e){return e.resolve("network@get",{fields:"createdAt,updatedAt,id,type,value,value,createdAt",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1403,bodyClass:"settings"}).state("app.settings.customizations",{url:"/customizations",views:{"content@app":{templateUrl:"app/main/apps/settings/views/customizations/customizations.html",controller:"CustomizationsController as vm"}},resolve:{customizations:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,defaultLogo,defaultLoginLogo,defaultHeaderWhiteLabel,headerWhiteLabel,defaultPageTitle,pageTitle",limit:10,offset:0})}]},authenticate:!0,permissionId:1407,bodyClass:"settings"}),t.addPart("app/main/apps/settings")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.settings",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.settings.updates","app.settings.license","app.settings.system"]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.license",{url:"/license",views:{"content@app":{templateUrl:"app/main/apps/settings/views/license/license.html",controller:"LicenseController as vm"}},authenticate:!0,permissionId:1405,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.license",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.system",{url:"/system?tab",views:{"content@app":{templateUrl:"app/main/apps/settings/views/system/system.html",controller:"SystemController as vm"}},resolve:{system:["apiResolver",function(e){return e.resolve("system@get")}],processes:["apiResolver",function(e){return e.resolve("pm2@get")}]},authenticate:!0,permissionId:1406,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.system",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.updates",{url:"/updates",views:{"content@app":{templateUrl:"app/main/apps/settings/views/updates/updates.html",controller:"UpdatesController as vm"}},resolve:{version:["apiResolver",function(e){return e.resolve("version@get",{latest:!0})}]},authenticate:!0,permissionId:1404,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.updates",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.sms",{abstract:!0,url:"/sms"}).state("app.sms.smsQueues",{url:"/smsQueues",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/smsQueues.html",controller:"SmsQueuesController as vm"}},resolve:{smsQueues:["apiResolver",function(e){return e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsQueues.edit",{url:"/:id?tab",params:{smsQueue:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/edit/view.html",controller:"SmsQueueController as vm"}},resolve:{smsQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsAccounts",{url:"/smsAccounts",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/smsAccounts.html",controller:"SmsAccountsController as vm"}},resolve:{smsAccounts:["apiResolver",function(e){return e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,smsMethod,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}).state("app.sms.smsAccounts.edit",{url:"/:id?tab",params:{smsAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/edit/view.html",controller:"SmsAccountController as vm"}},resolve:{smsAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,smsMethod,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",id:t.id})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}),t.addPart("app/main/apps/sms")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.sms",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.sms.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.sms.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/sms/views/realtime/realtime.html",controller:"SmsRealtimeController as vm"}},authenticate:!0,permissionId:710}).state("app.sms.realtime.agents",{url:"/agents",controller:"AgentsSmsRealtimeController as vm",templateUrl:"app/main/apps/sms/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:710}).state("app.sms.realtime.queues",{url:"/queues",controller:"QueuesSmsRealtimeController as vm",templateUrl:"app/main/apps/sms/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("smsQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"sms",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getSmsQueues")}]},authenticate:!0,permissionId:710})}e.$inject=["$stateProvider"],angular.module("app.sms.realtime",["timer"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.staff",{abstract:!0,url:"/staff"}).state("app.staff.users",{url:"/users",views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/users.html",controller:"UsersController as vm"}},resolve:{users:["apiResolver",function(e){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,permissions,crudPermissions,passwordResetAt,passwordResetAt",role:"admin,user",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.users.edit",{url:"/:id?tab",params:{user:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/edit/view.html",controller:"UserController as vm"}},resolve:{user:["apiResolver","$stateParams",function(e,t){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,permissions,crudPermissions,passwordResetAt,passwordResetAt",id:t.id})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.agents",{url:"/agents",views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/agents.html",controller:"AgentsController as vm"}},resolve:{agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,email,phone,mobile,userpic,password,showWebBar,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,voicemail,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,passwordResetAt,passwordResetAt",role:"agent",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"createdAt,updatedAt,id,role,fullname,name,alias,email,phone,mobile,userpic,password,showWebBar,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,voicemail,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,passwordResetAt,passwordResetAt",role:"agent",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.agents.edit",{url:"/:id?tab",params:{agent:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/edit/view.html",controller:"AgentController as vm"}},resolve:{agent:["apiResolver","$stateParams",function(e,t){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,email,phone,mobile,userpic,password,showWebBar,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,voicemail,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,passwordResetAt,passwordResetAt",id:t.id})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.telephones",{url:"/telephones",views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/telephones.html",controller:"TelephonesController as vm"}},resolve:{telephones:["apiResolver",function(e){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.telephones.edit",{url:"/:id?tab",params:{telephone:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/edit/view.html",controller:"TelephoneController as vm"}},resolve:{telephone:["apiResolver","$stateParams",function(e,t){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,encryption,phone,mobile",id:t.id})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.teams",{url:"/teams",views:{"content@app":{templateUrl:"app/main/apps/staff/views/teams/teams.html",controller:"TeamsController as vm"}},resolve:{teams:["apiResolver",function(e){return e.resolve("team@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:204,bodyClass:"staff"}),t.addPart("app/main/apps/staff")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.staff",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.tools",{abstract:!0,url:"/tools"}).state("app.tools.cannedAnswers",{url:"/cannedAnswers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",controller:"CannedAnswersController as vm"}},resolve:{cannedAnswers:["apiResolver",function(e){return e.resolve("cannedAnswer@get",{fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,offset:0})}]},authenticate:!0,permissionId:1002,bodyClass:"tools"}).state("app.tools.customDashboards",{url:"/customDashboards",views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/customDashboards.html",controller:"CustomDashboardsController as vm"}},resolve:{customDashboards:["apiResolver",function(e){return e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.customDashboards.edit",{url:"/:id?tab",params:{customDashboard:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/edit/view.html",controller:"CustomDashboardController as vm"}},resolve:{customDashboard:["apiResolver","$stateParams",function(e,t){return e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",id:t.id})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.intervals",{url:"/intervals",views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/intervals.html",controller:"IntervalsController as vm"}},resolve:{intervals:["apiResolver",function(e){return e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,offset:0})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.intervals.edit",{url:"/:id?tab",params:{interval:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/edit/view.html",controller:"IntervalController as vm"}},resolve:{interval:["apiResolver","$stateParams",function(e,t){return e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",id:t.id})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.pauses",{url:"/pauses",views:{"content@app":{templateUrl:"app/main/apps/tools/views/pauses/pauses.html",controller:"PausesController as vm"}},resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1005,bodyClass:"tools"}).state("app.tools.schedules",{url:"/schedules",views:{"content@app":{templateUrl:"app/main/apps/tools/views/schedules/schedules.html",controller:"SchedulesController as vm"}},resolve:{schedules:["apiResolver",function(e){return e.resolve("schedule@get",{fields:"createdAt,updatedAt,id,name,type,DefaultReportId,CustomReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:42,bodyClass:"tools"}).state("app.tools.sounds",{url:"/sounds",views:{"content@app":{templateUrl:"app/main/apps/tools/views/sounds/sounds.html",controller:"SoundsController as vm"}},resolve:{sounds:["apiResolver",function(e){return e.resolve("sound@get",{fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1006,bodyClass:"tools"}).state("app.tools.tags",{url:"/tags",views:{"content@app":{templateUrl:"app/main/apps/tools/views/tags/tags.html",controller:"TagsController as vm"}},resolve:{tags:["apiResolver",function(e){return e.resolve("tag@get",{fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1007,bodyClass:"tools"}).state("app.tools.templates",{url:"/templates",views:{"content@app":{templateUrl:"app/main/apps/tools/views/templates/templates.html",controller:"TemplatesController as vm"}},resolve:{templates:["apiResolver",function(e){return e.resolve("template@get",{fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1008,bodyClass:"tools"}).state("app.tools.triggers",{url:"/triggers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/triggers.html",controller:"TriggersController as vm"}},resolve:{triggers:["apiResolver",function(e){return e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1009,bodyClass:"tools"}).state("app.tools.triggers.edit",{url:"/:id?tab",params:{trigger:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/edit/view.html",controller:"TriggerController as vm"}},resolve:{trigger:["apiResolver","$stateParams",function(e,t){return e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",id:t.id})}]},authenticate:!0,permissionId:1009,bodyClass:"tools"}).state("app.tools.trunks",{url:"/trunks",views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/trunks.html",controller:"TrunksController as vm"}},resolve:{trunks:["apiResolver",function(e){return e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,otherFields",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"}).state("app.tools.trunks.edit",{url:"/:id?tab",params:{trunk:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/edit/view.html",controller:"TrunkController as vm"}},resolve:{trunk:["apiResolver","$stateParams",function(e,t){return e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,otherFields",id:t.id})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"}).state("app.tools.variables",{url:"/variables",views:{"content@app":{templateUrl:"app/main/apps/tools/views/variables/variables.html",controller:"VariablesController as vm"}},resolve:{variables:["apiResolver",function(e){return e.resolve("variable@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1011,bodyClass:"tools"}),t.addPart("app/main/apps/tools")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.tools",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/voice/views/realtime/realtime.html",controller:"VoiceRealtimeController as vm"}},authenticate:!0,permissionId:410}).state("app.voice.realtime.agents",{url:"/agents",controller:"AgentsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:410}).state("app.voice.realtime.telephones",{url:"/telephones",controller:"TelephonesVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/telephones/view.html",resolve:{telephones:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,fullname,userpic,internal",role:"telephone",sort:"-updatedAt",limit:10,offset:0})}],rpcTelephones:["apiResolver",function(e){return e.resolve("rpc@getTelephones")}]},authenticate:!0,permissionId:410}).state("app.voice.realtime.trunks",{url:"/trunks",controller:"TrunksVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver",function(e){return e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:410}).state("app.voice.realtime.queues",{url:"/queues",controller:"QueuesVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"voice",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:410}).state("app.voice.realtime.queue_calls",{url:"/queue_calls",controller:"QueueCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queue_calls/view.html",resolve:{agents:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,name,role",role:"agent",nolimit:!0})}],rpcVoiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels")}]},authenticate:!0,permissionId:410}).state("app.voice.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,name,role",role:"agent",nolimit:!0})}]},authenticate:!0,permissionId:410}).state("app.voice.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"voice",type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:410}).state("app.voice.realtime.outbound_calls",{url:"/outbound_calls",controller:"OutboundCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/outbound_calls/view.html",resolve:{rpcCalls:["apiResolver",function(e){return e.resolve("rpc@getOutboundChannels")}]},authenticate:!0,permissionId:410})}e.$inject=["$stateProvider"],angular.module("app.voice.realtime",["timer"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.voice",{abstract:!0,url:"/voice"}).state("app.voice.voiceQueues",{url:"/voiceQueues",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/voiceQueues.html",controller:"VoiceQueuesController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.voiceQueues.edit",{url:"/:id?tab",params:{voiceQueue:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/edit/view.html",controller:"VoiceQueueController as vm"}},resolve:{voiceQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar",id:t.id})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.inboundroutes",{url:"/inboundroutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundroutes/inboundroutes.html",controller:"InboundRoutesController as vm"}},resolve:{inboundroutes:["apiResolver",function(e){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}]},authenticate:!0,permissionId:402,bodyClass:"voice"}).state("app.voice.inboundroutes.edit",{url:"/:id?tab",params:{inboundroute:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundroutes/edit/view.html",controller:"InboundRouteController as vm"}},resolve:{inboundroute:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",id:t.id})}]},authenticate:!0,permissionId:402,bodyClass:"voice"}).state("app.voice.outboundroutes",{url:"/outboundroutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundroutes/outboundroutes.html",controller:"OutboundRoutesController as vm"}},resolve:{outboundroutes:["apiResolver",function(e){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,recordingFormat,cutdigits,description",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}]},authenticate:!0,permissionId:403,bodyClass:"voice"}).state("app.voice.outboundroutes.edit",{url:"/:id?tab",params:{outboundroute:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundroutes/edit/view.html",controller:"OutboundRouteController as vm"}},resolve:{outboundroute:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,recordingFormat,cutdigits,description",id:t.id})}]},authenticate:!0,permissionId:403,bodyClass:"voice"}).state("app.voice.internalroutes",{url:"/internalroutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalroutes/internalroutes.html",controller:"InternalRoutesController as vm"}},resolve:{internalroutes:["apiResolver",function(e){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}]},authenticate:!0,permissionId:404,bodyClass:"voice"}).state("app.voice.internalroutes.edit",{url:"/:id?tab",params:{internalroute:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalroutes/edit/view.html",controller:"InternalRouteController as vm"}},resolve:{internalroute:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",id:t.id})}]},authenticate:!0,permissionId:404,bodyClass:"voice"}).state("app.voice.contexts",{url:"/contexts",views:{"content@app":{templateUrl:"app/main/apps/voice/views/contexts/contexts.html",controller:"ContextsController as vm"}},resolve:{contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,offset:0})}]},authenticate:!0,permissionId:405,bodyClass:"voice"}).state("app.voice.voicemails",{url:"/voicemails",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/voicemails.html",controller:"VoicemailsController as vm"}},resolve:{voicemails:["apiResolver",function(e){return e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.voicemails.edit",{url:"/:id?tab",params:{voicemail:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/edit/view.html",controller:"VoicemailController as vm"}},resolve:{voicemail:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",id:t.id})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.musiconholds",{url:"/musiconholds",views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/musiconholds.html",controller:"MusicOnHoldsController as vm"}},resolve:{musiconholds:["apiResolver",function(e){return e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,offset:0})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.musiconholds.edit",{url:"/:id?tab",params:{musiconhold:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/edit/view.html",controller:"MusicOnHoldController as vm"}},resolve:{musiconhold:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",id:t.id})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.voiceRecordings",{url:"/voiceRecordings",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",controller:"VoiceRecordingsController as vm"}},resolve:{voiceRecordings:["apiResolver",function(e){return e.resolve("voiceRecording@get",{fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,createdAt,userDisposition",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:408,bodyClass:"voice"}).state("app.voice.chanSpies",{url:"/chanSpies",views:{"content@app":{templateUrl:"app/main/apps/voice/views/chanSpies/chanSpies.html",controller:"ChanSpiesController as vm"}},resolve:{chanSpies:["apiResolver",function(e){return e.resolve("voiceChanSpy@get",{fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:409,bodyClass:"voice"}),t.addPart("app/main/apps/voice")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.voice",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.voice.realtime"]).config(e)}(),function(){"use strict";angular.module("app.navigation",[]).config(function(){})}(),function(){"use strict";function e(e,t){e.addPart("app/quick-panel")}e.$inject=["$translatePartialLoaderProvider","msApiProvider"],angular.module("app.quick-panel",[]).config(e)}(),function(){"use strict";function e(e,t){e.state("app.reset",{url:"/reset/:token",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.reset":{templateUrl:"app/reset/reset.html",controller:"ResetPasswordController as vm"}},bodyClass:"reset"}),t.addPart("app/reset")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.reset",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/toolbar")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.toolbar",[]).config(e)}(),function(){"use strict";function e(e){e.interceptors.push("authInterceptor")}e.$inject=["$httpProvider"],angular.module("app.auth").config(e)}(),function(){"use strict";function e(e,n,t,a){e.$on("$stateChangeStart",function(e,t){return t.hasOwnProperty("authenticate")&&t.authenticate&&!a.isLoggedIn()?(e.preventDefault(),n.go("app.login",{},{reload:!0,notify:!0})):a.isLoggedIn()&&t.hasOwnProperty("permissionId")&&t.permissionId&&!a.hasPermission(t.permissionId)&&!a.hasRole("admin")?(e.preventDefault(),n.go("app.dashboards.general",{},{reload:!0,notify:!0})):void 0})}e.$inject=["$rootScope","$state","$window","Auth"],angular.module("app.auth").run(e)}(),function(){"use strict";function e(e,a,i,o,t){var s,r=["id","role","fullname","name","internal","email","userpic","permissions","md5secret","phoneBarAutoAnswer","phoneBarAutoAnswerDelay","phoneBarEnableRecording","phoneBarEnableDtmfTone","voicePause","chatPause","mailPause","faxPause","smsPause","openchannelPause","phoneBarEnableSettings","phoneBarExpires","pauseType","showWebBar","phoneBarRemoteControlPort","phoneBarRemoteControl","lastLoginAt","lastPauseAt","crudPermissions","allowmessenger","passwordResetAt","alias"];function l(){var t=i.defer();return d("agent")&&0!==s.showWebBar?o.user.login({id:s.id}).$promise.then(function(){console.log("AGENT LOGGED IN"),t.resolve()}).catch(function(e){console.error(e),t.reject(e)}):d("admin")||d("user")?o.user.update({id:s.id},{online:!0,lastLoginAt:moment().format("YYYY-MM-DD HH:mm:ss")}).$promise.catch(function(e){console.error(e)}).finally(function(){t.resolve()}):t.resolve(),t.promise}function n(){if(a.remove("motion.user"),a.remove("motion.token"),s&&s.id){var e=s.id;s=null,t.localStorage.removeItem("motion.user:"+e)}}function d(e){return!!s&&s.role===e}function c(){return a.get("motion.token")}function m(e){return s=_.assign(s,_.pick(e,r)),a.put("motion.user",JSON.stringify(s)),s}return function(){if(a.get("motion.user"))s=JSON.parse(a.get("motion.user")),o.user.get({id:s.id,fields:r.join(",")}).$promise.then(function(e){if(e)return m(e)}).catch(function(e){console.log("Error retrieving user",e)})}(),{login:function(e){var t,n=i.defer();return o.auth.local(e).$promise.then(function(e){return t=e,a.put("motion.token",e.token),o.user.get({id:e.id,fields:r.join(",")}).$promise}).then(function(e){return(s=e).lastLoginAt=moment(),a.put("motion.user",JSON.stringify(e)),l()}).then(function(){n.resolve()}).catch(function(e){n.reject(e.data)}).finally(function(){return o.user.get({id:t.id,fields:r.join(",")}).$promise.then(function(e){s=e})}),n.promise},logout:function(e){var t;return i.defer(),e?(n(),i.resolve()):(t=i.defer(),d("agent")&&0!==s.showWebBar?o.user.logout({id:s.id}).$promise.then(function(){console.log("AGENT LOGGED OUT")}).catch(function(e){console.error(e)}).finally(function(){t.resolve()}):d("admin")||d("user")?o.user.update({id:s.id},{online:!1}).$promise.catch(function(e){console.error(e)}).finally(function(){t.resolve()}):t.resolve(),t.promise).then(n).catch(function(e){console.error(e)})},queueLogin:l,isLoggedIn:function(){return!(!s||!c())},hasRole:d,hasPermission:function(e){return!!s&&_.includes(s.permissions,e)},getToken:c,getCurrentUser:function(){return s},updateCurrentUser:m,removeCookies:n}}e.$inject=["$location","$cookies","$q","api","$window"],angular.module("app.auth").factory("Auth",e)}(),function(){"use strict";function e(e,t,n,a,i){var o;return{request:function(e){var t=n.get("motion.token");return e.headers=e.headers||{},i.isSameOrigin(e.url)&&t&&(e.headers.Authorization="Bearer "+t),e},responseError:function(e){switch(e.status){case 401:n.remove("motion.user"),n.remove("motion.token"),(o||(o=a.get("$state"))).go("app.login")}return t.reject(e)}}}e.$inject=["$rootScope","$q","$cookies","$injector","Util"],angular.module("app.auth").factory("authInterceptor",e)}(),function(){"use strict";function e(t){var n={safeCb:function(e){return angular.isFunction(e)?e:angular.noop},urlParse:function(e){var t=document.createElement("a");return t.href=e,""===t.host&&(t.href=t.href),t},isSameOrigin:function(i,e){return i=n.urlParse(i),(e=(e=e&&[].concat(e)||[]).map(n.urlParse)).push(t.location),1<=(e=e.filter(function(e){var t=i.hostname===e.hostname,n=i.protocol===e.protocol,a=i.port===e.port||""===e.port&&("80"===i.port||"443"===i.port);return t&&n&&a})).length}};return n}e.$inject=["$window"],angular.module("app.auth").factory("Util",e)}(),function(){"use strict";angular.module("app.core").provider("motionConfig",function(){var n={disableCustomScrollbars:!1,disableMdInkRippleOnMobile:!0,disableCustomScrollbarsOnMobile:!0};this.config=function(e){n=angular.extend({},n,e)},this.$get=function(){var e={getConfig:function(e){if(angular.isUndefined(n[e]))return!1;return n[e]},setConfig:function(e,t){n[e]=t}};return e}})}(),function(){"use strict";function e(e,t,n,a){t.debugEnabled(!0),e.config({tabindex:!1}),a.config({disableCustomScrollbars:!1,disableCustomScrollbarsOnMobile:!0,disableMdInkRippleOnMobile:!0}),n.config({wheelPropagation:!0})}e.$inject=["$ariaProvider","$logProvider","msScrollConfigProvider","motionConfigProvider"],angular.module("app.core").config(e)}(),function(){"use strict";function e(e,t,n){(t.generate(),n.getConfig("disableMdInkRippleOnMobile")&&e.isMobile())&&angular.element("body").attr("md-no-ink",!0);e.isMobile()&&angular.element("html").addClass("is-mobile");var a=e.detectBrowser();if(a){var i=a.browser+" "+a.version+" "+a.os;angular.element("html").addClass(i)}}e.$inject=["msUtils","motionGenerator","motionConfig"],angular.module("app.core").run(e)}(),function(){"use strict";function e(s,l,d){return{restrict:"E",compile:function(e,t){var o;return t.code||(o=e.html(),e.empty()),function(n,a,r){r.code&&(o=n.$eval(r.code));var i=n.$eval(r.shouldInterpolate);l.when(o).then(function(e){if(e){i&&(e=d(e)(n));var t=angular.element('<pre><code class="highlight" ng-non-bindable></code></pre>');a.append(t),s(function(){!function(e,t){var n=t.find("code"),a=e.split("\n"),i=(a=a.filter(function(e){return e.trim().length}))[0].match(/^\s*/)[0],o=new RegExp("^"+i);a=a.map(function(e){return e.replace(o,"").replace(/\s+$/,"")});var s=hljs.highlight(r.language||r.lang,a.join("\n"),!0);s.value=s.value.replace(/=<span class="hljs-value">""<\/span>/gi,"").replace("<head>","").replace("<head/>",""),n.append(s.value).addClass("highlight")}(e,t)},34,!1)}})}}}}e.$inject=["$timeout","$q","$interpolate"],angular.module("app.core").directive("hljs",e)}(),function(){"use strict";angular.module("app.core").directive("msCard",function(){return{restrict:"E",scope:{templatePath:"=template",card:"=ngModel",vm:"=viewModel"},template:'<div class="ms-card-content-wrapper" ng-include="templatePath" onload="cardTemplateLoaded()"></div>',compile:function(e){return e.addClass("ms-card"),function(e,t){e.cardTemplateLoaded=function(){e.$emit("msCard::cardTemplateLoaded",t)}}}}})}(),function(){"use strict";angular.module("app.core").directive("msClickToCall",function(){return{restrict:"E",scope:{type:"=",disabled:"=",target:"=",prefix:"=",license:"="},controller:["$scope","$rootScope","$http","$translate","Auth","toasty",function(t,n,a,i,e,o){function s(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function r(e){return a.get(e).success(function(){o.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(e){o.error({title:"PhoneBar API Error",msg:i.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}t.currentUser=e.getCurrentUser(),t.showMenu=function(){return t.target&&t.target.indexOf("@")<0&&t.target!=t.currentUser.internal&&t.target!=t.currentUser.name&&(0==t.currentUser.showWebBar&&t.currentUser.phoneBarRemoteControl||2==t.currentUser.showWebBar&&t.license.webrtc)&&!t.disabled},t.call=function(e){switch(t.currentUser.showWebBar){case 0:return r("http://127.0.0.1:"+(t.currentUser.phoneBarRemoteControlPort||"9888")+"/api/originate/"+s(e));case 2:n.$broadcast("webrtc::call",{target:s(e)})}},t.transfer=function(e){switch(t.currentUser.showWebBar){case 0:return r("http://127.0.0.1:"+(t.currentUser.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+s(e));case 2:n.$broadcast("webrtc::transfer",{target:s(e)})}}}],templateUrl:"app/core/directives/ms-click-to-call/ms-click-to-call.html"}})}(),function(){"use strict";function e(i){return{require:"ngModel",priority:1,link:function(e,t,n,a){a.$formatters.push(i.formatter),a.$parsers.push(i.parser)}}}e.$inject=["msDatepickerFixConfig"],angular.module("app.core").provider("msDatepickerFixConfig",function(){var t={formatter:function(e){return e?""===e?e:new Date(e):""},parser:function(e){return e?moment(e).add(moment(e).utcOffset(),"m").toDate():""}};this.config=function(e){t=angular.extend({},t,e)},this.$get=function(){return t}}).directive("msDatepickerFix",e)}(),function(){"use strict";angular.module("app.core").directive("msDualMultiselect",function(){return{restrict:"E",scope:{options:"="},controller:["$scope",function(s){s.transfer=function(e,t,n,a){var i=[];if(0<=n)i.push(e[n]),t.push(e[n]),e.splice(n,1);else{for(var o=0;o<e.length;o+=1)t.push(e[o]);e.length=0,i=t}s.options.transferCallback&&s.options.transferCallback(i,a)},s.getLine=function(e,t){var n="";if(_.isNil(t))return n;if(_.isArray(t)){for(var a=0;a<t.length;a++)n+=" "+(e[t[a]]?e[t[a]]:"");return n}return e[t]?e[t]:""}}],templateUrl:"app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html"}})}(),function(){"use strict";function e(e){return{restrict:"E",replace:!0,scope:{onReply:"&",setText:"&",getText:"&",pickerPosition:"=",search:"=",recentEmojis:"=",placeholder:"="},template:'<input class="emojionearea" type="text">',link:function(n,t){t.emojioneArea({pickerPosition:n.pickerPosition,search:n.search,recentEmojis:n.recentEmojis,placeholder:e.instant(n.placeholder||"Type a message"),events:{keyup:function(e,t){n.onReply({event:t,body:this.getText()})}}}),n.setText({dirFn:function(e){t[0].emojioneArea.setText(e||"")}}),n.getText({dirFn:function(){return t[0].emojioneArea.getText()}})}}}e.$inject=["$translate"],angular.module("app.core").directive("msEmojiArea",e)}(),function(){"use strict";angular.module("app.core").directive("msFontFamily",function(){return{restrict:"E",scope:{ngModel:"="},controller:["$scope",function(e){e.fonts=[{option:"Arial",value:"Arial,Helvetica,sans-serif"},{option:"Comic Sans MS",value:"Comic Sans MS,cursive"},{option:"Courier New",value:"Courier New,Courier,monospace"},{option:"Georgia",value:"Georgia,serif"},{option:"Lucida Sans Unicode",value:"Lucida Sans Unicode,Lucida Grande,sans-serif"},{option:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{option:"Times New Roman",value:"Times New Roman,Times,serif"},{option:"Trebuchet MS",value:"Trebuchet MS,Helvetica,sans-serif"},{option:"Verdana",value:"Verdana,Geneva,sans-serif"}]}],templateUrl:"app/core/directives/ms-font-family/ms-font-family.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsFormWizardController",function(){var t=this;function e(){return t.forms.length}function n(){return 0===t.selectedIndex}function a(){return t.selectedIndex===e()-1}t.forms=[],t.selectedIndex=0,t.registerForm=function(e){t.forms.push(e)},t.previousStep=function(){if(n())return;t.selectedIndex--},t.nextStep=function(){if(a())return;t.selectedIndex++},t.firstStep=function(){t.selectedIndex=0},t.lastStep=function(){t.selectedIndex=e()-1},t.totalSteps=e,t.isFirstStep=n,t.isLastStep=a,t.currentStepInvalid=function(){return angular.isDefined(t.forms[t.selectedIndex])&&t.forms[t.selectedIndex].$invalid},t.previousStepInvalid=function(){return 0<t.selectedIndex&&angular.isDefined(t.forms[t.selectedIndex-1])&&t.forms[t.selectedIndex-1].$invalid},t.formsIncomplete=function(){for(var e=0;e<t.forms.length;e++)if(t.forms[e].$invalid)return!0;return!1},t.resetForm=function(){for(var e=t.selectedIndex=0;e<t.forms.length;e++)t.forms[e].$setPristine(),t.forms[e].$setUntouched()}}).directive("msFormWizard",function(){return{restrict:"E",scope:!0,controller:"MsFormWizardController as msWizard",compile:function(e){return e.addClass("ms-form-wizard"),function(){}}}}).directive("msFormWizardForm",function(){return{restrict:"A",require:["form","^msFormWizard"],compile:function(e){return e.addClass("ms-form-wizard-form"),function(e,t,n,a){var i=a[0],o=a[1];o.registerForm(i)}}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{onClose:"&"},transclude:!0,templateUrl:"app/core/directives/ms-info-bar/ms-info-bar.html",link:function(e,t){var n=i.find("ms-info-bar-active"),a="ms-info-bar-active";n.addClass(a),e.removeInfoBar=function(){n.removeClass(a),t.remove(),e.onClose&&e.onClose(),e.$destroy()}}}}e.$inject=["$document"],angular.module("app.core").directive("msInfoBar",e)}(),function(){"use strict";function e(r,a,l,e){var d=this,t={columnCount:5,respectItemOrder:!1,reLayoutDebounce:400,responsive:{md:3,sm:2,xs:1}},n=!0;function i(){n&&e.cancel(n),n=e(function(){!function(){d.containerPos=d.container[0].getBoundingClientRect(),function(){d.columnCount=d.options.columnCount,l("gt-md")?d.columnCount=d.options.columnCount:l("md")?d.columnCount=d.columnCount>d.options.responsive.md?d.options.responsive.md:d.columnCount:l("sm")?d.columnCount=d.columnCount>d.options.responsive.sm?d.options.responsive.sm:d.columnCount:d.columnCount=d.options.responsive.xs;d.columnWidth=d.containerPos.width/d.columnCount}(),r.$broadcast("msMasonry:relayoutStarted"),d.items=d.container.find("ms-masonry-item");for(var e=Array.apply(null,new Array(d.columnCount)).map(function(){return 0}),t=0;t<d.items.length;t++){var n,a,i,o,s=d.items[t];(s=angular.element(s)).scope()&&s.scope().$broadcast("msMasonryItem:startReLayout"),s.css({width:d.columnWidth}),d.options.respectItemOrder?(i=t%d.columnCount,o=e[i]):(o=Math.min.apply(Math,e),i=e.indexOf(o)),e[i]=o+s[0].getBoundingClientRect().height,n=Math.round(i*d.columnWidth),a=o,s.css({transform:"translate3d("+n+"px,"+a+"px,0px)"}),s.addClass("placed"),s.scope()&&s.scope().$broadcast("msMasonryItem:finishReLayout")}}(),r.$broadcast("msMasonry:relayoutFinished")},d.options.reLayoutDebounce)}d.options=null,d.container=[],d.containerPos="",d.columnWidth="",d.items=[],d.reLayout=i,d.initialize=function(){d.options=d.options?angular.extend(t,d.options):t,r.$watch(function(){return d.container.width()},function(e,t){e!==t&&i()})},d.waitImagesLoaded=function(e,t){if("undefined"!=typeof imagesLoaded){var n=a.imagesLoaded(e);n.on("done",function(){t()})}else t()},r.$on("msMasonry:relayout",function(){i()})}function t(s){return{restrict:"AEC",controller:"msMasonryController",compile:function(i,o){return{pre:function(e,t,n,a){a.options=angular.fromJson(o.options||"{}"),a.container=i},post:function(e,t,n,a){s(function(){a.initialize()})}}}}}e.$inject=["$scope","$window","$mdMedia","$timeout"],t.$inject=["$timeout"],angular.module("app.core").controller("msMasonryController",e).directive("msMasonry",t).directive("msMasonryItem",function(){return{restrict:"AEC",require:"^msMasonry",priority:1,link:function(e,t,n,a){a.waitImagesLoaded(t,function(){a.reLayout()}),e.$on("msMasonryItem:finishReLayout",function(){e.$watch(function(){return t.height()},function(e,t){e!==t&&a.reLayout()})}),t.on("$destroy",function(){a.reLayout()})}}})}(),function(){"use strict";function e(n,e,a,i){var o=this;function s(e,t){o.selectedPalette=e,o.selectedHues=t}function r(){s(!(o.selectedColor={palette:"",hue:"",class:""}),!1),d()}function l(e,t){o.selectedColor={palette:e,hue:t,class:"md-"+e+"-"+t+"-bg",bgColorValue:i.rgba(o.palettes[e][t].value),fgColorValue:i.rgba(o.palettes[e][t].contrast)},"obj"!==o.msModelType||angular.equals(o.selectedColor,o.modelCtrl.$viewValue)||d(),s(e,o.palettes[e]),n.$selectedColor=o.selectedColor}function d(){"class"===o.msModelType?o.modelCtrl.$setViewValue(o.selectedColor.class):"obj"===o.msModelType&&o.modelCtrl.$setViewValue(o.selectedColor)}o.palettes=e,o.selectedPalette=!1,o.selectedHues=!1,n.$selectedColor={},o.activateHueSelection=s,o.selectColor=function(e,t){l(e,t),d(),a.hide()},o.removeColor=r,n.$watch("ngModel",function(){if(!o.modelCtrl.$viewValue||""===o.modelCtrl.$viewValue)return void r();var e,t;if("class"===o.msModelType){var n=o.modelCtrl.$viewValue.split("-");5<=n.length?(e=n[1]+"-"+n[2],t=n[3]):(e=n[1],t=n[2])}else"obj"===o.msModelType&&(e=o.modelCtrl.$viewValue.palette,t=o.modelCtrl.$viewValue.hue||500);l(e,t)})}e.$inject=["$scope","$mdColorPalette","$mdMenu","motionGenerator"],angular.module("app.core").controller("msMaterialColorPickerController",e).directive("msMaterialColorPicker",function(){return{require:["msMaterialColorPicker","ngModel"],restrict:"E",scope:{ngModel:"=",msModelType:"@?"},controller:"msMaterialColorPickerController as vm",transclude:!0,templateUrl:"app/core/directives/ms-material-color-picker/ms-material-color-picker.html",link:function(e,t,n,a,i){var o=a[0];o.modelCtrl=a[1],o.msModelType=e.msModelType||"class",i(e,function(e){(e=e.filter(function(e,t){return 1===t.nodeType})).length&&t.find("ms-color-picker-button").replaceWith(e)})}}})}(),function(){"use strict";function e(p,g,v){return{restrict:"A",link:function(e,t,n){var a="true"===n.msNavIsFolded,i=!1,o=angular.element(p[0].body),s=angular.element('<div id="ms-nav-fold-open-overlay"></div>'),r=angular.element('<div id="ms-nav-fold-close-overlay"></div>'),l=t.parent();function d(){o.addClass("ms-nav-folded"),g.$broadcast("msNav::forceCollapse"),t.scrollTop(0),l.append(s),s.on("mouseenter touchstart",function(e){c(e),i=!0})}function c(e){angular.isDefined(e)&&e.preventDefault(),o.addClass("ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),l.find(s).remove(),l.parent().append(r),r.on("mouseenter touchstart",function(e){m(e),i=!1})}function m(e){angular.isDefined(e)&&e.preventDefault(),g.$broadcast("msNav::forceCollapse"),t.scrollTop(0),o.removeClass("ms-nav-folded-open"),l.parent().find(r).remove(),l.append(s),s.on("mouseenter touchstart",function(e){c(e),i=!0})}function u(){o.removeClass("ms-nav-folded ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),t.off("mouseenter mouseleave")}v.setFoldable(e,t,a),a?d():u(),e.toggleFold=function(){(a=!a)?d():u()},e.openFolded=c,e.closeFolded=m,e.isNavFoldedOpen=function(){return i},e.$on("$destroy",function(){s.off("mouseenter touchstart"),r.off("mouseenter touchstart"),t.off("mouseenter mouseleave")})}}}function t(n,a,i){return{restrict:"E",scope:{},controller:"MsNavController",compile:function(e){return e.addClass("ms-nav"),function(e){n.$broadcast("msNav::expandMatchingToggles");var t=n.$on("$stateChangeSuccess",function(){n.$broadcast("msNav::expandMatchingToggles"),a.when("navigation").then(function(e){e.close(),i.isNavFoldedOpen()&&i.closeFolded()})});e.$on("$destroy",function(){t()})}}}}function n(m,u,p,g){return{restrict:"A",require:"^msNav",scope:!0,compile:function(e,t){return e.addClass("ms-nav-toggle"),angular.isUndefined(t.collapsed)&&(t.collapsed=!0),e.attr("collapsed",t.collapsed),function(a,i,e,n){var o={expanded:"expanded",expandAnimation:"expand-animation",collapseAnimation:"collapse-animation"},t=i.find("a"),s=[],r=/\(.*\)/g;function l(){return"true"===i.attr("collapsed")}function d(){var e=u.defer();if(!l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!1);var t=angular.element(i.find("ms-nav-toggle-items")[0]);t.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var n=t[0].offsetHeight;return t.css({position:"",visibility:"",display:"",height:""}),a.$evalAsync(function(){p.animate(t,{display:"block",height:"0px"},{height:n+"px"},o.expandAnimation).then(function(){t.addClass(o.expanded),t.css({height:""}),e.resolve({success:!0})})}),e.promise}function c(){var e=u.defer();if(l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!0);var t=angular.element(i.find("ms-nav-toggle-items")[0]),n=t[0].offsetHeight;return a.$evalAsync(function(){p.animate(t,{height:n+"px"},{height:"0px"},o.collapseAnimation).then(function(){t.removeClass(o.expanded),t.css({display:"",height:""}),e.resolve({success:!0})})}),e.promise}angular.forEach(t,function(e){var t=angular.element(e).attr("ui-sref");angular.isUndefined(t)||(t=t.replace(r,""),s.push(t))}),n.setToggleItem(i,a),i.children(".ms-nav-button").on("click",function(){if(n.isDisabled())return;n.disable(),l()?(n.clearLockedItems(),a.$emit("msNav::pushToLockedList"),m.$broadcast("msNav::collapse"),d().then(function(){n.enable()})):a.$broadcast("msNav::forceCollapse")}),a.$on("$destroy",function(){i.children(".ms-nav-button").off("click")}),a.$on("msNav::collapse",function(){var e=n.getLockedItems(),t=!1;angular.forEach(e,function(e){angular.equals(e.scope,a)&&(t=!0)}),t||c().then(function(){n.enable()})}),a.$on("msNav::forceCollapse",function(){c().then(function(){n.enable()})}),a.$on("msNav::expandMatchingToggles",function(){var t=g.current.name,n=!1;angular.forEach(s,function(e){t===e&&(n=!0)}),n?d():c()}),a.$on("msNav::pushToLockedList",function(){n.setLockedItem(i,a)})}}}}e.$inject=["$document","$rootScope","msNavFoldService"],t.$inject=["$rootScope","$mdComponentRegistry","msNavFoldService"],n.$inject=["$rootScope","$q","$animate","$state"],angular.module("app.core").factory("msNavFoldService",function(){var n={};return{setFoldable:function(e,t){n={scope:e,element:t}},isNavFoldedOpen:function(){return n.scope.isNavFoldedOpen()},toggleFold:function(){n.scope.toggleFold()},openFolded:function(){n.scope.openFolded()},closeFolded:function(){n.scope.closeFolded()}}}).directive("msNavIsFolded",e).controller("MsNavController",function(){var e=this,t=!1,n=[],a=[];e.isDisabled=function(){return t},e.enable=function(){t=!1},e.disable=function(){t=!0},e.setToggleItem=function(e,t){n.push({element:e,scope:t})},e.getLockedItems=function(){return a},e.setLockedItem=function(e,t){a.push({element:e,scope:t})},e.clearLockedItems=function(){a=[]}}).directive("msNav",t).directive("msNavTitle",function(){return{restrict:"A",compile:function(e){return e.addClass("ms-nav-title"),function(){}}}}).directive("msNavButton",function(){return{restrict:"AE",compile:function(e){return e.addClass("ms-nav-button"),function(){}}}}).directive("msNavToggle",n)}(),function(){"use strict";function e(e,t){e.root?this.navigation=t.getNavigation(e.root):this.navigation=t.getNavigation(),this.toggleHorizontalMobileMenu=function(){angular.element("body").toggleClass("ms-navigation-horizontal-mobile-menu-active")},t.sort()}function t(c,m,u,p){return{restrict:"E",scope:{folded:"=",root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/vertical.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation"),function(e,t){var n=angular.element("body"),a=angular.element('<div id="ms-navigation-fold-expander"></div>'),i=angular.element('<div id="ms-navigation-fold-collapser"></div>'),o=u("navigation");function s(e){if(p.setFolded(e),e)c.$broadcast("msNavigation::collapse"),n.addClass("ms-navigation-folded"),r();else{var t=p.getActiveItem();t&&t.scope.$emit("msNavigation::stateMatched"),n.removeClass("ms-navigation-folded ms-navigation-folded-open"),i.remove()}}function r(){t.parent().append(a),m(function(){a.on("mouseenter touchstart",l)})}function l(e){e&&e.preventDefault(),p.setFoldedOpen(!0);var t=p.getActiveItem();t&&t.scope.$emit("msNavigation::stateMatched"),n.addClass("ms-navigation-folded-open"),a.remove(),n.find("#main").append(i),i.on("mouseenter touchstart",d)}function d(e){e&&e.preventDefault(),p.setFoldedOpen(!1),c.$broadcast("msNavigation::collapse"),n.removeClass("ms-navigation-folded-open"),i.remove(),r()}p.setNavigationScope(e),function(){null===p.getFolded()&&p.setFolded(e.folded);p.getFolded()&&(m(function(){c.$broadcast("msNavigation::collapse")}),n.addClass("ms-navigation-folded"),r())}(),e.$watch(function(){return o.isLockedOpen()},function(e,t){if(!angular.isUndefined(e)&&!angular.equals(e,t)&&p.getFolded())if(e)c.$broadcast("msNavigation::collapse");else{var n=p.getActiveItem();n&&n.scope.$emit("msNavigation::stateMatched")}}),e.$watch("folded",function(e,t){angular.isUndefined(e)||angular.equals(e,t)||s(e)}),e.toggleFolded=function(){s(!p.getFolded())},e.$on("$stateChangeStart",function(){o.close()}),e.$on("$destroy",function(){i.off("mouseenter touchstart"),a.off("mouseenter touchstart")})}}}}function n(n,e,a,i,t,o){var s=this;s.element=e,s.node=n.node,s.hasChildren=void 0,s.collapsed=void 0,s.collapsable=void 0,s.group=void 0,s.animateHeightClass="animate-height",s.toggleCollapsed=function(){s.collapsed?s.expand():s.collapse()},s.collapse=function(){var e=s.element.children("ul"),t=e[0].offsetHeight;n.$evalAsync(function(){s.collapsed=!0,s.element.addClass("collapsing"),i.animate(e,{display:"block",height:t+"px"},{height:"0px"},s.animateHeightClass).then(function(){e.css({display:"",height:""}),s.element.removeClass("collapsing")}),n.$broadcast("msNavigation::collapse")})},s.expand=function(){var e=s.element.children("ul");e.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var t=e[0].offsetHeight;e.css({position:"",visibility:"",display:"",height:""}),n.$evalAsync(function(){s.collapsed=!1,s.element.addClass("expanding"),i.animate(e,{display:"block",height:"0px"},{height:t+"px"},s.animateHeightClass).then(function(){e.css({height:""}),s.element.removeClass("expanding")}),a.$broadcast("msNavigation::collapse",s.node._path)})},s.getClass=function(){return s.node.class},s.isHidden=function(){if(angular.isDefined(s.node.hidden)&&angular.isFunction(s.node.hidden))return s.node.hidden();return!1},function(){s.hasChildren=0<s.node.children.length,s.group=!(!angular.isDefined(s.node.group)||!0!==s.node.group),!s.hasChildren||s.group?s.collapsable=!1:s.collapsable=!(!angular.isUndefined(s.node.collapsable)&&"boolean"==typeof s.node.collapsable&&!0!==s.node.collapsable);s.collapsable?s.collapsed=!(!angular.isUndefined(s.node.collapsed)&&"boolean"==typeof s.node.collapsed&&!0!==s.node.collapsed):s.collapsed=!1;if(s.node.state===t.current.name||t.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(t.params)&&!angular.equals(s.node.stateParams,t.params))return;n.$emit("msNavigation::stateMatched"),o.setActiveItem(s.node,n)}n.$on("msNavigation::stateMatched",function(){s.collapsable&&s.collapsed&&n.$evalAsync(function(){s.collapsed=!1})}),n.$on("msNavigation::collapse",function(e,t){if(!s.collapsed&&s.collapsable)if(angular.isUndefined(t))s.collapse();else{var n=t.split("."),a=[],i=o.getActiveItem();if(i&&(a=i.node._path.split(".")),-1<n.indexOf(s.node._id))return;if(-1<a.indexOf(s.node._id))return;s.collapse()}}),n.$on("$stateChangeSuccess",function(){if(s.node.state===t.current.name){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(t.params)&&!angular.equals(s.node.stateParams,t.params))return;o.setActiveItem(s.node,n),a.$broadcast("msNavigation::collapse",s.node._path)}if(t.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(t.params)&&!angular.equals(s.node.stateParams,t.params))return;n.$emit("msNavigation::stateMatched")}})}()}function a(t){return{restrict:"E",scope:{root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/horizontal.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation-horizontal"),function(e){t.setNavigationScope(e)}}}}function i(n,e,t,a,i){var o=this;o.element=e,o.node=n.node,o.hasChildren=void 0,o.group=void 0,o.getClass=function(){return o.node.class},function(){if(o.isActive=!1,o.hasChildren=0<o.node.children.length,o.group=!(!angular.isDefined(o.node.group)||!0!==o.node.group),o.node.state===a.current.name||a.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(o.node.stateParams,a.params))return;n.$emit("msNavigation::stateMatched"),i.setActiveItem(o.node,n)}n.$on("msNavigation::stateMatched",function(){o.hasChildren&&n.$evalAsync(function(){o.isActive=!0})}),n.$on("msNavigation::clearActive",function(){if(o.hasChildren){var e=[],t=i.getActiveItem();t&&(e=t.node._path.split(".")),-1<e.indexOf(o.node._id)?n.$evalAsync(function(){o.isActive=!0}):n.$evalAsync(function(){o.isActive=!1})}}),n.$on("$stateChangeSuccess",function(){if(o.node.state===a.current.name||a.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(o.node.stateParams,a.params))return;i.setActiveItem(o.node,n),t.$broadcast("msNavigation::clearActive")}})}()}function o(i){return{restrict:"A",require:"^msNavigationHorizontalNode",compile:function(e){return e.addClass("ms-navigation-horizontal-item"),function(e,t,n,a){t.on("click",function(){if(!a.hasChildren||i("gt-md"))return;t.toggleClass("expanded")}),e.$on("$destroy",function(){t.off("click")})}}}}e.$inject=["$scope","msNavigationService"],t.$inject=["$rootScope","$timeout","$mdSidenav","msNavigationService"],n.$inject=["$scope","$element","$rootScope","$animate","$state","msNavigationService"],a.$inject=["msNavigationService"],i.$inject=["$scope","$element","$rootScope","$state","msNavigationService"],o.$inject=["$mdMedia"],angular.module("app.core").provider("msNavigationService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function s(e,t){if(angular.isString(e)){for(var n=e.split("."),a=n[n.length-1],i=function(e){var t=l;if(1===e.length)return t;e.pop();for(var n=0;n<e.length;n++){for(var a=e[n],i=!0,o=0;o<t.length;o++)if(t[o]._id===a){t=t[o].children,i=!1;break}if(i){var s={_id:a,_path:e.join("."),title:a,weight:1,children:[]};t.push(s),t=s.children}}return t}(n),o=!1,s=0;s<i.length;s++)if(i[s]._id===a){o=i[s];break}o?(angular.extend(o,t),o.uisref=m(o)):(t.children=[],!angular.isUndefined(t.weight)&&angular.isNumber(t.weight)||(t.weight=1),t._id=a,t._path=e,t.uisref=m(t),i.push(t))}else r.error("path must be a string (eg. `dashboard.project`)")}function d(e){if(angular.isString(e)){for(var t=l,n=e.split("."),a=0;a<n.length;a++)for(var i=n[a],o=0;o<t.length;o++)if(t[o]._id===i){if(t[o]._path===e)return t.splice(o,1),!0;t=t[o].children;break}return!1}r.error("path must be a string (eg. `dashboard.project`)")}function c(e){e||(e=l).sort(a);for(var t=0;t<e.length;t++){var n=e[t].children;1<n.length&&n.sort(a),0<n.length&&c(n)}}function a(e,t){return parseInt(e.weight)-parseInt(t.weight)}function m(e){var t="";return angular.isDefined(e.state)&&(t=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(t=t+"("+angular.toJson(e.stateParams)+")")),t}this.saveItem=s,this.deleteItem=d,this.sortByWeight=c,this.$get=function(){var n=null,t=null,a=null,i=null,e={saveItem:s,deleteItem:d,sort:c,clearNavigation:function(){l=[],t&&(t.vm.navigation=l)},setActiveItem:function(e,t){n={node:e,scope:t}},getActiveItem:function(){return n},getNavigation:o,getFlatNavigation:function(e){return function e(t){var n=[];for(var a=0;a<t.length;a++){var i=angular.copy(t[a]);i.children=[],n.push(i),0<t[a].children.length&&(n=n.concat(e(t[a].children)))}return n}(o(e))},setNavigationScope:function(e){t=e},setFolded:function(e){a=e},getFolded:function(){return a},setFoldedOpen:function(e){i=e},getFoldedOpen:function(){return i},toggleFolded:function(){t.toggleFolded()}};return e;function o(e){if(e){for(var t=0;t<l.length;t++)if(l[t]._id===e)return[l[t]];return null}return l}}}).controller("MsNavigationController",e).directive("msNavigation",t).controller("MsNavigationNodeController",n).directive("msNavigationNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationNode"},controller:"MsNavigationNodeController as vm",compile:function(e){return e.addClass("ms-navigation-node"),function(e,t,n,a){t.addClass(a.getClass()),a.group&&t.addClass("group")}}}}).directive("msNavigationItem",function(){return{restrict:"A",require:"^msNavigationNode",compile:function(e){return e.addClass("ms-navigation-item"),function(e,t,n,a){a.collapsable&&t.on("click",a.toggleCollapsed),e.$on("$destroy",function(){t.off("click")})}}}}).directive("msNavigationHorizontal",a).controller("MsNavigationHorizontalNodeController",i).directive("msNavigationHorizontalNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationHorizontalNode"},controller:"MsNavigationHorizontalNodeController as vm",compile:function(e){return e.addClass("ms-navigation-horizontal-node"),function(e,t,n,a){t.addClass(a.getClass()),a.group&&t.addClass("group")}}}}).directive("msNavigationHorizontalItem",o)}(),function(){"use strict";function e(i,t,o,e,n,s,a,r,l,d,c){var m=this,u=["ringingId","speakerId","microphoneId","ringingVolume","speakerVolume","microphoneVolume","ringingMute","speakerMute","microphoneMute"],p=JSON.parse(a.localStorage.getItem("motion2.user:"+m.conf.id))||{webrtc:{ringingVolume:.5,speakerVolume:.5,microphoneVolume:1,ringingMute:!1,speakerMute:!1,microphoneMute:!1}};function g(e){switch(e){case"ringing":m.conf.ringingMute&&m.soundPlayer.pause(),m.conf.ringingId&&m.soundPlayer.setSinkId(m.conf.ringingId).catch(function(e){console.info(e.message,m.conf.ringingId)});break;case"speaker":m.conf.speakerMute&&m.remotePlayer.pause(),m.conf.speakerId&&m.soundPlayer.setSinkId(m.conf.speakerId).catch(function(e){console.info(e.message,m.conf.speakerId)});break;case"microphone":if(m.conf.microphoneMute)for(var t=0;t<m.sessions.length;t+=1)m.sessions[t].mute();break;default:console.log("unknown device")}}function v(e,t,n){m.calls.unshift({target:e,fullname:n||e,inbound:t,time:moment().format("HH:mm")}),50<m.calls.length&&m.calls.pop()}function h(){return m.conf.license&&m.conf.isWebRTCSupported&&m.conf.hasMicrophone&&m.conf.hasSpeakers&&"https"===m.conf.protocol&&("chrome"===m.conf.browserName.toLowerCase()||"opera"===m.conf.browserName.toLowerCase()||"safari"===m.conf.browserName.toLowerCase())}function b(){p.webrtc=_.pick(m.conf,u),a.localStorage.setItem("motion2.user:"+m.conf.id,JSON.stringify(p))}function f(e){this.remotePlayer.srcObject=e.stream}function A(e){var t,n,a=e.session;switch(e.originator){case"local":a.outgoing=!0,a.name=e.request.ruri.user,a.user=e.request.ruri.user,v(a.user,!1);break;case"remote":a.incoming=!0,a.name=e.request.from.display_name,a.user=e.request.from.uri.user,t=e.session,n=t.name?t.name+" <"+t.user+">":t.user,c.create("Incoming call from: ",n,null,function(){t.answer(m.sessionConf)},function(){t.terminate()}).then(function(e){t.notification=e}).catch(function(e){console.error(e)}),v(e.session.user,!0),m.conf.autoAnswer&&o(function(){a.isInProgress()&&(a.autoAnswer=!0,m.conf.microphoneId?m.sessionConf.mediaConstraints.audio={deviceId:m.conf.microphoneId}:m.sessionConf.mediaConstraints.audio=!0,a.answer(m.sessionConf))},m.conf.autoAnswerDelay?1e3*m.conf.autoAnswerDelay:0)}a.call_id=e.request.call_id,a.connection&&(a.connection.onaddstream=f.bind(this)),a.on("progress",function(e,t){var n=!1;switch(t.originator){case"local":this.conf.ringingMute||(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/incoming-call.ogg"),n=!0);break;case"remote":this.putOtherCallsOnHold(e),this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/outgoing-call.ogg"),n=!0}n&&(this.soundPlayer.loop="loop",this.soundPlayer.play().catch(function(e){console.log(e.message)}))}.bind(this,a)),a.on("confirmed",function(n,e){return n.confirmed=!0,"remote"===e.originator&&n.connection&&(n.connection.onaddstream=f.bind(this),_.head(n.connection.getRemoteStreams())&&(this.remotePlayer.srcObject=_.head(n.connection.getRemoteStreams()))),this.soundPlayer.pause(),this.soundPlayer.loop=null,this.putOtherCallsOnHold(n),g("speaker"),g("microphone"),n.autoAnswer&&(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/beep.ogg"),this.soundPlayer.play().catch(function(e){console.log(e.message)})),d.rpc.getVoiceChannels().$promise.then(function(e){var t=_.find(e.rows,function(e){return e.sipcalllinkedid===n.call_id?e:e.sipcalluniqueid===n.call_id?e:null});t&&(n.monitor=t.monitor,n.uniqueid=t.uniqueid,n.monitors=t.monitors)}).catch(function(e){console.error(e)})}.bind(this,a)),a.on("hold",function(e,t){"local"===t.originator&&(e.localHold=!0)}.bind(this,a)),a.on("unhold",function(e,t){"local"===t.originator&&(e.localHold=!1)}.bind(this,a)),a.on("ended",function(e,t){_.remove(this.sessions,{id:e.id})}.bind(this,a)),a.on("failed",function(e,t){this.soundPlayer.pause(),this.soundPlayer.loop=null,e.notification&&e.notification.close(),_.remove(this.sessions,{id:e.id})}.bind(this,a)),this.sessions.push(a)}function E(){m.target="",document.getElementById("ms-target").blur(),document.getElementById("ms-target").value="",i.$broadcast("angucomplete-alt:clearInput","ms-target-wrap")}function y(e,t,n,a){return function(){s.show(s.simple().textContent(t).position(n).hideDelay(a)),e.terminate()}}e(function(){},999),m.direction="right",m.selectedMode="md-scale",m.target="",m.showDialpad=!1,m.soundPlayer=document.createElement("audio"),m.remotePlayer=document.getElementById(m.conf.remotePlayerId),m.soundPlayer.volume=1,m.sessionConf={mediaConstraints:{audio:!0,video:!1}},m.sessions=[],m.calls=[],m.ua=new JsSIP.UA({sockets:[new JsSIP.WebSocketInterface("wss://"+m.conf.host+":8089/ws")],uri:new JsSIP.URI("sip",m.conf.name,m.conf.host,5060,null,null).toString(),authorization_user:m.conf.name,ha1:m.conf.ha1,realm:m.conf.realm,user_agent:m.conf.ua,session_timers_refresh_method:"invite",register_expires:m.conf.phoneBarExpires||60,register:!0}),m.conf=_.merge(p.webrtc,m.conf),t.bind("keyup",function(e){switch(e.keyCode){case 27:o(function(){m.showDialpad=!1})}}),m.$onInit=function(){g("ringing"),g("speaker"),b(),this.ua.on("registered",function(){console.log("registered"),this.registered=!0}.bind(this)),this.ua.on("unregistered",function(){console.log("unregistered"),this.registered=!1}.bind(this)),this.ua.on("newRTCSession",A.bind(this)),DetectRTC.load(function(){this.conf.hasMicrophone=DetectRTC.hasMicrophone,this.conf.hasSpeakers="Chrome"!==DetectRTC.browser.name&&"Edge"!==DetectRTC.browser.name&&"Opera"!==DetectRTC.browser.name||DetectRTC.hasSpeakers,this.conf.isWebRTCSupported=DetectRTC.isWebRTCSupported,this.conf.osName=DetectRTC.osName,this.conf.osVersion=DetectRTC.osVersion,this.conf.browserName=DetectRTC.browser.name,this.conf.browserVersion=DetectRTC.browser.version,h()?this.ua.start():this.conf.license||l.warning({title:r.instant("TOOLBAR.WARNING"),msg:r.instant("TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"})}.bind(this))}.bind(this),m.type=function(e,t){var n=e;switch(m.target||(m.target=""),t&&(m.target+=e,i.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",m.target)),e){case"*":n="asterisk";break;case"#":n="pound"}m.conf.enableDtmfTone&&(m.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/dialpad/"+n+".ogg"),m.soundPlayer.play().catch(function(e){console.log(e.message)}));for(var a=0;a<m.sessions.length;a+=1)m.sessions[a].isEstablished()&&!m.sessions[a].isOnHold().local&&m.sessions[a].sendDTMF(e)},m.call=function(){if(m.target&&m.target!==m.conf.name&&m.target!==m.conf.internal){m.conf.microphoneId?m.sessionConf.mediaConstraints.audio={deviceId:m.conf.microphoneId}:m.sessionConf.mediaConstraints.audio=!0;var e=m.target.replace(/ /g,"");e=(e=e.replace(/\(/g,"")).replace(/\)/g,""),m.ua.call(e,m.sessionConf)}E()},m.hold=function(e){e.hold({useUpdate:!1})},m.refer=function(t){var e=n.prompt().title("Transfer").textContent("Type the target").placeholder("Target").ariaLabel("Target").ok("Transfer").cancel("Cancel");n.show(e).then(function(e){t.refer(e,{eventHandlers:{requestSucceeded:y(t,"requestSucceeded","top right",3e3),requestFailed:y(t,"requestFailed","top right",3e3)}})})},m.record=function(e){n.show({controller:"RecordDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/record/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{session:e,sessions:m.sessions}})},m.unhold=function(e){e.unhold({useUpdate:!1})},m.answer=function(e){e.answer(m.sessionConf)},m.terminate=function(e){e.terminate()},m.selectSession=function(e){e.unhold({useUpdate:!1}),m.putOtherCallsOnHold(e)},m.typeWrapper=function(e){switch(e.key.toLowerCase()){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"*":case"#":m.type(e.key);break;case"enter":m.call()}},m.toggleDialpad=function(){m.showDialpad=!m.showDialpad},m.referAttended=function(e){n.show({controller:"ReferAttendedDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/referAttended/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{session:e,sessions:_.reject(m.sessions,{id:e.id})}})},m.toggleVolume=function(e){switch(e){case"ringing":m.conf.ringingMute=!m.conf.ringingMute;break;case"speaker":m.conf.speakerMute?(m.conf.speakerMute=!1,m.remotePlayer.play().catch(function(e){console.log(e.message)})):(m.conf.speakerMute=!0,m.remotePlayer.pause());break;case"microphone":m.conf.microphoneMute=!m.conf.microphoneMute;for(var t=0;t<m.sessions.length;t+=1)m.conf.microphoneMute?m.sessions[t].mute():m.sessions[t].unmute();break;default:console.log("unknown device")}b()},m.closeDialpad=function(){m.showDialpad=!1},m.putOtherCallsOnHold=function(e){if(1<m.sessions.length)for(var t=0;t<m.sessions.length;t+=1)m.sessions[t].id===e.id||m.sessions[t].isOnHold().remote||m.sessions[t].hold({useUpdate:!1})},m.targetChanged=function(e){e?/^(\w|\.|\+|#|\*|\(|\)|\s|\-)*$/.test(e)?(m.target=e,i.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",m.target)):m.target?i.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",m.target):E():E()},m.targetSelected=function(e){e&&(m.target=e.originalObject.target,m.call(),E())},i.$on("webrtc::settings",function(e){n.show({controller:"SettingsController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/settings/settings.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{devices:function(){return navigator.mediaDevices.enumerateDevices()}},locals:{conf:m.conf}}).then(function(e){e&&(m.conf=e,g("ringing"),g("speaker"),b())})}),i.$on("webrtc::logout",function(){m.ua.stop()}),i.$on("webrtc::call",function(e,t){t.target&&(m.target=t.target,m.call())}),i.$on("webrtc::transfer",function(e,t){if(t.target)for(var n=0;n<m.sessions.length;n+=1)if(m.sessions[n].isEstablished()&&!m.sessions[n].isOnHold().local){m.sessions[n].refer(t.target,{eventHandlers:{requestSucceeded:y(m.sessions[n],"requestSucceeded","top right",3e3),requestFailed:y(m.sessions[n],"requestFailed","top right",3e3)}});break}})}e.$inject=["$scope","$document","$timeout","$interval","$mdDialog","$mdToast","$window","$translate","toasty","api","motNotification"],angular.module("app.core").controller("MsPhonebarController",e).directive("msPhonebar",function(){return{restrict:"E",scope:{conf:"="},require:"msPhonebar",controller:"MsPhonebarController",controllerAs:"vm_pb",bindToController:!0,templateUrl:"assets/ms-phonebar/ms-phonebar.html"}})}(),function(){"use strict";function e(i){return{restrict:"C",controller:["$scope","$element",function(e,t){function n(){t.css("display","inline"),i(a,1e3)}function a(){t.css("display","none"),i(n,1e3)}n()}],replace:!0}}function t(t,i,o,e,n){var s=this;function a(t,e){console.log("startMonitor");var n=i.defer(),a=(e||t.filename.replace(/^.*[\\\/]/,"")).split(".")[0];return o.rpc.startMonitor({uniqueid:s.session.uniqueid,filename:a,format:"wav"}).$promise.then(function(e){t.filename=a+".wav",t.mixmonitorid=e.mixmonitorid,t.status="rec",s.session.monitor=!0,n.resolve(t)}).catch(function(e){n.reject(e)}),n.promise}s.title="Record",s.sessions=e,s.session=n,s.closeDialog=function(){t.hide()},s.addRecording=function(){var e=t.prompt({skipHide:!0}).title("Start new recording").textContent("Type the file name.").placeholder("File name").ariaLabel("File name").initialValue(function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}()).ok("Start").cancel("Cancel");t.show(e).then(function(e){return a({},e)}).then(function(e){s.session.monitors.push(e)})},s.stop=function(t){return console.log("stopMonitor"),o.rpc.stopMonitor({uniqueid:s.session.uniqueid,mixmonitorid:t.mixmonitorid}).$promise.then(function(e){t.status="pause",s.session.monitor=_.includes(s.session.monitors,{status:"rec"})}).catch(function(e){console.error(e)})},s.start=a}e.$inject=["$timeout"],t.$inject=["$mdDialog","$q","api","sessions","session"],angular.module("app.core").directive("msBlink",e).controller("RecordDialogController",t)}(),function(){"use strict";function e(t,a,i,e){var o=this;function s(e){t.hide(e)}o.title="Refer Attended",o.sessions=i,o.session=e,o.sessionTarget=null,o.closeDialog=s,o.transfer=function(){var e,t,n=_.find(i,function(e){if(e.user===o.target)return e});n.outgoing?(e=n,t=o.session):(e=o.session,t=n);t.refer(e.user,{replaces:e,eventHandlers:{requestSucceeded:function(e){a.show(a.simple().textContent("requestSucceeded").position("top right").hideDelay(3e3)),s(),t.terminate()},requestFailed:function(e){a.show(a.simple().textContent("requestFailed").position("top right").hideDelay(3e3)),s(),t.terminate()}}})}}e.$inject=["$mdDialog","$mdToast","sessions","session"],angular.module("app.core").controller("ReferAttendedDialogController",e)}(),function(){"use strict";function e(e,o,t){var n=this;function a(e,t,n){var a;if(o[n]){if(a=_.find(e,function(e){return e.deviceId===o[n]}))return a.deviceId;var i=_.findIndex(e,function(e){return e.kind===t&&"default"!==e.deviceId});if(0<=i)return e[i].deviceId}else(a=_.find(e,function(e){return e.kind===t&&"default"!==e.deviceId}))&&(o[n]=a.deviceId);return o[n]||null}o.ringingId=a(t,"audiooutput","ringingId"),o.speakerId=a(t,"audiooutput","speakerId"),o.microphoneId=a(t,"audioinput","microphoneId"),o.ringingVolume=o.ringingVolume||.5,o.speakerVolume=o.speakerVolume||.5,o.microphoneVolume=o.microphoneVolume||1,o.ringingMute=o.ringingMute||!1,o.speakerMute=o.speakerMute||!1,o.microphoneMute=o.microphoneMute||!1,n.conf=angular.copy(o),n.devices=t,n.saveSettings=function(){e.hide(n.conf)},n.closeDialog=function(){e.hide()},n.isCompatibleBrowser=function(){return"chrome"===n.conf.browserName.toLowerCase()||"opera"===n.conf.browserName.toLowerCase()||"safari"===n.conf.browserName.toLowerCase()}}e.$inject=["$mdDialog","conf","devices"],angular.module("app.toolbar").controller("SettingsController",e)}(),function(){"use strict";angular.module("app.core").directive("msRandomClass",function(){return{restrict:"A",scope:{msRandomClass:"="},link:function(e,t){var n=e.msRandomClass[Math.floor(Math.random()*e.msRandomClass.length)];t.addClass(n)}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{id:"=",model:"=",download:"="},replace:!0,link:function(t,e){var n=!1,a=document.createElement("audio");t.download||a.setAttribute("controlsList","nodownload"),a.setAttribute("preload","none"),a.setAttribute("controls",""),a.setAttribute("style","width: 265px;"),a.setAttribute("src"," "),a.onplay=function(e){n||(n=!0,e.preventDefault(),i[t.model||"voiceRecording"].download({id:t.id}).$promise.then(function(e){var t=[e.buffer],n=new Blob(t,{type:e.type});a.setAttribute("type",e.type),a.setAttribute("src",URL.createObjectURL(n)),a.play()}).catch(function(e){console.error(e)}))},e.append(a)}}}e.$inject=["api"],angular.module("app.core").directive("msRecording",e)}(),function(){"use strict";angular.module("app.core").directive("msResponsiveTable",function(){return{restrict:"A",link:function(e,t){var n=angular.element('<div class="ms-responsive-table-wrapper"></div>');t.after(n),n.append(t)}}})}(),function(){"use strict";function e(o,s,t,n){return{restrict:"AE",compile:function(e){if(!(n.getConfig("disableCustomScrollbars")||n.getConfig("disableCustomScrollbarsOnMobile")&&t.isMobile()))return e.addClass("ms-scroll"),function(e,t,n){var a={};function i(){PerfectScrollbar.update(t[0])}n.msScroll&&(a=e.$eval(n.msScroll)),a=angular.extend({},s.getConfig(),a),o(function(){PerfectScrollbar.initialize(t[0],a)},0),t.on("mouseenter",i),e.$watch(function(){return t.prop("scrollHeight")},function(e,t){angular.isUndefined(e)||angular.equals(e,t)||i()}),e.$watch(function(){return t.prop("scrollWidth")},function(e,t){angular.isUndefined(e)||angular.equals(e,t)||i()}),e.$on("$destroy",function(){t.off("mouseenter"),PerfectScrollbar.destroy(t[0])})}}}}e.$inject=["$timeout","msScrollConfig","msUtils","motionConfig"],angular.module("app.core").provider("msScrollConfig",function(){var t={wheelSpeed:1,wheelPropagation:!1,swipePropagation:!0,minScrollbarLength:null,maxScrollbarLength:null,useBothWheelAxes:!1,useKeyboard:!0,suppressScrollX:!1,suppressScrollY:!1,scrollXMarginOffset:0,scrollYMarginOffset:0,stopPropagationOnClick:!0};this.config=function(e){t=angular.extend({},t,e)},this.$get=function(){var e={getConfig:function(){return t}};return e}}).directive("msScroll",e)}(),function(){"use strict";function e(o,i,e){var s=this;s.collapsed=!0,s.query="",s.queryOptions={debounce:s.debounce||0};var t=!(!s.collapseOnBlur||"true"!=s.collapseOnBlur);s.resultsLoading=!1,s.results=null,s.selectedResultIndex=0,s.ignoreMouseEvents=!1,s.populateResults=function(e){if(s.collapsed)return;var t=angular.isArray(e),n=null===e;if(!t&&!n)return;s.selectedResultIndex=0,s.results=e},s.expand=function(){s.collapsed=!1,o.expand(),s.onExpand&&angular.isFunction(s.onExpand)&&s.onExpand()},s.collapse=function(){s.query="",s.populateResults(null),s.collapsed=!0,o.collapse(),s.onCollapse&&angular.isFunction(s.onCollapse)&&s.onCollapse()},s.blurCollapse=function(){if(!t)return;s.collapse()},s.absorbEvent=function(e){e.preventDefault()},s.handleKeydown=function(e){var t=e.keyCode;-1<[27,38,40].indexOf(t)&&e.preventDefault();switch(t){case 13:if(!s.results)return;s.handleResultClick(s.results[s.selectedResultIndex]);break;case 27:s.collapse();break;case 38:0<=s.selectedResultIndex-1&&(s.selectedResultIndex--,s.ensureSelectedResultIsVisible());break;case 40:if(!s.results)return;s.selectedResultIndex+1<s.results.length&&(s.selectedResultIndex++,s.ensureSelectedResultIsVisible())}},s.handleMouseenter=function(e){if(s.ignoreMouseEvents)return;s.selectedResultIndex=e},s.temporarilyIgnoreMouseEvents=function(){s.ignoreMouseEvents=!0,e.cancel(s.mouseEventIgnoreTimeout),s.mouseEventIgnoreTimeout=e(function(){s.ignoreMouseEvents=!1},250)},s.handleResultClick=function(e){s.onResultClick&&s.onResultClick({item:e});s.collapse()},s.ensureSelectedResultIsVisible=function(){var e=i.find(".ms-search-bar-results"),t=angular.element(e.find(".result")[s.selectedResultIndex]);if(e&&t){var n=t.position().top-8,a=t.position().top+t.outerHeight()+8;s.temporarilyIgnoreMouseEvents(),e.scrollTop()>n&&e.scrollTop(n),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}},o.$watch("MsSearchBar.query",function(e,t){if(!angular.isUndefined(e)&&!angular.equals(e,t)&&!s.collapsed){var n=o.$parent.$eval(s.onSearch,{query:e}),a=angular.isArray(n),i=n&&!!n.then;a&&s.populateResults(n),i&&(s.resultsLoading=!0,n.then(function(e){s.populateResults(e)},function(){s.populateResults([])}).finally(function(){s.resultsLoading=!1}))}})}function t(i){return{restrict:"E",scope:{},require:"msSearchBar",controller:"MsSearchBarController as MsSearchBar",bindToController:{debounce:"=?",onSearch:"@",onResultClick:"&?",onExpand:"&?",onCollapse:"&?",collapseOnBlur:"@"},templateUrl:"app/core/directives/ms-search-bar/ms-search-bar.html",compile:function(e){return e.addClass("ms-search-bar"),function(e,t){var n,a=i.find("body");e.collapse=function(){t.removeClass("expanded"),a.removeClass("ms-search-bar-expanded")},e.expand=function(){t.addClass("expanded"),a.addClass("ms-search-bar-expanded"),n.focus()},n=t.find("#ms-search-bar-input")}}}}e.$inject=["$scope","$element","$timeout"],t.$inject=["$document"],angular.module("app.core").controller("MsSearchBarController",e).directive("msSearchBar",t)}(),function(){"use strict";function e(e,n,i,s,r,l){var d=this;d.query="",d.queryOptions={debounce:300},d.resultsLoading=!1,d.selectedResultIndex=0,d.ignoreMouseEvents=!1,d.mobileBarActive=!1,d.results=null,d.shortcuts=[],d.sortableOptions={ghostClass:"ghost",forceFallback:!0,fallbackClass:"dragging",onSort:function(){d.saveShortcuts()}},d.populateResults=function(){for(var e=[],t=l.getFlatNavigation(),n=r.defer(),a=0;a<t.length;a++)t[a].uisref&&e.push(t[a]);if(d.query){e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(d.query)))return!0});for(var i=0;i<e.length;i++){e[i].hasShortcut=!1;for(var o=0;o<d.shortcuts.length;o++)if(d.shortcuts[o]._id===e[i]._id){e[i].hasShortcut=!0;break}}}else 0<d.shortcuts.length&&(e=d.shortcuts);return d.selectedResultIndex=0,s(function(){n.resolve(e)},250),n.promise},d.loadShortcuts=function(){var e=r.defer(),t=angular.fromJson(n.get("motion.shortcuts"));angular.isUndefined(t)&&(t=[{title:"Agents",icon:"icon-account-multiple",state:"app.staff.agents",weight:5,children:[],uisref:"app.staff.agents",hasShortcut:!0},{title:"License",icon:"icon-cog",state:"app.settings.license",weight:10,children:[],uisref:"app.settings.license",hasShortcut:!0}],n.put("motion.shortcuts",angular.toJson(t)));return e.resolve(t),e.promise},d.saveShortcuts=function(){var e=r.defer();return n.put("motion.shortcuts",angular.toJson(d.shortcuts)),s(function(){e.resolve({success:!0})},250),e.promise},d.addShortcut=function(e){e.hasShortcut=!0,d.shortcuts.push(e),d.saveShortcuts()},d.removeShortcut=function(e){e.hasShortcut=!1;for(var t=0;t<d.shortcuts.length;t++)d.shortcuts[t]._id===e._id&&(d.shortcuts.splice(t,1),d.query||(0===d.shortcuts.length?d.results=null:t>=d.shortcuts.length&&(d.selectedResultIndex=d.shortcuts.length-1)));d.saveShortcuts()},d.handleResultClick=function(e){e.hasShortcut?d.removeShortcut(e):d.addShortcut(e)},d.absorbEvent=function(e){e.preventDefault()},d.handleKeydown=function(e){var t=e.keyCode;-1<[38,40].indexOf(t)&&e.preventDefault();switch(t){case 13:d.handleResultClick(d.results[d.selectedResultIndex]);break;case 38:0<=d.selectedResultIndex-1&&(d.selectedResultIndex--,d.ensureSelectedResultIsVisible());break;case 40:d.selectedResultIndex+1<d.results.length&&(d.selectedResultIndex++,d.ensureSelectedResultIsVisible())}},d.handleMouseenter=function(e){if(d.ignoreMouseEvents)return;d.selectedResultIndex=e},d.temporarilyIgnoreMouseEvents=function(){d.ignoreMouseEvents=!0,s.cancel(d.mouseEventIgnoreTimeout),d.mouseEventIgnoreTimeout=s(function(){d.ignoreMouseEvents=!1},250)},d.ensureSelectedResultIsVisible=function(){var e=i.find("#ms-shortcut-add-menu").find(".results"),t=angular.element(e.find(".result")[d.selectedResultIndex]);if(e&&t){var n=t.position().top-8,a=t.position().top+t.outerHeight()+8;d.temporarilyIgnoreMouseEvents(),e.scrollTop()>n&&e.scrollTop(n),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}},d.toggleMobileBar=function(){d.mobileBarActive=!d.mobileBarActive},d.loadShortcuts().then(function(e){d.shortcuts=e,0<d.shortcuts.length&&(d.results=e)}),e.$watch("MsShortcuts.query",function(e,t){angular.isUndefined(e)||angular.equals(e,t)||(d.resultsLoading=!0,d.populateResults().then(function(e){d.results=e},function(){d.results=[]}).finally(function(){d.resultsLoading=!1}))})}e.$inject=["$scope","$cookies","$document","$timeout","$q","msNavigationService"],angular.module("app.core").controller("MsShortcutsController",e).directive("msShortcuts",function(){return{restrict:"E",scope:{},require:"msShortcuts",controller:"MsShortcutsController as MsShortcuts",bindToController:{},templateUrl:"app/core/directives/ms-shortcuts/ms-shortcuts.html",compile:function(e){return e.addClass("ms-shortcuts"),function(e,t){}}}})}(),function(){"use strict";angular.module("app.core").directive("msSidenavHelper",function(){return{restrict:"A",require:"^mdSidenav",link:function(e,t,n,a){e.$watch(function(){return a.isOpen()&&!a.isLockedOpen()},function(e){angular.isUndefined(e)||(t.parent().toggleClass("full-height",e),angular.element("html").toggleClass("sidenav-open",e))})}}})}(),function(){"use strict";function e(a){return{restrict:"E",link:function(e,t){var n=e.$on("msSplashScreen::remove",function(){a.leave(t).then(function(){n(),e=t=null})})}}}e.$inject=["$animate"],angular.module("app.core").directive("msSplashScreen",e)}(),function(){"use strict";function e(e){var i=this;function t(){i.setCurrentStep(1)}function n(e){return s(e)?i.steps[e-1].scope.optionalStep:null}function a(e){return s(e)?!!i.steps[e-1].scope.hideStep:null}function o(e){return s(e)?!!n(e)||i.steps[e-1].form.$valid:null}function s(e){return!(angular.isUndefined(e)||e<1||e>i.steps.length)}i.mainForm=void 0,i.orientation="horizontal",i.steps=[],i.currentStep=void 0,i.currentStepNumber=1,i.setOrientation=function(e){i.orientation=e||"horizontal"},i.registerMainForm=function(e){i.mainForm=e},i.registerStep=function(e,t,n){var a={element:e,scope:t,form:n,stepNumber:t.step||i.steps.length+1,stepTitle:t.stepTitle,stepTitleTranslate:t.stepTitleTranslate};return i.steps.push(a),i.steps.sort(function(e,t){return e.stepNumber-t.stepNumber}),a},i.setupSteps=function(){i.setCurrentStep(i.currentStepNumber)},i.resetForm=function(){e(function(){for(var e=0;e<i.steps.length;e++)i.steps[e].form.$setPristine(),i.steps[e].form.$setUntouched();i.mainForm.$setPristine(),i.mainForm.$setUntouched(),t()})},i.setCurrentStep=function(e){if(!s(e))return;if(i.currentStepNumber=e,"horizontal"===i.orientation){for(var t=0;t<i.steps.length;t++)i.steps[t].element.hide();i.steps[i.currentStepNumber-1].element.show()}else if("vertical"===i.orientation){for(var n=0;n<i.steps.length;n++)i.steps[n].element.find(".ms-stepper-step-content").hide();i.steps[i.currentStepNumber-1].element.find(".ms-stepper-step-content").show()}},i.gotoStep=function(e){if(a(e))return;i.setCurrentStep(e)},i.gotoPreviousStep=function(){for(var e=i.currentStepNumber-1,t=e;1<=t;t--)if(!a(t)){e=t;break}i.setCurrentStep(e)},i.gotoNextStep=function(){for(var e=i.currentStepNumber+1,t=e;t<=i.steps.length;t++)if(!a(t)){e=t;break}i.setCurrentStep(e)},i.gotoFirstStep=t,i.gotoLastStep=function(){i.setCurrentStep(i.steps.length)},i.isFirstStep=function(){return 1===i.currentStepNumber},i.isLastStep=function(){return i.currentStepNumber===i.steps.length},i.isStepCurrent=function(e){if(!s(e))return null;return i.currentStepNumber===e},i.isStepDisabled=function(e){if(!s(e))return null;for(var t=!1,n=1;n<e;n++)if(!o(n)){t=!0;break}return t},i.isStepOptional=n,i.isStepHidden=a,i.filterHiddenStep=function(e){return!a(e.stepNumber)},i.isStepValid=o,i.isStepNumberValid=s,i.isFormValid=function(){return i.mainForm.$valid}}function t(s){return{restrict:"A",scope:{},require:["form","msVerticalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/vertical.html",compile:function(e){return e.addClass("ms-stepper"),function(e,t,n,a){var i=a[0],o=a[1];s(function(){o.setOrientation("vertical"),o.registerMainForm(i),o.setupSteps()})}}}}e.$inject=["$timeout"],t.$inject=["$timeout"],angular.module("app.core").controller("MsStepperController",e).directive("msHorizontalStepper",function(){return{restrict:"A",scope:{},require:["form","msHorizontalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/horizontal/horizontal.html",compile:function(e){return e.addClass("ms-stepper"),function(e,t,n,a){var i=a[0],o=a[1];o.setOrientation("horizontal"),o.registerMainForm(i),o.setupSteps()}}}}).directive("msHorizontalStepperStep",function(){return{restrict:"E",require:["form","^msHorizontalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},compile:function(e){return e.addClass("ms-stepper-step"),function(e,t,n,a){var i=a[0],o=a[1];e.optionalStep=angular.isDefined(n.optionalStep),o.registerStep(t,e,i),t.hide()}}}}).directive("msVerticalStepper",t).directive("msVerticalStepperStep",function(){return{restrict:"E",require:["form","^msVerticalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html",compile:function(e){return e.addClass("ms-stepper-step"),function(e,t,n,a){var i=a[0],o=a[1];e.optionalStep=angular.isDefined(n.optionalStep),e.stepInfo=o.registerStep(t,e,i),e.MsStepper=o,t.find(".ms-stepper-step-content").hide()}}}})}(),function(){"use strict";function e(m,u){return{scope:!0,require:"^msTimeline",compile:function(e){return e.addClass("ms-timeline-item").addClass("hidden"),function(e,n,t,a){var i=72,o=!1,s=!1,r=a.getScrollEl();!function(){n.find("ms-card")?e.$on("msCard::cardTemplateLoaded",function(e,t){var n=angular.element(t[0]);d(n).then(function(){m(function(){o=!0})})}):d(n).then(function(){m(function(){o=!0})});r.on("scroll",c),c()}();var l=e.$watch(function(){return o&&s},function(e,t){angular.equals(e,t)||e&&(n.removeClass("hidden").addClass("animate"),l())},!0);function d(e){var t=u.defer(),n=e.find("img");return 0<n.length?n.on("load",function(){t.resolve("Image is loaded")}):t.resolve("No images"),t.promise}function c(){r.scrollTop()+r.height()>n.position().top+i&&(m(function(){s=!0}),r.off("scroll",c))}}}}}e.$inject=["$timeout","$q"],angular.module("app.core").controller("MsTimelineController",function(){var t=this;t.scrollEl=void 0,t.setScrollEl=function(e){t.scrollEl=e},t.getScrollEl=function(){return t.scrollEl}}).directive("msTimeline",function(){return{scope:{msTimeline:"=?",loadMore:"&?msTimelineLoadMore"},controller:"MsTimelineController",compile:function(e){return e.addClass("ms-timeline"),function(e,t,n,a){var i=angular.element('<div class="ms-timeline-loader md-accent-bg md-whiteframe-4dp"><span class="spinner animate-rotate"></span></div>');t.append(i);var o={scrollEl:"#content"};o=angular.extend(o,e.msTimeline,{});var s=angular.element(o.scrollEl);a.setScrollEl(s);var r=144;function l(){s.scrollTop()+s.height()+r>i.position().top&&(i.addClass("show"),c(),e.loadMore().then(function(){i.removeClass("show"),d()},function(){i.remove()}))}function d(){s.on("scroll",l)}function c(){s.off("scroll",l)}d(),e.$on("$destroy",function(){c()})}}}}).directive("msTimelineItem",e)}(),function(){"use strict";angular.module("app.core").directive("msTimezone",function(){return{restrict:"E",scope:{ngModel:"="},controller:["$scope",function(e){e.timezone=[{name:"Europe/Andorra",utcOffset:60,offsetStr:"+01:00",countries:["AD"]},{name:"Asia/Dubai",utcOffset:240,offsetStr:"+04:00",countries:["AE","OM"]},{name:"Asia/Kabul",utcOffset:270,offsetStr:"+04:30",countries:["AF"]},{name:"Europe/Tirane",utcOffset:60,offsetStr:"+01:00",countries:["AL"]},{name:"Asia/Yerevan",utcOffset:240,offsetStr:"+04:00",countries:["AM"]},{name:"Antarctica/Rothera",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Palmer",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Mawson",utcOffset:300,offsetStr:"+05:00",countries:["AQ"]},{name:"Antarctica/Davis",utcOffset:420,offsetStr:"+07:00",countries:["AQ"]},{name:"Antarctica/Casey",utcOffset:480,offsetStr:"+08:00",countries:["AQ"]},{name:"Antarctica/Vostok",utcOffset:360,offsetStr:"+06:00",countries:["AQ"]},{name:"Antarctica/DumontDUrville",utcOffset:600,offsetStr:"+10:00",countries:["AQ"]},{name:"Antarctica/Syowa",utcOffset:180,offsetStr:"+03:00",countries:["AQ"]},{name:"Antarctica/Troll",utcOffset:0,offsetStr:"+00:00",countries:["AQ"]},{name:"America/Argentina/Buenos_Aires",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Cordoba",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Salta",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Jujuy",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Tucuman",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Catamarca",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/La_Rioja",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Juan",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Mendoza",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Luis",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Rio_Gallegos",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Ushuaia",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"Pacific/Pago_Pago",utcOffset:-660,offsetStr:"-11:00",countries:["AS","UM"]},{name:"Europe/Vienna",utcOffset:60,offsetStr:"+01:00",countries:["AT"]},{name:"Australia/Lord_Howe",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Antarctica/Macquarie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Hobart",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Currie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Melbourne",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Sydney",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Broken_Hill",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Brisbane",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Lindeman",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Adelaide",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Darwin",utcOffset:570,offsetStr:"+09:30",countries:["AU"]},{name:"Australia/Perth",utcOffset:480,offsetStr:"+08:00",countries:["AU"]},{name:"Australia/Eucla",utcOffset:525,offsetStr:"+08:45",countries:["AU"]},{name:"Asia/Baku",utcOffset:240,offsetStr:"+04:00",countries:["AZ"]},{name:"America/Barbados",utcOffset:-240,offsetStr:"-04:00",countries:["BB"]},{name:"Asia/Dhaka",utcOffset:360,offsetStr:"+06:00",countries:["BD"]},{name:"Europe/Brussels",utcOffset:60,offsetStr:"+01:00",countries:["BE"]},{name:"Europe/Sofia",utcOffset:120,offsetStr:"+02:00",countries:["BG"]},{name:"Atlantic/Bermuda",utcOffset:-240,offsetStr:"-04:00",countries:["BM"]},{name:"Asia/Brunei",utcOffset:480,offsetStr:"+08:00",countries:["BN"]},{name:"America/La_Paz",utcOffset:-240,offsetStr:"-04:00",countries:["BO"]},{name:"America/Noronha",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Belem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Fortaleza",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Recife",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Araguaina",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Maceio",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Bahia",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Sao_Paulo",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Campo_Grande",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Cuiaba",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Santarem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Porto_Velho",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Boa_Vista",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Manaus",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Eirunepe",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Rio_Branco",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Nassau",utcOffset:-300,offsetStr:"-05:00",countries:["BS"]},{name:"Asia/Thimphu",utcOffset:360,offsetStr:"+06:00",countries:["BT"]},{name:"Europe/Minsk",utcOffset:180,offsetStr:"+03:00",countries:["BY"]},{name:"America/Belize",utcOffset:-360,offsetStr:"-06:00",countries:["BZ"]},{name:"America/St_Johns",utcOffset:-210,offsetStr:"-03:30",countries:["CA"]},{name:"America/Halifax",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Glace_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Moncton",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Goose_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Blanc-Sablon",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Toronto",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Nipigon",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Thunder_Bay",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Iqaluit",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Pangnirtung",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Resolute",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Atikokan",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Rankin_Inlet",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Winnipeg",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Rainy_River",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Regina",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Swift_Current",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Edmonton",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Cambridge_Bay",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Yellowknife",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Inuvik",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Creston",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Dawson_Creek",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Fort_Nelson",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Vancouver",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Whitehorse",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Dawson",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"Indian/Cocos",utcOffset:390,offsetStr:"+06:30",countries:["CC"]},{name:"Europe/Zurich",utcOffset:60,offsetStr:"+01:00",countries:["CH","DE","LI"]},{name:"Africa/Abidjan",utcOffset:0,offsetStr:"+00:00",countries:["CI","BF","GM","GN","ML","MR","SH","SL","SN","ST","TG"]},{name:"Pacific/Rarotonga",utcOffset:-600,offsetStr:"-10:00",countries:["CK"]},{name:"America/Santiago",utcOffset:-180,offsetStr:"-03:00",countries:["CL"]},{name:"Pacific/Easter",utcOffset:-300,offsetStr:"-05:00",countries:["CL"]},{name:"Asia/Shanghai",utcOffset:480,offsetStr:"+08:00",countries:["CN"]},{name:"Asia/Urumqi",utcOffset:360,offsetStr:"+06:00",countries:["CN"]},{name:"America/Bogota",utcOffset:-300,offsetStr:"-05:00",countries:["CO"]},{name:"America/Costa_Rica",utcOffset:-360,offsetStr:"-06:00",countries:["CR"]},{name:"America/Havana",utcOffset:-300,offsetStr:"-05:00",countries:["CU"]},{name:"Atlantic/Cape_Verde",utcOffset:-60,offsetStr:"-01:00",countries:["CV"]},{name:"America/Curacao",utcOffset:-240,offsetStr:"-04:00",countries:["CW","AW","BQ","SX"]},{name:"Indian/Christmas",utcOffset:420,offsetStr:"+07:00",countries:["CX"]},{name:"Asia/Nicosia",utcOffset:120,offsetStr:"+02:00",countries:["CY"]},{name:"Europe/Prague",utcOffset:60,offsetStr:"+01:00",countries:["CZ","SK"]},{name:"Europe/Berlin",utcOffset:60,offsetStr:"+01:00",countries:["DE"]},{name:"Europe/Copenhagen",utcOffset:60,offsetStr:"+01:00",countries:["DK"]},{name:"America/Santo_Domingo",utcOffset:-240,offsetStr:"-04:00",countries:["DO"]},{name:"Africa/Algiers",utcOffset:60,offsetStr:"+01:00",countries:["DZ"]},{name:"America/Guayaquil",utcOffset:-300,offsetStr:"-05:00",countries:["EC"]},{name:"Pacific/Galapagos",utcOffset:-360,offsetStr:"-06:00",countries:["EC"]},{name:"Europe/Tallinn",utcOffset:120,offsetStr:"+02:00",countries:["EE"]},{name:"Africa/Cairo",utcOffset:120,offsetStr:"+02:00",countries:["EG"]},{name:"Africa/El_Aaiun",utcOffset:0,offsetStr:"+00:00",countries:["EH"]},{name:"Europe/Madrid",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Africa/Ceuta",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Atlantic/Canary",utcOffset:0,offsetStr:"+00:00",countries:["ES"]},{name:"Europe/Helsinki",utcOffset:120,offsetStr:"+02:00",countries:["FI","AX"]},{name:"Pacific/Fiji",utcOffset:720,offsetStr:"+12:00",countries:["FJ"]},{name:"Atlantic/Stanley",utcOffset:-180,offsetStr:"-03:00",countries:["FK"]},{name:"Pacific/Chuuk",utcOffset:600,offsetStr:"+10:00",countries:["FM"]},{name:"Pacific/Pohnpei",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Pacific/Kosrae",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Atlantic/Faroe",utcOffset:0,offsetStr:"+00:00",countries:["FO"]},{name:"Europe/Paris",utcOffset:60,offsetStr:"+01:00",countries:["FR"]},{name:"Europe/London",utcOffset:0,offsetStr:"+00:00",countries:["GB","GG","IM","JE"]},{name:"Asia/Tbilisi",utcOffset:240,offsetStr:"+04:00",countries:["GE"]},{name:"America/Cayenne",utcOffset:-180,offsetStr:"-03:00",countries:["GF"]},{name:"Africa/Accra",utcOffset:0,offsetStr:"+00:00",countries:["GH"]},{name:"Europe/Gibraltar",utcOffset:60,offsetStr:"+01:00",countries:["GI"]},{name:"America/Godthab",utcOffset:-180,offsetStr:"-03:00",countries:["GL"]},{name:"America/Danmarkshavn",utcOffset:0,offsetStr:"+00:00",countries:["GL"]},{name:"America/Scoresbysund",utcOffset:-60,offsetStr:"-01:00",countries:["GL"]},{name:"America/Thule",utcOffset:-240,offsetStr:"-04:00",countries:["GL"]},{name:"Europe/Athens",utcOffset:120,offsetStr:"+02:00",countries:["GR"]},{name:"Atlantic/South_Georgia",utcOffset:-120,offsetStr:"-02:00",countries:["GS"]},{name:"America/Guatemala",utcOffset:-360,offsetStr:"-06:00",countries:["GT"]},{name:"Pacific/Guam",utcOffset:600,offsetStr:"+10:00",countries:["GU","MP"]},{name:"Africa/Bissau",utcOffset:0,offsetStr:"+00:00",countries:["GW"]},{name:"America/Guyana",utcOffset:-240,offsetStr:"-04:00",countries:["GY"]},{name:"Asia/Hong_Kong",utcOffset:480,offsetStr:"+08:00",countries:["HK"]},{name:"America/Tegucigalpa",utcOffset:-360,offsetStr:"-06:00",countries:["HN"]},{name:"America/Port-au-Prince",utcOffset:-300,offsetStr:"-05:00",countries:["HT"]},{name:"Europe/Budapest",utcOffset:60,offsetStr:"+01:00",countries:["HU"]},{name:"Asia/Jakarta",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Pontianak",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Makassar",utcOffset:480,offsetStr:"+08:00",countries:["ID"]},{name:"Asia/Jayapura",utcOffset:540,offsetStr:"+09:00",countries:["ID"]},{name:"Europe/Dublin",utcOffset:0,offsetStr:"+00:00",countries:["IE"]},{name:"Asia/Jerusalem",utcOffset:120,offsetStr:"+02:00",countries:["IL"]},{name:"Asia/Kolkata",utcOffset:330,offsetStr:"+05:30",countries:["IN"]},{name:"Indian/Chagos",utcOffset:360,offsetStr:"+06:00",countries:["IO"]},{name:"Asia/Baghdad",utcOffset:180,offsetStr:"+03:00",countries:["IQ"]},{name:"Asia/Tehran",utcOffset:210,offsetStr:"+03:30",countries:["IR"]},{name:"Atlantic/Reykjavik",utcOffset:0,offsetStr:"+00:00",countries:["IS"]},{name:"Europe/Rome",utcOffset:60,offsetStr:"+01:00",countries:["IT","SM","VA"]},{name:"America/Jamaica",utcOffset:-300,offsetStr:"-05:00",countries:["JM"]},{name:"Asia/Amman",utcOffset:120,offsetStr:"+02:00",countries:["JO"]},{name:"Asia/Tokyo",utcOffset:540,offsetStr:"+09:00",countries:["JP"]},{name:"Africa/Nairobi",utcOffset:180,offsetStr:"+03:00",countries:["KE","DJ","ER","ET","KM","MG","SO","TZ","UG","YT"]},{name:"Asia/Bishkek",utcOffset:360,offsetStr:"+06:00",countries:["KG"]},{name:"Pacific/Tarawa",utcOffset:720,offsetStr:"+12:00",countries:["KI"]},{name:"Pacific/Enderbury",utcOffset:780,offsetStr:"+13:00",countries:["KI"]},{name:"Pacific/Kiritimati",utcOffset:840,offsetStr:"+14:00",countries:["KI"]},{name:"Asia/Pyongyang",utcOffset:510,offsetStr:"+08:30",countries:["KP"]},{name:"Asia/Seoul",utcOffset:540,offsetStr:"+09:00",countries:["KR"]},{name:"America/Cayman",utcOffset:-300,offsetStr:"-05:00",countries:["KY"]},{name:"Asia/Almaty",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Qyzylorda",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Aqtobe",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Aqtau",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Oral",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Beirut",utcOffset:120,offsetStr:"+02:00",countries:["LB"]},{name:"Asia/Colombo",utcOffset:330,offsetStr:"+05:30",countries:["LK"]},{name:"Africa/Monrovia",utcOffset:0,offsetStr:"+00:00",countries:["LR"]},{name:"Europe/Vilnius",utcOffset:120,offsetStr:"+02:00",countries:["LT"]},{name:"Europe/Luxembourg",utcOffset:60,offsetStr:"+01:00",countries:["LU"]},{name:"Europe/Riga",utcOffset:120,offsetStr:"+02:00",countries:["LV"]},{name:"Africa/Tripoli",utcOffset:120,offsetStr:"+02:00",countries:["LY"]},{name:"Africa/Casablanca",utcOffset:0,offsetStr:"+00:00",countries:["MA"]},{name:"Europe/Monaco",utcOffset:60,offsetStr:"+01:00",countries:["MC"]},{name:"Europe/Chisinau",utcOffset:120,offsetStr:"+02:00",countries:["MD"]},{name:"Pacific/Majuro",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Pacific/Kwajalein",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Asia/Rangoon",utcOffset:390,offsetStr:"+06:30",countries:["MM"]},{name:"Asia/Ulaanbaatar",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Hovd",utcOffset:420,offsetStr:"+07:00",countries:["MN"]},{name:"Asia/Choibalsan",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Macau",utcOffset:480,offsetStr:"+08:00",countries:["MO"]},{name:"America/Martinique",utcOffset:-240,offsetStr:"-04:00",countries:["MQ"]},{name:"Europe/Malta",utcOffset:60,offsetStr:"+01:00",countries:["MT"]},{name:"Indian/Mauritius",utcOffset:240,offsetStr:"+04:00",countries:["MU"]},{name:"Indian/Maldives",utcOffset:300,offsetStr:"+05:00",countries:["MV"]},{name:"America/Mexico_City",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Cancun",utcOffset:-300,offsetStr:"-05:00",countries:["MX"]},{name:"America/Merida",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Monterrey",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Matamoros",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Mazatlan",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Chihuahua",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Ojinaga",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Hermosillo",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Tijuana",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Santa_Isabel",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Bahia_Banderas",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"Asia/Kuala_Lumpur",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Asia/Kuching",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Africa/Maputo",utcOffset:120,offsetStr:"+02:00",countries:["MZ","BI","BW","CD","MW","RW","ZM","ZW"]},{name:"Africa/Windhoek",utcOffset:120,offsetStr:"+02:00",countries:["NA"]},{name:"Pacific/Noumea",utcOffset:660,offsetStr:"+11:00",countries:["NC"]},{name:"Pacific/Norfolk",utcOffset:660,offsetStr:"+11:00",countries:["NF"]},{name:"Africa/Lagos",utcOffset:60,offsetStr:"+01:00",countries:["NG","AO","BJ","CD","CF","CG","CM","GA","GQ","NE"]},{name:"America/Managua",utcOffset:-360,offsetStr:"-06:00",countries:["NI"]},{name:"Europe/Amsterdam",utcOffset:60,offsetStr:"+01:00",countries:["NL"]},{name:"Europe/Oslo",utcOffset:60,offsetStr:"+01:00",countries:["NO","SJ"]},{name:"Asia/Kathmandu",utcOffset:345,offsetStr:"+05:45",countries:["NP"]},{name:"Pacific/Nauru",utcOffset:720,offsetStr:"+12:00",countries:["NR"]},{name:"Pacific/Niue",utcOffset:-660,offsetStr:"-11:00",countries:["NU"]},{name:"Pacific/Auckland",utcOffset:780,offsetStr:"+13:00",countries:["NZ","AQ"]},{name:"Pacific/Chatham",utcOffset:825,offsetStr:"+13:45",countries:["NZ"]},{name:"America/Panama",utcOffset:-300,offsetStr:"-05:00",countries:["PA"]},{name:"America/Lima",utcOffset:-300,offsetStr:"-05:00",countries:["PE"]},{name:"Pacific/Tahiti",utcOffset:-600,offsetStr:"-10:00",countries:["PF"]},{name:"Pacific/Marquesas",utcOffset:-570,offsetStr:"-09:30",countries:["PF"]},{name:"Pacific/Gambier",utcOffset:-540,offsetStr:"-09:00",countries:["PF"]},{name:"Pacific/Port_Moresby",utcOffset:600,offsetStr:"+10:00",countries:["PG"]},{name:"Pacific/Bougainville",utcOffset:660,offsetStr:"+11:00",countries:["PG"]},{name:"Asia/Manila",utcOffset:480,offsetStr:"+08:00",countries:["PH"]},{name:"Asia/Karachi",utcOffset:300,offsetStr:"+05:00",countries:["PK"]},{name:"Europe/Warsaw",utcOffset:60,offsetStr:"+01:00",countries:["PL"]},{name:"America/Miquelon",utcOffset:-180,offsetStr:"-03:00",countries:["PM"]},{name:"Pacific/Pitcairn",utcOffset:-480,offsetStr:"-08:00",countries:["PN"]},{name:"America/Puerto_Rico",utcOffset:-240,offsetStr:"-04:00",countries:["PR"]},{name:"Asia/Gaza",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Asia/Hebron",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Europe/Lisbon",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Madeira",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Azores",utcOffset:-60,offsetStr:"-01:00",countries:["PT"]},{name:"Pacific/Palau",utcOffset:540,offsetStr:"+09:00",countries:["PW"]},{name:"America/Asuncion",utcOffset:-180,offsetStr:"-03:00",countries:["PY"]},{name:"Asia/Qatar",utcOffset:180,offsetStr:"+03:00",countries:["QA","BH"]},{name:"Indian/Reunion",utcOffset:240,offsetStr:"+04:00",countries:["RE","TF"]},{name:"Europe/Bucharest",utcOffset:120,offsetStr:"+02:00",countries:["RO"]},{name:"Europe/Belgrade",utcOffset:60,offsetStr:"+01:00",countries:["RS","BA","HR","ME","MK","SI"]},{name:"Europe/Kaliningrad",utcOffset:120,offsetStr:"+02:00",countries:["RU"]},{name:"Europe/Moscow",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Simferopol",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Volgograd",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Samara",utcOffset:240,offsetStr:"+04:00",countries:["RU"]},{name:"Asia/Yekaterinburg",utcOffset:300,offsetStr:"+05:00",countries:["RU"]},{name:"Asia/Omsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novosibirsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novokuznetsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Krasnoyarsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Irkutsk",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Chita",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Yakutsk",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Khandyga",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Vladivostok",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Sakhalin",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Ust-Nera",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Magadan",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Srednekolymsk",utcOffset:660,offsetStr:"+11:00",countries:["RU"]},{name:"Asia/Kamchatka",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Anadyr",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Riyadh",utcOffset:180,offsetStr:"+03:00",countries:["SA","KW","YE"]},{name:"Pacific/Guadalcanal",utcOffset:660,offsetStr:"+11:00",countries:["SB"]},{name:"Indian/Mahe",utcOffset:240,offsetStr:"+04:00",countries:["SC"]},{name:"Africa/Khartoum",utcOffset:180,offsetStr:"+03:00",countries:["SD","SS"]},{name:"Europe/Stockholm",utcOffset:60,offsetStr:"+01:00",countries:["SE"]},{name:"Asia/Singapore",utcOffset:480,offsetStr:"+08:00",countries:["SG"]},{name:"America/Paramaribo",utcOffset:-180,offsetStr:"-03:00",countries:["SR"]},{name:"America/El_Salvador",utcOffset:-360,offsetStr:"-06:00",countries:["SV"]},{name:"Asia/Damascus",utcOffset:120,offsetStr:"+02:00",countries:["SY"]},{name:"America/Grand_Turk",utcOffset:-240,offsetStr:"-04:00",countries:["TC"]},{name:"Africa/Ndjamena",utcOffset:60,offsetStr:"+01:00",countries:["TD"]},{name:"Indian/Kerguelen",utcOffset:300,offsetStr:"+05:00",countries:["TF"]},{name:"Asia/Bangkok",utcOffset:420,offsetStr:"+07:00",countries:["TH","KH","LA","VN"]},{name:"Asia/Dushanbe",utcOffset:300,offsetStr:"+05:00",countries:["TJ"]},{name:"Pacific/Fakaofo",utcOffset:780,offsetStr:"+13:00",countries:["TK"]},{name:"Asia/Dili",utcOffset:540,offsetStr:"+09:00",countries:["TL"]},{name:"Asia/Ashgabat",utcOffset:300,offsetStr:"+05:00",countries:["TM"]},{name:"Africa/Tunis",utcOffset:60,offsetStr:"+01:00",countries:["TN"]},{name:"Pacific/Tongatapu",utcOffset:780,offsetStr:"+13:00",countries:["TO"]},{name:"Europe/Istanbul",utcOffset:120,offsetStr:"+02:00",countries:["TR"]},{name:"America/Port_of_Spain",utcOffset:-240,offsetStr:"-04:00",countries:["TT","AG","AI","BL","DM","GD","GP","KN","LC","MF","MS","VC","VG","VI"]},{name:"Pacific/Funafuti",utcOffset:720,offsetStr:"+12:00",countries:["TV"]},{name:"Asia/Taipei",utcOffset:480,offsetStr:"+08:00",countries:["TW"]},{name:"Europe/Kiev",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Uzhgorod",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Zaporozhye",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Pacific/Wake",utcOffset:720,offsetStr:"+12:00",countries:["UM"]},{name:"America/New_York",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Detroit",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Louisville",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Monticello",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Indianapolis",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vincennes",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Winamac",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Marengo",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Petersburg",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vevay",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Chicago",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Tell_City",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Knox",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Menominee",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Center",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/New_Salem",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Beulah",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Denver",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Boise",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Phoenix",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Los_Angeles",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Metlakatla",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Anchorage",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Juneau",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Sitka",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Yakutat",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Nome",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Adak",utcOffset:-600,offsetStr:"-10:00",countries:["US"]},{name:"Pacific/Honolulu",utcOffset:-600,offsetStr:"-10:00",countries:["US","UM"]},{name:"America/Montevideo",utcOffset:-180,offsetStr:"-03:00",countries:["UY"]},{name:"Asia/Samarkand",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"Asia/Tashkent",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"America/Caracas",utcOffset:-270,offsetStr:"-04:30",countries:["VE"]},{name:"Asia/Ho_Chi_Minh",utcOffset:420,offsetStr:"+07:00",countries:["VN"]},{name:"Pacific/Efate",utcOffset:660,offsetStr:"+11:00",countries:["VU"]},{name:"Pacific/Wallis",utcOffset:720,offsetStr:"+12:00",countries:["WF"]},{name:"Pacific/Apia",utcOffset:840,offsetStr:"+14:00",countries:["WS"]},{name:"Africa/Johannesburg",utcOffset:120,offsetStr:"+02:00",countries:["ZA","LS","SZ"]}]}],templateUrl:"app/core/directives/ms-timezone/ms-timezone.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsWidgetEngineCounterController",function(){var a=this;a.filter=[],a.filtered=!1,a.fontSize=20,a.getCount=function(e){var t=0;if(e){a.fontSize=e.attrs[2]&&e.attrs[2].value?parseInt(e.attrs[2].value)-parseInt(e.attrs[2].value)%2:20,e.attrs[1].value&&e.attrs[1].value.length?(a.filtered=!0,a.filter=_.intersection(e.voiceQueuesSelected,e.attrs[1].value)):(a.filtered=!1,a.filter=e.voiceQueuesSelected);for(var n=0;n<e.voiceQueues.rows.length;n+=1)_.includes(a.filter,e.voiceQueues.rows[n].id)&&("abandoned"===e.attrs[0].value?t+=parseInt(e.voiceQueues.rows[n].total)-parseInt(e.voiceQueues.rows[n].answered)-parseInt(e.voiceQueues.rows[n].unmanaged):t+=e.voiceQueues.rows[n][e.attrs[0].value]?parseInt(e.voiceQueues.rows[n][e.attrs[0].value]):0)}return t}})}(),function(){"use strict";function e(s,e){var r=this;r.filter=[],r.filtered=!1,r.properties=[],r.multiBarChart={labels:["QUEUE_NAME"],series:["TOTAL"],data:[[50]],options:{responsive:!0,legend:{display:!0,fontColor:"#2196f3"},scales:{xAxes:[{gridLines:{display:!0},ticks:{fontColor:"#2196f3",stepSize:1,beginAtZero:!0}}],yAxes:[{gridLines:{display:!1},ticks:{fontColor:"#2196f3"}}]}}},r.getMultiBarChart=function(e){e&&(e.attrs&&function(e){r.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[3].value&&e.attrs[3].value.length?(r.filtered=!0,r.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(r.filtered=!1,r.filter=e.voiceQueuesSelected);if(r.multiBarChart.series.length>r.properties.length){var t=r.multiBarChart.series.length-r.properties.length;r.multiBarChart.series.splice(0,t),r.multiBarChart.data.splice(0,t)}for(var n=0;n<r.properties.length;n+=1){if(r.multiBarChart.series[n]=s.instant("TOOLS."+r.properties[n].toUpperCase()),_.isNil(r.multiBarChart.data[n])&&(r.multiBarChart.data[n]=[]),r.multiBarChart.labels.length>r.filter.length){var a=r.multiBarChart.labels.length-r.filter.length;r.multiBarChart.labels.splice(0,a),r.multiBarChart.data[n].splice(0,a)}for(var i=0,o=0;i<e.voiceQueues.rows.length;i+=1)_.includes(r.filter,e.voiceQueues.rows[i].id)&&(r.multiBarChart.labels[o]=e.voiceQueues.rows[i].name,"abandoned"===r.properties[n].toLowerCase()?r.multiBarChart.data[n][o]=parseInt(e.voiceQueues.rows[i].total)-parseInt(e.voiceQueues.rows[i].answered)-parseInt(e.voiceQueues.rows[i].unmanaged):r.multiBarChart.data[n][o]=e.voiceQueues.rows[i][r.properties[n]]?parseInt(e.voiceQueues.rows[i][r.properties[n]]):0,o+=1)}}(e),e.foreground&&function(e){r.multiBarChart.options.legend.fontColor=e.foreground;for(var t=0;t<r.multiBarChart.options.scales.xAxes.length;t+=1)r.multiBarChart.options.scales.xAxes[t].ticks.fontColor=e.foreground;for(var n=0;n<r.multiBarChart.options.scales.yAxes.length;n+=1)r.multiBarChart.options.scales.yAxes[n].ticks.fontColor=e.foreground}(e))}}e.$inject=["$translate","socket"],angular.module("app.core").controller("MsWidgetEngineMultibarChartController",e)}(),function(){"use strict";function e(o){var s=this;s.filter=[],s.filtered=!1,s.properties=[],s.pieChart={labels:["ANSWERED"],data:[30],options:{responsive:!0,legend:{display:!0}}},s.getPieChart=function(e){e&&(e.attrs&&function(e){s.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[3].value&&e.attrs[3].value.length?(s.filtered=!0,s.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(s.filtered=!1,s.filter=e.voiceQueuesSelected);if(s.pieChart.labels.length>s.properties.length){var t=s.pieChart.labels.length-s.properties.length;s.pieChart.labels.splice(0,t),s.pieChart.data.splice(0,t)}for(var n=0,a=0;n<s.properties.length;n+=1){s.pieChart.labels[n]=o.instant("TOOLS."+s.properties[n].toUpperCase());for(var i=0;i<e.voiceQueues.rows.length;i+=1)_.includes(s.filter,e.voiceQueues.rows[i].id)&&("abandoned"===s.properties[n].toLowerCase()?a+=parseInt(e.voiceQueues.rows[i].total)-parseInt(e.voiceQueues.rows[i].answered)-parseInt(e.voiceQueues.rows[i].unmanaged):a+=e.voiceQueues.rows[i][s.properties[n]]?parseInt(e.voiceQueues.rows[i][s.properties[n]]):0);s.pieChart.data[n]=a,a=0}}(e),e.foreground&&(t=e,s.pieChart.options.legend.fontColor=t.foreground));var t}}e.$inject=["$translate"],angular.module("app.core").controller("MsWidgetEnginePieChartController",e)}(),function(){"use strict";function e(e,n,a,i){var o=this;function t(e){o.results=e||{count:0,rows:[]}}function s(){o.query.offset=(o.query.page-1)*o.query.limit,o.promise=i.analyticCustomReport.run(o.query,t).$promise}o.countDown=0,o.refresh=0,o.title="",o.columns=[],o.results={rows:[],count:0},o.query={limit:10,page:1,startDate:moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),endDate:moment().endOf("day").format("YYYY-MM-DD HH:mm:ss"),output:"web"},o.onInit=function e(t){t&&t.attrs&&(t.attrs[0]&&t.attrs[0].value&&(o.query.id=t.attrs[0].value,i.analyticFieldReport.get({fields:"field,alias",nolimit:!0,CustomReportId:t.attrs[0].value}).$promise.then(function(e){return e&&e.rows&&(o.columns=e.rows),i.analyticCustomReport.get({id:t.attrs[0].value,fields:"id,name"}).$promise}).then(function(e){e&&e.name&&(o.title=e.name),s()}).catch(function(e){console.log(e)})),t.attrs[1]&&t.attrs[1].value&&(o.refresh=parseInt(t.attrs[1].value),!_.isNaN(o.refresh)&&0<o.refresh?(o.countDown=parseInt(t.attrs[1].value),o.interval=a(function(){o.countDown-=1},1e3,0),o.timeout=n(function(){o.interval&&a.cancel(o.interval),e(t)},1e3*o.refresh)):(o.interval&&a.cancel(o.interval),o.timeout&&n.cancel(o.timeout))))},o.getResults=s,o.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t},e.$on("$destroy",function(){o.interval&&a.cancel(o.interval),o.timeout&&n.cancel(o.timeout)})}e.$inject=["$scope","$timeout","$interval","api"],angular.module("app.core").controller("MsWidgetEngineWebReportController",e)}(),function(){"use strict";function e(e,t){this.getTrustedURL=function(e){return t.trustAsResourceUrl(e)}}function t(e){return{restrict:"E",scope:{config:"=?",onEdit:"&?",onDelete:"&?"},require:"msWidgetEngine",controller:"MsWidgetEngineController",controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-widget-engine/ms-widget-engine.html"}}e.$inject=["$mdDialog","$sce"],t.$inject=["$document"],angular.module("app.core").controller("MsWidgetEngineController",e).directive("msWidgetEngine",t)}(),function(){"use strict";function e(e,t){var n=this;n.flipped=!1,n.flip=function(){if(!angular.isDefined(e.flippable)||!0!==e.flippable)return;n.flipped=!n.flipped,t.toggleClass("flipped",n.flipped)}}e.$inject=["$scope","$element"],angular.module("app.core").controller("MsWidgetController",e).directive("msWidget",function(){return{restrict:"E",scope:{flippable:"=?"},controller:"MsWidgetController",transclude:!0,compile:function(e){return e.addClass("ms-widget"),function(e,t,n,a,i){i(function(e){t.empty(),t.append(e)})}}}}).directive("msWidgetFront",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-front"),function(e,t,n,a,i){i(function(e){t.empty(),t.append(e)}),e.flipWidget=a.flip}}}}).directive("msWidgetBack",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-back"),function(e,t,n,a,i){i(function(e){t.empty(),t.append(e)}),e.flipWidget=a.flip}}}})}(),function(){"use strict";angular.module("app.core").filter("altDate",function(){return function(e){var t=Date.now()-new Date(e);return t<36e5?moment(e).fromNow():t<864e5?moment(e).format("HH:mm"):t<6048e5?moment(e).format("dddd"):moment(e).calendar()}})}(),function(){"use strict";function e(t){return function(e){return t.trustAsHtml(e)}}e.$inject=["$sce"],angular.module("app.core").filter("toTrusted",e).filter("htmlToPlaintext",function(){return function(e){return String(e).replace(/<[^>]+>/gm,"")}}).filter("nospace",function(){return function(e){return e?e.replace(/ /g,""):""}}).filter("humanizeDoc",function(){return function(e){if(e)return"directive"===e.type?e.name.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()}):e.label||e.name}})}(),function(){"use strict";angular.module("app.core").filter("filterByIds",function(){return function(e,t){if(0===e.length||!t)return e;if(0===t.length)return[];for(var n=[],a=0;a<e.length;a++){for(var i=e[a],o=!1,s=0;s<t.length;s++){var r=t[s];if(i.id===r){o=!0;break}}o&&n.push(i)}return n}})}(),function(){"use strict";angular.module("app.core").filter("filterByPropIds",function(){return function(e,t,n){if(0===e.length||!n||0===n.length)return e;for(var a=[],i=0;i<e.length;i++){for(var o=e[i],s=!1,r=0;r<n.length;r++){var l=n[r];if(-1<o[t].indexOf(l)){s=!0;break}}s&&a.push(o)}return a}})}(),function(){"use strict";angular.module("app.core").filter("filterByTags",function(){return function(e,n){if(0===e.length||0===n.length)return e;var a=[];return e.forEach(function(e){var t=n.every(function(t){var n=!1;return e.tags.forEach(function(e){e.name!==t.name||(n=!0)}),n});t&&a.push(e)}),a}}).filter("filterSingleByTags",function(){return function(e,t){if(0!==e.length&&0!==t.length){if(e.length<t.length)return[];var n=[],a=t.every(function(t){var n=!1;return e.forEach(function(e){e.name!==t.name||(n=!0)}),n});return a&&n.push(e),n}}})}(),function(){"use strict";function c(e,t,n,a){this.id=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),this.title=e,this.body=t,this.accept=n,this.reject=a,this.close=i}function m(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}function i(){var n=this;navigator.serviceWorker.ready.then(function(e){e.getNotifications().then(function(e){var t=_.find(e,function(e){return e.data.id===n.id});t&&t.close()})})}angular.module("app.dashboards").provider("motNotification",function(){return{$get:[function(){var l,n,d=[];"serviceWorker"in navigator&&m()?navigator.serviceWorker.register("notification.js").then(function(e){(l=e).update(),l.installing?n=l.installing:l.waiting?n=l.waiting:l.active&&(n=l.active)}).catch(function(e){console.error("Service worker registration failed",e)}):console.error("Service Worker is not supported");return navigator.serviceWorker.addEventListener("message",function(e){if(e.source===n){var t=_.find(d,{id:e.data.id});if(t)switch(e.data.action){case"accept":t.accept&&t.accept();break;case"reject":t.reject&&t.reject()}}}),{create:function(e,i,o,s,r){return new Promise(function(t,n){var a;m()&&(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)?(a=new c(e||"MyTitle",i||"MyBody",s,r),d.push(a),a?window.Notification.requestPermission().then(function(e){if("granted"===e)return l.showNotification(a.title,{body:a.body,requireInteraction:!0,icon:o||"assets/images/business/queueCampaigns.jpg",data:{id:a.id},actions:[{action:"accept",title:"Accept"},{action:"reject",title:"Reject"}]})}).then(function(e){t(a)}).catch(function(e){n(e)}):n(new Error("Notification creating error"))):t()})}}}]}})}(),function(){"use strict";function e(l,d,c){return{resolve:function(e,t){var n=e.split("@"),a=n[0],i=n[1],o=t||{};if(!a||!i)return d.error("apiResolver.resolve requires correct action parameter (ResourceName@methodName)"),!1;var s=l.defer(),r=function(e){for(var t=e.split("."),n=c,a=0;a<t.length;a++){if(angular.isUndefined(n[t[a]])){d.error('Resource part "'+t[a]+'" is not defined!'),n=!1;break}n=n[t[a]]}if(!n)return!1;return n}(a);r?r[i](o,function(e){s.resolve(e)},function(e){s.reject(e)}):(d.error('Resource "'+a+'" is not defined in the api service!'),s.reject('Resource "'+a+'" is not defined in the api service!'));return s.promise}}}e.$inject=["$q","$log","api"],angular.module("app.core").factory("apiResolver",e)}(),function(){"use strict";angular.module("app.core").provider("msApi",function(){var n=angular.injector(["ng"]).get("$log"),a="",v=[];function t(e){a=e}function i(){return a}function o(e,t){angular.isString(e)?angular.isArray(t)?v[e]={url:a+(t[0]||""),paramDefaults:t[1]||[],actions:t[2]||[],options:t[3]||{}}:n.error('"resource" must be an array and it must follow $resource definition'):n.error('"path" must be a string (eg. `dashboard.project`)')}this.setBaseUrl=t,this.getBaseUrl=i,this.getApiObject=function(){return v},this.register=o,this.$get=["$log","$q","$resource","$rootScope",function(m,u,p,g){var e={setBaseUrl:t,getBaseUrl:i,register:o,resolve:function(e,t){g.$broadcast("msApi::resolveStart");var n=e.split("@"),a=n[0],i=n[1],o=t||{};if(!a||!i)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var s=u.defer(),r=v[a];if(r){var l=p(r.url,r.paramDefaults,r.actions,r.options);l[i](o,function(e){s.resolve(e),g.$broadcast("msApi::resolveSuccess")},function(e){s.reject(e),g.$broadcast("msApi::resolveError")})}else m.error('Resource "'+a+'" is not defined in the api service!'),s.reject('Resource "'+a+'" is not defined in the api service!');return s.promise},request:function(e,t,n,a){g.$broadcast("msApi::requestStart");var i=e.split("@"),o=i[0],s=i[1],r=t||{};if(!o||!s)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var l=u.defer(),d=v[o];if(d){var c=p(d.url,d.paramDefaults,d.actions,d.options);c[s](r,function(e){g.$broadcast("msApi::requestSuccess"),l.resolve(e),angular.isDefined(n)&&angular.isFunction(n)&&n(e)},function(e){g.$broadcast("msApi::requestError"),l.reject(e),angular.isDefined(a)&&angular.isFunction(a)&&a(e)})}else m.error('Resource "'+o+'" is not defined in the api service!'),l.reject('Resource "'+o+'" is not defined in the api service!');return l.promise}};return e}]})}(),function(){"use strict";function e(l){var e=new MobileDetect(l.navigator.userAgent),d=null;return{exists:function(e,t){return-1<t.indexOf(e)},detectBrowser:function(){if(d)return d;var e=[{string:l.navigator.userAgent,subString:"Edge",versionSearch:"Edge",identity:"Edge"},{string:l.navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:l.navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:l.navigator.vendor,subString:"Apple",versionSearch:"Version",identity:"Safari"},{prop:l.opera,identity:"Opera"},{string:l.navigator.vendor,subString:"iCab",identity:"iCab"},{string:l.navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:l.navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:l.navigator.vendor,subString:"Camino",identity:"Camino"},{string:l.navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:l.navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:l.navigator.userAgent,subString:"Trident/7",identity:"Explorer",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],t=[{string:l.navigator.platform,subString:"Win",identity:"Windows"},{string:l.navigator.platform,subString:"Mac",identity:"Mac"},{string:l.navigator.platform,subString:"Linux",identity:"Linux"},{string:l.navigator.platform,subString:"iPhone",identity:"iPhone"},{string:l.navigator.platform,subString:"iPod",identity:"iPod"},{string:l.navigator.platform,subString:"iPad",identity:"iPad"},{string:l.navigator.platform,subString:"Android",identity:"Android"}],i="";function n(e){for(var t=0;t<e.length;t++){var n=e[t].string,a=e[t].prop;if(i=e[t].versionSearch||e[t].identity,n){if(-1!==n.indexOf(e[t].subString))return e[t].identity}else if(a)return e[t].identity}}function a(e){var t=e.indexOf(i);if(-1!==t)return parseInt(e.substring(t+i.length+1))}var o=n(e)||"unknown-browser",s=a(l.navigator.userAgent)||a(l.navigator.appVersion)||"unknown-version",r=n(t)||"unknown-os";return o=o.toLowerCase(),s=o+"-"+s,r=r.toLowerCase(),d={browser:o,version:s,os:r}},guidGenerator:function(){var e=function(){return(65536*(1+Math.random())||0).toString(16).substring(1)};return e()+e()+e()+e()+e()+e()},isMobile:function(){return e.mobile()},toggleInArray:function(e,t){-1===t.indexOf(e)?t.push(e):t.splice(t.indexOf(e),1)}}}e.$inject=["$window"],angular.module("app.core").factory("msUtils",e)}(),function(){"use strict";function e(e,t){var n=this;n.themes=t.themes,n.layoutModes=[{label:"Boxed",value:"boxed"},{label:"Wide",value:"wide"}],n.layoutStyles=[{label:"Vertical Navigation",value:"verticalNavigation",figure:"/assets/images/theme-options/vertical-nav.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar",value:"verticalNavigationFullwidthToolbar",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar 2",value:"verticalNavigationFullwidthToolbar2",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar-2.jpg"},{label:"Horizontal Navigation",value:"horizontalNavigation",figure:"/assets/images/theme-options/horizontal-nav.jpg"},{label:"Content with Toolbar",value:"contentWithToolbar",figure:"/assets/images/theme-options/content-with-toolbar.jpg"},{label:"Content Only",value:"contentOnly",figure:"/assets/images/theme-options/content-only.jpg"}],n.layoutMode="wide",n.layoutStyle=e.get("motion.layoutStyle")||"verticalNavigation",n.setActiveTheme=function(e){t.setActiveTheme(e)},n.getActiveTheme=function(){return t.themes.active},n.updateLayoutMode=function(){angular.element("body").toggleClass("boxed","boxed"===n.layoutMode)},n.updateLayoutStyle=function(){e.put("motion.layoutStyle",n.layoutStyle),location.reload()}}function t(t){return{restrict:"E",scope:{},controller:"MsThemeOptionsController as vm",templateUrl:"app/core/theme-options/theme-options.html",compile:function(e){return e.addClass("ms-theme-options"),function(e){e.toggleOptionsSidenav=function(){t("motion-theme-options").toggle()}}}}}e.$inject=["$cookies","motionTheming"],t.$inject=["$mdSidenav"],angular.module("app.core").controller("MsThemeOptionsController",e).directive("msThemeOptions",t)}(),function(){"use strict";function e(i,a,o){var s={};return{generate:function(){var e=angular.copy(o.getRegisteredThemes()),a=angular.copy(o.getRegisteredPalettes());angular.forEach(e,function(n){s[n.name]={},angular.forEach(n.colors,function(e,t){s[n.name][t]={name:e.name,levels:{default:{color:l(a[e.name][e.hues.default].value),contrast1:l(a[e.name][e.hues.default].contrast,1),contrast2:l(a[e.name][e.hues.default].contrast,2),contrast3:l(a[e.name][e.hues.default].contrast,3),contrast4:l(a[e.name][e.hues.default].contrast,4)},hue1:{color:l(a[e.name][e.hues["hue-1"]].value),contrast1:l(a[e.name][e.hues["hue-1"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-1"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-1"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-1"]].contrast,4)},hue2:{color:l(a[e.name][e.hues["hue-2"]].value),contrast1:l(a[e.name][e.hues["hue-2"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-2"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-2"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-2"]].contrast,4)},hue3:{color:l(a[e.name][e.hues["hue-3"]].value),contrast1:l(a[e.name][e.hues["hue-3"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-3"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-3"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-3"]].contrast,4)}}}})}),function(e){var t=angular.copy(e);angular.forEach(t,function(n){angular.forEach(n,function(e,t){n[t]=e.levels,n[t].color=e.levels.default.color,n[t].contrast1=e.levels.default.contrast1,n[t].contrast2=e.levels.default.contrast2,n[t].contrast3=e.levels.default.contrast3,n[t].contrast4=e.levels.default.contrast4,delete n[t].default})}),o.setThemesList(t);var n=i.get("motion.selectedTheme");n?o.setActiveTheme(n):o.setActiveTheme("default")}(s);var r={};angular.forEach(s,function(e,t){var n,a,i,o,s;(r={})["@themeName"]=t,angular.forEach(e,function(e,a){angular.forEach(e.levels,function(e,n){angular.forEach(e,function(e,t){r["@"+a+d(n)+d(t)]=e})})}),n=r,a=new RegExp(Object.keys(n).join("|"),"gi"),i='/* Content hack because they wont fix */\n/* https://github.com/angular/material/pull/8067 */\n[md-theme="@themeName"] md-content.md-hue-1,\nmd-content.md-@themeName-theme.md-hue-1 {\n color: @backgroundHue1Contrast1;\n background-color: @backgroundHue1Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-2,\nmd-content.md-@themeName-theme.md-hue-2 {\n color: @backgroundHue2Contrast1;\n background-color: @backgroundHue2Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-3,\n md-content.md-@themeName-theme.md-hue-3 {\n color: @backgroundHue3Contrast1;\n background-color: @backgroundHue3Color;\n}\n\n/* Text Colors */\n[md-theme="@themeName"] a {\n color: @accentDefaultColor;\n}\n\n[md-theme="@themeName"] .secondary-text,\n[md-theme="@themeName"] .icon {\n color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .hint-text,\n[md-theme="@themeName"] .disabled-text {\n color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .fade-text,\n[md-theme="@themeName"] .divider {\n color: @backgroundDefaultContrast4;\n}\n\n/* Primary */\n[md-theme="@themeName"] .md-primary-bg {\n background-color: @primaryDefaultColor;\n color: @primaryDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg .secondary-text,\n[md-theme="@themeName"] .md-primary-bg .icon {\n color: @primaryDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg .hint-text,\n[md-theme="@themeName"] .md-primary-bg .disabled-text {\n color: @primaryDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg .fade-text,\n[md-theme="@themeName"] .md-primary-bg .divider {\n color: @primaryDefaultContrast4;\n}\n\n/* Primary, Hue-1 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 {\n background-color: @primaryHue1Color;\n color: @primaryHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .icon {\n color: @primaryHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .disabled-text {\n color: @primaryHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .divider {\n color: @primaryHue1Contrast4;\n}\n\n/* Primary, Hue-2 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 {\n background-color: @primaryHue2Color;\n color: @primaryHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .icon {\n color: @primaryHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .disabled-text {\n color: @primaryHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .divider {\n color: @primaryHue2Contrast4;\n}\n\n/* Primary, Hue-3 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 {\n background-color: @primaryHue3Color;\n color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .icon {\n color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .disabled-text {\n color: @primaryHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .divider {\n color: @primaryHue3Contrast4;\n}\n\n/* Primary foreground */\n[md-theme="@themeName"] .md-primary-fg {\n color: @primaryDefaultColor !important;\n}\n\n/* Primary foreground, Hue-1 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-1 {\n color: @primaryHue1Color !important;\n}\n\n/* Primary foreground, Hue-2 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-2 {\n color: @primaryHue2Color !important;\n}\n\n/* Primary foreground, Hue-3 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-3 {\n color: @primaryHue3Color !important;\n}\n\n/* Accent */\n[md-theme="@themeName"] .md-accent-bg {\n background-color: @accentDefaultColor;\n color: @accentDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg .secondary-text,\n[md-theme="@themeName"] .md-accent-bg .icon {\n color: @accentDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg .hint-text,\n[md-theme="@themeName"] .md-accent-bg .disabled-text {\n color: @accentDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg .fade-text,\n[md-theme="@themeName"] .md-accent-bg .divider {\n color: @accentDefaultContrast4;\n}\n\n/* Accent, Hue-1 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 {\n background-color: @accentHue1Color;\n color: @accentHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .icon {\n color: @accentHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .disabled-text {\n color: @accentHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .divider {\n color: @accentHue1Contrast4;\n}\n\n/* Accent, Hue-2 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 {\n background-color: @accentHue2Color;\n color: @accentHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .icon {\n color: @accentHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .disabled-text {\n color: @accentHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .divider {\n color: @accentHue2Contrast4;\n}\n\n/* Accent, Hue-3 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 {\n background-color: @accentHue3Color;\n color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .icon {\n color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .disabled-text {\n color: @accentHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .divider {\n color: @accentHue3Contrast4;\n}\n\n/* Accent foreground */\n[md-theme="@themeName"] .md-accent-fg {\n color: @accentDefaultColor !important;\n}\n\n/* Accent foreground, Hue-1 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-1 {\n color: @accentHue1Color !important;\n}\n\n/* Accent foreground, Hue-2 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-2 {\n color: @accentHue2Color !important;\n}\n\n/* Accent foreground, Hue-3 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-3 {\n color: @accentHue3Color !important;\n}\n\n/* Warn */\n[md-theme="@themeName"] .md-warn-bg {\n background-color: @warnDefaultColor;\n color: @warnDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg .secondary-text,\n[md-theme="@themeName"] .md-warn-bg .icon {\n color: @warnDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg .hint-text,\n[md-theme="@themeName"] .md-warn-bg .disabled-text {\n color: @warnDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg .fade-text,\n[md-theme="@themeName"] .md-warn-bg .divider {\n color: @warnDefaultContrast4;\n}\n\n/* Warn, Hue-1 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 {\n background-color: @warnHue1Color;\n color: @warnHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .icon {\n color: @warnHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .disabled-text {\n color: @warnHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .divider {\n color: @warnHue1Contrast4;\n}\n\n/* Warn, Hue-2 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 {\n background-color: @warnHue2Color;\n color: @warnHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .icon {\n color: @warnHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .disabled-text {\n color: @warnHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .divider {\n color: @warnHue2Contrast4;\n}\n\n/* Warn, Hue-3 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 {\n background-color: @warnHue3Color;\n color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .icon {\n color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .disabled-text {\n color: @warnHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .divider {\n color: @warnHue3Contrast4;\n}\n\n/* Warn foreground */\n[md-theme="@themeName"] .md-warn-fg {\n color: @warnDefaultColor !important;\n}\n\n/* Warn foreground, Hue-1 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-1 {\n color: @warnHue1Color !important;\n}\n\n/* Warn foreground, Hue-2 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-2 {\n color: @warnHue2Color !important;\n}\n\n/* Warn foreground, Hue-3 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-3 {\n color: @warnHue3Color !important;\n}\n\n/* Background */\n[md-theme="@themeName"] .md-background-bg {\n background-color: @backgroundDefaultColor;\n color: @backgroundDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg .secondary-text,\n[md-theme="@themeName"] .md-background-bg .icon {\n color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg .hint-text,\n[md-theme="@themeName"] .md-background-bg .disabled-text {\n color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg .fade-text,\n[md-theme="@themeName"] .md-background-bg .divider {\n color: @backgroundDefaultContrast4;\n}\n\n/* Background, Hue-1 */\n[md-theme="@themeName"] .md-background-bg.md-hue-1 {\n background-color: @backgroundHue1Color;\n color: @backgroundHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .icon {\n color: @backgroundHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .disabled-text {\n color: @backgroundHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .divider {\n color: @backgroundHue1Contrast4;\n}\n\n/* Background, Hue-2 */\n[md-theme="@themeName"] .md-background-bg.md-hue-2 {\n background-color: @backgroundHue2Color;\n color: @backgroundHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .icon {\n color: @backgroundHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .disabled-text {\n color: @backgroundHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .divider {\n color: @backgroundHue2Contrast4;\n}\n\n/* Background, Hue-3 */\n[md-theme="@themeName"] .md-background-bg.md-hue-3 {\n background-color: @backgroundHue3Color;\n color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .icon {\n color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .disabled-text {\n color: @backgroundHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .divider {\n color: @backgroundHue3Contrast4;\n}\n\n/* Background foreground */\n[md-theme="@themeName"] .md-background-fg {\n color: @backgroundDefaultColor !important;\n}\n\n/* Background foreground, Hue-1 */\n[md-theme="@themeName"] .md-background-fg.md-hue-1 {\n color: @backgroundHue1Color !important;\n}\n\n/* Background foreground, Hue-2 */\n[md-theme="@themeName"] .md-background-fg.md-hue-2 {\n color: @backgroundHue2Color !important;\n}\n\n/* Background foreground, Hue-3 */\n[md-theme="@themeName"] .md-background-fg.md-hue-3 {\n color: @backgroundHue3Color !important;\n}'.replace(a,function(e){return n[e]}),o=angular.element("head"),(s=angular.element('<style type="text/css"></style>')).html(i),o.append(s)})},rgba:l};function l(e,t){var n=t||!1;return 4===e.length&&255===e[0]&&255===e[1]&&255===e[2]&&e.splice(3,4),n&&(e=function(e,t){var n={white:{1:"1",2:"0.7",3:"0.3",4:"0.12"},black:{1:"0.87",2:"0.54",3:"0.26",4:"0.12"}};255===e[0]&&255===e[1]&&255===e[2]?e[3]=n.white[t]:0===e[0]&&0===e[1]&&0===e[2]&&(e[3]=n.black[t]);return e}(e,n)),3===e.length?"rgb("+e.join(",")+")":4===e.length?"rgba("+e.join(",")+")":void a.error("Invalid number of arguments supplied in the color array: "+e.length+"\nThe array must have 3 or 4 colors.")}function d(e){return e.charAt(0).toUpperCase()+e.slice(1)}}e.$inject=["$cookies","$log","motionTheming"],angular.module("app.core").factory("motionGenerator",e)}(),function(){"use strict";angular.module("app.core").constant("motionPalettes",[{name:"motion-blue",options:{50:"#ebf1fa",100:"#c2d4ef",200:"#9ab8e5",300:"#78a0dc",400:"#5688d3",500:"#3470ca",600:"#2e62b1",700:"#275498",800:"#21467e",900:"#1a3865",A100:"#c2d4ef",A200:"#9ab8e5",A400:"#5688d3",A700:"#275498",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}},{name:"motion-paleblue",options:{50:"#ececee",100:"#c5c6cb",200:"#9ea1a9",300:"#7d818c",400:"#5c616f",500:"#3c4252",600:"#353a48",700:"#2d323e",800:"#262933",900:"#1e2129",A100:"#c5c6cb",A200:"#9ea1a9",A400:"#5c616f",A700:"#2d323e",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}}])}(),function(){"use strict";angular.module("app.core").constant("motionThemes",{default:{primary:{name:"motion-paleblue",hues:{default:"700","hue-1":"500","hue-2":"600","hue-3":"400"}},accent:{name:"light-blue",hues:{default:"600","hue-1":"400","hue-2":"700","hue-3":"A100"}},warn:{name:"red"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},pinkTheme:{primary:{name:"blue-grey",hues:{default:"800","hue-1":"600","hue-2":"400","hue-3":"A100"}},accent:{name:"pink",hues:{default:"400","hue-1":"300","hue-2":"600","hue-3":"A100"}},warn:{name:"blue"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},tealTheme:{primary:{name:"motion-blue",hues:{default:"900","hue-1":"600","hue-2":"500","hue-3":"A100"}},accent:{name:"teal",hues:{default:"500","hue-1":"400","hue-2":"600","hue-3":"A100"}},warn:{name:"deep-orange"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}}})}(),function(){"use strict";function e(n,e,t){var a;angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.getObject("motion.customTheme");i&&(t.custom=i),n.alwaysWatchTheme(!0),angular.forEach(e,function(e){n.definePalette(e.name,e.options)}),angular.forEach(t,function(e,t){n.theme(t).primaryPalette(e.primary.name,e.primary.hues).accentPalette(e.accent.name,e.accent.hues).warnPalette(e.warn.name,e.warn.hues).backgroundPalette(e.background.name,e.background.hues)})}e.$inject=["$mdThemingProvider","motionPalettes","motionThemes"],angular.module("app.core").config(e)}(),function(){"use strict";function e(t,n,e){var a={getRegisteredPalettes:function(){return e.PALETTES},getRegisteredThemes:function(){return e.THEMES},setActiveTheme:function(e){if(angular.isUndefined(a.themes.list[e]))return angular.isUndefined(a.themes.list.default)?void n.error('You must have at least one theme named "default"'):(n.warn('The theme "'+e+'" does not exist! Falling back to the "default" theme.'),a.themes.active.name="default",a.themes.active.theme=a.themes.list.default,void t.put("motion.selectedTheme",a.themes.active.name));a.themes.active.name=e,a.themes.active.theme=a.themes.list[e],t.put("motion.selectedTheme",e)},setThemesList:function(e){a.themes.list=e},themes:{list:{},active:{name:"",theme:{}}}};return a}e.$inject=["$cookies","$log","$mdTheming"],angular.module("app.core").service("motionTheming",e)}(),function(){"use strict";function e(t,o,s,r){this.search=function(t){for(var e=[],n=r.getFlatNavigation(),a=s.defer(),i=0;i<n.length;i+=1)n[i].uisref&&e.push(n[i]);t&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(t)))return!0}));return o(function(){a.resolve(e)},1e3),a.promise},this.searchResultClick=function(e){e.uisref&&(e.stateParams?t.go(e.state,e.stateParams):t.go(e.state))}}e.$inject=["$state","$timeout","$q","msNavigationService"],angular.module("app.errors.error-404").controller("Error404Controller",e)}(),function(){"use strict";function e(e,t){var n=this;n.code="",n.send=!1,n.error=e.params,n.sendReport=function(){t.post("/api/jira",n.error).then(function(e){n.send=!0,e.data&&(n.code=e.data.id)},function(e){n.send=!1})}}e.$inject=["$state","$http"],angular.module("app.errors.error-500").controller("Error500Controller",e)}(),function(){"use strict";function e(e,t){var n=this;n.currentUser=e.getCurrentUser(),n.cookieAlertHide=t.get("motion.cookieAlertHide:"+n.currentUser.id)||!1,n.cookieAlertOnClose=function(){t.put("motion.cookieAlertHide:"+n.currentUser.id,!0)}}e.$inject=["Auth","$cookies"],angular.module("app.footer").controller("FooterController",e)}(),function(){"use strict";function e(e,t,n,a,i){var o=this;o.form={},o.forgotPassword=function(){return i.auth.forgot(o.form).$promise.then(function(){t.success({title:n.instant("FORGOTPASSWORD.LINK_SENT"),msg:n.instant("FORGOTPASSWORD.LINNK_SENT_MESSAGE")})}).catch(function(e){e&&t.error({title:n.instant("FORGOTPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},o.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general")}}e.$inject=["Auth","toasty","$translate","$state","api"],angular.module("app.forgot").controller("ForgotPasswordController",e)}(),function(){"use strict";function e(e,t){var n=this;n.currentUser=e.getCurrentUser(),n.newsAlertHide=t.get("motion.newsAlertHide:"+n.currentUser.id)||!1,n.newsAlertOnClose=function(){t.put("motion.newsAlertHide:"+n.currentUser.id,!0)}}e.$inject=["Auth","$cookies"],angular.module("app.header").controller("HeaderController",e)}(),function(){"use strict";function e(e){var t={baseUrl:"api/"};return t.auth=e(t.baseUrl+"auth/local",{},{local:{method:"post",url:t.baseUrl+"auth/local"},forgot:{method:"post",url:t.baseUrl+"auth/local/forgot"},reset:{method:"post",url:t.baseUrl+"auth/local/reset/:token",params:{token:"@token"}},google:{method:"post",url:t.baseUrl+"auth/google"}}),t.jira=e(t.baseUrl+"jira"),t.rpc=e(t.baseUrl+"rpc",{},{startMonitor:{method:"get",url:t.baseUrl+"rpc/voice/channels/:uniqueid/mixmonitor",params:{uniqueid:"@uniqueid"}},stopMonitor:{method:"get",url:t.baseUrl+"rpc/voice/channels/:uniqueid/stopmixmonitor",params:{uniqueid:"@uniqueid"}},getVoiceChannels:{method:"get",url:t.baseUrl+"rpc/voice/channels"},getVoiceQueues:{method:"get",url:t.baseUrl+"rpc/voice/queues"},getChatQueues:{method:"get",url:t.baseUrl+"rpc/chat/queues"},getMailQueues:{method:"get",url:t.baseUrl+"rpc/mail/queues"},getSmsQueues:{method:"get",url:t.baseUrl+"rpc/sms/queues"},getOpenchannelQueues:{method:"get",url:t.baseUrl+"rpc/openchannel/queues"},getFaxQueues:{method:"get",url:t.baseUrl+"rpc/fax/queues"},getVoiceQueuesPreview:{method:"get",url:t.baseUrl+"rpc/voice/queues/preview/:id"},getVoiceQueuesChannels:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels"},getVoiceQueuesChannel:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels/:uniqueid"},getVoiceQueuesChannelHangup:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels/:uniqueid/hangup"},getVoiceQueuesChannelRedirect:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels/:uniqueid/redirect/:exten"},getOutbound:{method:"get",url:t.baseUrl+"rpc/outbound"},getOutboundChannels:{method:"get",url:t.baseUrl+"rpc/outbound/channels"},getAgents:{method:"get",url:t.baseUrl+"rpc/agents"},setAgentCapacity:{method:"put",url:t.baseUrl+"rpc/agents/:id/capacity",params:{id:"@id"}},getTelephones:{method:"get",url:t.baseUrl+"rpc/telephones"},getTrunks:{method:"get",url:t.baseUrl+"rpc/trunks"},getCampaigns:{method:"get",url:t.baseUrl+"rpc/campaigns"},getMailAccounts:{method:"get",url:t.baseUrl+"rpc/mail/accounts"},getFaxAccounts:{method:"get",url:t.baseUrl+"rpc/fax/accounts"},getChatQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/chat/queues/waitinginteractions"},getMailQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/mail/queues/waitinginteractions"},getOpenchannelQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/openchannel/queues/waitinginteractions"},getSmsQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/sms/queues/waitinginteractions"},getFaxQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/fax/queues/waitinginteractions"}}),t.version=e(t.baseUrl+"version",{},{fetch:{method:"get",url:t.baseUrl+"version/fetch"},reset:{method:"get",url:t.baseUrl+"version/reset"},pull:{method:"get",url:t.baseUrl+"version/pull"},restart:{method:"get",url:t.baseUrl+"version/restart"},migrations:{method:"get",url:t.baseUrl+"version/migrations"}}),t.system=e(t.baseUrl+"system",{},{killProcess:{method:"get",url:t.baseUrl+"system/process/:pid/kill",params:{pid:"@pid"}}}),t.pm2=e(t.baseUrl+"pm2/:id",{id:"@id"},{update:{method:"put",isArray:!0}}),t.user=e(t.baseUrl+"users/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"users/describe"},clone:{method:"post",url:t.baseUrl+"users/:id/clone",params:{includeAll:"@includeAll"}},bulkCreate:{method:"post",url:t.baseUrl+"users/create_many",isArray:!0},addContacts:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/contacts"},changePassword:{isArray:!1,method:"put",url:t.baseUrl+"users/:id/password"},addQueues:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/queues"},addAvatar:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/avatar"},getAvatar:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/avatar"},getContacts:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/contacts"},getQueues:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/queues"},getVoiceQueuesRt:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/queues_rt"},getGroups:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/groups"},getRecordings:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/recordings"},getChatInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/chat/interactions"},getOpenchannelInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/openchannel/interactions"},getMailInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/mail/interactions"},getSmsInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/sms/interactions"},getFaxInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/fax/interactions"},login:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/login"},logout:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/logout"},pause:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/pause"},unpause:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/unpause"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/teams"},getLists:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/lists"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/agents"},addChatInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/chat_interactions"},removeChatInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/chat_interactions"},addMailInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/mail_interactions"},removeMailInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/mail_interactions"},addFaxInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/fax_interactions"},removeFaxInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/fax_interactions"},addSmsInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/sms_interactions"},removeSmsInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/sms_interactions"},addOpenchannelInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/openchannel_interactions"},removeOpenchannelInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/openchannel_interactions"}}),t.voiceChanSpy=e(t.baseUrl+"voice/chanspy/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/chanspy/describe"},clone:{method:"post",url:t.baseUrl+"voice/chanspy/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceContext=e(t.baseUrl+"voice/contexts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/contexts/describe"},clone:{method:"post",url:t.baseUrl+"voice/contexts/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceDisposition=e(t.baseUrl+"voice/dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/dispositions/describe"},clone:{method:"post",url:t.baseUrl+"voice/dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceExtension=e(t.baseUrl+"voice/extensions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/extensions/describe"},clone:{method:"post",url:t.baseUrl+"voice/extensions/:id/clone",params:{includeAll:"@includeAll"}},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"voice/extensions/:id/applications"}}),t.voiceMusicOnHold=e(t.baseUrl+"voice/mohs/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/mohs/describe"},clone:{method:"post",url:t.baseUrl+"voice/mohs/:id/clone",params:{includeAll:"@includeAll"}},addSound:{isArray:!1,method:"post",url:t.baseUrl+"voice/mohs/:id/sounds"},removeSound:{isArray:!1,method:"delete",url:t.baseUrl+"voice/mohs/:id/sounds/:id2"},getSounds:{isArray:!1,method:"get",url:t.baseUrl+"voice/mohs/:id/sounds"}}),t.voiceQueue=e(t.baseUrl+"voice/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/queues/describe"},clone:{method:"post",url:t.baseUrl+"voice/queues/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hopper_black"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"voice/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"voice/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/users"},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/members"},getLists:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/lists"},addLists:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/lists"},removeLists:{isArray:!0,method:"delete",url:t.baseUrl+"voice/queues/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:t.baseUrl+"voice/queues/:id/blacklists"}}),t.voiceRecording=e(t.baseUrl+"voice/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/recordings/describe"},clone:{method:"post",url:t.baseUrl+"voice/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"voice/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}},downloads:{isArray:!1,method:"get",url:t.baseUrl+"voice/recordings/:id/downloads"}}),t.voiceMail=e(t.baseUrl+"voice/mails/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/mails/describe"},clone:{method:"post",url:t.baseUrl+"voice/mails/:id/clone",params:{includeAll:"@includeAll"}},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"voice/mails/:id/messages"}}),t.voiceMailMessage=e(t.baseUrl+"voice/mails/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/mails/messages/describe"},clone:{method:"post",url:t.baseUrl+"voice/mails/messages/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"voice/mails/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.voiceCallReport=e(t.baseUrl+"voice/calls/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/calls/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/calls/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceDialReport=e(t.baseUrl+"voice/dials/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/dials/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/dials/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceAgentReport=e(t.baseUrl+"voice/agents/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/agents/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/agents/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceQueueReport=e(t.baseUrl+"voice/queues/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/queues/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/queues/reports/:id/clone",params:{includeAll:"@includeAll"}},getVoiceQueuesReport:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/reports/index"}}),t.memberReport=e(t.baseUrl+"members/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"members/reports/describe"},clone:{method:"post",url:t.baseUrl+"members/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.trunk=e(t.baseUrl+"trunks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"trunks/describe"},clone:{method:"post",url:t.baseUrl+"trunks/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceTransferReport=e(t.baseUrl+"voice/transfers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/transfers/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/transfers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailServerOut=e(t.baseUrl+"mail/out_servers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/out_servers/describe"},clone:{method:"post",url:t.baseUrl+"mail/out_servers/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailAccount=e(t.baseUrl+"mail/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/accounts/describe"},clone:{method:"post",url:t.baseUrl+"mail/accounts/:id/clone",params:{includeAll:"@includeAll"}},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/canned_answers"},getImap:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/in_servers"},addImap:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/in_servers"},removeImap:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/in_servers"},getSmtp:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/out_servers"},addSmtp:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/out_servers"},removeSmtp:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/out_servers"},addInteraction:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/applications"},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/dispositions"},addDispositions:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/dispositions"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/messages"},send:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/send"},verifySmtp:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/verify"}}),t.mailQueue=e(t.baseUrl+"mail/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/queues/describe"},clone:{method:"post",url:t.baseUrl+"mail/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"mail/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"mail/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"mail/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"mail/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"mail/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"mail/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"mail/queues/:id/users"}}),t.mailSubstatus=e(t.baseUrl+"mail/substatuses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/substatuses/describe"},clone:{method:"post",url:t.baseUrl+"mail/substatuses/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailInteraction=e(t.baseUrl+"mail/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/interactions/describe"},clone:{method:"post",url:t.baseUrl+"mail/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"mail/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"mail/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"mail/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"mail/interactions/:id/tags"}}),t.mailMessage=e(t.baseUrl+"mail/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/messages/describe"},clone:{method:"post",url:t.baseUrl+"mail/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"mail/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"mail/messages/:id/reject"}}),t.mailApplication=e(t.baseUrl+"mail/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/applications/describe"},clone:{method:"post",url:t.baseUrl+"mail/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailDisposition=e(t.baseUrl+"mail/dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/dispositions/describe"},clone:{method:"post",url:t.baseUrl+"mail/dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailQueueReport=e(t.baseUrl+"mail/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"mail/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.dashboard=e(t.baseUrl+"dashboards/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"dashboards/describe"},clone:{method:"post",url:t.baseUrl+"dashboards/:id/clone",params:{includeAll:"@includeAll"}},addItem:{isArray:!1,method:"post",url:t.baseUrl+"dashboards/:id/items"},getItems:{isArray:!1,method:"get",url:t.baseUrl+"dashboards/:id/items"}}),t.dashboardItem=e(t.baseUrl+"dashboards/items/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"dashboards/items/describe"},clone:{method:"post",url:t.baseUrl+"dashboards/items/:id/clone",params:{includeAll:"@includeAll"}}}),t.faxAccount=e(t.baseUrl+"fax/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/accounts/describe"},clone:{method:"post",url:t.baseUrl+"fax/accounts/:id/clone",params:{includeAll:"@includeAll"}},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"fax/accounts/:id/canned_answers"},addInteraction:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/applications"},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/dispositions"},addDispositions:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/dispositions"},addAccountApplications:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/addaccountapplications"},updateAccountApplications:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/updateaccountapplications"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/messages"},send:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/send"}}),t.faxApplication=e(t.baseUrl+"fax/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/applications/describe"},clone:{method:"post",url:t.baseUrl+"fax/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.faxDisposition=e(t.baseUrl+"fax/dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/dispositions/describe"},clone:{method:"post",url:t.baseUrl+"fax/dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),t.faxInteraction=e(t.baseUrl+"fax/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/interactions/describe"},clone:{method:"post",url:t.baseUrl+"fax/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"fax/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"fax/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"fax/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"fax/interactions/:id/tags"}}),t.faxMessage=e(t.baseUrl+"fax/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/messages/describe"},clone:{method:"post",url:t.baseUrl+"fax/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"fax/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"fax/messages/:id/reject"}}),t.faxQueue=e(t.baseUrl+"fax/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/queues/describe"},clone:{method:"post",url:t.baseUrl+"fax/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"fax/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"fax/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"fax/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"fax/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"fax/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"fax/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"fax/queues/:id/users"}}),t.faxQueueReport=e(t.baseUrl+"fax/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"fax/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.smsAccount=e(t.baseUrl+"sms/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/accounts/describe"},clone:{method:"post",url:t.baseUrl+"sms/accounts/:id/clone",params:{includeAll:"@includeAll"}},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"sms/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/applications"},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/dispositions"},addDispositions:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/dispositions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/interactions"},send:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/send"},status:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/status"}}),t.smsApplication=e(t.baseUrl+"sms/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/applications/describe"},clone:{method:"post",url:t.baseUrl+"sms/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.smsDisposition=e(t.baseUrl+"sms/dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/dispositions/describe"},clone:{method:"post",url:t.baseUrl+"sms/dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),t.smsInteraction=e(t.baseUrl+"sms/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/interactions/describe"},clone:{method:"post",url:t.baseUrl+"sms/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"sms/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"sms/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"sms/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"sms/interactions/:id/tags"}}),t.smsMessage=e(t.baseUrl+"sms/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/messages/describe"},clone:{method:"post",url:t.baseUrl+"sms/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"sms/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"sms/messages/:id/reject"},status:{isArray:!1,method:"post",url:t.baseUrl+"sms/messages/:id/status"}}),t.smsQueue=e(t.baseUrl+"sms/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/queues/describe"},clone:{method:"post",url:t.baseUrl+"sms/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"sms/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"sms/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"sms/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"sms/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"sms/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"sms/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"sms/queues/:id/users"}}),t.openchannelAccount=e(t.baseUrl+"openchannel/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/accounts/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/accounts/:id/clone",params:{includeAll:"@includeAll"}},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/applications"},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/dispositions"},addDispositions:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/dispositions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/interactions"}}),t.openchannelApplication=e(t.baseUrl+"openchannel/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/applications/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.openchannelDisposition=e(t.baseUrl+"openchannel/dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/dispositions/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),t.openchannelInteraction=e(t.baseUrl+"openchannel/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/interactions/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/interactions/:id/tags"}}),t.openchannelMessage=e(t.baseUrl+"openchannel/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/messages/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"openchannel/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"openchannel/messages/:id/reject"}}),t.openchannelQueue=e(t.baseUrl+"openchannel/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/queues/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"openchannel/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"openchannel/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/queues/:id/users"}}),t.chatWebsite=e(t.baseUrl+"chat/websites/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/websites/describe"},clone:{method:"post",url:t.baseUrl+"chat/websites/:id/clone",params:{includeAll:"@includeAll"}},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"chat/websites/:id/canned_answers"},addLogo:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/logo"},addAvatar:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/avatar"},getLogo:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/logo"},getAvatar:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/avatar"},notify:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/notify"},offline:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/offline"},addInteraction:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/interactions"},getSnippet:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/snippet"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/applications"},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/dispositions"},addDispositions:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/dispositions"},addProactiveActions:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/proactive_actions"},getProactiveActions:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/proactive_actions"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/fields"},getOfflineMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/offline_messages"}}),t.openchannelQueueReport=e(t.baseUrl+"openchannel/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatApplication=e(t.baseUrl+"chat/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/applications/describe"},clone:{method:"post",url:t.baseUrl+"chat/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatDisposition=e(t.baseUrl+"chat/dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/dispositions/describe"},clone:{method:"post",url:t.baseUrl+"chat/dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatInteraction=e(t.baseUrl+"chat/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/interactions/describe"},clone:{method:"post",url:t.baseUrl+"chat/interactions/:id/clone",params:{includeAll:"@includeAll"}},abandon:{isArray:!1,method:"put",url:t.baseUrl+"chat/interactions/:id/abandon"},attachmentUpload:{isArray:!1,method:"post",url:t.baseUrl+"chat/interactions/:id/attachment_upload"},attachmentDownload:{isArray:!1,method:"get",url:t.baseUrl+"chat/interactions/:id/attachment_download"},close:{isArray:!1,method:"put",url:t.baseUrl+"chat/interactions/:id/close"},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"chat/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/interactions/:id/messages"},getMyMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/interactions/:id/my_messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"chat/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"chat/interactions/:id/tags"}}),t.chatMessage=e(t.baseUrl+"chat/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/messages/describe"},clone:{method:"post",url:t.baseUrl+"chat/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"chat/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"chat/messages/:id/reject"}}),t.chatOfflineMessage=e(t.baseUrl+"chat/offline_messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/offline_messages/describe"},clone:{method:"post",url:t.baseUrl+"chat/offline_messages/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatQueue=e(t.baseUrl+"chat/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/queues/describe"},clone:{method:"post",url:t.baseUrl+"chat/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"chat/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"chat/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"chat/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"chat/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"chat/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"chat/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"chat/queues/:id/users"}}),t.chatGroup=e(t.baseUrl+"chat/groups/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/groups/describe"},clone:{method:"post",url:t.baseUrl+"chat/groups/:id/clone",params:{includeAll:"@includeAll"}},getUnread:{isArray:!1,method:"get",url:t.baseUrl+"chat/groups/:id/unread"},addMembers:{isArray:!0,method:"post",url:t.baseUrl+"chat/groups/:id/members"},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"chat/groups/:id/members"},removeMembers:{isArray:!1,method:"delete",url:t.baseUrl+"chat/groups/:id/members"},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"chat/groups/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/groups/:id/messages"}}),t.chatProactiveAction=e(t.baseUrl+"chat/proactive_actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/proactive_actions/describe"},clone:{method:"post",url:t.baseUrl+"chat/proactive_actions/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmCompany=e(t.baseUrl+"cm/companies/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/companies/describe"},clone:{method:"post",url:t.baseUrl+"cm/companies/:id/clone",params:{includeAll:"@includeAll"}},addContacts:{isArray:!1,method:"post",url:t.baseUrl+"cm/companies/:id/contacts"},getContacts:{isArray:!1,method:"get",url:t.baseUrl+"cm/companies/:id/contacts"}}),t.cmContact=e(t.baseUrl+"cm/contacts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/contacts/describe"},clone:{method:"post",url:t.baseUrl+"cm/contacts/:id/clone",params:{includeAll:"@includeAll"}},merge:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/merge"},bulkCreate:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/create_many"},getHoppers:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/hopper_finals"},getJscriptySessions:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/jscripty_sessions"},uploadCsv:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/csv"},upload:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/upload"},import:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/upload/:id"}}),t.cmHopper=e(t.baseUrl+"cm/hopper/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper/:id/clone",params:{includeAll:"@includeAll"}},getPreview:{isArray:!1,method:"post",url:t.baseUrl+"cm/hopper/preview"},getOpenContacts:{isArray:!1,method:"get",url:t.baseUrl+"cm/hopper/opencontacts"}}),t.cmHopperBlack=e(t.baseUrl+"cm/hopper_black/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper_black/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper_black/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmHopperFinal=e(t.baseUrl+"cm/hopper_final/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper_final/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper_final/:id/clone",params:{includeAll:"@includeAll"}},countContactsQueueCampaignHopperFinal:{isArray:!0,method:"get",url:t.baseUrl+"cm/hopper_final/voice/queue/countAttributes/:id"},countContactsIvrCampaignHopperFinal:{isArray:!0,method:"get",url:t.baseUrl+"cm/hopper_final/campaign/countAttributes/:id"},moveContactsQueueCampaignHopperFinal:{isArray:!0,method:"post",url:t.baseUrl+"cm/hopper_final/voice/queue/moveContacts/:id"},moveContactsIvrCampaignHopperFinal:{isArray:!0,method:"post",url:t.baseUrl+"cm/hopper_final/voice/campaign/moveContacts/:id"},checkContactHopper:{isArray:!1,method:"post",url:t.baseUrl+"cm/hopper_final/checkContactHopper"}}),t.cmHopperHistory=e(t.baseUrl+"cm/hopper_history/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper_history/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper_history/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmCustomField=e(t.baseUrl+"cm/custom_fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/custom_fields/describe"},clone:{method:"post",url:t.baseUrl+"cm/custom_fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmList=e(t.baseUrl+"cm/lists/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/lists/describe"},clone:{method:"post",url:t.baseUrl+"cm/lists/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"cm/lists/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/dispositions"},addContacts:{isArray:!1,method:"post",url:t.baseUrl+"cm/lists/:id/contacts"},getContacts:{isArray:!0,method:"get",url:t.baseUrl+"cm/lists/:id/contacts"},getContactsCsv:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/contacts/csv"},addCustomField:{isArray:!1,method:"post",url:t.baseUrl+"cm/lists/:id/fields"},getCustomFields:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/fields"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"cm/lists/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"cm/lists/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/users"}}),t.action=e(t.baseUrl+"actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"actions/describe"},clone:{method:"post",url:t.baseUrl+"actions/:id/clone",params:{includeAll:"@includeAll"}}}),t.automation=e(t.baseUrl+"automations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"automations/describe"},clone:{method:"post",url:t.baseUrl+"automations/:id/clone",params:{includeAll:"@includeAll"}},addConditions:{isArray:!1,method:"post",url:t.baseUrl+"automations/:id/conditions"},getConditions:{isArray:!1,method:"get",url:t.baseUrl+"automations/:id/conditions"},addActions:{isArray:!1,method:"post",url:t.baseUrl+"automations/:id/actions"},getActions:{isArray:!1,method:"get",url:t.baseUrl+"automations/:id/actions"}}),t.cannedAnswer=e(t.baseUrl+"canned_answers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"canned_answers/describe"},clone:{method:"post",url:t.baseUrl+"canned_answers/:id/clone",params:{includeAll:"@includeAll"}}}),t.condition=e(t.baseUrl+"conditions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"conditions/describe"},clone:{method:"post",url:t.baseUrl+"conditions/:id/clone",params:{includeAll:"@includeAll"}}}),t.interval=e(t.baseUrl+"intervals/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"intervals/describe"},clone:{method:"post",url:t.baseUrl+"intervals/:id/clone",params:{includeAll:"@includeAll"}},addInterval:{isArray:!1,method:"post",url:t.baseUrl+"intervals/:id/sub_intervals"},getIntervals:{isArray:!1,method:"get",url:t.baseUrl+"intervals/:id/sub_intervals"},addIntervals:{isArray:!0,method:"post",url:t.baseUrl+"intervals/:id/sub_intervals/create_many"}}),t.pause=e(t.baseUrl+"pauses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"pauses/describe"},clone:{method:"post",url:t.baseUrl+"pauses/:id/clone",params:{includeAll:"@includeAll"}}}),t.cdr=e(t.baseUrl+"cdr/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cdr/describe"},clone:{method:"post",url:t.baseUrl+"cdr/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceQueuesLog=e(t.baseUrl+"voiceQueuesLog/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voiceQueuesLog/describe"},clone:{method:"post",url:t.baseUrl+"voiceQueuesLog/:id/clone",params:{includeAll:"@includeAll"}}}),t.schedule=e(t.baseUrl+"schedules/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"schedules/describe"},clone:{method:"post",url:t.baseUrl+"schedules/:id/clone",params:{includeAll:"@includeAll"}}}),t.sound=e(t.baseUrl+"sounds/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sounds/describe"},clone:{method:"post",url:t.baseUrl+"sounds/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"sounds/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}},delete:{isArray:!1,method:"delete",url:t.baseUrl+"sounds/:id"}}),t.tag=e(t.baseUrl+"tags/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"tags/describe"},clone:{method:"post",url:t.baseUrl+"tags/:id/clone",params:{includeAll:"@includeAll"}}}),t.template=e(t.baseUrl+"templates/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"templates/describe"},clone:{method:"post",url:t.baseUrl+"templates/:id/clone",params:{includeAll:"@includeAll"}}}),t.trigger=e(t.baseUrl+"triggers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"triggers/describe"},clone:{method:"post",url:t.baseUrl+"triggers/:id/clone",params:{includeAll:"@includeAll"}},addAllCondition:{isArray:!1,method:"post",url:t.baseUrl+"triggers/:id/all_conditions"},addAnyCondition:{isArray:!1,method:"post",url:t.baseUrl+"triggers/:id/any_conditions"},getAllConditions:{isArray:!1,method:"get",url:t.baseUrl+"triggers/:id/all_conditions"},getAnyConditions:{isArray:!1,method:"get",url:t.baseUrl+"triggers/:id/any_conditions"},addAction:{isArray:!1,method:"post",url:t.baseUrl+"triggers/:id/actions"},getActions:{isArray:!1,method:"get",url:t.baseUrl+"triggers/:id/actions"}}),t.variable=e(t.baseUrl+"variables/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"variables/describe"},clone:{method:"post",url:t.baseUrl+"variables/:id/clone",params:{includeAll:"@includeAll"}}}),t.integration=e(t.baseUrl+"integrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/:id/clone",params:{includeAll:"@includeAll"}}}),t.integrationReport=e(t.baseUrl+"integrations/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/reports/describe"},clone:{method:"post",url:t.baseUrl+"integrations/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.analyticCustomReport=e(t.baseUrl+"analytics/custom_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/custom_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/custom_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:t.baseUrl+"analytics/custom_reports/:id/preview"},run:{isArray:!1,method:"get",url:t.baseUrl+"analytics/custom_reports/:id/run"},query:{isArray:!1,method:"get",url:t.baseUrl+"analytics/custom_reports/:id/query"}}),t.analyticDefaultReport=e(t.baseUrl+"analytics/default_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/default_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/default_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:t.baseUrl+"analytics/default_reports/:id/preview"},run:{isArray:!1,method:"get",url:t.baseUrl+"analytics/default_reports/:id/run"},query:{isArray:!1,method:"get",url:t.baseUrl+"analytics/default_reports/:id/query"}}),t.analyticExtractedReport=e(t.baseUrl+"analytics/extracted_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/extracted_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/extracted_reports/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"analytics/extracted_reports/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.analyticMetric=e(t.baseUrl+"analytics/metrics/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/metrics/describe"},clone:{method:"post",url:t.baseUrl+"analytics/metrics/:id/clone",params:{includeAll:"@includeAll"}}}),t.analyticFieldReport=e(t.baseUrl+"analytics/field_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/field_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/field_reports/:id/clone",params:{includeAll:"@includeAll"}},bulkCreate:{method:"post",url:t.baseUrl+"analytics/field_reports/create_many",isArray:!0},bulkDestroy:{method:"delete",url:t.baseUrl+"analytics/field_reports/destroy_many",isArray:!0},addFields:{isArray:!0,method:"post",url:t.baseUrl+"analytics/field_reports/:id/create_many"}}),t.analyticTreeReport=e(t.baseUrl+"analytics/tree_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/tree_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/tree_reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.intSalesforceAccount=e(t.baseUrl+"integrations/salesforce/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/salesforce/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/salesforce/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/salesforce/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/accounts/:id/fields"}}),t.intSalesforceConfiguration=e(t.baseUrl+"integrations/salesforce/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/salesforce/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/salesforce/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/configurations/:id/descriptions"}}),t.intSalesforceField=e(t.baseUrl+"integrations/salesforce/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/salesforce/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/salesforce/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intSugarcrmAccount=e(t.baseUrl+"integrations/sugarcrm/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/sugarcrm/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/fields"}}),t.intSugarcrmConfiguration=e(t.baseUrl+"integrations/sugarcrm/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/descriptions"}}),t.intSugarcrmField=e(t.baseUrl+"integrations/sugarcrm/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/sugarcrm/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/sugarcrm/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intDeskAccount=e(t.baseUrl+"integrations/desk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/desk/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/desk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/desk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/accounts/:id/fields"}}),t.intDeskConfiguration=e(t.baseUrl+"integrations/desk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/desk/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/desk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:t.baseUrl+"integrations/desk/configurations/:id/tags"}}),t.intDeskField=e(t.baseUrl+"integrations/desk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/desk/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/desk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intZohoAccount=e(t.baseUrl+"integrations/zoho/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zoho/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zoho/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/zoho/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/accounts/:id/fields"}}),t.intZohoConfiguration=e(t.baseUrl+"integrations/zoho/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zoho/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zoho/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/configurations/:id/descriptions"}}),t.intZohoField=e(t.baseUrl+"integrations/zoho/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zoho/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zoho/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intZendeskAccount=e(t.baseUrl+"integrations/zendesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zendesk/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zendesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/zendesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/accounts/:id/fields"}}),t.intZendeskConfiguration=e(t.baseUrl+"integrations/zendesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zendesk/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zendesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:t.baseUrl+"integrations/zendesk/configurations/:id/tags"}}),t.intZendeskField=e(t.baseUrl+"integrations/zendesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zendesk/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zendesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intFreshdeskAccount=e(t.baseUrl+"integrations/freshdesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/freshdesk/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/freshdesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/accounts/:id/fields"}}),t.intFreshdeskConfiguration=e(t.baseUrl+"integrations/freshdesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/freshdesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:t.baseUrl+"integrations/freshdesk/configurations/:id/tags"}}),t.intFreshdeskField=e(t.baseUrl+"integrations/freshdesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/freshdesk/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/freshdesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.network=e(t.baseUrl+"networks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"networks/describe"},clone:{method:"post",url:t.baseUrl+"networks/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatQueueReport=e(t.baseUrl+"chat/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"chat/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatInternalMessage=e(t.baseUrl+"chat/internal/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/internal/messages/describe"},clone:{method:"post",url:t.baseUrl+"chat/internal/messages/:id/clone",params:{includeAll:"@includeAll"}},getUsers:{isArray:!1,method:"get",url:t.baseUrl+"chat/internal/messages/users"}}),t.jscriptyAnswerReport=e(t.baseUrl+"jscripty/answers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/answers/reports/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/answers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.jscriptyQuestionReport=e(t.baseUrl+"jscripty/questions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/questions/reports/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/questions/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.jscriptySessionReport=e(t.baseUrl+"jscripty/sessions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/sessions/reports/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/sessions/reports/:id/clone",params:{includeAll:"@includeAll"}},getQuestions:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/sessions/reports/:id/questions"}}),t.smsQueueReport=e(t.baseUrl+"sms/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"sms/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.squareReport=e(t.baseUrl+"square/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/reports/describe"},clone:{method:"post",url:t.baseUrl+"square/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.squareReportDetail=e(t.baseUrl+"square/details/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/details/reports/describe"},clone:{method:"post",url:t.baseUrl+"square/details/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.jscriptyProject=e(t.baseUrl+"jscripty/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/projects/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/projects/:id/clone",params:{includeAll:"@includeAll"}},getSessions:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/projects/:id/sessions"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/projects/:id/answers"},getSummary:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/projects/:id/summary"}}),t.setting=e(t.baseUrl+"settings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"settings/describe"},clone:{method:"post",url:t.baseUrl+"settings/:id/clone",params:{includeAll:"@includeAll"}},addLogo:{isArray:!1,method:"post",url:t.baseUrl+"settings/:id/logo"},addLogoLogin:{isArray:!1,method:"post",url:t.baseUrl+"settings/:id/logo_login"},getLogo:{isArray:!1,method:"get",url:t.baseUrl+"settings/:id/logo"},getLogoLogin:{isArray:!1,method:"get",url:t.baseUrl+"settings/:id/logo_login"},gdpr:{isArray:!1,method:"get",url:t.baseUrl+"settings/:id/gdpr"}}),t.squareOdbc=e(t.baseUrl+"square/odbc/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/odbc/describe"},clone:{method:"post",url:t.baseUrl+"square/odbc/:id/clone",params:{includeAll:"@includeAll"}},test:{isArray:!1,method:"get",url:t.baseUrl+"square/odbc/:id/test"}}),t.squareProject=e(t.baseUrl+"square/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/projects/describe"},clone:{method:"post",url:t.baseUrl+"square/projects/:id/clone",params:{includeAll:"@includeAll"}}}),t.squareRecording=e(t.baseUrl+"square/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/recordings/describe"},clone:{method:"post",url:t.baseUrl+"square/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"square/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.team=e(t.baseUrl+"teams/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"teams/describe"},clone:{method:"post",url:t.baseUrl+"teams/:id/clone",params:{includeAll:"@includeAll"}},getQueues:{isArray:!0,method:"get",url:t.baseUrl+"teams/:id/queues"},addQueues:{isArray:!0,method:"post",url:t.baseUrl+"teams/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:t.baseUrl+"teams/:id/queues"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"teams/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"teams/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"teams/:id/users"}}),t.license=e(t.baseUrl+"license/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"license/describe"},clone:{method:"post",url:t.baseUrl+"license/:id/clone",params:{includeAll:"@includeAll"}}}),t.campaign=e(t.baseUrl+"campaigns/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"campaigns/describe"},clone:{method:"post",url:t.baseUrl+"campaigns/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hopper_black"},getLists:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/lists"},addLists:{isArray:!0,method:"post",url:t.baseUrl+"campaigns/:id/lists"},removeLists:{isArray:!0,method:"delete",url:t.baseUrl+"campaigns/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:t.baseUrl+"campaigns/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:t.baseUrl+"campaigns/:id/blacklists"}}),t.migration=e(t.baseUrl+"migrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"migrations/describe"},clone:{method:"post",url:t.baseUrl+"migrations/:id/clone",params:{includeAll:"@includeAll"}}}),t.attachment=e(t.baseUrl+"attachments/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"attachments/describe"},clone:{method:"post",url:t.baseUrl+"attachments/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"attachments/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t}e.$inject=["$resource"],angular.module("motion").factory("api",e)}(),function(){"use strict";function e(e,t){t.setConfig({position:"top-right",sound:!1,html:!0,theme:"material"}),e.useLoader("$translatePartialLoader",{urlTemplate:"{part}/i18n/{lang}.json"}),e.preferredLanguage("en"),e.useSanitizeValueStrategy(null)}e.$inject=["$translateProvider","toastyConfigProvider"],angular.module("motion").config(e)}(),function(){"use strict";angular.module("motion")}(),function(){"use strict";function e(e,t,n){this.themes=e.themes;var a=n.get("motion.language");a&&t.use(a)}e.$inject=["motionTheming","$translate","$cookies"],angular.module("motion").controller("IndexController",e)}(),function(){"use strict";function e(a,i){return function(e){var t=new Date,n=new Date(e);return n.getDate()===t.getDate()&&n.getMonth()===t.getMonth()&&n.getFullYear()===t.getFullYear()?a("date")(n.getTime(),"shortTime"):n.getDate()===t.getDate()-1&&n.getMonth()===t.getMonth()&&n.getFullYear()===t.getFullYear()?i.instant("DASHBOARDS.YESTERDAY")+" "+a("date")(n.getTime(),"shortTime"):a("date")(n.getTime(),"MMM d, y h:mm a")}}function t(e){return{Today:e.instant("DASHBOARDS.TODAY"),Yesterday:e.instant("DASHBOARDS.YESTERDAY"),"This Week":e.instant("DASHBOARDS.THIS_WEEK"),"Last Week":e.instant("DASHBOARDS.LAST_WEEK"),"This Month":e.instant("DASHBOARDS.THIS_MONTH"),"Last Month":e.instant("DASHBOARDS.LAST_MONTH"),"This Year":e.instant("DASHBOARDS.THIS_YEAR"),"Last Year":e.instant("DASHBOARDS.LAST_YEAR"),January:e.instant("DASHBOARDS.JANUARY"),February:e.instant("DASHBOARDS.FEBRUARY"),March:e.instant("DASHBOARDS.MARCH"),April:e.instant("DASHBOARDS.APRIL"),May:e.instant("DASHBOARDS.MAY"),June:e.instant("DASHBOARDS.JUNE"),July:e.instant("DASHBOARDS.JULY"),August:e.instant("DASHBOARDS.AUGUST"),September:e.instant("DASHBOARDS.SEPTEMBER"),October:e.instant("DASHBOARDS.OCTOBER"),November:e.instant("DASHBOARDS.NOVEMBER"),December:e.instant("DASHBOARDS.DECEMBER"),Mon:e.instant("DASHBOARDS.MON"),Tue:e.instant("DASHBOARDS.TUE"),Wed:e.instant("DASHBOARDS.WED"),Thu:e.instant("DASHBOARDS.THU"),Fri:e.instant("DASHBOARDS.FRI"),Sat:e.instant("DASHBOARDS.SAT"),Sun:e.instant("DASHBOARDS.SUN")}}e.$inject=["$filter","$translate"],t.$inject=["$translate"],angular.module("motion").filter("limitObjectFromTo",function(){return function(e,t,n){var a,i={},o=0;for(a in e)if(n<=o&&(i[a]=e[a]),++o===n+t)break;return i}}).filter("formatdate",e).factory("IndexFactory",function(){var e=[{value:"jan"},{value:"feb"},{value:"mar"},{value:"apr"},{value:"may"},{value:"jun"},{value:"jul"},{value:"aug"},{value:"sep"},{value:"oct"},{value:"nov"},{value:"dec"}],t=[{value:"1"},{value:"2"},{value:"3"},{value:"4"},{value:"5"},{value:"6"},{value:"7"},{value:"8"},{value:"9"},{value:"10"},{value:"11"},{value:"12"}],n=[{value:"mon"},{value:"tue"},{value:"wed"},{value:"thu"},{value:"fri"},{value:"sat"},{value:"sun"}],a=[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{getMonthName:function(){return e},getMonthNumber:function(){return t},getDaysOfWeek:function(){return n},getDaysOfMonth:function(){return a}}}).factory("dateFilterLocalizationFactory",t).factory("Sequence",function(){return{enqueue:function(e){this.tail=this.tail?this.tail.finally(e):e()}}})}(),function(){"use strict";function e(e,t,n){var a;n.html5Mode(!0),t.otherwise("/dashboards/general"),angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.get("motion.layoutStyle")||"verticalNavigation",o={verticalNavigation:{main:"app/core/layouts/vertical-navigation.html",toolbar:"app/toolbar/layouts/vertical-navigation/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html",header:"app/header/layouts/vertical-navigation/header.html",footer:"app/footer/layouts/vertical-navigation/footer.html"},verticalNavigationFullwidthToolbar:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html"},verticalNavigationFullwidthToolbar2:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar-2/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html"},horizontalNavigation:{main:"app/core/layouts/horizontal-navigation.html",toolbar:"app/toolbar/layouts/horizontal-navigation/toolbar.html",navigation:"app/navigation/layouts/horizontal-navigation/navigation.html"},contentOnly:{main:"app/core/layouts/content-only.html",toolbar:"",navigation:""},contentWithToolbar:{main:"app/core/layouts/content-with-toolbar.html",toolbar:"app/toolbar/layouts/content-with-toolbar/toolbar.html",navigation:""}};e.state("app",{abstract:!0,views:{"main@":{templateUrl:o[i].main,controller:"MainController as vm"},"toolbar@app":{templateUrl:o[i].toolbar,controller:"ToolbarController as vm"},"navigation@app":{templateUrl:o[i].navigation,controller:"NavigationController as vm"},"quickPanel@app":{templateUrl:"app/quick-panel/quick-panel.html",controller:"QuickPanelController as vm"},"header@app":{templateUrl:o[i].header,controller:"HeaderController as vm"},"footer@app":{templateUrl:o[i].footer,controller:"FooterController as vm"}},resolve:{license:["apiResolver",function(e){return e.resolve("license@get")}],setting:["apiResolver",function(e){return e.resolve("setting@get",{id:1})}]}})}e.$inject=["$stateProvider","$urlRouterProvider","$locationProvider"],angular.module("motion").config(e)}(),function(){"use strict";function e(e,t,n){var a=e.$on("$stateChangeStart",function(){e.loadingProgress=!0}),i=e.$on("$stateChangeSuccess",function(){t(function(){e.loadingProgress=!1})});e.state=n,e.$on("$destroy",function(){a(),i()})}e.$inject=["$rootScope","$timeout","$state"],angular.module("motion").run(e)}(),function(){"use strict";function e(a,e){var i;function o(){i=io({query:"id="+e.getCurrentUser().id,transports:["websocket","polling"]})}return{connect:o,on:function(e,t){t=t||angular.noop,i||o(),i.on(e,function(){var e=arguments;a.$apply(function(){t.apply(i,e)})})},onWithoutApply:function(e,t){t=t||angular.noop,i||o(),i.on(e,function(){t.apply(i,arguments)})},emit:function(e,t,n){n=n||angular.noop,i||o(),i.emit(e,t,function(){var e=arguments;a.$apply(function(){n.apply(i,e)})})},removeAllListeners:function(e){i||o(),i.removeAllListeners(e)},removeListener:function(e,t){i||o(),i.removeListener(e,t)},disconnect:function(){i||o(),i.disconnect()}}}e.$inject=["$rootScope","Auth"],angular.module("motion").factory("socket",e)}(),function(){"use strict";function e(t,n,e,a,i,o){var s=this;s.progresslogin=!1,s.login=function(){return s.progresslogin=!0,o.login(s.form).then(function(){return t.go("app.dashboards.general")}).catch(function(e){s.message=e.message}).finally(function(){s.progresslogin=!1})},s.loginOauth=function(e){n.location.href="/api/auth/"+e},s.onInit=function(){{if(t.params.token&&t.params.userId)return o.removeCookies(),s.progresslogin=!0,e.put("motion.token",t.params.token),i.user.get({id:t.params.userId}).$promise.then(function(e){e&&(o.updateCurrentUser(e),t.go("app.dashboards.general"))}).finally(function(){s.progresslogin=!1});o.isLoggedIn()&&t.go("app.dashboards.general")}},s.onInit()}e.$inject=["$state","$window","$cookies","$timeout","api","Auth"],angular.module("app.login").controller("LoginController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="ANALYTICS.EDIT_EXTRACTEDREPORT",m.extractedReport=angular.copy(s),m.extractedReports=o,m.newExtractedReport=!1,m.extractedReport||(m.extractedReport={},m.title="ANALYTICS.NEW_EXTRACTEDREPORT",m.newExtractedReport=!0),m.addNewExtractedReport=function(){m.errors=[],r.analyticExtractedReport.save(m.extractedReport).$promise.then(function(e){m.extractedReports.unshift(e.toJSON()),i.success({title:"ExtractedReport properly created",msg:m.extractedReport.name?m.extractedReport.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveExtractedReport=function(){m.errors=[],r.analyticExtractedReport.update({id:m.extractedReport.id},m.extractedReport).$promise.then(function(e){var t=_.find(m.extractedReports,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ExtractedReport properly saved!",msg:m.extractedReport.name?m.extractedReport.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteExtractedReport=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The extractedReport will be deleted.").ariaLabel("Delete ExtractedReport").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.analyticExtractedReport.delete({id:m.extractedReport.id}).$promise.then(function(){_.remove(m.extractedReports,{id:m.extractedReport.id}),i.success({title:"ExtractedReport properly deleted!",msg:(m.extractedReport.name||"extractedReport")+" has been deleted!"}),u(m.extractedReport)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","extractedReports","extractedReport","api","Auth","license","setting"],angular.module("app.analytics").controller("CreateOrEditExtractedReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.extractedReports=r||{count:0,rows:[]},v.table="extractedReports",v.listOrder="",v.listOrderAsc=null,v.selectedExtractedReports=[],v.query={fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,createdAt,status,output",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{extractedReport:e,extractedReports:v.extractedReports.rows,license:v.license,setting:null}})},v.downloadfile2=function(o,e){return l.analyticExtractedReport.download({id:o.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=o.savename;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the extractedReport?").htmlContent("<b>"+(e.name||"extractedReport")+"</b> will be deleted.").ariaLabel("delete extractedReport").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getExtractedReports=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.analyticExtractedReport.get(v.query,f).$promise},v.createOrEditExtractedReport=function(e,t){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{extractedReport:t,extractedReports:v.extractedReports.rows,license:v.license,setting:v.setting}})},v.deleteExtractedReport=A,v.exportSelectedExtractedReports=function(){var e=angular.copy(v.selectedExtractedReports);return v.selectedExtractedReports=[],e},v.deleteSelectedExtractedReports=function(e){var t=i.confirm().title("Are you sure want to delete the selected extractedReports?").htmlContent("<b>"+v.selectedExtractedReports.length+" selected</b> will be deleted.").ariaLabel("delete ExtractedReports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedExtractedReports.forEach(function(e){A(e)}),v.selectedExtractedReports=[]})},v.deselectExtractedReports=function(){v.selectedExtractedReports=[]},v.selectAllExtractedReports=function(){v.selectedExtractedReports=v.extractedReports.rows};var h=!0,b=1;function f(e){v.extractedReports=e||{count:0,rows:[]}}function A(e){l.analyticExtractedReport.delete({id:e.id}).$promise.then(function(){_.remove(v.extractedReports.rows,{id:e.id}),v.extractedReports.count-=1,v.extractedReports.rows.length||v.getExtractedReports(),c.success({title:"ExtractedReport deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticExtractedReport"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticExtractedReport",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getExtractedReports())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","extractedReports","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.analytics").controller("ExtractedReportsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="ANALYTICS.EDIT_METRIC",m.metric=angular.copy(s),m.metrics=o,m.newMetric=!1,m.metric||(m.metric={table:"report_agent"},m.title="ANALYTICS.NEW_METRIC",m.newMetric=!0),m.addNewMetric=function(){m.errors=[],r.analyticMetric.save(m.metric).$promise.then(function(e){m.metrics.unshift(e.toJSON()),i.success({title:"Metric properly created",msg:m.metric.name?m.metric.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMetric=function(){m.errors=[],r.analyticMetric.update({id:m.metric.id},m.metric).$promise.then(function(e){var t=_.find(m.metrics,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Metric properly saved!",msg:m.metric.name?m.metric.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMetric=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The metric will be deleted.").ariaLabel("Delete Metric").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.analyticMetric.delete({id:m.metric.id}).$promise.then(function(){_.remove(m.metrics,{id:m.metric.id}),i.success({title:"Metric properly deleted!",msg:(m.metric.name||"metric")+" has been deleted!"}),u(m.metric)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","metrics","metric","api","Auth","license","setting"],angular.module("app.analytics").controller("CreateOrEditMetricDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.metrics=r||{count:0,rows:[]},v.table="metrics",v.listOrder="",v.listOrderAsc=null,v.selectedMetrics=[],v.query={fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,page:1},v.arraytable=_.keyBy([{option:"Agent Report",value:"'report_agent'"},{option:"Call Report",value:"'report_call'"},{option:"Contacts",value:"'cm_contacts'"},{option:"CSquare Report",value:"'report_square'"},{option:"CSquare Details Report",value:"'report_square_details'"},{option:"Dialer Hopper Processing",value:"'cm_hopper'"},{option:"Dialer Hopper Logs",value:"'cm_hopper_history'"},{option:"Dialer Hopper Final",value:"'cm_hopper_final'"},{option:"Integration Report",value:"'report_integration'"},{option:"Jscripty Sessions",value:"'report_jscripty_sessions'"},{option:"Jscripty Questions",value:"'report_jscripty_questions'"},{option:"Jscripty Answers",value:"'report_jscripty_answers'"},{option:"Member Report",value:"'report_member'"},{option:"Queue Report",value:"'report_queue'"},{option:"Users",value:"'users'"},{option:"Voice Recordings",value:"'voice_recordings'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editdialog=function(e,t){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{metric:e,metrics:v.metrics.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the metric?").htmlContent("<b>"+(e.name||"metric")+"</b> will be deleted.").ariaLabel("delete metric").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getMetrics=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.analyticMetric.get(v.query,f).$promise},v.createOrEditMetric=function(e,t){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{metric:t,metrics:v.metrics.rows,license:v.license,setting:v.setting}})},v.deleteMetric=A,v.exportSelectedMetrics=function(){var e=angular.copy(v.selectedMetrics);return v.selectedMetrics=[],e},v.deleteSelectedMetrics=function(e){var t=i.confirm().title("Are you sure want to delete the selected metrics?").htmlContent("<b>"+v.selectedMetrics.length+" selected</b> will be deleted.").ariaLabel("delete Metrics").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedMetrics.forEach(function(e){A(e)}),v.selectedMetrics=[]})},v.deselectMetrics=function(){v.selectedMetrics=[]},v.selectAllMetrics=function(){v.selectedMetrics=v.metrics.rows};var h=!0,b=1;function f(e){v.metrics=e||{count:0,rows:[]}}function A(e){l.analyticMetric.delete({id:e.id}).$promise.then(function(){_.remove(v.metrics.rows,{id:e.id}),v.metrics.count-=1,v.metrics.rows.length||v.getMetrics(),c.success({title:"Metric deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticMetric"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticMetric",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getMetrics())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","metrics","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.analytics").controller("MetricsController",e)}(),function(){"use strict";function e(e,t,a,n,i,o,s){var r=this;function l(){t.hide()}r.errors=[],r.report=angular.copy(n),r.report.name+="-copy",r.treeCustomData=s,r.treeCustomConfig={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},r.treeCustomEvents={select_node:function(e,t){r.currentNode=t.node}},r.copyReport=function(){var n;r.errors=[],i.analyticCustomReport.save({name:r.report.name,description:r.report.description,table:r.report.table,conditions:r.report.conditions,joins:r.report.joins,parent:r.currentNode.id}).$promise.then(function(e){n=e,a.success({title:"Report properly copied!",msg:r.report.name?r.report.name+" has been copied!":""});var t={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return t["analyticCustomReport"===o?"CustomReportId":"DefaultReportId"]=r.report.id,i.analyticFieldReport.get(t).$promise}).then(function(e){var e=_.map(e.rows,function(e){return _.extend({},e,{CustomReportId:n.id})});return i.analyticFieldReport.bulkCreate(e).$promise}).then(function(){a.success({title:"Fields copied!",msg:"Fields has been copied!"}),l()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:COPYREPORT",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","treeCustomData"],angular.module("app.analytics").controller("CopyReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l){var d=this;function c(){t.hide()}d.errors=[],d.joinTables=[],d.title="ANALYTICS.EDIT_REPORT",d.report=angular.copy(i),d.reports=a,d.newReport=!1,d.tables=l.getMap(),d.joinTypes=[{key:"join",value:"Join"},{key:"left_join",value:"Left Join"},{key:"right_join",value:"Right Join"},{key:"outer_join",value:"Outer Join"},{key:"cross_join",value:"Cross Join"}],d.report||(d.report={name:"",table:"report_agent",description:"",parent:r.id},d.title="ANALYTICS.NEW_REPORT",d.newReport=!0),d.addNewReport=function(){d.errors=[],d.report.joins=_.map(d.joinTables||[],function(e){return{parentKey:e.parentKey,foreignTable:e.name,foreignKey:e.foreignKey,type:e.type.toLowerCase()}}),d.report.joins=JSON.stringify(d.report.joins),o[s].save(d.report).$promise.then(function(e){d.reports.unshift(e),n.success({title:"Report properly created",msg:d.report.name?d.report.name+" has been created!":""}),c()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.save"}];for(var t=0;t<e.data.errors.length;t++)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveReport=function(){d.errors=[],o[s].update({id:d.report.id},d.report).$promise.then(function(e){var t=_.find(d.reports,{id:e.id});t&&_.merge(t,e),n.success({title:"Report properly saved!",msg:d.report.name?d.report.name+" has been saved!":""}),c()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.update"}];for(var t=0;t<e.data.errors.length;t++)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteReport=function(){d.errors=[];var e=t.confirm().title("Are you sure?").content("The report will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(event);t.show(e).then(function(){o[s].delete({id:d.report.id}).$promise.then(function(){_.remove(d.reports,{id:d.report.id}),n.success({title:"Report properly deleted!",msg:d.report.name?d.report.name+" has been deleted!":""}),c()}).catch(function(e){d.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.delete"}]})},function(){})},d.closeDialog=c,d.selectedTableChange=function(e){e&&(delete d.selectedItem,d.joinTables.push(e))},d.removeJoin=function(e){d.joinTables.splice(e,1)},d.getFields=function(t,n,e){var a=_.find(d.tables,{name:e});a&&a.api&&o[a.api].describe().$promise.then(function(e){t[n]=_.difference(_.keys(e),["$promise","$resolved"])}).catch(function(e){console.error(e)})}}e.$inject=["$location","$mdDialog","toasty","reports","report","api","apiName","currentNode","describeTable"],angular.module("app.analytics").controller("CreateOrEditReportDialogController",e)}(),function(){"use strict";function e(i,a,o,e){var s=this;s.report={},s.conditions=e.getConditions,s.init=function(e){s.report=e,s.report.condition=angular.fromJson(e.conditions)||{group:{operator:"AND",rules:[]}};for(var t=0;t<s.report.condition.group.rules.length;t++)if(s.report.condition.group.rules[t].field){var n=s.report.condition.group.rules[t].field.split(".");1===n.length&&(s.report.condition.group.rules[t].field=s.report.table+"."+s.report.condition.group.rules[t].field)}a.getColumns(s.report.table).then(function(e){s.columns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt"])}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.addCondition=function(e){e.unshift({condition:"=",field:"",value:""})},s.addGroup=function(e){e.push({group:{operator:"AND",rules:[]}})},s.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the item?").htmlContent("The item will be deleted.").ariaLabel("delete item").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){e.splice(t,1)},function(){console.log("CANCEL")})},s.isValueByCondition=function(e){return!_.includes(["IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"],e)}}e.$inject=["$mdDialog","describeTable","toasty","sqlUtil"],angular.module("app.analytics").controller("ReportConditionsController",e)}(),function(){"use strict";function e(t){var a={cm_contacts:"cmContact",cm_hopper:"cmHopper",cm_hopper_final:"cmHopperFinal",cm_hopper_history:"cmHopperHistory",chat_websites:"chatWebsite",chat_queues:"chatQueue",chat_interactions:"chatInteraction",chat_messages:"chatMessage",chat_offline_messages:"chatOfflineMessage",report_chat_queue:"chatQueueReport",mail_accounts:"mailAccount",mail_queues:"mailQueue",mail_interactions:"mailInteraction",mail_messages:"mailMessage",report_mail_queue:"mailQueueReport",openchannel_accounts:"openchannelAccount",openchannel_queues:"openchannelQueue",openchannel_interactions:"openchannelInteraction",openchannel_messages:"openchannelMessage",report_openchannel_queue:"openchannelQueueReport",sms_accounts:"smsAccount",sms_queues:"smsQueue",sms_interactions:"smsInteraction",sms_messages:"smsMessage",report_sms_queue:"smsQueueReport",fax_accounts:"faxAccount",fax_queues:"faxQueue",fax_interactions:"faxInteraction",fax_messages:"faxMessage",report_fax_queue:"faxQueueReport",report_call:"voiceCallReport",report_agent:"voiceAgentReport",report_square:"squareReport",report_member:"memberReport",report_queue:"voiceQueueReport",report_square_details:"squareReportDetail",report_jscripty_sessions:"jscriptySessionReport",report_jscripty_questions:"jscriptyQuestionReport",report_jscripty_answers:"jscriptyAnswerReport",users:"user",voice_recordings:"voiceRecording"};return{getMap:function(){var n=[];return _.forIn(a,function(e,t){n.push({name:t,api:e})}),n},getColumns:function(e){return t[a[e]].describe().$promise}}}e.$inject=["api"],angular.module("app.analytics").factory("describeTable",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;(m.errors=[],m.title="Edit Report Field",m.report=i,m.reportField=angular.copy(s),m.reportFields=o,m.metrics=r,m.columns=l,m.sqlUtil=d,m.newReportField=!1,m.reportField)?(m.reportField.type=m.reportField.custom?"custom":m.reportField.MetricId?"metric":"column",m.reportField.field&&!m.reportField.custom&&_.isNil(m.reportField.MetricId)&&1===m.reportField.field.split(".").length&&(m.reportField.field=m.report.table+"."+m.reportField.field)):(m.reportField={type:"column",function:null,format:null,groupBy:!1,orderBy:null},m.title="New Report Field",m.newReportField=!0);function u(){n.hide()}m.addNewReportField=function(){m.errors=[],m.reportField.custom="custom"===m.reportField.type,m.reportField.MetricId="metric"===m.reportField.type?m.reportField.MetricId:null,m.reportField.CustomReportId=m.report.id,c.analyticFieldReport.save(m.reportField).$promise.then(function(e){m.reportFields.push(e),a.success({title:"Report field properly created",msg:m.reportField.field?m.reportField.field+" has been created!":m.reportField.type+" has been created!"}),u()}).catch(function(e){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.save"}]})},m.saveReportField=function(){m.errors=[],m.reportField.custom="custom"===m.reportField.type,m.reportField.MetricId="metric"===m.reportField.type?m.reportField.MetricId:null,c.analyticFieldReport.update({id:m.reportField.id},m.reportField).$promise.then(function(e){var t=_.find(m.reportFields,{id:e.id});t&&_.merge(t,e),a.success({title:"Report Field properly saved!",msg:m.reportField.field?m.reportField.field+" has been saved!":""}),u()}).catch(function(e){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.update"}]})},m.deleteReportField=function(e){m.errors=[];var t=n.confirm().title("Are you sure?").content("The field will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){c.analyticFieldReport.delete({id:m.reportField.id}).$promise.then(function(){_.remove(m.reportFields,{id:m.reportField.id}),a.success({title:"Report Field properly deleted!",msg:m.reportField.field?m.reportField.field+" has been deleted!":""}),u()}).catch(function(e){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReportField.delete"}]})},function(){})},m.closeDialog=u}e.$inject=["$scope","$location","$mdDialog","toasty","report","reportFields","reportField","metrics","columns","sqlUtil","api"],angular.module("app.analytics").controller("CreateOrEditReportFieldDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.report={},c.reportFields={count:0,rows:[]},c.functions=_.keyBy(l.getFunctions,"value"),c.formats=_.keyBy(l.getFormats,"value"),c.groupBy=_.keyBy(l.getGroupBy,"value"),c.orderBy=_.keyBy(l.getOrderBy,"value"),c.selectedReportFields=[],c.query={fields:"createdAt,updatedAt,id,field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0},c.sortableTable={animation:100,onSort:function(e){s.analyticFieldReport.addFields({id:c.report.id},e.models).$promise.then(function(e){c.reportFields.rows=e}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDFIELDS"})})}},c.init=function(e){c.report=e,c.query.CustomReportId=c.report.id,r.getColumns(c.report.table).then(function(e){return c.columns=_.difference(_.keys(e),["$promise","$resolved"]),s.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise}).then(function(e){c.metrics=e.rows}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.getReportFields()},c.deleteConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>"+e.field+"</b> will be deleted.").ariaLabel("delete field").targetEvent(t).ok("OK").cancel("CANCEL");a.show(n).then(function(){p(e)},function(){console.log("CANCEL")})},c.success=u,c.getReportFields=function(){c.promise=s.analyticFieldReport.get(c.query,u).$promise},c.createOrEditReportField=function(e,t){a.show({controller:"CreateOrEditReportFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/edit/field/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:c.report,reportField:t,reportFields:c.reportFields.rows,metrics:c.metrics,columns:c.columns,setting:null}})},c.deleteReportField=p,c.deleteSelectedReportFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+c.selectedReportFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){c.selectedReportFields.forEach(function(e){p(e)}),c.selectedReportFields=[]})},c.getMetricName=function(e){var t=_.find(c.metrics,{id:e});return t?t.name:d.instant("ANALYTICS.NO_METRIC_FOUND")},c.getMetricValue=function(e){var t=_.find(c.metrics,{id:e});return t?t.metric:d.instant("ANALYTICS.NO_METRIC_FOUND")};var m=!0;function u(e){c.reportFields=e||{count:0,rows:[]}}function p(e){s.analyticFieldReport.delete({id:e.id}).$promise.then(function(){c.selectedReportFields=[],_.remove(c.reportFields.rows,{id:e.id}),c.reportFields.count-=1,c.reportFields.rows.length||c.getReportFields(),o.success({title:"Field deleted!",msg:e.field?e.field+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}t.$watch("vm_rf.query.filter",function(e,t){m?n(function(){m=!1}):c.getReportFields()})}e.$inject=["$cookies","$scope","$timeout","$mdDialog","$document","toasty","api","describeTable","sqlUtil","$translate"],angular.module("app.analytics").controller("ReportFieldsController",e)}(),function(){"use strict";angular.module("app.analytics").factory("sqlUtil",function(){return{getFunctions:[{value:"SUM",option:function(e){return"SUM ("+e+")"}},{value:"COUNT",option:function(e){return"COUNT ("+e+")"}},{value:"COUNT DISTINCT",option:function(e){return"COUNT (DISTINCT "+e+")"}},{value:"MAX",option:function(e){return"MAX ("+e+")"}},{value:"MIN",option:function(e){return"MIN ("+e+")"}},{value:"AVG",option:function(e){return"AVG ("+e+")"}},{value:"GROUP_CONCAT",option:function(e){return"GROUP_CONCAT ("+e+")"}},{value:"GROUP_CONCAT ASC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" ASC)"}},{value:"GROUP_CONCAT DESC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" DESC)"}}],getFormats:[{value:"SEC_TO_TIME",option:function(e){return"SEC_TO_TIME ("+e+")"}},{value:"DATE",option:function(e){return"DATE ("+e+")"}},{value:"HOUR",option:function(e){return"HOUR ("+e+")"}},{value:"ROUND",option:function(e){return"ROUND ("+e+")"}},{value:"UNIX_TIMESTAMP",option:function(e){return"UNIX_TIMESTAMP ("+e+")"}}],getGroupBy:[{value:!1,option:function(){return"No"}},{value:!0,option:function(e){return"GROUP BY "+e}}],getOrderBy:[{value:"ASC",option:function(e){return"ORDER BY "+e+" ASC"}},{value:"DESC",option:function(e){return"ORDER BY "+e+" DESC"}}],getConditions:["=","!=","<","<=",">",">=","LIKE","NOT LIKE","IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"]}})}(),function(){"use strict";function e(e,t,n,a){var i=this;function o(e){return _.isArray(e)}i.report=a||{},i.selectedTab=e.params.tab||0,i.gotoReports=function(){e.go("app.analytics.reports")},i.saveReport=function(){i.report.conditions=angular.toJson(i.report.condition),n.analyticCustomReport.update({id:i.report.id},_.omit(i.report,"joins")).$promise.then(function(){t.success({title:"Report updated!",msg:i.report.name?i.report.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETreport",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.previewReport=function(){i.columns=[],i.rows=[],i.error=!1,n.analyticFieldReport.get({fields:"field,alias",nolimit:!0,CustomReportId:i.report.id}).$promise.then(function(e){return i.columns=e?e.rows:[],n.analyticCustomReport.preview({id:i.report.id}).$promise}).then(function(e){i.rows=e}).catch(function(e){console.log(e),i.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},t.error(i.error)})},i.queryReport=function(){return i.queryResult="Loading...",n.analyticCustomReport.query({id:i.report.id}).$promise.then(function(e){i.queryResult=e.sql}).catch(function(e){i.queryResult="",console.log(e),i.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},t.error(i.error)})},i.mapArray=function(e,t){if(o(e))return _.map(e,t).join(",");return""},i.isArray=o,i.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t}}e.$inject=["$state","toasty","api","report"],angular.module("app.analytics").controller("ReportController",e)}(),function(){"use strict";function e(e,t,n,a,i,o){var s=this;s.errors=[],s.report=angular.copy(a),s.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t},s.closeDialog=function(){t.hide()},function(){s.columns=[],s.rows=[],s.error=!1;var e={fields:"field,alias",nolimit:!0};e["analyticCustomReport"===o?"CustomReportId":"DefaultReportId"]=s.report.id,s.promise=i.analyticFieldReport.get(e).$promise.then(function(e){return s.columns=e?e.rows:[],i[o].preview({id:s.report.id}).$promise}).then(function(e){s.rows=e}).catch(function(e){console.log(e),s.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},n.error(s.error)})}()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName"],angular.module("app.analytics").controller("PreviewReportDialogController",e)}(),function(){"use strict";function e(e,n,a,i,o,s,t,r,l,d,c){var m=this;m.currentUser=c.getCurrentUser(),m.reports={count:0,rows:[]},m.selectedReports=[],m.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},m.apiName=null,m.currentPath="",m.customTree=!0,m.editstate=function(e,t){o.go("app.analytics.reports.edit",{id:e.id})},m.copydialog=function(e,t){i.show({controller:"CopyReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/copy/dialog.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{report:e,apiName:m.apiName,treeCustomData:m.treeCustomInstance.jstree(!0).get_json("#")}}).finally(function(){})},m.previewdialog=function(e,t){i.show({controller:"PreviewReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/preview/dialog.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{report:e,apiName:m.apiName}})},m.rundialog=function(e,t){i.show({controller:"RunReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/dialog.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{report:e,apiName:m.apiName,currentPath:m.currentPath}})},m.downloadfile=function(a,e){var i;r.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise.then(function(e){i=_.keyBy(e.rows,"id");var t={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return t["analyticCustomReport"===m.apiName?"CustomReportId":"DefaultReportId"]=a.id,r.analyticFieldReport.get(t).$promise}).then(function(e){for(var t=0;t<e.rows.length;t+=1)e.rows[t].MetricId&&(e.rows[t].field=i[e.rows[t].MetricId].metric,e.rows[t].custom=!0),delete e.rows[t].MetricId;var n=s.document.createElement("a");n.href="data:text/json;charset=utf-8,"+s.encodeURIComponent(angular.toJson({name:a.name,description:a.description,table:a.table,conditions:a.conditions,joins:a.joins,fields:e.rows})),n.download=a.name+".json",n.target="_self",n.click(),d.success({title:"Report downloaded!",msg:a.name?a.name+" has been downloaded!":""})}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DOWNLOADJSON",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the report?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete report").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){h(e)},function(){console.log("CANCEL")})},m.success=g,m.getReports=v,m.createOrEditReport=function(e,t){i.show({controller:"CreateOrEditReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:t,reports:m.reports.rows,apiName:m.apiName,currentNode:m.currentNode,setting:null}})},m.importReport=function(e,t,n){if("application/json"===e.file.type){var a=new FileReader;a.onload=function(e){console.log(e.target.result);try{var n=atob(e.target.result.split(",")[1]);n=angular.fromJson(n),r.analyticCustomReport.save({name:n.name,description:n.description,table:n.table,conditions:n.conditions,joins:n.joins,parent:m.currentNode.id}).$promise.then(function(t){m.reports.rows.unshift(t),d.success({title:"Report saved!",msg:t.name?t.name+" has been saved!":""});var e=_.map(n.fields,function(e){return _.extend({},e,{CustomReportId:t.id})});return r.analyticFieldReport.bulkCreate(e).$promise}).then(function(e){d.success({title:"Fields saved!",msg:"Fields has been saved!"})}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETanalyticReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}catch(e){console.error(e),d.error({title:"Decode File Error",msg:e.toString()})}},a.readAsDataURL(e.file)}else d.error({title:"Format Error",msg:"Please use only json files"})},m.deleteReport=h,m.exportSelectedReports=function(){var e=angular.copy(m.selectedReports);return m.selectedReports=[],e},m.deleteSelectedReports=function(e){var t=i.confirm().title("Are you sure want to delete the selected reports?").htmlContent("<b>"+m.selectedReports.length+" selected</b> will be deleted.").ariaLabel("delete Reports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){m.selectedReports.forEach(function(e){h(e)}),m.selectedReports=[]})},m.deselectReports=function(){m.selectedReports=[]},m.selectAllReports=function(){m.selectedReports=m.reports.rows},m.treeDefaultData=l.rows[0]?angular.fromJson(l.rows[0].tree):[],m.treeCustomData=l.rows[1]?angular.fromJson(l.rows[1].tree):[],m.treeDefaultConfig=E(!1),m.treeCustomConfig=E(!0),m.treeDefaultEvents=y(!1),m.treeCustomEvents=y(!0);var u=!0,p=1;function g(e){m.reports=e||{count:0,rows:[]}}function v(){m.query.offset=(m.query.page-1)*m.query.limit,m.apiName&&(m.promise=r[m.apiName].get(m.query,g).$promise)}function h(e){m.apiName&&r[m.apiName].delete({id:e.id}).$promise.then(function(){_.remove(m.reports.rows,{id:e.id}),m.reports.count-=1,m.reports.rows.length||m.getReports(),d.success({title:"Report deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticreport.delete"}];for(var t=0;t<e.data.errors.length;t++)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticreport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function b(e,t){m.treeDefaultInstance.jstree(!0).deselect_all(),m.treeDefaultInstance.jstree(!0).close_all(),m.currentNode=t.node,m.currentNode.custom=!0,m.currentPath=m.treeCustomInstance.jstree(!0).get_path(m.currentNode).join("/ "),m.apiName="analyticCustomReport",m.query.parent=t.node.id,v()}function f(e,t){m.treeCustomInstance.jstree(!0).deselect_all(),m.treeCustomInstance.jstree(!0).close_all(),m.currentNode=t.node,m.currentNode.custom=!1,m.currentPath=m.treeDefaultInstance.jstree(!0).get_path(m.currentNode).join("/ "),m.apiName="analyticDefaultReport",m.query.parent=t.node.id,v()}function A(e,t){var n=angular.toJson(m.treeCustomInstance.jstree(!0).get_json("#"));r.analyticTreeReport.update({id:2,tree:n}).$promise.then(function(){l.rows[1]&&(l.rows[1].tree=n),d.success({title:"Node Updated",msg:t.node.text?t.node.text+" has been updated!":"Node has been updated!"})}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEanalyticTreeReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}function E(e){return{core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:e?["contextmenu","dnd","search","state","wholerow"]:["search","state","wholerow"],contextmenu:{items:function(n){return{create:{label:t.instant("ANALYTICS.CREATE"),action:function(){n=m.treeCustomInstance.jstree(!0).create_node(n),m.treeCustomInstance.jstree(!0).edit(n)}},rename:{_disabled:"#"===n.parent,label:t.instant("ANALYTICS.RENAME"),action:function(){m.treeCustomInstance.jstree(!0).edit(n)}},remove:{_disabled:"#"===n.parent||"admin"!==m.currentUser.role&&0!==m.currentUser.crudPermissions,label:t.instant("ANALYTICS.REMOVE"),action:function(){var e=i.confirm().title("Are you sure want to delete the node?").htmlContent("<b>"+(n.text?n.text:"Node")+"</b> and its subnode will be deleted.").ariaLabel("delete node").ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,t=m.treeCustomInstance.jstree(!0).get_parent(n);t=m.treeCustomInstance.jstree(!0).get_node(t),m.treeCustomInstance.jstree(!0).delete_node(n),e=[n.id].concat(n.children_d||[]),r.analyticCustomReport.get({parent:e.join(","),fields:"id,name"}).$promise.then(function(e){e&&e.rows&&e.rows.forEach(function(e){h(e)})}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEreportsByParents",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.treeCustomInstance.jstree(!0).select_node(t)})}}}}}}}function y(e){return e?{create_node:A,rename_node:A,move_node:A,delete_node:A,select_node:b}:{select_node:f}}e.$watch("vm.query.filter",function(e,t){u?n(function(){u=!1}):(t||(p=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=p),m.getReports())}),e.$watch("vm.search",function(e,t){m.treeDefaultInstance&&m.treeDefaultInstance.jstree(!0).search(e),m.treeCustomInstance&&m.treeCustomInstance.jstree(!0).search(e)})}e.$inject=["$scope","$timeout","$document","$mdDialog","$state","$window","$translate","api","treeReports","toasty","Auth"],angular.module("app.analytics").controller("ReportsController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){l.export={id:l.report.id,name:l.report.name,startDate:new Date(moment().startOf("day")),endDate:new Date(moment().endOf("day")),output:"xlsx",fullPath:r?r+"/"+l.report.name:l.report.name}}function c(){n.hide()}l.errors=[],l.report=angular.copy(t),l.export={},l.runReport=function(t){l.errors=[],l.exportDate=_.assign({},l.export,{startDate:moment(l.export.startDate).format("YYYY-MM-DD HH:mm:ss"),endDate:moment(l.export.endDate).format("YYYY-MM-DD HH:mm:ss")}),i[o].run(l.exportDate).$promise.then(function(e){"web"===l.export.output?n.show({controller:"WebReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/web/dialog.html",parent:angular.element(s.body),targetEvent:t,skipHide:!0,locals:{apiName:o,exportDate:l.exportDate,results:e},resolve:{columns:["apiResolver",function(e){var t={fields:"field,alias",nolimit:!0};return t["analyticCustomReport"===o?"CustomReportId":"DefaultReportId"]=l.report.id,e.resolve("analyticFieldReport@get",t)}]}}):(a.success({title:"Report properly run!",msg:l.report.name?l.report.name+" has been run!":""}),c())}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.closeDialog=c,(l.refreshDate=d)()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","$document","currentPath"],angular.module("app.analytics").controller("RunReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s){var r=this;function l(e){r.results=e||{count:0,rows:[]}}r.errors=[],r.columns=a?a.rows:[],r.results=i||{rows:[],count:0},r.query={limit:10,page:1},r.closeDialog=function(){e.hide()},r.getResults=function(){s.offset=(r.query.page-1)*r.query.limit,s.limit=r.query.limit,r.promise=n[o].run(s,l).$promise},r.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t}}e.$inject=["$mdDialog","toasty","api","columns","results","apiName","exportDate"],angular.module("app.analytics").controller("WebReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CALLYSQUARE.EDIT_ODBC",m.odbc=angular.copy(s),m.odbcs=o,m.newOdbc=!1,m.odbc||(m.odbc={},m.title="CALLYSQUARE.NEW_ODBC",m.newOdbc=!0),m.addNewOdbc=function(){m.errors=[],r.squareOdbc.save(m.odbc).$promise.then(function(e){m.odbcs.unshift(e.toJSON()),i.success({title:"Odbc properly created",msg:m.odbc.name?m.odbc.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveOdbc=function(){m.errors=[],r.squareOdbc.update({id:m.odbc.id},m.odbc).$promise.then(function(e){var t=_.find(m.odbcs,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Odbc properly saved!",msg:m.odbc.name?m.odbc.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteOdbc=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The odbc will be deleted.").ariaLabel("Delete Odbc").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.squareOdbc.delete({id:m.odbc.id}).$promise.then(function(){_.remove(m.odbcs,{id:m.odbc.id}),i.success({title:"Odbc properly deleted!",msg:(m.odbc.name||"odbc")+" has been deleted!"}),u(m.odbc)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","odbcs","odbc","api","Auth","license","setting"],angular.module("app.callysquare").controller("CreateOrEditOdbcDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.odbcs=r||{count:0,rows:[]},v.table="odbcs",v.listOrder="",v.listOrderAsc=null,v.selectedODBC=[],v.query={fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{odbc:e,odbcs:v.odbcs.rows,license:v.license,setting:null}})},v.testtestOdbc=function(e,t){return l.squareOdbc.test({id:e.id}).$promise.then(function(){c.success({title:"Square ODBC properly tested",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"Square ODBC properly tested",msg:e.data?JSON.stringify(e.data):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the odbc?").htmlContent("<b>"+(e.name||"odbc")+"</b> will be deleted.").ariaLabel("delete odbc").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getODBC=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.squareOdbc.get(v.query,f).$promise},v.createOrEditOdbc=function(e,t){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{odbc:t,odbcs:v.odbcs.rows,license:v.license,setting:v.setting}})},v.deleteOdbc=A,v.exportSelectedODBC=function(){var e=angular.copy(v.selectedODBC);return v.selectedODBC=[],e},v.deleteSelectedODBC=function(e){var t=i.confirm().title("Are you sure want to delete the selected odbcs?").htmlContent("<b>"+v.selectedODBC.length+" selected</b> will be deleted.").ariaLabel("delete Odbcs").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedODBC.forEach(function(e){A(e)}),v.selectedODBC=[]})},v.deselectODBC=function(){v.selectedODBC=[]},v.selectAllODBC=function(){v.selectedODBC=v.odbcs.rows};var h=!0,b=1;function f(e){v.odbcs=e||{count:0,rows:[]}}function A(e){l.squareOdbc.delete({id:e.id}).$promise.then(function(){_.remove(v.odbcs.rows,{id:e.id}),v.odbcs.count-=1,v.odbcs.rows.length||v.getODBC(),c.success({title:"Odbc deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareOdbc"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareOdbc",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getODBC())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","odbcs","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.callysquare").controller("OdbcsController",e)}(),function(){"use strict";function e(t,n,e,a,i,o,s,r){var l=this;function d(e){t.hide(e)}l.errors=[],l.title="CALLYSQUARE.EDIT_PROJECT",l.project=angular.copy(a),l.newWindow=!0,l.projects=e,l.newProject=!1,l.openFromEditor=o,l.project||(l.project={name:"",description:""},l.title="CALLYSQUARE.NEW_PROJECT",l.newProject=!0),l.addNewProject=function(){l.errors=[],i.squareProject.save(l.project).$promise.then(function(e){l.projects.unshift(e),n.success({title:"Project properly created",msg:l.project.name?l.project.name+" has been created!":""}),d(e),l.openFromEditor&&(l.newWindow?s.open("/callysquare/projects/"+e.id,"_blank"):r.go("app.callysquare.projects.edit",{id:e.id}))}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}];for(var t=0;t<e.data.errors.length;t++)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.saveProject=function(){l.errors=[],i.squareProject.update({id:l.project.id},l.project).$promise.then(function(e){var t=_.find(l.projects,{id:e.id});t&&_.merge(t,e),n.success({title:"Project properly saved!",msg:l.project.name?l.project.name+" has been saved!":""}),d(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}];for(var t=0;t<e.data.errors.length;t++)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.deleteProject=function(){l.errors=[];var e=t.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(event);t.show(e).then(function(){i.squareProject.delete({id:l.project.id}).$promise.then(function(){_.remove(l.projects,{id:l.project.id}),n.success({title:"Project properly deleted!",msg:l.project.name?l.project.name+" has been deleted!":""}),d(l.project)}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.delete"}]})},function(){})},l.closeDialog=d}e.$inject=["$mdDialog","toasty","projects","project","api","openFromEditor","$window","$state"],angular.module("app.callysquare").controller("CreateOrEditSquareProjectDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,o,s,r,l,d,c,m,u,p,g,v,h,b,f,A,E,y,S,T,C){var x,O,w,I,R,N,D=this,L={playback:["file_id"],answer:["timeout"],menu:["file_id","digit","response","retry"],getdigits:["file_id","variable_id","mindigit","maxdigit","retry"],getsecretdigits:["file_id","variable_id","mindigit","maxdigit","hiddendigitsnum","retry"],vswitch:["variable_id"],database:["odbc_id","query"],ext_dial:["trunk_name","phone","timeout"],set:["variable_id"],math:["variable_id"],gotoc:["context","extension","priority"],system:["command"],agi:["command"],gotoif:["condition"],saydigits:["digits"],saynumber:["number"],sayphonetic:["text"],record:["file","timeout"],goal:["goalname"],dial:["sip_id","timeout"],queue:["queue_id","timeout"],callback:["list_id","name","phone","delay"],gotoiftime:["interval_id"],voicemail:["mailbox"],subproject:["project_id"],sendSMS:["sms_account_id","to","sms_text"],sendMail:["account_id","to"],sendFax:["account_id","to","attachment_path"],tts:["text"],ispeechtts:["text","key","speed"],ispeechasr:["key","timeout"],custom_app:["application"],googleasr:["key","timeout"],awspolly:["aws_access_key_id","aws_secret_access_key","tts"],lumenvoxtts:["text"],lumenvoxasr:["grammar"],tildeasr:["appid","appsecret","uri"],login:["findBy"],pause:["findBy","pause_id"],unpause:["findBy"],logout:["findBy"]},M={queue:["file_id"],database:["variable_id"],pause:["pause_id"]},k={sendMail:["to","cc","bcc"],voicemail:["mailbox"]};function U(e,t,n,a){return _.map(e,function(e){return{value:e[t],option:e[n],group:a?e[a]:void 0}})}D.cellName=A.tagName,D.attributes=_.map(A.attributes,function(e){return{name:e.name,value:e.value,defaultValue:M[D.cellName]&&_.includes(M[D.cellName],e.name),required:L[D.cellName]&&_.includes(L[D.cellName],e.name),help:k[D.cellName]&&_.includes(k[D.cellName],e.name)}}),D.values={sip_id:U(r,"id","fullname","role"),trunk_name:U(l,"name","name"),trunk_id:U(l,"id","name"),queue_id:U(d,"id","name"),file_id:U(c,"id","name"),variable_id:U(m,"id","name"),odbc_id:U(u,"id","name"),project_id:U(p,"id","name"),context:U(g,"id","name"),interval_id:(x=v,O="id",w="name",I="IntervalId",R=_.filter(x,function(e){return null===e[I]}),N=[],_.forEach(R,function(t){N.push({value:t[O],option:t[w]});var e=_.filter(x,function(e){return e[I]===t.id});_.forEach(e,function(e){N.push({value:e[O],option:" - "+e[w]})})}),N),account_id:U(h,"id","name"),template_id:U(b,"id","name"),list_id:U(f,"id","name"),sms_account_id:U(T,"id","name"),pause_id:U(C,"id","name"),answer:[{value:"yes",option:"Yes"},{value:"no",option:"No"}],hiddendigitspos:[{value:"first",option:"First"},{value:"last",option:"Last"}],recordingFormat:[{value:"wav",option:"Wav"},{value:"gsm",option:"Gsm"}],intkey:[{value:"#",option:"#"},{value:"*",option:"*"}],beep:[{value:"BEEP",option:"Yes"},{value:"NOBEEP",option:"No"}],model:n,ispeech_asr_language:a,ispeech_tts_language:o,google_tts_language:s,google_asr_language:i,aws_polly_region:S,aws_polly_voice:y,callback_priority:[{option:"Highest",value:4},{option:"High",value:3},{option:"Medium",value:2},{option:"Low",value:1},{option:"Lowest",value:0}],findBy:[{value:"internal",option:"Internal"},{value:"phone",option:"Phone"},{value:"mobile",option:"Mobile"}]},D.closeDialog=function(e){e&&E(D.attributes),t.hide()},D.getMap=U}e.$inject=["$mdDialog","toasty","ispeechAsrModel","ispeechAsrLanguage","googleAsrLanguage","ispeechTtsLanguage","googleTtsLanguage","users","trunks","queues","sounds","variables","databases","projects","contexts","intervals","mailAccounts","templates","lists","cell","saveCallback","awsPollyVoice","awsPollyRegion","smsAccounts","pauses"],angular.module("app.callysquare").controller("MxGraphDialogController",e)}(),function(){"use strict";angular.module("app.callysquare").directive("stringToNumber",function(){return{require:"ngModel",link:function(e,t,n,a){a.$parsers.push(function(e){return""+e}),a.$formatters.push(function(e){return parseFloat(e)})}}})}(),function(){"use strict";angular.module("app.callysquare").factory("ispeechAsrModel",function(){return[{value:"0",option:"Default"},{value:"date",option:"Date"},{value:"usmoney",option:"US Money"},{value:"numbersto9",option:"Numbers to 9"},{value:"numbersto99",option:"Numbers to 99"},{value:"numbersto999",option:"Numbers to 999"},{value:"time",option:"Time"},{value:"phonenumber",option:"Phone number"},{value:"streets",option:"Streets"},{value:"citystate",option:"US City/States"}]}).factory("ispeechAsrLanguage",function(){return[{value:"en-US",option:"English (US)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GB",option:"English (UK)"},{value:"en-AU",option:"English (Australia)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-MX",option:"Spanish (Mexico)"},{value:"it-IT",option:"Italian (Italy) / Finnish (Finland)"},{value:"fr-FR",option:"German (Germany)"},{value:"fr-CA",option:"French (Canada)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ca-ES",option:"Catalan (Catalan)"},{value:"zh-TW",option:"Chinese (Taiwan)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"ko-KR",option:"Korean (Korea)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"nb-NO",option:"Norwegian (Norway)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"zh-CN",option:"Chinese (China)"},{value:"zh-HK",option:"Chinese (Hong Kong)"}]}).factory("ispeechTtsLanguage",function(){return[{value:"usenglishfemale",option:"US English Female"},{value:"usenglishmale",option:"US English Male"},{value:"ukenglishfemale",option:"UK English Female"},{value:"ukenglishmale",option:"UK English Male"},{value:"auenglishfemale",option:"Australian English"},{value:"usspanishfemale",option:"US Spanish Female"},{value:"usspanishmale",option:"US Spanish Male"},{value:"chchinesefemale",option:"Chinese Female"},{value:"chchinesemale",option:"Chinese Male"},{value:"hkchinesefemale",option:"Hong Kong Cantonese Female"},{value:"twchinesefemale",option:"Taiwan Chinese Female"},{value:"jpjapanesefemale",option:"Japanese Female"},{value:"jpjapanesemale",option:"Japanese Male"},{value:"krkoreanfemale",option:"Korean Female"},{value:"krkoreanmale",option:"Korean Male"},{value:"caenglishfemale",option:"Canadian English Female"},{value:"huhungarianfemale",option:"Hungarian Female"},{value:"brportuguesefemale",option:"Brazilian Portuguese Female"},{value:"eurportuguesefemale",option:"European Portuguese Female"},{value:"eurportuguesemale",option:"European Portuguese Male"},{value:"eurspanishfemale",option:"European Spanish Female"},{value:"eurspanishmale",option:"European Spanish Male"},{value:"eurcatalanfemale",option:"European Catalan Female"},{value:"eurczechfemale",option:"European Czech Female"},{value:"eurdanishfemale",option:"European Danish Female"},{value:"eurfinnishfemale",option:"European Finnish Female"},{value:"eurfrenchfemale",option:"European French Female"},{value:"eurfrenchmale",option:"European French Male"},{value:"eurnorwegianfemale",option:"European Norwegian Female"},{value:"eurdutchfemale",option:"European Dutch Female"},{value:"eurpolishfemale",option:"European Polish Female"},{value:"euritalianfemale",option:"European Italian Female"},{value:"euritalianmale",option:"European Italian Male"},{value:"eurturkishfemale",option:"European Turkish Female"},{value:"eurturkishmale",option:"European Turkish Male"},{value:"eurgermanfemale",option:"European German Female"},{value:"eurgermanmale",option:"European German Male"},{value:"rurussianfemale",option:"Russian Female"},{value:"rurussianmale",option:"Russian Male"},{value:"swswedishfemale",option:"Swedish Female"},{value:"cafrenchfemale",option:"Canadian French Female"},{value:"cafrenchmale",option:"Canadian French Male"}]}).factory("googleTtsLanguage",function(){return[{value:"af",option:"Afrikaans"},{value:"sq",option:"Albanian"},{value:"am",option:"Amharic"},{value:"ar",option:"Arabic"},{value:"hy",option:"Armenian"},{value:"az",option:"Azerbaijani"},{value:"eu",option:"Basque"},{value:"be",option:"Belarusian"},{value:"bn",option:"Bengali"},{value:"bh",option:"Bihari"},{value:"bs",option:"Bosnian"},{value:"br",option:"Breton"},{value:"bg",option:"Bulgarian"},{value:"km",option:"Cambodian"},{value:"ca",option:"Catalan"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-TW",option:"Chinese (Traditional)"},{value:"co",option:"Corsican"},{value:"hr",option:"Croatian"},{value:"cs",option:"Czech"},{value:"da",option:"Danish"},{value:"nl",option:"Dutch"},{value:"en",option:"English"},{value:"eo",option:"Esperanto"},{value:"et",option:"Estonian"},{value:"fo",option:"Faroese"},{value:"tl",option:"Filipino"},{value:"fi",option:"Finnish"},{value:"fr",option:"French"},{value:"fy",option:"Frisian"},{value:"gl",option:"Galician"},{value:"ka",option:"Georgian"},{value:"de",option:"German"},{value:"el",option:"Greek"},{value:"gn",option:"Guarani"},{value:"gu",option:"Gujarati"},{value:"xx-hacker",option:"Hacker"},{value:"ha",option:"Hausa"},{value:"iw",option:"Hebrew"},{value:"hi",option:"Hindi"},{value:"hu",option:"Hungarian"},{value:"is",option:"Icelandic"},{value:"id",option:"Indonesian"},{value:"ia",option:"Interlingua"},{value:"ga",option:"Irish"},{value:"it",option:"Italian"},{value:"jw",option:"Javanese"},{value:"ja",option:"Japanese"},{value:"kn",option:"Kannada"},{value:"kk",option:"Kazakh"},{value:"rw",option:"Kinyarwanda"},{value:"rn",option:"Kirundi"},{value:"xx-klingon",option:"Klingon"},{value:"ku",option:"Kurdish"},{value:"ko",option:"Korean"},{value:"ky",option:"Kyrgyz"},{value:"lo",option:"Laothian"},{value:"la",option:"Latin"},{value:"lv",option:"Latvian"},{value:"ln",option:"Lingala"},{value:"lt",option:"Lithuanian"},{value:"mk",option:"Macedonian"},{value:"mg",option:"Malagasy"},{value:"ml",option:"Malayalam"},{value:"mt",option:"Maltese"},{value:"mi",option:"Maori"},{value:"mr",option:"Marathi"},{value:"mo",option:"Moldavian"},{value:"mn",option:"Mongolian"},{value:"sr-ME",option:"Montenegrin"},{value:"ne",option:"Nepali"},{value:"no",option:"Norwegian"},{value:"nn",option:"Norwegian (Nynorsk)"},{value:"oc",option:"Occitan"},{value:"or",option:"Oriya"},{value:"om",option:"Oromo"},{value:"ps",option:"Pashto"},{value:"fa",option:"Persian"},{value:"xx-pirate",option:"Pirate"},{value:"pl",option:"Polish"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"pa",option:"Punjabi"},{value:"qu",option:"Quechua"},{value:"ro",option:"Romanian"},{value:"rm",option:"Romansh"},{value:"ru",option:"Russian"},{value:"gd",option:"Scots Gaelic"},{value:"sr",option:"Serbian"},{value:"sh",option:"Serbo-Croatian"},{value:"st",option:"Sesotho"},{value:"sn",option:"Shona"},{value:"sd",option:"Sindhi"},{value:"si",option:"Sinhalese"},{value:"sk",option:"Slovak"},{value:"sl",option:"Slovenian"},{value:"so",option:"Somali"},{value:"es",option:"Spanish"},{value:"su",option:"Sundanese"},{value:"sw",option:"Swahili"},{value:"sv",option:"Swedish"},{value:"tg",option:"Tajik"},{value:"ta",option:"Tamil"},{value:"tt",option:"Tatar"},{value:"te",option:"Telugu"},{value:"th",option:"Thai"},{value:"ti",option:"Tigrinya"},{value:"to",option:"Tonga"},{value:"tr",option:"Turkish"},{value:"tk",option:"Turkmen"},{value:"tw",option:"Twi"},{value:"ug",option:"Uighur"},{value:"uk",option:"Ukrainian"},{value:"ur",option:"Urdu"},{value:"uz",option:"Uzbek"},{value:"vi",option:"Vietnamese"},{value:"cy",option:"Welsh"},{value:"xh",option:"Xhosa"},{value:"yi",option:"Yiddish"},{value:"yo",option:"Yoruba"},{value:"zu",option:"Zulu"}]}).factory("googleAsrLanguage",function(){return[{value:"af-ZA",option:"Afrikaans (South Africa)"},{value:"am-ET",option:"Amharic (Ethiopia)"},{value:"hy-AM",option:"Armenian (Armenia)"},{value:"az-AZ",option:"Azerbaijani (Azerbaijan)"},{value:"id-ID",option:"Indonesian (Indonesia)"},{value:"ms-MY",option:"Malay (Malaysia)"},{value:"bn-BD",option:"Bengali (Bangladesh)"},{value:"bn-IN",option:"Bengali (India)"},{value:"ca-ES",option:"Catalan (Spain)"},{value:"cs-CZ",option:"Czech (Czech Republic)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"de-DE",option:"German (Germany)"},{value:"en-AU",option:"English (Australia)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GH",option:"English (Ghana)"},{value:"en-GB",option:"English (United Kingdom)"},{value:"en-IN",option:"English (India)"},{value:"en-IE",option:"English (Ireland)"},{value:"en-KE",option:"English (Kenya)"},{value:"en-NZ",option:"English (New Zealand)"},{value:"en-NG",option:"English (Nigeria)"},{value:"en-PH",option:"English (Philippines)"},{value:"en-ZA",option:"English (South Africa)"},{value:"en-TZ",option:"English (Tanzania)"},{value:"en-US",option:"English (United States)"},{value:"es-AR",option:"Spanish (Argentina)"},{value:"es-BO",option:"Spanish (Bolivia)"},{value:"es-CL",option:"Spanish (Chile)"},{value:"es-CO",option:"Spanish (Colombia)"},{value:"es-CR",option:"Spanish (Costa Rica)"},{value:"es-EC",option:"Spanish (Ecuador)"},{value:"es-SV",option:"Spanish (El Salvador)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-US",option:"Spanish (United States)"},{value:"es-GT",option:"Spanish (Guatemala)"},{value:"es-HN",option:"Spanish (Honduras)"},{value:"es-MX",option:"Spanish (Mexico)"},{value:"es-NI",option:"Spanish (Nicaragua)"},{value:"es-PA",option:"Spanish (Panama)"},{value:"es-PY",option:"Spanish (Paraguay)"},{value:"es-PE",option:"Spanish (Peru)"},{value:"es-PR",option:"Spanish (Puerto Rico)"},{value:"es-DO",option:"Spanish (Dominican Republic)"},{value:"es-UY",option:"Spanish (Uruguay)"},{value:"es-VE",option:"Spanish (Venezuela)"},{value:"eu-ES",option:"Basque (Spain)"},{value:"fil-PH",option:"Filipino (Philippines)"},{value:"fr-CA",option:"French (Canada)"},{value:"fr-FR",option:"French (France)"},{value:"gl-ES",option:"Galician (Spain)"},{value:"ka-GE",option:"Georgian (Georgia)"},{value:"gu-IN",option:"Gujarati (India)"},{value:"hr-HR",option:"Croatian (Croatia)"},{value:"zu-ZA",option:"Zulu (South Africa)"},{value:"is-IS",option:"Icelandic (Iceland)"},{value:"it-IT",option:"Italian (Italy)"},{value:"jv-ID",option:"Javanese (Indonesia)"},{value:"kn-IN",option:"Kannada (India)"},{value:"km-KH",option:"Khmer (Cambodia)"},{value:"lo-LA",option:"Lao (Laos)"},{value:"lv-LV",option:"Latvian (Latvia)"},{value:"lt-LT",option:"Lithuanian (Lithuania)"},{value:"hu-HU",option:"Hungarian (Hungary)"},{value:"ml-IN",option:"Malayalam (India)"},{value:"mr-IN",option:"Marathi (India)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"ne-NP",option:"Nepali (Nepal)"},{value:"nb-NO",option:"Norwegian Bokmal (Norway)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ro-RO",option:"Romanian (Romania)"},{value:"si-LK",option:"Sinhala (Srilanka)"},{value:"sk-SK",option:"Slovak (Slovakia)"},{value:"sl-SI",option:"Slovenian (Slovenia)"},{value:"su-ID",option:"Sundanese (Indonesia)"},{value:"sw-TZ",option:"Swahili (Tanzania)"},{value:"sw-KE",option:"Swahili (Kenya)"},{value:"fi-FI",option:"Finnish (Finland)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"ta-IN",option:"Tamil (India)"},{value:"ta-SG",option:"Tamil (Singapore)"},{value:"ta-LK",option:"Tamil (Sri Lanka)"},{value:"ta-MY",option:"Tamil (Malaysia)"},{value:"te-IN",option:"Telugu (India)"},{value:"vi-VN",option:"Vietnamese (Vietnam)"},{value:"tr-TR",option:"Turkish (Turkey)"},{value:"ur-PK",option:"Urdu (Pakistan)"},{value:"ur-IN",option:"Urdu (India)"},{value:"el-GR",option:"Greek (Greece)"},{value:"bg-BG",option:"Bulgarian (Bulgaria)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sr-RS",option:"Serbian (Serbia)"},{value:"uk-UA",option:"Ukrainian (Ukraine)"},{value:"he-IL",option:"Hebrew (Israel)"},{value:"ar-IL",option:"Arabic (Israel)"},{value:"ar-JO",option:"Arabic (Jordan)"},{value:"ar-AE",option:"Arabic (United Arab Emirates)"},{value:"ar-BH",option:"Arabic (Bahrain)"},{value:"ar-DZ",option:"Arabic (Algeria)"},{value:"ar-SA",option:"Arabic (Saudi Arabia)"},{value:"ar-IQ",option:"Arabic (Iraq)"},{value:"ar-KW",option:"Arabic (Kuwait)"},{value:"ar-MA",option:"Arabic (Morocco)"},{value:"ar-TN",option:"Arabic (Tunisia)"},{value:"ar-OM",option:"Arabic (Oman)"},{value:"ar-PS",option:"Arabic (State of Palestine)"},{value:"ar-QA",option:"Arabic (Qatar)"},{value:"ar-LB",option:"Arabic (Lebanon)"},{value:"ar-EG",option:"Arabic (Egypt)"},{value:"fa-IR",option:"Persian (Iran)"},{value:"hi-IN",option:"Hindi (India)"},{value:"th-TH",option:"Thai (Thailand)"},{value:"ko-KR",option:"Korean (South Korea)"},{value:"cmn-Hant-TW",option:"Chinese, Mandarin (Traditional, Taiwan)"},{value:"yue-Hant-HK",option:"Chinese, Cantonese (Traditional, Hong Kong)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"cmn-Hans-HK",option:"Chinese, Mandarin (Simplified, Hong Kong)"},{value:"cmn-Hans-CN",option:"Chinese, Mandarin (Simplified, China)"}]}).factory("awsPollyVoice",function(){return[{value:"Amy",option:"Amy (English, British, Female)"},{value:"Astrid",option:"Astrid (Swedish, Female)"},{value:"Brian",option:"Brian (English, British, Male)"},{value:"Carla",option:"Carla (Italian, Female)"},{value:"Carmen",option:"Carmen (Romanian, Female)"},{value:"Celine",option:"Celine (French, Female)"},{value:"Chantal",option:"Chantal (French, Canadian, Female)"},{value:"Conchita",option:"Conchita (Spanish, Castilian, Female)"},{value:"Cristiano",option:"Cristiano (Portuguese, Male)"},{value:"Dora",option:"Dora (Icelandic, Female)"},{value:"Emma",option:"Emma (English, British, Female)"},{value:"Enrique",option:"Enrique (Spanish, Castilian, Male)"},{value:"Ewa",option:"Ewa (Polish, Female)"},{value:"Filiz",option:"Filiz (Turkish, Female)"},{value:"Geraint",option:"Geraint (English, Welsh, Male)"},{value:"Giorgio",option:"Giorgio (Italian, Male)"},{value:"Gwineth",option:"Gwineth (Welsh, Female)"},{value:"Hans",option:"Hans (German, Male)"},{value:"Ines",option:"Ines (Portuguese, Female)"},{value:"Ivy",option:"Ivy (English, US, Female)"},{value:"Jacek",option:"Jacek (Polish, Male)"},{value:"Jan",option:"Jan (Polish, Male)"},{value:"Joanna",option:"Joanna (English, US, Female)"},{value:"Joey",option:"Joey (English, US, Male)"},{value:"Justin",option:"Justin (English, US, Male)"},{value:"Karl",option:"Karl (Icelandic, Male)"},{value:"Kendra",option:"Kendra (English, US, Female)"},{value:"Kimberly",option:"Kimberly (English, US, Female)"},{value:"Liv",option:"Liv (Norwegian, Female)"},{value:"Lotte",option:"Lotte (Dutch, Female)"},{value:"Mads",option:"Mads (Danish, Male)"},{value:"Maja",option:"Maja (Polish, Female)"},{value:"Marlene",option:"Marlene (German, Female)"},{value:"Mathieu",option:"Mathieu (French, Male)"},{value:"Maxim",option:"Maxim (Russian, Male)"},{value:"Miguel",option:"Miguel (Spanish, US, Male)"},{value:"Mizuki",option:"Mizuki (Japanese, Female)"},{value:"Naja",option:"Naja (Danish, Female)"},{value:"Nicole",option:"Nicole (English, Austrialian, Female)"},{value:"Penelope",option:"Penelope (Spanish, US, Female)"},{value:"Raveena",option:"Raveena (English, Indian, Female)"},{value:"Ricardo",option:"Ricardo (Portuguese, Brazilian, Male)"},{value:"Ruben",option:"Ruben (Dutch, Male)"},{value:"Russell",option:"Russell (English, Austrialian, Male)"},{value:"Salli",option:"Salli (English, US, Female)"},{value:"Tatyana",option:"Tatyana (Russian, Female)"},{value:"Vitoria",option:"Vitoria (Portuguese, Brazilian, Female)"}]}).factory("awsPollyRegion",function(){return[{value:"us-east-1",option:"US East (N. Virginia)"},{value:"us-east-2",option:"US East (Ohio)"},{value:"us-west-1",option:"US West (N. California)"},{value:"us-west-2",option:"US West (Oregon)"},{value:"ca-central-1",option:"Canada (Central)"},{value:"eu-west-1",option:"EU (Ireland)"},{value:"eu-central-1",option:"EU (Frankfurt)"},{value:"eu-west-2",option:"EU (London)"},{value:"eu-west-3",option:"EU (Paris)"},{value:"ap-southeast-1",option:"Asia Pacific (Singapore)"},{value:"ap-southeast-2",option:"Asia Pacific (Sydney)"},{value:"ap-northeast-2",option:"Asia Pacific (Seoul)"},{value:"ap-northeast-1",option:"Asia Pacific (Tokyo)"},{value:"ap-south-1",option:"Asia Pacific (Mumbai)"},{value:"sa-east-1",option:"South America (São Paulo)"}]})}(),function(){"use strict";function e(t,e,n,a){var i=this;i.project={preproduction:n},i.closeDialog=function(e){e?(a(i.project.preproduction),t.hide(i.project.preproduction)):t.hide()}}e.$inject=["$mdDialog","toasty","currentXML","saveCallback"],angular.module("app.callysquare").controller("MxGraphEditXMLController",e)}(),function(){"use strict";function e(t,n){var a=this;function i(e){e?(n(e),t.hide(e)):t.hide()}a.errors=[],a.ngFlowOptions={chunkSize:5242880,maxChunkRetries:1,singleFile:!0,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},a.ngFlow={flow:{}},a.dropping=!1,a.closeDialog=i,a.fileAdded=function(e){a.errors=[],"text/xml"!==e.file.type&&a.errors.push({message:"The format "+e.file.type+" is not supported!"});5242880<e.file.size&&a.errors.push({message:"The file is too big. Max 5MB files are supported!"});if(!a.errors.length){var t=new FileReader;t.onload=function(e){i(e.target.result)},t.readAsText(e.file)}}}e.$inject=["$mdDialog","saveCallback"],angular.module("app.callysquare").controller("MxGraphImportXMLController",e)}(),function(){"use strict";function e(t,n,e,a){var i=this;i.project=_.clone(e),i.closeDialog=function(){t.hide()},i.save=function(){i.errors=[],a.squareProject.update({id:i.project.id},{notes:i.project.notes,description:i.project.description}).$promise.then(function(e){n.success({title:"Project updated!",msg:i.project.name?i.project.name+" has been updated!":""}),t.hide(e)}).catch(function(e){console.error(e),i.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}]})}}e.$inject=["$mdDialog","toasty","project","api"],angular.module("app.callysquare").controller("MxGraphUpdateInfoController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;o.projects=n,o.id="",o.newWindow=!0,o.closeDialog=function(e){o.errors=[],e?(t.hide(),o.newWindow?a.open("/callysquare/projects/"+o.id,"_blank"):i.go("app.callysquare.projects.edit",{id:o.id})):t.hide()}}e.$inject=["$mdDialog","toasty","projects","$window","$state"],angular.module("app.callysquare").controller("MxGraphOpenProjectController",e)}(),function(){"use strict";function e(t,n,e,a,i,o,s){var r=this;r.project=angular.copy(e),r.project.name+="_new",r.project.preproduction=a,r.newWindow=!0,r.closeDialog=function(){t.hide()},r.save=function(){delete r.project.id,i.squareProject.save(r.project).$promise.then(function(e){n.success({title:"Project properly created",msg:r.project.name?r.project.name+" has been created!":""}),t.hide(e),r.newWindow?o.open("/callysquare/projects/"+e.id,"_blank"):s.go("app.callysquare.projects.edit",{id:e.id})}).catch(function(e){console.error(e),r.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}]})}}e.$inject=["$mdDialog","toasty","project","currentXML","api","$window","$state"],angular.module("app.callysquare").controller("MxGraphSaveProjectAsController",e)}(),function(){"use strict";function e(e,n,a,i,o,t,s,r,l,d,c,m,u,p,g,v,h,b,f,A,E){var y=this;y.project=t||{},y.saveOrPublishProject=function(e,t){var n={preproduction:e};t&&(n.production=e);o.squareProject.update({id:y.project.id},n).$promise.then(function(e){i.success({title:"Project "+(t?"published":"saved")+"!",msg:y.project.name?y.project.name+" has been "+(t?"published":"saved")+"!":""}),y.project.preproduction=e.preproduction}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsquareProject",msg:e.data?JSON.stringify(e.data):e.toString()})})},y.$onInit=function(){new EditorUi(y,new Editor,document.getElementById("geEditor")).openString(y.project.preproduction,y.project.name,y.project)},y.openDialog=function(e,t){a.show({controller:"MxGraphDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{users:s.rows||[],trunks:r.rows||[],queues:l.rows||[],sounds:d.rows||[],variables:c.rows||[],databases:m.rows||[],contexts:u.rows||[],projects:p.rows||[],intervals:g.rows||[],mailAccounts:v.rows||[],smsAccounts:f.rows||[],pauses:A.rows||[],templates:h.rows||[],lists:b.rows||[],cell:e,saveCallback:t}})},y.newProject=function(e){a.show({controller:"CreateOrEditProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{project:e,projects:p.rows,openFromEditor:!0,setting:null}})},y.openProject=function(){a.show({controller:"MxGraphOpenProjectController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/open/open.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{projects:p.rows||[]}})},y.saveProjectAs=function(e){a.show({controller:"MxGraphSaveProjectAsController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{project:y.project,currentXML:e}}).then(function(e){e&&p.rows.push(e)})},y.newVariable=function(e){a.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{variable:e,variables:c.rows,license:null,setting:null}})},y.updateInfo=function(e){a.show({controller:"MxGraphUpdateInfoController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/info/info.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:y.project}}).then(function(e){e&&_.merge(y.project,e)})},y.editXML=function(e,t){a.show({controller:"MxGraphEditXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/edit/edit.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{currentXML:e,saveCallback:t}}).then(function(e){e&&(y.project.preproduction=e)})},y.importXML=function(e){a.show({controller:"MxGraphImportXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/import/import.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{saveCallback:e}}).then(function(e){e&&(y.project.preproduction=e)})},y.gotoProjects=function(){e.go("app.callysquare.projects")}}e.$inject=["$state","$document","$mdDialog","toasty","api","project","users","trunks","queues","sounds","variables","databases","contexts","projects","intervals","mailAccounts","templates","lists","smsAccounts","pauses","$window"],angular.module("app.callysquare").controller("ProjectController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d,c){var m=this;m.currentUser=c.getCurrentUser(),m.projects=a||{count:0,rows:[]},m.table="projects",m.listOrder="",m.listOrderAsc=null,m.selectedProjects=[],m.query={fields:"id,name,description,notes",sort:"-updatedAt",limit:10,page:1},m.editstate=function(e,t){n.go("app.callysquare.projects.edit",{id:e.id})},m.deleteconfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the project?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete project").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){v(e)},function(){console.log("CANCEL")})},m.success=g,m.getProjects=function(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=i.squareProject.get(m.query,g).$promise},m.createOrEditProject=function(e,t){s.show({controller:"CreateOrEditSquareProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:t,projects:m.projects.rows,openFromEditor:null,setting:null}})},m.deleteProject=v,m.exportSelectedProjects=function(){var e=angular.copy(m.selectedProjects);return m.selectedProjects=[],e},m.deleteSelectedProjects=function(e){var t=s.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+m.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){m.selectedProjects.forEach(function(e){v(e)}),m.selectedProjects=[]})},m.deselectProjects=function(){m.selectedProjects=[]},m.selectAllProjects=function(){m.selectedProjects=m.projects.rows};var u=!0,p=1;function g(e){m.projects=e||{count:0,rows:[]}}function v(e){i.squareProject.delete({id:e.id}).$promise.then(function(){_.remove(m.projects.rows,{id:e.id}),m.projects.count-=1,m.projects.rows.length||m.getProjects(),d.success({title:"Project deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.project.delete"}];for(var t=0;t<e.data.errors.length;t++)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.project.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){u?l(function(){u=!1}):(t||(p=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=p),m.getProjects())})}e.$inject=["$scope","$state","$mdSidenav","projects","api","msUtils","$mdDialog","$document","$timeout","toasty","Auth"],angular.module("app.callysquare").controller("ProjectsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CALLYSQUARE.EDIT_SQUARERECORDING",m.squareRecording=angular.copy(s),m.squareRecordings=o,m.newSquareRecording=!1,m.squareRecording||(m.squareRecording={},m.title="CALLYSQUARE.NEW_SQUARERECORDING",m.newSquareRecording=!0),m.addNewSquareRecording=function(){m.errors=[],r.squareRecording.save(m.squareRecording).$promise.then(function(e){m.squareRecordings.unshift(e.toJSON()),i.success({title:"SquareRecording properly created",msg:m.squareRecording.name?m.squareRecording.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSquareRecording=function(){m.errors=[],r.squareRecording.update({id:m.squareRecording.id},m.squareRecording).$promise.then(function(e){var t=_.find(m.squareRecordings,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SquareRecording properly saved!",msg:m.squareRecording.name?m.squareRecording.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSquareRecording=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The squareRecording will be deleted.").ariaLabel("Delete SquareRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.squareRecording.delete({id:m.squareRecording.id}).$promise.then(function(){_.remove(m.squareRecordings,{id:m.squareRecording.id}),i.success({title:"SquareRecording properly deleted!",msg:(m.squareRecording.name||"squareRecording")+" has been deleted!"}),u(m.squareRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","squareRecordings","squareRecording","api","Auth","license","setting"],angular.module("app.callysquare").controller("CreateOrEditSquareRecordingDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.squareRecordings=r||{count:0,rows:[]},v.table="squareRecordings",v.listOrder="",v.listOrderAsc=null,v.selectedSquareRecordings=[],v.query={fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,createdAt",sort:"-updatedAt",limit:10,page:1},v.downloadfile2=function(o,e){return l.squareRecording.download({id:o.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=o.uniqueid+".wav";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the squareRecording?").htmlContent("<b>"+(e.name||"squareRecording")+"</b> will be deleted.").ariaLabel("delete squareRecording").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getSquareRecordings=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.squareRecording.get(v.query,f).$promise},v.createOrEditSquareRecording=function(e,t){i.show({controller:"CreateOrEditSquareRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/squareRecordings/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{squareRecording:t,squareRecordings:v.squareRecordings.rows,license:v.license,setting:v.setting}})},v.deleteSquareRecording=A,v.exportSelectedSquareRecordings=function(){var e=angular.copy(v.selectedSquareRecordings);return v.selectedSquareRecordings=[],e},v.deleteSelectedSquareRecordings=function(e){var t=i.confirm().title("Are you sure want to delete the selected squareRecordings?").htmlContent("<b>"+v.selectedSquareRecordings.length+" selected</b> will be deleted.").ariaLabel("delete SquareRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedSquareRecordings.forEach(function(e){A(e)}),v.selectedSquareRecordings=[]})},v.deselectSquareRecordings=function(){v.selectedSquareRecordings=[]},v.selectAllSquareRecordings=function(){v.selectedSquareRecordings=v.squareRecordings.rows};var h=!0,b=1;function f(e){v.squareRecordings=e||{count:0,rows:[]}}function A(e){l.squareRecording.delete({id:e.id}).$promise.then(function(){_.remove(v.squareRecordings.rows,{id:e.id}),v.squareRecordings.count-=1,v.squareRecordings.rows.length||v.getSquareRecordings(),c.success({title:"SquareRecording deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareRecording"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getSquareRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","squareRecordings","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.callysquare").controller("SquareRecordingsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.chatQueues=r||{count:0,rows:[]},v.table="chatQueues",v.listOrder="",v.listOrderAsc=null,v.selectedChatQueues=[],v.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,page:1},v.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.chat.chatQueues.edit",{id:e.id,chatQueue:e})},v.teamadddialog=function(e,t){i.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:v.chatQueues?v.chatQueues.rows:[]}})},v.agentadddialog=function(e,t){i.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:v.chatQueues?v.chatQueues.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the chatQueue?").htmlContent("<b>"+(e.name||"chatQueue")+"</b> will be deleted.").ariaLabel("delete chatQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.chat.realtime.queues",{})},v.success=f,v.getChatQueues=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.chatQueue.get(v.query,f).$promise},v.createOrEditChatQueue=function(e,t){i.show({controller:"CreateOrEditChatQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:t,chatQueues:v.chatQueues.rows,license:v.license,setting:v.setting}})},v.deleteChatQueue=A,v.exportSelectedChatQueues=function(){var e=angular.copy(v.selectedChatQueues);return v.selectedChatQueues=[],e},v.deleteSelectedChatQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected chatQueues?").htmlContent("<b>"+v.selectedChatQueues.length+" selected</b> will be deleted.").ariaLabel("delete ChatQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedChatQueues.forEach(function(e){A(e)}),v.selectedChatQueues=[]})},v.deselectChatQueues=function(){v.selectedChatQueues=[]},v.selectAllChatQueues=function(){v.selectedChatQueues=v.chatQueues.rows};var h=!0,b=1;function f(e){v.chatQueues=e||{count:0,rows:[]}}function A(e){l.chatQueue.delete({id:e.id}).$promise.then(function(){_.remove(v.chatQueues.rows,{id:e.id}),v.chatQueues.count-=1,v.chatQueues.rows.length||v.getChatQueues(),c.success({title:"ChatQueue deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatQueue"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getChatQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","chatQueues","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.chat").controller("ChatQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CHAT.EDIT_CHATQUEUE",m.chatQueue=angular.copy(s),m.chatQueues=o,m.newChatQueue=!1,m.chatQueue||(m.chatQueue={strategy:"beepall",timeout:10},m.title="CHAT.NEW_CHATQUEUE",m.newChatQueue=!0),m.addNewChatQueue=function(){m.errors=[],r.chatQueue.save(m.chatQueue).$promise.then(function(e){m.chatQueues.unshift(e.toJSON()),i.success({title:"ChatQueue properly created",msg:m.chatQueue.name?m.chatQueue.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveChatQueue=function(){m.errors=[],r.chatQueue.update({id:m.chatQueue.id},m.chatQueue).$promise.then(function(e){var t=_.find(m.chatQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ChatQueue properly saved!",msg:m.chatQueue.name?m.chatQueue.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteChatQueue=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The chatQueue will be deleted.").ariaLabel("Delete ChatQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.chatQueue.delete({id:m.chatQueue.id}).$promise.then(function(){_.remove(m.chatQueues,{id:m.chatQueue.id}),i.success({title:"ChatQueue properly deleted!",msg:(m.chatQueue.name||"chatQueue")+" has been deleted!"}),u(m.chatQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","chatQueues","chatQueue","api","Auth","license","setting"],angular.module("app.chat").controller("CreateOrEditChatQueueDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.chatQueue[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.chatQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserChatQueue?"penalty "+e.UserChatQueue.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserChatQueue?"penalty "+e.UserChatQueue.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.chatQueue=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("CHAT.ALL_AGENTS"),labelSelected:s.instant("CHAT.SELECTED_AGENTS"),transferCallback:function(e,t){a.chatQueue[t?"removeAgents":"addAgents"]({id:l.chatQueue.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"ChatQueue properly "+(t?"removed":"added"),msg:"ChatQueue has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:chatQueue.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","chatQueue","chatQueues","realtime","$translate","Auth"],angular.module("app.chat").controller("ChatQueueagentaddController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.chatQueue=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("CHAT.ALL_TEAMS"),labelSelected:i.instant("CHAT.SELECTED_TEAMS"),transferCallback:function(e,t){a.chatQueue[t?"removeTeams":"addTeams"]({id:o.chatQueue.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:chatQueue.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.chatQueue.getTeams({id:o.chatQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","chatQueue","$translate"],angular.module("app.chat").controller("ChatQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.chatQueue=d||e.params.chatQueue||{},c.selectedTab=e.params.tab||0,c.teamadddialog=function(e,t){n.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:c.chatQueues?c.chatQueues.rows:[]}})},c.agentadddialog=function(e,t){n.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:c.chatQueues?c.chatQueues.rows:[],realtime:!1}})},c.alert=r.info,c.gotoChatQueues=function(){e.go("app.chat.chatQueues")},c.saveChatQueue=function(){s.chatQueue.update({id:c.chatQueue.id},c.chatQueue).$promise.then(function(){r.success({title:"ChatQueue updated!",msg:c.chatQueue.name?c.chatQueue.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","chatQueue"],angular.module("app.chat").controller("ChatQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.chatWebsites=r||{count:0,rows:[]},v.table="chatWebsites",v.listOrder="",v.listOrderAsc=null,v.selectedChatWebsites=[],v.query={fields:"createdAt,updatedAt,id,token,agentIdentifier,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,fontSize,header_shape,showAgentAvatar,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,header_offline,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardTranscript,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,page:1},v.arrayagentIdentifier=_.keyBy([{option:"WebsiteAlias",value:"'website_alias'"},{option:"AgentAlias",value:"'agent_alias'"},{option:"AgentFullname",value:"'agent_fullname'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayheader_shape=_.keyBy([{option:"Rounded",value:"'rounded'"},{option:"Squared",value:"'squared'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayratingType=_.keyBy([{option:"Star",value:"'star'"},{option:"Thumb",value:"'thumb'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayacceptMethod=_.keyBy([{option:"HTTP GET",value:"'GET'"},{option:"HTTP POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayrejectMethod=_.keyBy([{option:"HTTP GET",value:"'GET'"},{option:"HTTP POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraycloseMethod=_.keyBy([{option:"HTTP GET",value:"'GET'"},{option:"HTTP POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.chat.chatWebsites.edit",{id:e.id,chatWebsite:e})},v.interactionsgoto=function(e,t){n.go("app.chat.chatWebsites.edit",{id:e.id,tab:9})},v.offlinemessagesgoto=function(e,t){n.go("app.chat.chatWebsites.edit",{id:e.id,tab:10})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the chatWebsite?").htmlContent("<b>"+(e.name||"chatWebsite")+"</b> will be deleted.").ariaLabel("delete chatWebsite").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getChatWebsites=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.chatWebsite.get(v.query,f).$promise},v.createOrEditChatWebsite=function(e,t){i.show({controller:"CreateOrEditChatWebsiteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:t,chatWebsites:v.chatWebsites.rows,license:v.license,setting:v.setting}})},v.deleteChatWebsite=A,v.exportSelectedChatWebsites=function(){var e=angular.copy(v.selectedChatWebsites);return v.selectedChatWebsites=[],e},v.deleteSelectedChatWebsites=function(e){var t=i.confirm().title("Are you sure want to delete the selected chatWebsites?").htmlContent("<b>"+v.selectedChatWebsites.length+" selected</b> will be deleted.").ariaLabel("delete ChatWebsites").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedChatWebsites.forEach(function(e){A(e)}),v.selectedChatWebsites=[]})},v.deselectChatWebsites=function(){v.selectedChatWebsites=[]},v.selectAllChatWebsites=function(){v.selectedChatWebsites=v.chatWebsites.rows},l.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.lists=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){v.interval=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.chatWebsites=e||{count:0,rows:[]}}function A(e){l.chatWebsite.delete({id:e.id}).$promise.then(function(){_.remove(v.chatWebsites.rows,{id:e.id}),v.chatWebsites.count-=1,v.chatWebsites.rows.length||v.getChatWebsites(),c.success({title:"ChatWebsite deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getChatWebsites())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","chatWebsites","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.chat").controller("ChatWebsitesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CHAT.EDIT_CHATWEBSITE",m.chatWebsite=angular.copy(s),m.chatWebsites=o,m.newChatWebsite=!1,m.chatWebsite||(m.chatWebsite={remote:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():""),header_shape:"rounded",IntervalId:"null",timezone:"null",waitForTheAssignedAgent:10,notificationSound:!0},m.title="CHAT.NEW_CHATWEBSITE",m.newChatWebsite=!0),t.params.id&&(m.chatWebsite.ChatWebsiteId=t.params.id),m.addNewChatWebsite=function(){m.errors=[],r.chatWebsite.save(m.chatWebsite).$promise.then(function(e){m.chatWebsites.unshift(e.toJSON()),i.success({title:"ChatWebsite properly created",msg:m.chatWebsite.name?m.chatWebsite.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveChatWebsite=function(){m.errors=[],r.chatWebsite.update({id:m.chatWebsite.id},m.chatWebsite).$promise.then(function(e){var t=_.find(m.chatWebsites,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ChatWebsite properly saved!",msg:m.chatWebsite.name?m.chatWebsite.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteChatWebsite=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The chatWebsite will be deleted.").ariaLabel("Delete ChatWebsite").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.chatWebsite.delete({id:m.chatWebsite.id}).$promise.then(function(){_.remove(m.chatWebsites,{id:m.chatWebsite.id}),i.success({title:"ChatWebsite properly deleted!",msg:(m.chatWebsite.name||"chatWebsite")+" has been deleted!"}),u(m.chatWebsite)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){m.interval=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","chatWebsites","chatWebsite","api","Auth","license","setting"],angular.module("app.chat").controller("CreateOrEditChatWebsiteDialogController",e)}(),function(){"use strict";function e(s,i,a,o,e){var r=this;function t(e,t){if(r.chatWebsiteApps.rows.length){var n=r.chatWebsiteApps.rows[t]?r.chatWebsiteApps.rows[t]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsiteApp:n,chatWebsite:r.chatWebsite}}).then(function(e){e&&(e.id?r.chatWebsiteApps.rows[t]=e:r.chatWebsiteApps.rows.splice(t,0,e),l())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.chatWebsiteApps.rows.length;n++,0){var a=r.chatWebsiteApps.rows[n],i=[],o=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.chatWebsite.context,a.exten=r.chatWebsite.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(o.length?_.last(o).priority:a.priority)+1,t=_.concat(t,i,[a],o)}s.chatWebsite.addApplications({id:r.chatWebsite.id},_.sortBy(t,"priority")).$promise.then(function(e){r.chatWebsiteApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.chatWebsiteApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.chatWebsite={},r.chatWebsiteApps={count:0,rows:[]},r.selectedChatWebsiteApps=[],r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"ChatQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",route:"chatQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",route:"user",filters:{fields:"id,name",role:"agent",sort:"name",nolimit:!0}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",maxlength:255,required:!0,param:1}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e){r.chatWebsite=e,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getChatWebsiteApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.chatWebsiteApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getChatWebsiteApps=function(){r.promise=s.chatWebsite.getApplications(r.query,n).$promise},r.editChatWebsiteApp=t,r.editInterval=function(e,t){if(r.chatWebsiteApps.rows.length){var n=r.chatWebsiteApps.rows[t]?r.chatWebsiteApps.rows[t]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteChatWebsiteApp=function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id}),l(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedChatWebsiteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedChatWebsiteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedChatWebsiteApps.forEach(function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id})}),r.selectedChatWebsiteApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return s.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.chat").controller("ChatWebsiteActionsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size for image files is 8 Mb"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.chatWebsite=angular.copy(e),i.ngFlowOptions.target="/api/chat/websites/:id/avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsiteagentAvatarController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(e.appType||e.app).toUpperCase(),o.agent=angular.copy(e),o.agent.appdata)switch(o.agent.appType?o.agent.appType.toLowerCase():o.agent.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.agent.appdata.split(",");o.agent.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.agent.text=s.slice(1,s.length).join(",");break;case"message":o.agent.text=o.agent.appdata;break;case"set":o.agent.name=o.agent.appdata.split("=")[0],o.agent.value=o.agent.appdata.split("=")[1];break;case"agi":o.agent.project=o.agent.appdata;break;default:var r=o.agent.appdata.split(",");o.agent.agent=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.agent.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.agent.timeout=30;function l(e){t.hide(e)}o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outbounddial"===o.agent.appType.toLowerCase()&&(o.agent.prefix=o.agent.phone?o.agent.phone.split("$")[0]:void 0,o.agent.callerId=o.agent.callerID?"CALLERID(all)="+o.agent.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outboundDial"===o.agent.appType&&(o.agent.phone=a.cutdigits?(o.agent.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.agent.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.agent.options+="U(xcally-mixmonitor-context)"):o.agent.options=o.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.agents,{name:o.agent.agent});t&&(o.agent.UserId=t.id);if(o.agent.appType&&"custom"===o.agent.appType);else switch((o.agent.app||o.agent.appType).toLowerCase()){case"set":o.agent.appdata=o.agent.name+"="+o.agent.value;break;case"custom":break;default:e[0]=o.agent.agent,e[1]=o.agent.timeout,o.agent.appdata=e.join(",")}l(o.agent)},o.closeDialog=l,i.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){o.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(n.appType||n.app).toUpperCase(),o.autoreply=angular.copy(n),o.autoreply.appdata)switch(o.autoreply.appType?o.autoreply.appType.toLowerCase():o.autoreply.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.autoreply.appdata.split(",");o.autoreply.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.autoreply.text=s.slice(1,s.length).join(",");break;case"message":o.autoreply.text=o.autoreply.appdata;break;case"set":o.autoreply.name=o.autoreply.appdata.split("=")[0],o.autoreply.value=o.autoreply.appdata.split("=")[1];break;case"agi":o.autoreply.project=o.autoreply.appdata;break;default:var r=o.autoreply.appdata.split(",");o.autoreply.times=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.autoreply.text=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.autoreply.times=1;function l(e){t.hide(e)}o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outbounddial"===o.autoreply.appType.toLowerCase()&&(o.autoreply.prefix=o.autoreply.phone?o.autoreply.phone.split("$")[0]:void 0,o.autoreply.callerId=o.autoreply.callerID?"CALLERID(all)="+o.autoreply.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outboundDial"===o.autoreply.appType&&(o.autoreply.phone=a.cutdigits?(o.autoreply.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.autoreply.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.autoreply.options+="U(xcally-mixmonitor-context)"):o.autoreply.options=o.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(o.autoreply.appType&&"custom"===o.autoreply.appType);else switch((o.autoreply.app||o.autoreply.appType).toLowerCase()){case"set":o.autoreply.appdata=o.autoreply.name+"="+o.autoreply.value;break;case"custom":break;default:e[0]=o.autoreply.times,e[1]=o.autoreply.text,o.autoreply.appdata=e.join(",")}l(o.autoreply)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(n.appType||n.app).toUpperCase(),o.close=angular.copy(n),o.close.appdata)switch(o.close.appType?o.close.appType.toLowerCase():o.close.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.close.appdata.split(",");o.close.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.close.text=s.slice(1,s.length).join(",");break;case"message":o.close.text=o.close.appdata;break;case"set":o.close.name=o.close.appdata.split("=")[0],o.close.value=o.close.appdata.split("=")[1];break;case"agi":o.close.project=o.close.appdata;break;default:var r=o.close.appdata.split(",");o.close.disposition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outbounddial"===o.close.appType.toLowerCase()&&(o.close.prefix=o.close.phone?o.close.phone.split("$")[0]:void 0,o.close.callerId=o.close.callerID?"CALLERID(all)="+o.close.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outboundDial"===o.close.appType&&(o.close.phone=a.cutdigits?(o.close.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.close.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.close.options+="U(xcally-mixmonitor-context)"):o.close.options=o.close.options.replace("U(xcally-mixmonitor-context)",""));if(o.close.appType&&"custom"===o.close.appType);else switch((o.close.app||o.close.appType).toLowerCase()){case"set":o.close.appdata=o.close.name+"="+o.close.value;break;case"custom":break;default:e[0]=o.close.disposition,o.close.appdata=e.join(",")}l(o.close)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotoif=angular.copy(n),o.gotoif.appdata)switch(o.gotoif.appType?o.gotoif.appType.toLowerCase():o.gotoif.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotoif.appdata.split(",");o.gotoif.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotoif.text=s.slice(1,s.length).join(",");break;case"message":o.gotoif.text=o.gotoif.appdata;break;case"set":o.gotoif.name=o.gotoif.appdata.split("=")[0],o.gotoif.value=o.gotoif.appdata.split("=")[1];break;case"agi":o.gotoif.project=o.gotoif.appdata;break;default:var r=o.gotoif.appdata.split(",");o.gotoif.condition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.gotoif.truepriority=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.gotoif.falsepriority=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10)}function l(e){t.hide(e)}o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outbounddial"===o.gotoif.appType.toLowerCase()&&(o.gotoif.prefix=o.gotoif.phone?o.gotoif.phone.split("$")[0]:void 0,o.gotoif.callerId=o.gotoif.callerID?"CALLERID(all)="+o.gotoif.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outboundDial"===o.gotoif.appType&&(o.gotoif.phone=a.cutdigits?(o.gotoif.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotoif.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotoif.options+="U(xcally-mixmonitor-context)"):o.gotoif.options=o.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotoif.appType&&"custom"===o.gotoif.appType);else switch((o.gotoif.app||o.gotoif.appType).toLowerCase()){case"set":o.gotoif.appdata=o.gotoif.name+"="+o.gotoif.value;break;case"custom":break;default:e[0]=o.gotoif.condition,e[1]=o.gotoif.truepriority,e[2]=o.gotoif.falsepriority,o.gotoif.appdata=e.join(",")}l(o.gotoif)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotop=angular.copy(n),o.gotop.appdata)switch(o.gotop.appType?o.gotop.appType.toLowerCase():o.gotop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotop.appdata.split(",");o.gotop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotop.text=s.slice(1,s.length).join(",");break;case"message":o.gotop.text=o.gotop.appdata;break;case"set":o.gotop.name=o.gotop.appdata.split("=")[0],o.gotop.value=o.gotop.appdata.split("=")[1];break;case"agi":o.gotop.project=o.gotop.appdata;break;default:var r=o.gotop.appdata.split(",");o.gotop.priority=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outbounddial"===o.gotop.appType.toLowerCase()&&(o.gotop.prefix=o.gotop.phone?o.gotop.phone.split("$")[0]:void 0,o.gotop.callerId=o.gotop.callerID?"CALLERID(all)="+o.gotop.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outboundDial"===o.gotop.appType&&(o.gotop.phone=a.cutdigits?(o.gotop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotop.options+="U(xcally-mixmonitor-context)"):o.gotop.options=o.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotop.appType&&"custom"===o.gotop.appType);else switch((o.gotop.app||o.gotop.appType).toLowerCase()){case"set":o.gotop.appdata=o.gotop.name+"="+o.gotop.value;break;case"custom":break;default:e[0]=o.gotop.priority,o.gotop.appdata=e.join(",")}l(o.gotop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditChatWebsiteAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(n.appType||n.app).toUpperCase(),o.noop=angular.copy(n),o.noop.appdata)switch(o.noop.appType?o.noop.appType.toLowerCase():o.noop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.noop.appdata.split(",");o.noop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.noop.text=s.slice(1,s.length).join(",");break;case"message":o.noop.text=o.noop.appdata;break;case"set":o.noop.name=o.noop.appdata.split("=")[0],o.noop.value=o.noop.appdata.split("=")[1];break;case"agi":o.noop.project=o.noop.appdata;break;default:var r=o.noop.appdata.split(",");o.noop.value=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outbounddial"===o.noop.appType.toLowerCase()&&(o.noop.prefix=o.noop.phone?o.noop.phone.split("$")[0]:void 0,o.noop.callerId=o.noop.callerID?"CALLERID(all)="+o.noop.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outboundDial"===o.noop.appType&&(o.noop.phone=a.cutdigits?(o.noop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.noop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.noop.options+="U(xcally-mixmonitor-context)"):o.noop.options=o.noop.options.replace("U(xcally-mixmonitor-context)",""));if(o.noop.appType&&"custom"===o.noop.appType);else switch((o.noop.app||o.noop.appType).toLowerCase()){case"set":o.noop.appdata=o.noop.name+"="+o.noop.value;break;case"custom":break;default:e[0]=o.noop.value,o.noop.appdata=e.join(",")}l(o.noop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppnoopDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(e.appType||e.app).toUpperCase(),o.queue=angular.copy(e),o.queue.appdata)switch(o.queue.appType?o.queue.appType.toLowerCase():o.queue.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.queue.appdata.split(",");o.queue.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.queue.text=s.slice(1,s.length).join(",");break;case"message":o.queue.text=o.queue.appdata;break;case"set":o.queue.name=o.queue.appdata.split("=")[0],o.queue.value=o.queue.appdata.split("=")[1];break;case"agi":o.queue.project=o.queue.appdata;break;default:var r=o.queue.appdata.split(",");o.queue.queue=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.queue.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.queue.queue=300,o.queue.timeout=300;function l(e){t.hide(e)}o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outbounddial"===o.queue.appType.toLowerCase()&&(o.queue.prefix=o.queue.phone?o.queue.phone.split("$")[0]:void 0,o.queue.callerId=o.queue.callerID?"CALLERID(all)="+o.queue.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outboundDial"===o.queue.appType&&(o.queue.phone=a.cutdigits?(o.queue.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.queue.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.queue.options+="U(xcally-mixmonitor-context)"):o.queue.options=o.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.queues,{name:o.queue.queue});t&&(o.queue[_.capitalize("chat")+"QueueId"]=t.id);if(o.queue.appType&&"custom"===o.queue.appType);else switch((o.queue.app||o.queue.appType).toLowerCase()){case"set":o.queue.appdata=o.queue.name+"="+o.queue.value;break;case"custom":break;default:e[0]=o.queue.queue,e[1]=o.queue.timeout,o.queue.appdata=e.join(",")}l(o.queue)},o.closeDialog=l,i.chatQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){o.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppqueueDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(e.appType||e.app).toUpperCase(),o.system=angular.copy(e),o.system.appdata)switch(o.system.appType?o.system.appType.toLowerCase():o.system.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.system.appdata.split(",");o.system.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.system.text=s.slice(1,s.length).join(",");break;case"message":o.system.text=o.system.appdata;break;case"set":o.system.name=o.system.appdata.split("=")[0],o.system.value=o.system.appdata.split("=")[1];break;case"agi":o.system.project=o.system.appdata;break;default:var r=o.system.appdata.split(",");o.system.command=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.system.variable=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.system.variable="";function l(e){t.hide(e)}o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outbounddial"===o.system.appType.toLowerCase()&&(o.system.prefix=o.system.phone?o.system.phone.split("$")[0]:void 0,o.system.callerId=o.system.callerID?"CALLERID(all)="+o.system.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outboundDial"===o.system.appType&&(o.system.phone=a.cutdigits?(o.system.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.system.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.system.options+="U(xcally-mixmonitor-context)"):o.system.options=o.system.options.replace("U(xcally-mixmonitor-context)",""));if(o.system.appType&&"custom"===o.system.appType);else switch((o.system.app||o.system.appType).toLowerCase()){case"set":o.system.appdata=o.system.name+"="+o.system.value;break;case"custom":break;default:e[0]=o.system.command,e[1]=o.system.variable,o.system.appdata=e.join(",")}l(o.system)},o.closeDialog=l,i.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){o.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppsystemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteChatCannedAnswers={count:0,rows:[]},c.selectedChatWebsiteChatCannedAnswers=[],c.query={fields:"createdAt,updatedAt,id,key,value,description,createdAt",limit:10,page:1},c.init=function(e){c.chatWebsite=e,c.query.id=c.chatWebsite.id,c.query.ChatWebsiteId=c.chatWebsite.id,c.getChatWebsiteChatCannedAnswers()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the chatCannedAnswer?").htmlContent("<b>"+(e.name||"chatCannedAnswer")+"</b> will be deleted.").ariaLabel("delete chatCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteChatCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getAnswers(c.query,p).$promise},c.createOrEditChatWebsiteChatCannedAnswer=function(e,t){o.show({controller:"CreateOrEditChatCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,chatCannedAnswer:t,chatCannedAnswers:c.chatWebsiteChatCannedAnswers.rows,license:null,setting:null}})},c.exportSelectedChatWebsiteChatCannedAnswers=function(){var e=angular.copy(c.selectedChatWebsiteChatCannedAnswers);return c.selectedChatWebsiteChatCannedAnswers=[],e},c.deleteChatWebsiteChatCannedAnswer=g,c.deleteSelectedChatWebsiteChatCannedAnswers=function(e){var t=o.confirm().title("Are you sure want to delete the selected chatCannedAnswers?").htmlContent("<b>"+c.selectedChatWebsiteChatCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete chatCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedChatWebsiteChatCannedAnswers.forEach(function(e){g(e)}),c.selectedChatWebsiteChatCannedAnswers=[]})};var m=!0,u=1;function p(e){c.chatWebsiteChatCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteChatCannedAnswers.rows,{id:e.id}),c.chatWebsiteChatCannedAnswers.count-=1,c.chatWebsiteChatCannedAnswers.rows.length||c.getChatWebsiteChatCannedAnswers(),r.success({title:"ChatCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteChatCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteChatCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CHAT.EDIT_CHATCANNEDANSWER",m.chatCannedAnswer=angular.copy(s),m.chatCannedAnswers=o,m.newChatCannedAnswer=!1,m.chatCannedAnswer||(m.chatCannedAnswer={},m.title="CHAT.NEW_CHATCANNEDANSWER",m.newChatCannedAnswer=!0),t.params.id&&(m.chatCannedAnswer.ChatWebsiteId=t.params.id),m.addNewChatCannedAnswer=function(){m.errors=[],r.cannedAnswer.save(m.chatCannedAnswer).$promise.then(function(e){m.chatCannedAnswers.unshift(e.toJSON()),i.success({title:"ChatCannedAnswer properly created",msg:m.chatCannedAnswer.name?m.chatCannedAnswer.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveChatCannedAnswer=function(){m.errors=[],r.cannedAnswer.update({id:m.chatCannedAnswer.id},m.chatCannedAnswer).$promise.then(function(e){var t=_.find(m.chatCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ChatCannedAnswer properly saved!",msg:m.chatCannedAnswer.name?m.chatCannedAnswer.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteChatCannedAnswer=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The chatCannedAnswer will be deleted.").ariaLabel("Delete ChatCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cannedAnswer.delete({id:m.chatCannedAnswer.id}).$promise.then(function(){_.remove(m.chatCannedAnswers,{id:m.chatCannedAnswer.id}),i.success({title:"ChatCannedAnswer properly deleted!",msg:(m.chatCannedAnswer.name||"chatCannedAnswer")+" has been deleted!"}),u(m.chatCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","chatCannedAnswers","chatCannedAnswer","api","Auth","license","setting"],angular.module("app.chat").controller("CreateOrEditChatCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteChatDispositions={count:0,rows:[]},c.selectedChatWebsiteChatDispositions=[],c.query={fields:"createdAt,updatedAt,id,name,createdAt",limit:10,page:1},c.init=function(e){c.chatWebsite=e,c.query.id=c.chatWebsite.id,c.query.ChatWebsiteId=c.chatWebsite.id,c.getChatWebsiteChatDispositions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the chatDisposition?").htmlContent("<b>"+(e.name||"chatDisposition")+"</b> will be deleted.").ariaLabel("delete chatDisposition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteChatDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getDispositions(c.query,p).$promise},c.createOrEditChatWebsiteChatDisposition=function(e,t){o.show({controller:"CreateOrEditChatDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/chatDispositions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,chatDisposition:t,chatDispositions:c.chatWebsiteChatDispositions.rows,license:null,setting:null}})},c.exportSelectedChatWebsiteChatDispositions=function(){var e=angular.copy(c.selectedChatWebsiteChatDispositions);return c.selectedChatWebsiteChatDispositions=[],e},c.deleteChatWebsiteChatDisposition=g,c.deleteSelectedChatWebsiteChatDispositions=function(e){var t=o.confirm().title("Are you sure want to delete the selected chatDispositions?").htmlContent("<b>"+c.selectedChatWebsiteChatDispositions.length+" selected</b> will be deleted.").ariaLabel("delete chatDispositions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedChatWebsiteChatDispositions.forEach(function(e){g(e)}),c.selectedChatWebsiteChatDispositions=[]})};var m=!0,u=1;function p(e){c.chatWebsiteChatDispositions=e||{count:0,rows:[]}}function g(e){l.chatDisposition.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteChatDispositions.rows,{id:e.id}),c.chatWebsiteChatDispositions.count-=1,c.chatWebsiteChatDispositions.rows.length||c.getChatWebsiteChatDispositions(),r.success({title:"ChatDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteChatDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteChatDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CHAT.EDIT_CHATDISPOSITION",m.chatDisposition=angular.copy(s),m.chatDispositions=o,m.newChatDisposition=!1,m.chatDisposition||(m.chatDisposition={},m.title="CHAT.NEW_CHATDISPOSITION",m.newChatDisposition=!0),t.params.id&&(m.chatDisposition.ChatWebsiteId=t.params.id),m.addNewChatDisposition=function(){m.errors=[],r.chatDisposition.save(m.chatDisposition).$promise.then(function(e){m.chatDispositions.unshift(e.toJSON()),i.success({title:"ChatDisposition properly created",msg:m.chatDisposition.name?m.chatDisposition.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatDisposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatDisposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveChatDisposition=function(){m.errors=[],r.chatDisposition.update({id:m.chatDisposition.id},m.chatDisposition).$promise.then(function(e){var t=_.find(m.chatDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ChatDisposition properly saved!",msg:m.chatDisposition.name?m.chatDisposition.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatDisposition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatDisposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteChatDisposition=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The chatDisposition will be deleted.").ariaLabel("Delete ChatDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.chatDisposition.delete({id:m.chatDisposition.id}).$promise.then(function(){_.remove(m.chatDispositions,{id:m.chatDisposition.id}),i.success({title:"ChatDisposition properly deleted!",msg:(m.chatDisposition.name||"chatDisposition")+" has been deleted!"}),u(m.chatDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatDisposition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatDisposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","chatDispositions","chatDisposition","api","Auth","license","setting"],angular.module("app.chat").controller("CreateOrEditChatDispositionDialogController",e)}(),function(){"use strict";function e(n,e,a){var i=this;i.chatWebsite={},i.offlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.offlineForm)&&(i.chatWebsite.offlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var t=0;t<e.rows.length;t++)i.customFields.push({key:"cf_"+e.rows[t].id,value:e.rows[t].alias});return a.cmContact.describe().$promise}).then(function(e){for(var t=_.keys(e),n=0;n<t.length;n++)_.includes(i.uselessFields,t[n])||_.startsWith(t[n],"cf_")||i.fields.unshift({key:t[n],value:t[n]});return a.variable.get().$promise}).then(function(e){i.variables=e.rows}).catch(function(e){console.error(e)})},i.up=function(e,t){if(0!==t){var n=i.chatWebsite.offlineForm.items[t-1];i.chatWebsite.offlineForm.items[t]=n,i.chatWebsite.offlineForm.items[t-1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===t?i.chatWebsite.offlineForm.fromKey--:i.chatWebsite.offlineForm.fromKey===t-1&&i.chatWebsite.offlineForm.fromKey++}},i.down=function(e,t){if(t!==i.chatWebsite.offlineForm.items.length-1){var n=i.chatWebsite.offlineForm.items[t+1];i.chatWebsite.offlineForm.items[t]=n,i.chatWebsite.offlineForm.items[t+1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===t?i.chatWebsite.offlineForm.fromKey++:i.chatWebsite.offlineForm.fromKey===t+1&&i.chatWebsite.offlineForm.fromKey--}},i.add=function(e){i.chatWebsite.offlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var t=n.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");n.show(t).then(function(){i.chatWebsite.offlineForm.items.splice(e,1)})}}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteofflineFormController",e)}(),function(){"use strict";function e(n,e,a){var i=this;i.chatWebsite={},i.onlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.onlineForm)&&(i.chatWebsite.onlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var t=0;t<e.rows.length;t++)i.customFields.push({key:"cf_"+e.rows[t].id,value:e.rows[t].alias});return a.cmContact.describe().$promise}).then(function(e){for(var t=_.keys(e),n=0;n<t.length;n++)_.includes(i.uselessFields,t[n])||_.startsWith(t[n],"cf_")||i.fields.unshift({key:t[n],value:t[n]});return a.variable.get().$promise}).then(function(e){i.variables=e.rows}).catch(function(e){console.error(e)})},i.up=function(e,t){if(0!==t){var n=i.chatWebsite.onlineForm.items[t-1];i.chatWebsite.onlineForm.items[t]=n,i.chatWebsite.onlineForm.items[t-1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===t?i.chatWebsite.onlineForm.fromKey--:i.chatWebsite.onlineForm.fromKey===t-1&&i.chatWebsite.onlineForm.fromKey++}},i.down=function(e,t){if(t!==i.chatWebsite.onlineForm.items.length-1){var n=i.chatWebsite.onlineForm.items[t+1];i.chatWebsite.onlineForm.items[t]=n,i.chatWebsite.onlineForm.items[t+1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===t?i.chatWebsite.onlineForm.fromKey++:i.chatWebsite.onlineForm.fromKey===t+1&&i.chatWebsite.onlineForm.fromKey--}},i.add=function(e){i.chatWebsite.onlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var t=n.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");n.show(t).then(function(){i.chatWebsite.onlineForm.fromKey===e&&(i.chatWebsite.onlineForm.fromKey=null),i.chatWebsite.onlineForm.items.splice(e,1),i.chatWebsite.onlineForm.items.length||(i.chatWebsite.onlineForm.fromKey=null)})}}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteonlineFormController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteInteractions={count:0,rows:[]},c.selectedChatWebsiteInteractions=[],c.query={fields:"createdAt,updatedAt,UserId,ContactId,ChatWebsiteId,id,createdAt,closedAt,Contact.firstName,Owner.name,disposition,ratingValue,ratingType,note,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e){c.chatWebsite=e,c.query.id=c.chatWebsite.id,c.getChatWebsiteInteractions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getInteractions(c.query,p).$promise},c.createOrEditChatWebsiteInteraction=function(e,t){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/interactions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,interaction:t,interactions:c.chatWebsiteInteractions.rows,license:null,setting:null}})},c.spychatInteraction=function(e,n){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"chat",interaction:n,spy:!0})}})},c.exportSelectedChatWebsiteInteractions=function(){var e=angular.copy(c.selectedChatWebsiteInteractions);return c.selectedChatWebsiteInteractions=[],e},c.deleteChatWebsiteInteraction=g,c.deleteSelectedChatWebsiteInteractions=function(e){var t=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedChatWebsiteInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedChatWebsiteInteractions.forEach(function(e){g(e)}),c.selectedChatWebsiteInteractions=[]})};var m=!0,u=1;function p(e){c.chatWebsiteInteractions=e||{count:0,rows:[]}}function g(e){l.chatInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteInteractions.rows,{id:e.id}),c.chatWebsiteInteractions.count-=1,c.chatWebsiteInteractions.rows.length||c.getChatWebsiteInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteInteractionsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size for image files is 8 Mb"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.chatWebsite=angular.copy(e),i.ngFlowOptions.target="/api/chat/websites/:id/logo".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitelogoController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteOfflineMessages={count:0,rows:[]},c.selectedChatWebsiteOfflineMessages=[],c.query={fields:"createdAt,updatedAt,id,ContactId,createdAt",sort:"-createdAt",limit:10,page:1},c.init=function(e){c.chatWebsite=e,c.query.id=c.chatWebsite.id,c.getChatWebsiteOfflineMessages()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the offlineMessage?").htmlContent("<b>"+(e.name||"offlineMessage")+"</b> will be deleted.").ariaLabel("delete offlineMessage").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteOfflineMessages=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getOfflineMessages(c.query,p).$promise},c.createOrEditChatWebsiteOfflineMessage=function(e,t){o.show({controller:"CreateOrEditOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,offlineMessage:t,offlineMessages:c.chatWebsiteOfflineMessages.rows,license:null,setting:null}})},c.showOfflineMessageChatWebsiteOfflineMessage=function(e,n){o.show({controller:"ShowOfflineMessageOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,resolve:{message:["apiResolver","$stateParams",function(e,t){return e.resolve("chatOfflineMessage@get",{fields:"id,body",id:n.id})}]}})},c.exportSelectedChatWebsiteOfflineMessages=function(){var e=angular.copy(c.selectedChatWebsiteOfflineMessages);return c.selectedChatWebsiteOfflineMessages=[],e},c.deleteChatWebsiteOfflineMessage=g,c.deleteSelectedChatWebsiteOfflineMessages=function(e){var t=o.confirm().title("Are you sure want to delete the selected offlineMessages?").htmlContent("<b>"+c.selectedChatWebsiteOfflineMessages.length+" selected</b> will be deleted.").ariaLabel("delete offlineMessages").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedChatWebsiteOfflineMessages.forEach(function(e){g(e)}),c.selectedChatWebsiteOfflineMessages=[]})},l.cmContact.get({fields:"id,firstName,lastName",nolimit:"true"}).$promise.then(function(e){c.contacts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontacts",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.chatWebsiteOfflineMessages=e||{count:0,rows:[]}}function g(e){l.chatOfflineMessage.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteOfflineMessages.rows,{id:e.id}),c.chatWebsiteOfflineMessages.count-=1,c.chatWebsiteOfflineMessages.rows.length||c.getChatWebsiteOfflineMessages(),r.success({title:"OfflineMessage deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteOfflineMessages())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteOfflineMessagesController",e)}(),function(){"use strict";function e(t,e){this.title="CHAT.OFFLINE_MESSAGE",this.message=e,this.closeDialog=function(e){t.hide(e)}}e.$inject=["$mdDialog","message"],angular.module("app.chat").controller("ShowOfflineMessageOfflineMessageDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteProactiveActions={count:0,rows:[]},c.selectedChatWebsiteProactiveActions=[],c.query={fields:"createdAt,updatedAt,id,name,type,selector,timeout,createdAt",limit:10,page:1},c.arraytype=_.keyBy([{option:"MouseOver",value:"'mouseOver'"},{option:"Timeout",value:"'timeout'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e){c.chatWebsite=e,c.query.id=c.chatWebsite.id,c.query.ChatWebsiteId=c.chatWebsite.id,c.getChatWebsiteProactiveActions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the chatProactiveAction?").htmlContent("<b>"+(e.name||"chatProactiveAction")+"</b> will be deleted.").ariaLabel("delete chatProactiveAction").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteProactiveActions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getProactiveActions(c.query,p).$promise},c.createOrEditChatWebsiteChatProactiveAction=function(e,t){o.show({controller:"CreateOrEditChatProactiveActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,chatProactiveAction:t,proactive:c.chatWebsiteProactiveActions.rows,license:null,setting:null}})},c.exportSelectedChatWebsiteProactiveActions=function(){var e=angular.copy(c.selectedChatWebsiteProactiveActions);return c.selectedChatWebsiteProactiveActions=[],e},c.deleteChatWebsiteChatProactiveAction=g,c.deleteSelectedChatWebsiteProactiveActions=function(e){var t=o.confirm().title("Are you sure want to delete the selected proactive?").htmlContent("<b>"+c.selectedChatWebsiteProactiveActions.length+" selected</b> will be deleted.").ariaLabel("delete proactive").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedChatWebsiteProactiveActions.forEach(function(e){g(e)}),c.selectedChatWebsiteProactiveActions=[]})};var m=!0,u=1;function p(e){c.chatWebsiteProactiveActions=e||{count:0,rows:[]}}function g(e){l.chatProactiveAction.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteProactiveActions.rows,{id:e.id}),c.chatWebsiteProactiveActions.count-=1,c.chatWebsiteProactiveActions.rows.length||c.getChatWebsiteProactiveActions(),r.success({title:"ChatProactiveAction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteProactiveActions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteProactiveActionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CHAT.EDIT_CHATPROACTIVEACTION",m.chatProactiveAction=angular.copy(s),m.proactive=o,m.newChatProactiveAction=!1,m.chatProactiveAction||(m.chatProactiveAction={type:"mouseOver"},m.title="CHAT.NEW_CHATPROACTIVEACTION",m.newChatProactiveAction=!0),t.params.id&&(m.chatProactiveAction.ChatWebsiteId=t.params.id),m.addNewChatProactiveAction=function(){m.errors=[],r.chatProactiveAction.save(m.chatProactiveAction).$promise.then(function(e){m.proactive.unshift(e.toJSON()),i.success({title:"ChatProactiveAction properly created",msg:m.chatProactiveAction.name?m.chatProactiveAction.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveChatProactiveAction=function(){m.errors=[],r.chatProactiveAction.update({id:m.chatProactiveAction.id},m.chatProactiveAction).$promise.then(function(e){var t=_.find(m.proactive,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ChatProactiveAction properly saved!",msg:m.chatProactiveAction.name?m.chatProactiveAction.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteChatProactiveAction=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The chatProactiveAction will be deleted.").ariaLabel("Delete ChatProactiveAction").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.chatProactiveAction.delete({id:m.chatProactiveAction.id}).$promise.then(function(){_.remove(m.proactive,{id:m.chatProactiveAction.id}),i.success({title:"ChatProactiveAction properly deleted!",msg:(m.chatProactiveAction.name||"chatProactiveAction")+" has been deleted!"}),u(m.chatProactiveAction)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","proactive","chatProactiveAction","api","Auth","license","setting"],angular.module("app.chat").controller("CreateOrEditChatProactiveActionDialogController",e)}(),function(){"use strict";function e(e){var t=this;t.chatWebsite={},t.init=function(e){t.chatWebsite=e,t.start="\n\x3c!-- START Motion Chat Script --\x3e",t.script='\n <script src="'+t.chatWebsite.remote+"/api/chat/websites/"+t.chatWebsite.id+"/snippet?token="+t.chatWebsite.token+'"><\/script>',t.end="\n\x3c!-- START Motion Chat Script --\x3e"},t.info={},e.$watch("vm_ac.chatWebsite.remote",function(e){t.script='\n <script src="'+t.chatWebsite.remote+"/api/chat/websites/"+t.chatWebsite.id+"/snippet?token="+t.chatWebsite.token+'"><\/script>'})}e.$inject=["$scope"],angular.module("app.chat").controller("ChatWebsiteScriptController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.chatWebsite=d||e.params.chatWebsite||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoChatWebsites=function(){e.go("app.chat.chatWebsites")},c.saveChatWebsite=function(){s.chatWebsite.update({id:c.chatWebsite.id},c.chatWebsite).$promise.then(function(){r.success({title:"ChatWebsite updated!",msg:c.chatWebsite.name?c.chatWebsite.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.lists=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.template.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.templates=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtemplates",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){c.interval=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","chatWebsite"],angular.module("app.chat").controller("ChatWebsiteController",e)}(),function(){"use strict";function e(e,s,t,n,a,i,o,r,l,d,c,m,u,p,g,v){var h=this,b=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum"],f=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var A in h.availableStates=["ringing","inuse","busy","onhold","not_inuse"],h.pauses=o||{count:0,rows:[]},h.license=g,h.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},h.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},h.paginatedAgents={},h.load=!1,h.order=[],h.agentInternal={},h.agents)h.agents.hasOwnProperty(A)&&(h.agents[A].init=!0);h.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},h.logout=function(e,t){return d.user.logout({id:e.id}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),h.agents[e.id]&&(h.agents[e.id].online=!1),h.rpcAgents[e.id]&&(h.rpcAgents[e.id].online=!1),y()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"chat",realtime:!0,direction:"inbound"}})},h.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},h.getAgentStatus=C,h.getAgentGlobalStatus=x,h.isPause=S,h.checkPause=function(e){return"pause"===e},h.isPartialPause=function(e){return"*pause"===e},h.onSave=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(_.omit(e,f),b)),_.merge(h.rpcAgents[e.id],_.pick(_.omit(e,f),b)),x(h.agents[e.id]))},h.onUpdate=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(e,b)),_.merge(h.rpcAgents[e.id],_.pick(e,b)),x(h.agents[e.id]))},h.onInit=y,h.onConnect=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(_.merge(h.agents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(h.rpcAgents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},h.onComplete=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(h.agents[h.agentInternal[e.destaccountcode]]=_.omit(h.agents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),h.rpcAgents[h.agentInternal[e.destaccountcode]]=_.omit(h.rpcAgents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",h.onSave),c.on("user:update",h.onUpdate),c.on("user:agentconnect",h.onConnect),c.on("user:agentcomplete",h.onComplete),y();var E=v(function(){h.load&&(h.load=!1,y())},999);function y(e){h.load=!1;var t,n,a=s.defer();h.promise=a.promise,h.filteredAgents=[],h.order=[],_.forIn(h.agents,function(e,t){h.rpcAgents[t]&&_.merge(e,_.pick(_.omit(h.rpcAgents[t],f),b)),x(e),e.online?(h.filteredAgents.push(e),h.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),h.query.globalStatusFilter&&_.remove(h.filteredAgents,function(e){return e.globalStatus!==h.query.globalStatusFilter}),h.query.pauseTypeFilter&&_.remove(h.filteredAgents,function(e){return e.pauseType!==h.query.pauseTypeFilter}),h.query.filter&&_.remove(h.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(h.query.filter.toLowerCase())<0}),h.filteredAgents=(t=h.filteredAgents,n=_.startsWith(h.query.order,"-")?"desc":"asc",_.orderBy(t,[h.query.order.replace("-","")],[n]));var i=(h.query.page-1)*h.query.limit;h.paginatedAgents=_.drop(h.filteredAgents,i).slice(0,h.query.limit);for(var o=0;o<h.paginatedAgents.length;o+=1)h.order.push(h.paginatedAgents[o].id);a.resolve(),h.load=!0}function S(e){return"pause"===e||"*pause"===e}function T(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function C(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function x(e){var t="unknown";t=_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"pause":_.some([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"*pause":_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],T)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=S(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),E&&(v.cancel(E),E=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","Auth","license","$interval"],angular.module("app.voice").controller("AgentsChatRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function g(){var n=[];return _.forIn(u.queues,function(e,t){e.paused=0,e.loggedInDb=0,u.queues[t].agents={},n.push(l.chatQueue.getMembers({id:t}).$promise),u.rpcQueues[t]&&_.merge(e,_.pick(u.rpcQueues[t],p))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&u.queues[e[t].rows[n].ChatQueueId].paused++,u.queues[e[t].rows[n].ChatQueueId].loggedInDb++,u.queues[e[t].rows[n].ChatQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].ChatQueueId}).catch(function(e){console.error(e)})}u.count=s.count?s.count:0,u.queues=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.hasRole("admin")?u.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:u.query={id:m.getCurrentUser().id,channel:"chat",type:"inbound",sort:"-updatedAt",limit:10,page:1},u.success=b,u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=l.chatQueue.get(u.query,b).$promise:u.promise=l.user.getQueues(u.query,b).$promise},u.createOrEditChatQueue=function(e,t){a.show({controller:"CreateOrEditChatQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:t,chatQueues:_.values(u.queues),license:null,setting:null}})},u.agentAdd=function(e,t){a.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:t,chatQueues:u.queues?u.queues.rows:[],realtime:!1}})},u.updateQueue=function(e){return l.chatQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},u.onSave=function(e){u.queues[e.id]&&_.merge(u.queues[e.id],_.pick(e,p))},u.onSaveMember=function(e){u.queues[e.ChatQueueId]&&u.queues[e.ChatQueueId].loggedInDb++},u.onRemoveMember=function(e){u.queues[e.ChatQueueId]&&u.queues[e.ChatQueueId].loggedInDb--},u.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(u.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(u.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},u.onLogin=function(e){console.log("onLogged",e),u.queues[e.ChatQueueId]&&(u.queues[e.ChatQueueId].loggedInDb+=1,u.queues[e.ChatQueueId].agents[e.UserId]=e.ChatQueueId)},u.onLogout=function(e){console.log("onLogout",e),u.queues[e.ChatQueueId]&&0<u.queues[e.ChatQueueId].loggedInDb&&(u.queues[e.ChatQueueId].loggedInDb-=1,delete u.queues[e.ChatQueueId].agents[e.UserId])},u.$onInit=g,u.order=[],_.forIn(u.queues,function(e,t){u.order.push(e.id)}),d.on("chat_queue:save",u.onSave),d.on("userChatQueue:save",u.onSaveMember),d.on("userChatQueue:remove",u.onRemoveMember),d.on("user:update",u.onPause),d.on("userVoiceQueue:remove",u.onLogout),d.on("userVoiceQueue:save",u.onLogin);var v=!0,h=1;function b(e){if(u.count=e.count,u.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){u.order=[];for(var t=0;t<e.rows.length;t++)u.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("chat_queue:save"),d.removeAllListeners("userChatQueue:remove"),d.removeAllListeners("userChatQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","Auth"],angular.module("app.chat").controller("QueuesChatRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.chat.realtime.agents":this.selectedTab=0;break;case"app.chat.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,n.go("app.chat.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.chat.realtime.agents");break;case 1:n.go("app.chat.realtime.queues");break;default:n.go("app.chat.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.chat").controller("ChatRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.companies=r||{count:0,rows:[]},v.table="companies",v.listOrder="",v.listOrderAsc=null,v.selectedCompanies=[],v.query={fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,page:1},v.editstate=function(e,t){n.go("app.contactmanager.companies.edit",{id:e.id,company:e})},v.gotocontactsgoto=function(e,t){n.go("app.contactmanager.contacts",{CompanyId:e.id})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the company?").htmlContent("<b>"+(e.name||"company")+"</b> will be deleted.").ariaLabel("delete company").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getCompanies=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.cmCompany.get(v.query,f).$promise},v.createOrEditCompany=function(e,t){i.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{company:t,companies:v.companies.rows,license:v.license,setting:v.setting}})},v.deleteCompany=A,v.exportSelectedCompanies=function(){var e=angular.copy(v.selectedCompanies);return v.selectedCompanies=[],e},v.deleteSelectedCompanies=function(e){var t=i.confirm().title("Are you sure want to delete the selected companies?").htmlContent("<b>"+v.selectedCompanies.length+" selected</b> will be deleted.").ariaLabel("delete Companys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedCompanies.forEach(function(e){A(e)}),v.selectedCompanies=[]})},v.deselectCompanies=function(){v.selectedCompanies=[]},v.selectAllCompanies=function(){v.selectedCompanies=v.companies.rows};var h=!0,b=1;function f(e){v.companies=e||{count:0,rows:[]}}function A(e){l.cmCompany.delete({id:e.id}).$promise.then(function(){_.remove(v.companies.rows,{id:e.id}),v.companies.count-=1,v.companies.rows.length||v.getCompanies(),c.success({title:"Company deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCompany"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCompany",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getCompanies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","companies","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.contactmanager").controller("CompaniesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CONTACTMANAGER.EDIT_COMPANY",m.company=angular.copy(s),m.companies=o,m.newCompany=!1,m.company||(m.company={},m.title="CONTACTMANAGER.NEW_COMPANY",m.newCompany=!0),m.addNewCompany=function(){m.errors=[],r.cmCompany.save(m.company).$promise.then(function(e){m.companies.unshift(e.toJSON()),i.success({title:"Company properly created",msg:m.company.name?m.company.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveCompany=function(){m.errors=[],r.cmCompany.update({id:m.company.id},m.company).$promise.then(function(e){var t=_.find(m.companies,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Company properly saved!",msg:m.company.name?m.company.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteCompany=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The company will be deleted.").ariaLabel("Delete Company").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cmCompany.delete({id:m.company.id}).$promise.then(function(){_.remove(m.companies,{id:m.company.id}),i.success({title:"Company properly deleted!",msg:(m.company.name||"company")+" has been deleted!"}),u(m.company)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","companies","company","api","Auth","license","setting"],angular.module("app.contactmanager").controller("CreateOrEditCompanyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.company=d||n.params.company||{},c.selectedTab=n.params.tab||0,c.gotogoto=function(e,t){n.go("app.contactmanager.contacts",{CompanyId:e.id})},c.alert=r.info,c.gotoCompanies=function(){n.go("app.contactmanager.companies")},c.saveCompany=function(){s.cmCompany.update({id:c.company.id},c.company).$promise.then(function(){r.success({title:"Company updated!",msg:c.company.name?c.company.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmCompany",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","company"],angular.module("app.contactmanager").controller("CompanyController",e)}(),function(){"use strict";function e(t,i,n,a,o,s,e,r,l,d,c,m,u,p,g,v){var h=this;h.currentUser=p.getCurrentUser();h.license=v,h.ngFlowOptions={target:"api/cm/contacts/upload",singleFile:!0,maxChunkRetries:1,chunkSize:62914560,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},h.contacts=e||{count:0,rows:[]},h.options={hidden:!1,hover:!1,isOpen:!1},h.table="cm_contacts",h.selectedContacts=[],h.lists=r||{rows:[],count:0},h.companies=d||{rows:[],count:0},h.tags=m||{rows:[],count:0},h.listsMap=l,h.companiesMap=c,h.selectedTags=[],h.selectedList=null,h.selectedCompany=null,h.query=_.merge({sort:"-updatedAt",limit:10,offset:0,page:1},g),h.editdialog=function(e,t){a.go("app.contactmanager.contacts.edit",{id:e.id})},h.deleteconfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the contact?").htmlContent("<b>"+(e.firstName||e.email||e.phone||"Contact")+"</b> will be deleted.").ariaLabel("delete contact").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){E(e)})},h.success=A,h.getContacts=function(){h.query.offset=(h.query.page-1)*h.query.limit,h.promise=s.cmContact.get(h.query,A).$promise},h.mergeContact=function(e,t){o.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"id,name"})}]},locals:{contacts:h.contacts.rows}})},h.duplicateContact=function(e,t){o.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"id,name"})}]},locals:{contacts:h.contacts.rows}})},h.createOrEditContact=function(e,t){t&&t.dateOfBirth&&(t.dateOfBirth=new Date(t.dateOfBirth));o.show({controller:"CreateOrEditContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ListId:h.query.ListId||a.params.ListId,CompanyId:h.query.CompanyId||a.params.CompanyId,contact:t,contacts:h.contacts.rows,setting:null},resolve:{lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"id,name"})}],companies:["apiResolver",function(e){return e.resolve("cmCompany@get",{fields:"id,name"})}]}})},h.deleteContact=E,h.exportSelectedContacts=function(){var e=angular.copy(h.selectedContacts);return h.selectedContacts=[],e},h.deleteSelectedContacts=function(e){var t=o.confirm().title("Are you sure want to delete the selected contacts?").htmlContent("<b>"+h.selectedContacts.length+" selected</b> will be deleted.").ariaLabel("delete Contacts").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){h.selectedContacts.forEach(function(e){E(e)}),h.selectedContacts=[]})},h.deselectContacts=function(){h.selectedContacts=[]},h.selectAllContacts=function(){h.selectedContacts=h.contacts.rows},h.createTag=function(e){var t=o.prompt().title("What would you name your tag?").placeholder("Tag name").ariaLabel("Tag name").targetEvent(e).ok("Ok").cancel("Cancel");return o.show(t).then(function(e){if(e)return s.tag.save({name:e});u.error({title:"Error creating tag!",msg:"Invalid tag name."})}).then(function(e){e&&(h.tags.rows.push(e),u.success({title:"Tag properly created!",msg:e.tag?e.name+" has been created!":""}))})},h.createList=function(e){var t=o.prompt().title("What would you name your list?").placeholder("List name").ariaLabel("List name").targetEvent(e).ok("Ok").cancel("Cancel");return o.show(t).then(function(e){if(e)return s.cmList.save({name:e});u.error({title:"Error creating list!",msg:"Invalid list name."})}).then(function(e){e&&(h.lists.rows.push(e),u.success({title:"List properly created!",msg:e.name?e.name+" has been created!":""}))})},h.createCompany=function(e){var t=o.prompt().title("What would you name your company?").placeholder("Company name").ariaLabel("Company name").targetEvent(e).ok("Ok").cancel("Cancel");return o.show(t).then(function(e){if(e)return s.cmCompany.save({name:e});u.error({title:"Error creating company!",msg:"Invalid company name."})}).then(function(e){e&&(h.companies.rows.push(e),u.success({title:"Company properly created!",msg:e.name?e.name+" has been created!":""}))})},h.uploadContacts=function(e){o.show({controller:"UploadContactsDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/upload/upload.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!1,locals:{lists:r,companies:d}}).then(function(){h.getContacts()}).catch(function(e){console.error()})},h.importContacts=function(e,t,n){var a=JSON.parse(t);o.show({controller:"ImportContactsDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/import/import.html",parent:angular.element(i.body),clickOutsideToClose:!1,locals:{lists:r,companies:d,file:a.file,fields:a.fields,license:h.license}}).then(function(){h.getContacts()}).catch(function(e){console.error()})},h.hasPermission=function(){return p.hasPermission(303)||p.hasRole("admin")},a.params.ListId&&(h.selectedList=a.params.ListId),a.params.CompanyId&&(h.selectedCompany=a.params.CompanyId),t.$watch("vm.options.isOpen",function(e){e?n(function(){t.tooltipVisible=h.options.isOpen},600):t.tooltipVisible=h.options.isOpen});var b=!0,f=1;function A(e){h.contacts=e||{count:0,rows:[]}}function E(e){s.cmContact.delete({id:e.id}).$promise.then(function(){_.remove(h.contacts.rows,{id:e.id}),h.contacts.count-=1,h.contacts.rows.length||h.getContacts(),u.success({title:"Contact deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){h.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}];for(var t=0;t<e.data.errors.length;t++)u.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else u.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm.query.filter",function(e,t){b?n(function(){b=!1}):(t||(f=h.query.page),e!==t&&(h.query.page=1),e||(h.query.page=f),h.getContacts())},!0),t.$watch("vm.selectedList",function(e,t){e!==t&&(h.query.ListId=h.selectedList||void 0,h.getContacts())}),t.$watch("vm.selectedCompany",function(e,t){e!==t&&(h.query.CompanyId=h.selectedCompany||void 0,h.getContacts())}),t.$watch("vm.selectedTags",function(e,t){(e.length||t.length)&&(h.query.tags=h.selectedTags.length?h.selectedTags.join():void 0,h.getContacts())})}e.$inject=["$scope","$document","$timeout","$state","$mdDialog","api","contacts","lists","listsMap","companies","companiesMap","tags","toasty","Auth","$stateParams","license"],angular.module("app.contactmanager").controller("ContactsController",e)}(),function(){"use strict";function e(n,a,e,t,i,o,s,r,l){var d=this;function c(){n.hide()}d.errors=[],d.title="CONTACTMANAGER.EDIT_CONTACT",d.contact=angular.copy(o),d.contacts=e||{rows:[],count:0},d.lists=t||{rows:[],count:0},d.companies=i||{rows:[],count:0},d.customFields={rows:[],count:0},d.newContact=!1,d.contact?(delete d.contact.List,d.ListId=d.contact.ListId||void 0):(d.contact={ListId:s?parseInt(s,10):void 0,CompanyId:r?parseInt(r,10):void 0},d.title="CONTACTMANAGER.NEW_CONTACT",d.newContact=!0),d.addNewContact=function(){d.errors=[],l.cmContact.save(d.contact).$promise.then(function(e){d.contacts.unshift(e),a.success({title:"Contact properly created",msg:d.contact.name?d.contact.name+" has been created!":""}),c()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t++)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contacts.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveContact=function(){d.errors=[],l.cmContact.update({id:d.contact.id},d.contact).$promise.then(function(e){var t=_.find(d.contacts,{id:e.id});t&&_.merge(t,e),a.success({title:"Contact properly saved!",msg:d.contact.name?d.contact.name+" has been saved!":""}),c()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.contact.update"}];for(var t=0;t<e.data.errors.length;t++)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteContact=function(e){d.errors=[];var t=n.confirm().title("Are you sure?").content("The contact will be deleted.").ariaLabel("Delete Contact").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){l.cmContact.delete({id:d.contact.id}).$promise.then(function(){_.remove(d.contacts,{id:d.contact.id}),a.success({title:"Contact properly deleted!",msg:d.contact.name?d.contact.name+" has been deleted!":""}),c()}).catch(function(e){console.error(e),d.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}]})},function(){})},d.closeDialog=c,d.getCustomFields=function(e){{if(e)return l.cmList.getCustomFields({id:e}).$promise.then(function(e){e&&(d.customFields=e)}).catch(function(e){console.error(e)});d.customFields={rows:[],count:0}}},d.getDateFromString=function(e){return new Date(e)}}e.$inject=["$mdDialog","toasty","contacts","lists","companies","contact","ListId","CompanyId","api"],angular.module("app.tools").controller("CreateOrEditContactDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o){var s=this;function r(){e.hide()}s.errors=[],s.title="CONTACTMANAGER.COPY_CONTACT",s.contact=angular.copy(n),s.lists=i||{rows:[],count:0},s.addNewContact=function(){s.errors=[],delete s.contact.id,s.contact.tags&&!s.contact.tags.length&&delete s.contact.tags;o.cmContact.save(s.contact).$promise.then(function(e){a.unshift(e),t.success({title:"Contact properly created",msg:s.contact.name?s.contact.name+" has been created!":""}),r()}).catch(function(e){console.error(e),s.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}]})},s.closeDialog=r}e.$inject=["$mdDialog","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("DuplicateContactDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;function d(e){a.hide(e)}l.errors=[],l.title="CONTACTMANAGER.EDIT_HOPPER",l.hopper=angular.copy(s),l.hoppers=o,l.newHopper=!1,l.hopper||(l.hopper={},l.title="CONTACTMANAGER.NEW_HOPPER",l.newHopper=!0),l.saveHopper=function(){l.errors=[],r.cmHopper.update({id:l.hopper.id},l.hopper).$promise.then(function(e){var t=_.find(l.hoppers,{id:e.id});t&&_.merge(t,e),i.success({title:"Hopper properly saved!",msg:l.hopper.name?l.hopper.name+" has been saved!":""}),d(e)}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}]})},l.getDateFromString=function(e){return new Date(e)},l.closeDialog=d}e.$inject=["$scope","$state","$location","$mdDialog","toasty","hoppers","hopper","api"],angular.module("app.contactmanager.contacts").controller("EditHopperDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d,c,m,u,p,g,v,h,b){var f=this;f.license=b,f.contact=r||{},f.hoppers=l||{rows:[],count:0},f.finals=d||{rows:[],count:0},f.histories=c||{rows:[],count:0},f.companies=u||{rows:[],count:0},f.lists=p||{rows:[],count:0},f.customFields=g||{rows:[],count:0},f.tags=v||{rows:[],count:0},f.jscriptySessions=h||{rows:[],count:0},f.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.queryHopper={fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,page:1},f.queryFinal={fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-id",limit:10,page:1},f.queryHistory={fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-id",limit:10,page:1},f.queryJscriptySession={fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,page:1},f.selectedTab=t.params.tab||0,f.gotoContacts=function(){t.go("app.contactmanager.contacts",{},{reload:!0,notify:!0})},f.duplicateContact=function(e){i.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,resolve:{lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"id,name"})}]},locals:{contacts:m.rows,contact:r}})},f.saveContact=function(){s.cmContact.update({id:f.contact.id},f.contact).$promise.then(function(){o.success({title:"Contact updated!",msg:f.contact.name?f.contact.name+" has been updated!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEcontact",msg:e.data?JSON.stringify(e.data):e.toString()})})},f.editCompany=function(e,t){i.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{companies:[],license:null,setting:null},resolve:{company:["apiResolver",function(e){return e.resolve("cmCompany@get",{id:t})}]}})},f.onSelectList=function(e){if(f.contact.ListId){var t=i.confirm().title("You are selecting the list number: "+f.contact.ListId).textContent("Warning! You won't select a different list for the contact "+f.contact.firstName||f.contact.lastName||f.contact.id).targetEvent(e).ok("Ok").cancel("Cancel");return i.show(t).then(f.onSelectListSuccess).catch(function(){f.contact.ListId=null})}},f.onSelectListSuccess=function(){return s.cmList.getCustomFields({id:f.contact.ListId}).$promise.then(function(e){f.customFields=e||{rows:[],count:0}}).catch(function(e){console.error(e)})},f.getDateFromString=function(e){return new Date(e)},f.getHoppers=function(){f.queryHopper.offset=(f.queryHopper.page-1)*f.queryHopper.limit,f.queryHopper.id=f.contact.id,f.promise=s.cmContact.getHoppers(f.queryHopper,y("hoppers")).$promise},f.getFinals=function(){f.queryFinal.offset=(f.queryFinal.page-1)*f.queryFinal.limit,f.queryFinal.id=f.contact.id,f.promise=s.cmContact.getHopperFinals(f.queryFinal,y("finals")).$promise},f.getHistories=function(){f.queryHistory.offset=(f.queryHistory.page-1)*f.queryHistory.limit,f.queryHistory.id=f.contact.id,f.promise=s.cmContact.getHopperHistories(f.queryHistory,y("histories")).$promise},f.getJscriptySessions=function(){f.queryJscriptySession.offset=(f.queryJscriptySession.page-1)*f.queryJscriptySession.limit,f.queryJscriptySession.id=f.contact.id,f.promise=s.cmContact.getJscriptySessions(f.queryJscriptySession,y("jscriptySessions")).$promise},f.deleteconfirm=function(t,e){var n=i.confirm().title("Are you sure want to delete the agent?").htmlContent("<b>"+(t.phone||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){var e;e=t,s.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(f.hoppers.rows,{id:e.id}),f.hoppers.count--,f.hoppers.rows.length||f.getHoppers(),o.success({title:"Hopper deleted!",msg:e.phone?e.phone+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEhopper",msg:e.data?JSON.stringify(e.data):e.toString()})})},function(){console.log("CANCEL")})},f.editHopper=function(e,t){i.show({controller:"CreateOrEditHopperVoiceQueueIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:t,hoppers:f.hoppers.rows,license:null,setting:null}})},f.createOrEditIvrCampaignHopper=function(e,t){i.show({controller:"CreateOrEditHopperCampaignIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:t,hoppers:f.hoppers.rows,license:null,setting:null}})};var A=!0,E=1;function y(t){return function(e){f[t]=e||{count:0,rows:[]}}}e.$watch("vm.queryHopper.filter",function(e,t){A?n(function(){A=!1}):(t||(E=f.queryHopper.page),e!==t&&(f.queryHopper.page=1),e||(f.queryHopper.page=E),f.getHoppers())}),e.$watch("vm.queryFinal.filter",function(e,t){A?n(function(){A=!1}):(t||(E=f.queryFinal.page),e!==t&&(f.queryFinal.page=1),e||(f.queryFinal.page=E),f.getFinals())}),e.$watch("vm.queryHistory.filter",function(e,t){A?n(function(){A=!1}):(t||(E=f.queryHistory.page),e!==t&&(f.queryHistory.page=1),e||(f.queryHistory.page=E),f.getHistories())})}e.$inject=["$scope","$timeout","$state","$document","$mdDialog","toasty","api","contact","hoppers","finals","histories","contacts","companies","lists","customFields","tags","jscriptySessions","license"],angular.module("app.contactmanager.contacts").controller("ContactController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p){var g=this;g.processing=!1,g.stopping=!0,g.license=p,g.pid=0,g.result={finish:!1,rows:0,affectedRows:0,failedRows:0,duplicatedRows:0,errors:[]},g.contactFields=[{key:"firstName",required:!0},{key:"lastName",required:!1},{key:"phone",required:!0},{key:"mobile",required:!1},{key:"email",required:!1},{key:"dateOfBirth",required:!1},{key:"country",required:!1},{key:"city",required:!1},{key:"street",required:!1},{key:"postalCode",required:!1},{key:"fax",required:!1}],g.motionBullFields=[{key:"UserId",required:!1},{key:"scheduledat",required:!1},{key:"priority",required:!1}],g.binding={},g.duplicate=[],g.lists=o||{rows:[],count:0},g.companies=s||{rows:[],count:0},g.customFields={rows:[],count:0},g.fields=u||[],g.closeDialog=function(){d.removeAllListeners("contact:import:"+v),t.hide()},g.onChangeList=function(){return l.cmList.getCustomFields({id:g.ListId}).$promise.then(function(e){g.customFields=e}).catch(function(e){console.error(e)})},g.uploadCsv=function(){g.processing=moment(),l.cmContact.import({id:m.filename,binding:g.binding,ListId:g.ListId,CompanyId:g.CompanyId,duplicates:g.duplicates,socket_timestamp:v}).$promise.then(function(e){g.stopping=!1,e&&e.pid&&(g.pid=e.pid)}).catch(function(e){g.processing=!1,r.error({title:"Import process failed!",msg:"Please retry with a new file"})})},g.getHeaderErrors=function(){var e=u;return e.push("contact_import_error"),e},g.getArrayErrors=function(){for(var e=[],t=0;t<g.result.errors.length;t+=1){var n=g.result.errors[t].row;n.contact_import_error=g.result.errors[t].message,e.push(n)}return e},g.stopUpload=function(){if(g.stopping=!0,g.pid)return l.system.killProcess({pid:g.pid}).$promise.then(function(e){r.success({title:"CSV import process stopped!",msg:"Import has been stopped!"})}).catch(function(e){r.error({title:"CSV stop import process failed!",msg:"pid is unknown"})})};var v=moment().unix();d.on("contact:import:"+v,function(n){i(function(){if(g.result.rows=n.rows,n.errors)for(var e=0;e<n.errors.length;e++)g.result.errors.push(n.errors[e]);if(n.finish){g.result.finish=!0,g.result.affectedRows=n.affectedRows,g.result.failedRows=g.result.errors.length;var t=g.result.rows-g.result.affectedRows-g.result.errors.length;t&&0<t&&(g.duplicates.length?g.result.duplicatedRows=t:g.result.failedRows+=t),g.result.elapsed=moment().diff(g.processing,"seconds")}})}),c.$on("$destroy",function(){d.removeAllListeners("contact:import:"+v)})}e.$inject=["$cookies","$mdDialog","$interval","$q","$timeout","lists","companies","toasty","api","socket","$scope","file","fields","license"],angular.module("app.tools").controller("ImportContactsDialogController",e)}(),function(){"use strict";function e(i,e,o,t,s,n,r){var a=this;a.errors=[],a.title="CONTACTMANAGER.MERGE_CONTACT",a.contact=angular.copy(t),a.lists=n||[],a.change=function(){a.searchTerm?r.cmContact.get({fields:"id,firstName,lastName,phone,email",filter:a.searchTerm,ListId:t.ListId}).$promise.then(function(e){a.contacts=e.rows}).catch(function(e){console.error(e)}):a.contacts=[]},a.showConfirm=function(e,t,n){var a=i.confirm().title("Would you like to merge your contacs?").textContent("All unfilled values of the contact #"+n.id+" will be overwritten by the fields of the contact #"+t.id+".").targetEvent(e).ok("Ok").cancel("Cancel");i.show(a).then(function(){return r.cmContact.merge({to:n.id,from:t.id}).$promise}).then(function(e){_.remove(s,{id:n.id}),_.remove(s,{id:t.id}),s.unshift(e)}).then(function(){o.success({title:"Contact properly merged!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:MERGE_CONTACT",msg:e.data?JSON.stringify(e.data):e.toString()})})},a.closeDialog=function(){i.hide()}}e.$inject=["$mdDialog","$scope","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("MergeContactDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this,u=moment().unix();d.on("contact:csv_"+u,function(t){i(function(){m.uploading=!0,m.success+=t.success,m.errors+=t.errors,m.duplicate+=t.duplicates;for(var e=0;e<t.rows.length;e+=1)m.rows.push(t.rows[e]);t.finished&&(m.uploading=!1,m.finished=!0,m.disableStopButton=!0)})}),m.uploading=!1,m.showStopButton=!1,m.success=0,m.errors=0,m.duplicate=0,m.rows=[],m.contactFields=[{key:"firstName",required:!0},{key:"lastName",required:!1},{key:"phone",required:!0},{key:"mobile",required:!1},{key:"email",required:!1},{key:"dateOfBirth",required:!1},{key:"country",required:!1},{key:"city",required:!1},{key:"street",required:!1},{key:"postalCode",required:!1},{key:"fax",required:!1}],m.binding={},m.lists=o||{rows:[],count:0},m.companies=s||{rows:[],count:0},m.customFields={rows:[],count:0},m.ngFlowOptions={maxChunkRetries:1,chunkSize:15728640,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,target:"api/cm/contacts/csv",allowDuplicateUploads:!0},m.ngFlow={flow:{}},m.closeDialog=function(){d.removeAllListeners("contact:csv_"+u),t.hide()},m.onChangeList=function(){return l.cmList.getCustomFields({id:m.ListId}).$promise.then(function(e){m.customFields=e}).catch(function(e){console.error(e)})},m.uploadCsv=function(){m.uploading=!0,m.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},m.ngFlow.flow.opts.query={},m.ngFlow.flow.opts.query.binding_keys=_.keys(m.binding),m.ngFlow.flow.opts.query.binding_values=_.values(m.binding),m.ngFlow.flow.opts.query.ListId=m.ListId,m.ngFlow.flow.opts.query.socket_timestamp=u,m.CompanyId&&(m.ngFlow.flow.opts.query.CompanyId=m.CompanyId);m.duplicates&&(m.ngFlow.flow.opts.query.duplicates=m.duplicates);console.log("Flow options are:",m.ngFlow.flow.opts),m.ngFlow.flow.upload()},m.exportErrors=function(){for(var e=angular.copy(m.rows),t=0;t<e.length;t+=1)e[t].contact&&(e[t].contact=JSON.stringify(e[t].contact));return angular.copy(e)},m.fileAdded=function(e,t,n){Papa.parse(t.file,{skipEmptyLines:!0,header:!0,complete:function(e){console.log("csv file resultss",e),m.fields=e.meta.fields,m.fileSelected=!0,c.$apply()}})},m.fileSuccess=function(e,t,n){console.log("filessuccess",e,t,n);try{var a=JSON.parse(t);if(!a.pid)throw new Error("No pid parameter from api response!");m.pid=a.pid,m.showStopButton=!0}catch(e){console.error("Unable to parse upload result",e)}},m.stopUpload=function(){if(m.disableStopButton=!1,m.pid)return l.system.killProcess({pid:m.pid}).$promise.then(function(e){console.log("CSV upload process stopped!")}).catch(function(e){console.error(e)});console.error("pid is not defined")},c.$on("$destroy",function(){d.removeAllListeners("contact:csv_"+u)})}e.$inject=["$cookies","$mdDialog","$interval","$q","$timeout","lists","companies","toasty","api","socket","$scope"],angular.module("app.tools").controller("UploadContactsDialogController",e)}(),function(){"use strict";function e(a,e,t,n,i,o,s,r,l,d,c){var m=this;function u(e){n.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD",m.sortable={animation:800,sort:!0,onSort:function(e){a.globalCustomFieldForm.$pristine=!1}},m.globalCustomField=s,m.globalCustomFields=o,m.newGlobalCustomField=!1,m.globalCustomField||(m.globalCustomField={type:"text"},m.title="CONTACTMANAGER.NEW_GLOBALCUSTOMFIELD",m.newGlobalCustomField=!0),a.$watch("vm.globalCustomField.type",function(e,t){if(e!==t)switch(e){case"text":m.globalCustomField.values="";break;case"select":m.globalCustomField.values=[]}}),m.addNewGlobalCustomField=function(){m.errors=[],r.cmCustomField.save(m.globalCustomField).$promise.then(function(e){m.globalCustomFields.unshift(e.toJSON()),i.success({title:"GlobalCustomField properly created",msg:m.globalCustomField.name?m.globalCustomField.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveGlobalCustomField=function(){m.errors=[],r.cmCustomField.update({id:m.globalCustomField.id},m.globalCustomField).$promise.then(function(e){var t=_.find(m.globalCustomFields,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"GlobalCustomField properly saved!",msg:m.globalCustomField.name?m.globalCustomField.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteGlobalCustomField=function(e){m.errors=[];var t=n.confirm().title("Are you sure?").content("The globalCustomField will be deleted.").ariaLabel("Delete GlobalCustomField").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){r.cmCustomField.delete({id:m.globalCustomField.id}).$promise.then(function(){_.remove(m.globalCustomFields,{id:m.globalCustomField.id}),i.success({title:"GlobalCustomField properly deleted!",msg:(m.globalCustomField.name||"globalCustomField")+" has been deleted!"}),u(m.globalCustomField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,m.addItem=function(e){e.push({value:"New Item"}),a.globalCustomFieldForm.$pristine=!1},m.removeItem=function(e,t){e.splice(t,1),a.globalCustomFieldForm.$pristine=!1},m.removeItems=function(e){for(var t=e.length,n=0;n<t;n++)e.splice(0,1);a.globalCustomFieldForm.$pristine=!1}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","globalCustomFields","globalCustomField","api","Auth","license","setting"],angular.module("app.contactmanager").controller("CreateOrEditGlobalCustomFieldDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.globalCustomFields=r||{count:0,rows:[]},v.table="globalCustomFields",v.listOrder="",v.listOrderAsc=null,v.selectedGlobalCustomFields=[],v.query={fields:"createdAt,updatedAt,id,alias,type,values,required",sort:"-updatedAt",ListId:"null",limit:10,page:1},v.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editdialog=function(e,t){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{globalCustomField:e,globalCustomFields:v.globalCustomFields.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the globalCustomField?").htmlContent("<b>"+(e.name||"globalCustomField")+"</b> will be deleted.").ariaLabel("delete globalCustomField").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getGlobalCustomFields=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.cmCustomField.get(v.query,f).$promise},v.createOrEditGlobalCustomField=function(e,t){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{globalCustomField:t,globalCustomFields:v.globalCustomFields.rows,license:v.license,setting:v.setting}})},v.deleteGlobalCustomField=A,v.exportSelectedGlobalCustomFields=function(){var e=angular.copy(v.selectedGlobalCustomFields);return v.selectedGlobalCustomFields=[],e},v.deleteSelectedGlobalCustomFields=function(e){var t=i.confirm().title("Are you sure want to delete the selected globalCustomFields?").htmlContent("<b>"+v.selectedGlobalCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete GlobalCustomFields").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedGlobalCustomFields.forEach(function(e){A(e)}),v.selectedGlobalCustomFields=[]})},v.deselectGlobalCustomFields=function(){v.selectedGlobalCustomFields=[]},v.selectAllGlobalCustomFields=function(){v.selectedGlobalCustomFields=v.globalCustomFields.rows};var h=!0,b=1;function f(e){v.globalCustomFields=e||{count:0,rows:[]}}function A(e){l.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(v.globalCustomFields.rows,{id:e.id}),v.globalCustomFields.count-=1,v.globalCustomFields.rows.length||v.getGlobalCustomFields(),c.success({title:"GlobalCustomField deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCustomField"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCustomField",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getGlobalCustomFields())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","globalCustomFields","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.contactmanager").controller("GlobalCustomFieldsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CONTACTMANAGER.EDIT_LIST",m.list=angular.copy(s),m.lists=o,m.newList=!1,m.list||(m.list={},m.title="CONTACTMANAGER.NEW_LIST",m.newList=!0),m.addNewList=function(){m.errors=[],r.cmList.save(m.list).$promise.then(function(e){m.lists.unshift(e.toJSON()),i.success({title:"List properly created",msg:m.list.name?m.list.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveList=function(){m.errors=[],r.cmList.update({id:m.list.id},m.list).$promise.then(function(e){var t=_.find(m.lists,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"List properly saved!",msg:m.list.name?m.list.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteList=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The list will be deleted.").ariaLabel("Delete List").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cmList.delete({id:m.list.id}).$promise.then(function(){_.remove(m.lists,{id:m.list.id}),i.success({title:"List properly deleted!",msg:(m.list.name||"list")+" has been deleted!"}),u(m.list)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","lists","list","api","Auth","license","setting"],angular.module("app.contactmanager").controller("CreateOrEditListDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.cmList[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.list.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserList?"penalty "+e.UserList.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserList?"penalty "+e.UserList.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.list=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("CONTACTMANAGER.ALL_AGENTS"),labelSelected:s.instant("CONTACTMANAGER.SELECTED_AGENTS"),transferCallback:function(e,t){a.cmList[t?"removeAgents":"addAgents"]({id:l.list.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"List properly "+(t?"removed":"added"),msg:"List has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:cmList.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","list","lists","realtime","$translate","Auth"],angular.module("app.contactmanager").controller("ListagentaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.list={},c.listCustomFields={count:0,rows:[]},c.selectedListCustomFields=[],c.query={fields:"createdAt,updatedAt,id,alias,type,values,required",limit:10,page:1},c.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e){c.list=e,c.query.id=c.list.id,c.query.ListId=c.list.id,c.getListCustomFields()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the customField?").htmlContent("<b>"+(e.name||"customField")+"</b> will be deleted.").ariaLabel("delete customField").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getListCustomFields=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.cmList.getCustomFields(c.query,p).$promise},c.createOrEditListCustomField=function(e,t){o.show({controller:"CreateOrEditCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:c.list,customField:t,customFields:c.listCustomFields.rows,license:null,setting:null}})},c.exportSelectedListCustomFields=function(){var e=angular.copy(c.selectedListCustomFields);return c.selectedListCustomFields=[],e},c.deleteListCustomField=g,c.deleteSelectedListCustomFields=function(e){var t=o.confirm().title("Are you sure want to delete the selected customFields?").htmlContent("<b>"+c.selectedListCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete customFields").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedListCustomFields.forEach(function(e){g(e)}),c.selectedListCustomFields=[]})};var m=!0,u=1;function p(e){c.listCustomFields=e||{count:0,rows:[]}}function g(e){l.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(c.listCustomFields.rows,{id:e.id}),c.listCustomFields.count-=1,c.listCustomFields.rows.length||c.getListCustomFields(),r.success({title:"CustomField deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcmList"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getListCustomFields())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.contactmanager").controller("ListCustomFieldsController",e)}(),function(){"use strict";function e(a,e,t,n,i,o,s,r,l,d,c){var m=this;function u(e){n.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CONTACTMANAGER.EDIT_CUSTOMFIELD",m.sortable={animation:800,sort:!0,onSort:function(e){a.customFieldForm.$pristine=!1}},m.customField=s,m.customFields=o,m.newCustomField=!1,m.customField||(m.customField={type:"text"},m.title="CONTACTMANAGER.NEW_CUSTOMFIELD",m.newCustomField=!0),e.params.id&&(m.customField.ListId=e.params.id),a.$watch("vm.customField.type",function(e,t){if(e!==t)switch(e){case"text":m.customField.values="";break;case"select":m.customField.values=[]}}),m.addNewCustomField=function(){m.errors=[],r.cmList.addCustomField({id:e.params.id},m.customField).$promise.then(function(e){m.customFields.unshift(e.toJSON()),i.success({title:"CustomField properly created",msg:m.customField.name?m.customField.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveCustomField=function(){m.errors=[],r.cmCustomField.update({id:m.customField.id},m.customField).$promise.then(function(e){var t=_.find(m.customFields,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"CustomField properly saved!",msg:m.customField.name?m.customField.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteCustomField=function(e){m.errors=[];var t=n.confirm().title("Are you sure?").content("The customField will be deleted.").ariaLabel("Delete CustomField").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){r.cmCustomField.delete({id:m.customField.id}).$promise.then(function(){_.remove(m.customFields,{id:m.customField.id}),i.success({title:"CustomField properly deleted!",msg:(m.customField.name||"customField")+" has been deleted!"}),u(m.customField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,m.addItem=function(e){e.push({value:"New Item"}),a.customFieldForm.$pristine=!1},m.removeItem=function(e,t){e.splice(t,1),a.customFieldForm.$pristine=!1},m.removeItems=function(e){for(var t=e.length,n=0;n<t;n++)e.splice(0,1);a.customFieldForm.$pristine=!1}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","customFields","customField","api","Auth","license","setting"],angular.module("app.contactmanager").controller("CreateOrEditCustomFieldDialogController",e)}(),function(){"use strict";function e(n,e,a,i,t,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=t,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.list=d||n.params.list||{},c.selectedTab=n.params.tab||0,c.gotogoto=function(e,t){n.go("app.contactmanager.contacts",{ListId:e.id})},c.agentadddialog=function(e,t){a.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{list:e,lists:c.lists?c.lists.rows:[],realtime:!1}})},c.alert=r.info,c.gotoLists=function(){n.go("app.contactmanager.lists")},c.saveList=function(){s.cmList.update({id:c.list.id},c.list).$promise.then(function(){r.success({title:"List updated!",msg:c.list.name?c.list.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","list"],angular.module("app.contactmanager").controller("ListController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.list={},c.listVoiceDispositions={count:0,rows:[]},c.selectedListVoiceDispositions=[],c.query={fields:"createdAt,updatedAt,id,name,createdAt",limit:10,page:1},c.init=function(e){c.list=e,c.query.id=c.list.id,c.query.ListId=c.list.id,c.getListVoiceDispositions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the voiceDisposition?").htmlContent("<b>"+(e.name||"voiceDisposition")+"</b> will be deleted.").ariaLabel("delete voiceDisposition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getListVoiceDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.cmList.getDispositions(c.query,p).$promise},c.createOrEditListVoiceDisposition=function(e,t){o.show({controller:"CreateOrEditVoiceDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/voiceDispositions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:c.list,voiceDisposition:t,voiceDispositions:c.listVoiceDispositions.rows,license:null,setting:null}})},c.exportSelectedListVoiceDispositions=function(){var e=angular.copy(c.selectedListVoiceDispositions);return c.selectedListVoiceDispositions=[],e},c.deleteListVoiceDisposition=g,c.deleteSelectedListVoiceDispositions=function(e){var t=o.confirm().title("Are you sure want to delete the selected voiceDispositions?").htmlContent("<b>"+c.selectedListVoiceDispositions.length+" selected</b> will be deleted.").ariaLabel("delete voiceDispositions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedListVoiceDispositions.forEach(function(e){g(e)}),c.selectedListVoiceDispositions=[]})};var m=!0,u=1;function p(e){c.listVoiceDispositions=e||{count:0,rows:[]}}function g(e){l.voiceDisposition.delete({id:e.id}).$promise.then(function(){_.remove(c.listVoiceDispositions.rows,{id:e.id}),c.listVoiceDispositions.count-=1,c.listVoiceDispositions.rows.length||c.getListVoiceDispositions(),r.success({title:"VoiceDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcmList"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getListVoiceDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.contactmanager").controller("ListVoiceDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CONTACTMANAGER.EDIT_VOICEDISPOSITION",m.voiceDisposition=angular.copy(s),m.voiceDispositions=o,m.newVoiceDisposition=!1,m.voiceDisposition||(m.voiceDisposition={},m.title="CONTACTMANAGER.NEW_VOICEDISPOSITION",m.newVoiceDisposition=!0),t.params.id&&(m.voiceDisposition.ListId=t.params.id),m.addNewVoiceDisposition=function(){m.errors=[],r.voiceDisposition.save(m.voiceDisposition).$promise.then(function(e){m.voiceDispositions.unshift(e.toJSON()),i.success({title:"VoiceDisposition properly created",msg:m.voiceDisposition.name?m.voiceDisposition.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceDisposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceDisposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveVoiceDisposition=function(){m.errors=[],r.voiceDisposition.update({id:m.voiceDisposition.id},m.voiceDisposition).$promise.then(function(e){var t=_.find(m.voiceDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"VoiceDisposition properly saved!",msg:m.voiceDisposition.name?m.voiceDisposition.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceDisposition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceDisposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteVoiceDisposition=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The voiceDisposition will be deleted.").ariaLabel("Delete VoiceDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceDisposition.delete({id:m.voiceDisposition.id}).$promise.then(function(){_.remove(m.voiceDispositions,{id:m.voiceDisposition.id}),i.success({title:"VoiceDisposition properly deleted!",msg:(m.voiceDisposition.name||"voiceDisposition")+" has been deleted!"}),u(m.voiceDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceDisposition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceDisposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","voiceDispositions","voiceDisposition","api","Auth","license","setting"],angular.module("app.contactmanager").controller("CreateOrEditVoiceDispositionDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.lists=r||{count:0,rows:[]},v.table="lists",v.listOrder="",v.listOrderAsc=null,v.selectedLists=[],v.query={fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,page:1},v.editstate=function(e,t){n.go("app.contactmanager.lists.edit",{id:e.id,list:e})},v.gotocontactsgoto=function(e,t){n.go("app.contactmanager.contacts",{ListId:e.id})},v.exportcsvcontactsexport=function(e,t){var n=a.document.createElement("a");n.href="/api/cm/lists/"+e.id+"/contacts/csv",n.target="_self",n.click()},v.agentadddialog=function(e,t){i.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{list:e,lists:v.lists?v.lists.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the list?").htmlContent("<b>"+(e.name||"list")+"</b> will be deleted.").ariaLabel("delete list").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getLists=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.cmList.get(v.query,f).$promise},v.createOrEditList=function(e,t){i.show({controller:"CreateOrEditListDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:t,lists:v.lists.rows,license:v.license,setting:v.setting}})},v.deleteList=A,v.exportSelectedLists=function(){var e=angular.copy(v.selectedLists);return v.selectedLists=[],e},v.deleteSelectedLists=function(e){var t=i.confirm().title("Are you sure want to delete the selected lists?").htmlContent("<b>"+v.selectedLists.length+" selected</b> will be deleted.").ariaLabel("delete Lists").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedLists.forEach(function(e){A(e)}),v.selectedLists=[]})},v.deselectLists=function(){v.selectedLists=[]},v.selectAllLists=function(){v.selectedLists=v.lists.rows};var h=!0,b=1;function f(e){v.lists=e||{count:0,rows:[]}}function A(e){l.cmList.delete({id:e.id}).$promise.then(function(){_.remove(v.lists.rows,{id:e.id}),v.lists.count-=1,v.lists.rows.length||v.getLists(),c.success({title:"List deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmList"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getLists())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","lists","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.contactmanager").controller("ListsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s){var r=this;r.currentUser=o.getCurrentUser(),r.customDashboard={},r.voiceQueues=s&&s.count?s:{count:0,rows:[]},r.voiceQueuesSelected=s&&s.count?_.map(s.rows,"id"):[],r.interval=t(function(){},1e3),r.onChangeVoiceQueues=function(){for(var e=0;e<r.customDashboard.widgets.length;e+=1)r.customDashboard.widgets[e].voiceQueuesSelected=r.voiceQueuesSelected},r.goToEdit=function(){e.go("app.tools.customDashboards.edit",{id:r.customDashboard.id,tab:1})},i.onWithoutApply("voice_queue:save",function(e){var t=_.find(r.voiceQueues.rows,{id:e.id});t&&_.merge(t,_.pick(e,_.keys(t)))}),a.dashboard.get({id:e.params.id}).$promise.then(function(e){if(e)return r.customDashboard=e,r.customDashboard.widgets=[],r.customDashboard.preview=!0,r.customDashboard.draggable={enabled:!1},r.customDashboard.resizable={enabled:!1},a.dashboard.getItems({id:r.customDashboard.id}).$promise}).then(function(e){if(e&&e.count&&e.rows)for(var t=0;t<e.rows.length;t+=1)e.rows[t].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[t].type+"/ms-widget-engine."+e.rows[t].type+".html",e.rows[t].voiceQueues=r.voiceQueues,e.rows[t].voiceQueuesSelected=r.voiceQueuesSelected,r.customDashboard.widgets.push(e.rows[t])}).catch(function(e){r.customDashboard=void 0}),n.$on("$destroy",function(){i.removeAllListeners("voice_queue:save"),r.interval&&t.cancel(r.interval)})}e.$inject=["$state","$interval","$scope","api","socket","Auth","voiceQueues"],angular.module("app.dashboards.custom").controller("DashboardCustomController",e)}(),function(){"use strict";function e(e,t,n,a,s,i,o,r,l,d,c,m,u,p,g,v,h,b,f,A,E,y,S,T){var C=this;C.license=E;function x(){var e={};for(var t in C.tabs)C.tabs.hasOwnProperty(t)&&(e[t]=C.tabs[t],C.tabs[t].interaction&&(e[t].interaction=_.pick(C.tabs[t].interaction,["id","OpenchannelAccountId","MailAccountId","ChatWebsiteId","FaxAccountId","SmsAccountId","closed"])));a.localStorage.setItem("motion2.user:"+C.user.id,JSON.stringify({tabs:e,currentTab:C.currentTab})),O(!0)}function O(e){var t={id:C.user.id,online:e,capacity:{mail:0,fax:0,sms:0,openchannel:0,chat:0},interaction:{mail:[],fax:[],sms:[],openchannel:[],chat:[]}};if(e)for(var n in C.tabs)C.tabs.hasOwnProperty(n)&&t.capacity.hasOwnProperty(C.tabs[n].channel)&&C.tabs[n].interaction&&!C.tabs[n].interaction.closed&&(t.capacity[C.tabs[n].channel]+=1,t.interaction[C.tabs[n].channel].push(C.tabs[n].interaction.id));return p.rpc.setAgentCapacity(t)}function w(t){if(C.tabs[t.id]&&(function(e){if(e.channel&&e.interaction)p.user["remove"+_.upperFirst(e.channel)+"Interactions"]({id:C.user.id,ids:[e.interaction.id]}).$promise.catch(function(e){console.error(e)})}(C.tabs[t.id]),delete C.tabs[t.id],C.currentTab=0,x(),"interaction"===t.type))return p[t.channel+"Interaction"].get({id:t.interaction.id}).$promise.then(function(e){return p.user["remove"+_.upperFirst(t.channel)+"Interactions"]({id:C.user.id,ids:[e.id]}).$promise}).catch(function(e){console.error(e)})}function I(e){e.id=_.random(1e10),e.openedAt=new Date,e.saved=!1,e.badges=0,C.tabs[e.id]=e,C.currentTab=e.id,x()}function R(t,n){var e={type:"interaction",title:t?t.toUpperCase():"openchannel",icon:function(e){switch(e){case"chat":return"icon-hangouts";case"mail":return"icon-email";case"sms":return"icon-message-text";case"openchannel":return"icon-google-earth";case"fax":return"icon-deskphone";default:return"icon-hangouts"}}(t),color:function(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";default:return"grey"}}(t),channel:t,interaction:n},a=_.find(C.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id===n.id&&e.channel===t});a?C.currentTab=a.id:I(e)}function N(e){e&&e.uniqueid&&C.notifications[e.uniqueid]&&(v.clear(C.notifications[e.uniqueid]),delete C.notifications[e.uniqueid])}function D(){return function(e){if(404===e.status)v.warning({title:s.instant("DASHBOARDS.ATTENTION"),msg:s.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){C.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var t=0;t<e.data.errors.length;t+=1)v.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else v.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}C.detectBrowser=T.detectBrowser(),C.user=u.getCurrentUser(),C.currentTab=0,C.notifications={},C.tabs={},C.globalUserLists=h||{count:0,rows:[]},C.globalLists=b||{count:0,rows:[]},C.globalCompanies=f||{count:0,rows:[]},C.globalTags=A||{count:0,rows:[]},C.onContactManager=function(t){var e={ListId:t.ListId,nolimit:!0,sort:"-updatedAt"},n=!1,a=t.calleridname&&"<unknown>"!==t.calleridname?t.calleridname:t.calleridnum||t.uniqueid,i=t.calleridnum;_.isNil(t["xmd-contactid"])?_.isNil(t.routeId)?e.phone=t.calleridnum:(e.phone=t.destcalleridnum,a=t.destcalleridname&&"<unknown>"!==t.destcalleridname?t.destcalleridname:t.destcalleridnum||t.uniqueid,i=t.destcalleridnum):_.isNil(t["xmd-listid"])||parseInt(t["xmd-listid"],10)===t.ListId?(e.id=t["xmd-contactid"],n=!0):t["xmd-contactid2"]&&(e.id=t["xmd-contactid2"],n=!0);return p.cmContact.get(e).$promise.then(function(e){n?e&&C.addContactTab(e,t):e.count&&e.rows[0]?C.addContactTab(e.rows[0],t):C.addContactTab({firstName:a,ListId:t.ListId,phone:i},t)}).catch(D())},C.onJscripty=function(n){return p.jscriptyProject.get({id:n.ProjectId}).$promise.then(function(t){if(t){if(!_.isUndefined(n["xmd-contactid"]))return p.cmContact.get({id:n["xmd-contactid"]}).$promise.then(function(e){I({type:"jscripty",title:t.name,icon:"icon-script",color:"grey",project:t,call:n,contact:e})}).catch(D());I({type:"jscripty",title:t.name,icon:"icon-script",color:"grey",project:t,call:n})}}).catch(D())},C.onBrowserUrl=function(e){if(e&&e.uri)if(e.uriLocation)switch(e.uriLocation){case"0":a.open(e.uri);break;case"1":a.open(e.uri,"_blank","width="+(e.windowWidth||"800")+",height="+e.windowHeight||"600");break;default:a.open(e.uri)}else a.open(e.uri)},C.onBrowserPopup=function(e){e&&e.html&&I({type:"popup",title:e.calleridnum||"popup",icon:"icon-tablet",color:"grey",html:e.html})},C.onNotificationSave=function(e){if(e&&e.uniqueid){n=e,y.isSupported()?y.requestPermission().then(function(){var e,t;t={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"../../../../../../../assets/images/avatars/customer.png",body:(e=n).queue?"Queue: "+e.queue:"",focusOnclick:!0,closeOnClick:!0},y.show(e.title,t)},function(e){console.error("Please enable browser notifications!",e)}):console.error("Browser notifications are not supported by the browser. Normal notifications will be used.");var t=C.alreadyExistsTab(e);if(t){if(p[e.channel+"Message"])return C.currentTab!==t.id&&(t.badges+=1),p[e.channel+"Message"].accept({id:e.id,UserId:C.user.id}).$promise.catch(D())}else v.wait({title:e.title,msg:e.msg||"",showClose:!1,clickToClose:!1,timeout:!1,sound:e.sound,html:!0,shake:e.shake||!1,onAdd:function(){C.notifications[e.uniqueid]=this.id},onAccept:function(){if(N(e),p[e.channel+"Message"])return p[e.channel+"Message"].accept({id:e.id,UserId:C.user.id,manual:!0}).$promise.then(function(e){R(e.channel,e.interaction),v.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(D())},onReject:function(){if(N(e),p[e.channel+"Message"])return p[e.channel+"Message"].reject({id:e.id,UserId:C.user.id}).$promise.then(function(e){v.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(D())}})}var n},C.onNotificationRemove=N,C.onClickTab=function(e){C.currentTab=e,x()},C.isActiveTab=function(e){return e===C.currentTab},C.alreadyExistsTab=function(t){return _.find(C.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id==t.interactionId&&e.channel==t.channel})},C.addContactTab=function(t,n){var a={type:"contact",title:t?function(e){var t="";e&&(e.firstName||e.lastName?(e.firstName&&(t+=e.firstName+" "),e.lastName&&(t+=e.lastName)):e.phone&&(t=e.phone));return t}(t):s.instant("DASHBOARDS.NEW_CONTACT"),icon:"icon-account-circle",color:"red",contact:t,userLists:h,lists:b,companies:f,tags:A,calls:n?[n]:[],autoCreate:n?n.autoCreate:0};if(n){if(n["xmd-cdrtype"]&&"dialer"===n["xmd-cdrtype"])n.answeredAt=n.agentcalledAt?moment(n.agentcalledAt,"YYYY-MM-DD HH:mm:ss").toDate():new Date;else if(n.uniqueid){var e=n.uniqueid.split(".")[0];n.answeredAt=e?new Date(1e3*parseInt(e)):new Date}(n.agentcompleteAt||n.endtime)&&(n.disposedAt=new Date)}if(t){var i=_.find(C.tabs,function(e){return"contact"===e.type&&e.contact&&e.contact.id==t.id});if(i){if(n)if(i.calls){var o=_.find(i.calls,function(e){return e.uniqueid===n.uniqueid});o||i.calls.push(n)}else i.calls=[n];C.currentTab=i.id}else{if(t.ListId)return p.cmList.getDispositions({id:t.ListId}).$promise.then(function(e){return a.dispositions=e,p.cmList.getCustomFields({id:t.ListId}).$promise}).then(function(e){a.customFields=e}).catch(D()).finally(function(){I(a)});I(a)}}else I(a)},C.addInteractionTab=R,C.addTab=I,C.removeTab=w,C.updateLocalStorage=x,C.closeTab=function(e){var t=n.confirm().title("interaction"===e.type?"Do you want to close the interaction?":"Are you sure want to close the "+e.type+"?").textContent("interaction"===e.type?"":"The "+e.type+" has been modified. Closing will lose all changes!").ariaLabel("Close Contact").ok("interaction"===e.type?"YES":"OK").cancel("interaction"===e.type?"NO":"CANCEL");{if(!e.saved)return n.show(t).then(function(){"interaction"===e.type&&n.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!0,locals:{channel:e.channel,interaction:e.interaction}}),w(e)}).catch(function(){"interaction"===e.type&&w(e)});w(e)}},g.on("trigger:contactmanager",C.onContactManager),g.on("trigger:jscripty",C.onJscripty),g.on("trigger:browser:url",C.onBrowserUrl),g.on("trigger:browser:popup",C.onBrowserPopup),g.on("notification:save",C.onNotificationSave),g.on("notification:remove",C.onNotificationRemove),function(){var e=a.localStorage.getItem("motion2.user:"+C.user.id);if(e)try{e=JSON.parse(e),C.tabs=e.tabs?e.tabs:{},C.currentTab=e.currentTab?e.currentTab:0,O(!0)}catch(e){console.error(e)}}(),e.$on("$destroy",function(){for(var e in C.notifications)C.notifications.hasOwnProperty(e)&&N({uniqueid:e});g.removeAllListeners("trigger:contactmanager"),g.removeAllListeners("trigger:jscripty"),g.removeAllListeners("trigger:browser:url"),g.removeAllListeners("trigger:browser:popup"),g.removeAllListeners("notification:save"),g.removeAllListeners("notification:remove")})}e.$inject=["$scope","$state","$mdDialog","$window","$translate","$mdToast","$document","$templateCache","$rootScope","$controller","$compile","$templateRequest","Auth","api","socket","toasty","globalUserLists","globalLists","globalCompanies","globalTags","license","desktopNotification","$http","msUtils"],angular.module("app.dashboards").controller("AgentDashboardGeneralController",e)}(),function(){"use strict";angular.module("app.dashboards").provider("desktopNotification",function(){var b={autoClose:!0,duration:5,showOnPageHidden:!1};return{config:function(e){for(var t in e)b.hasOwnProperty(t)&&null!=e[t]&&(b[t]=e[t])},$get:["$q","$timeout","$window","PERMISSIONS",function(e,u,t,p){var g=t.Notification||t.mozNotification||t.webkitNotification;return{isSupported:v,currentPermission:h,requestPermission:function(){if(!v())return e.reject("Notification API not supported");var n=e.defer();Promise.resolve(g.requestPermission)==g.requestPermission?g.requestPermission().then(function(e){p.GRANTED===e?n.resolve(e):n.reject(e)}):g.requestPermission(function(e,t){p.GRANTED===e?n.resolve(e):n.reject(e)});return n.promise},show:function(e,t){if(t=t||{},!v()||(n=e,a=t,i=angular.isString(n),o=!a.onClick||angular.isFunction(a.onClick),!i||!o)||function(e){if(e||b.showOnPageHidden)return!(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)}(t.showOnPageHidden)||h()!==p.GRANTED)return;var n,a,i,o;var s=new g(e,t),r=t.duration||b.duration,l=void 0===t.autoClose?b.autoClose:t.autoClose;s.onclick=function(){t.onClick&&t.onClick(),t.focusOnclick&&window.focus(),t.closeOnClick&&s.close()},l&&(d=s,c=r,m=1e3*c,u(d.close.bind(d),m,!1));var d,c,m;return s},permissions:{default:p.DEFAULT,granted:p.GRANTED,denied:p.DENIED}};function v(){return!(void 0===g)}function h(){return(g||{}).permission}}]}}).provider("msNavigationAgentService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function t(e,t){if(angular.isString(e)){for(var n=e.split("."),a=n[n.length-1],i=function(e){var t=l;if(1===e.length)return t;e.pop();for(var n=0;n<e.length;n++){for(var a=e[n],i=!0,o=0;o<t.length;o++)if(t[o]._id===a){t=t[o].children,i=!1;break}if(i){var s={_id:a,_path:e.join("."),title:a,weight:1,children:[]};t.push(s),t=s.children}}return t}(n),o=!1,s=0;s<i.length;s++)if(i[s]._id===a){o=i[s];break}o?(angular.extend(o,t),o.uisref=d(o)):(t.children=[],!angular.isUndefined(t.weight)&&angular.isNumber(t.weight)||(t.weight=1),t._id=a,t._path=e,t.uisref=d(t),i.push(t))}else r.error("path must be a string (eg. `dashboard.project`)")}function d(e){var t="";return angular.isDefined(e.state)&&(t=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(t=t+"("+angular.toJson(e.stateParams)+")")),t}this.saveItem=t,this.$get=function(){var e={saveItem:t,getNavigation:function(e){if(e){for(var t=0;t<l.length;t++)if(l[t]._id===e)return[l[t]];return null}return l}};return e}}).constant("PERMISSIONS",{DEFAULT:"default",GRANTED:"granted",DENIED:"denied"})}(),function(){"use strict";function e(s,r,e,i,l,t,d,c,n,a,o,m){var u=this;u.user=n.getCurrentUser(),u.detectBrowser=m.detectBrowser(),u.queryHopper={fields:"id,phone,scheduledat",sort:"-updatedAt",limit:10,page:1},u.queryFinal={fields:"uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-updatedAt",limit:10,page:1},u.queryHistory={fields:"uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,page:1},u.hoppers={rows:[],count:0},u.finals={rows:[],count:0},u.histories={rows:[],count:0},u.addNewContact=function(){u.errors=[],d.cmContact.save(u.contact).$promise.then(function(e){return u.contact.id=e.id,u.newContact=!1,u.tab.title=e.firstName||e.phone,u.tab.contact=u.contact,d.user.addContacts({id:n.getCurrentUser().id,ids:[e.id]})}).then(function(){u.detailForm.$pristine=!0,u.customFieldsForm.$pristine=!0,c.success({title:"Contact properly created",msg:u.contact.firstName?u.contact.firstName+" has been created!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.saveContact=function(){u.errors=[],d.cmContact.update({id:u.contact.id},u.contact).$promise.then(function(e){return u.tab.title=e.firstName||e.phone,u.tab.contact=u.contact,l.$parent.vm.updateLocalStorage(),d.user.addContacts({id:n.getCurrentUser().id,ids:[e.id]})}).then(function(){u.detailForm.$pristine=!0,u.customFieldsForm.$pristine=!0,c.success({title:"Contact properly updated!",msg:u.contact.name?u.contact.name+" has been updated!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.getCustomFields=function(e){return d.cmList.getCustomFields({id:e}).$promise.then(function(e){u.tab.customFields=e}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"LIST:GETCustomFields",msg:e.data?JSON.stringify(e.data):e.toString()})})},u.call=l.$parent.vm.call,u.disposeCall=function(e,t){if(u.newContact)return void c.error({title:"ATTENTION",msg:"Before to dispose, please save the contact!"});s.show({controller:"DisposeCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",parent:angular.element(r.body),targetEvent:t,clickOutsideToClose:!1,locals:{dispositions:u.tab.dispositions,contact:u.contact,call:t}}).then(function(e){e&&("BLACKLIST"===e?c.success({title:o.instant("DASHBOARDS.INFO"),msg:o.instant("DASHBOARDS.CALL_DISPOSED")+" "+e}):"RECALLME"===e||"RESCHEDULE"===e||c.success({title:o.instant("DASHBOARDS.INFO"),msg:o.instant("DASHBOARDS.CALL_SAVED")})),_.remove(u.tab.calls,function(e){return e.uniqueid==t.uniqueid})})},u.duplicateContact=function(e){s.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:u.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:n.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}})},u.mergeContact=function(e){s.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:u.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:n.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}})},u.getDateFromString=function(e){if(e)return new Date(e);return null},u.addJscriptyTab=function(e,t){try{l.$parent.$parent.$parent.vm.addTab({type:"jscripty",title:e.name,icon:"icon-script",color:"grey",project:e,contact:u.contact})}catch(e){c.error({title:"ERROR OPENING JSCRIPTY PROJECT",msg:"The project cannot be started"+JSON.stringify(e)})}},u.getHoppers=function(){u.contact&&u.contact.id&&(u.queryHopper.ContactId=u.contact.id,u.queryHopper.offset=(u.queryHopper.page-1)*u.queryHopper.limit,u.promise=d.cmHopper.get(u.queryHopper,v("hoppers")).$promise)},u.getFinals=function(){u.contact&&u.contact.id&&(u.queryFinal.ContactId=u.contact.id,u.queryFinal.offset=(u.queryFinal.page-1)*u.queryFinal.limit,u.promise=d.cmHopperFinal.get(u.queryFinal,v("finals")).$promise)},u.getHistories=function(){u.contact&&u.contact.id&&(u.queryHistory.ContactId=u.contact.id,u.queryHistory.offset=(u.queryHistory.page-1)*u.queryHistory.limit,u.promise=d.cmHopperHistory.get(u.queryHistory,v("histories")).$promise)},u.getJscriptyProjects=function(){d.jscriptyProject.get({fields:"createdAt,updatedAt,id,name,description,createdAt,formData,enableUncompleteSave",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){u.jscriptyProjects=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.jscripty.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscripty.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.getMailAccounts=function(){d.mailAccount.get({nolimit:!0}).$promise.then(function(e){u.mailAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.mail.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mail.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.getFaxAccounts=function(){d.faxAccount.get({nolimit:!0}).$promise.then(function(e){u.faxAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.fax.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.fax.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.getSmsAccounts=function(){d.smsAccount.get({nolimit:!0}).$promise.then(function(e){u.smsAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.sms.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sms.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.composeInteraction=function(e,i,t,n){var o=i.toLowerCase();s.show({controller:"Compose"+i+"InteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose"+i+"/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{account:t,message:{to:"mail"==o?n:n.split(",")},type:"new",interaction:{Contact:u.contact}},fullscreen:!0}).then(function(a){return d[o+"Account"].send({id:t.id},a).$promise.then(function(e){if("Mail"===i){var t=e;if(t&&t.Messages&&t.Messages.length){if(a.attachments&&a.attachments.length)for(var n=0;n<a.attachments.length;n+=1)d.attachment.update({id:a.attachments[n].id},{MailMessageId:_.head(t.Messages).id});c.success({title:"Message properly sent!",msg:"Message has been sent!"}),t.closed?(t.disposition=null,s.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!0,locals:{channel:"mail",interaction:t}})):l.$parent.vm.addInteractionTab("mail",t)}}else c.success({title:"Message properly sent!",msg:"Message has been sent!"}),l.$parent.vm.addInteractionTab(o,e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else"fax"===o?c.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()}):c.error({title:e.status?"API:"+e.status+" - "+e.statusText:i.toUpperCase()+"ACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},u.init=function(e,t){u.tab=e,l.$watchGroup(["vm.detailForm.$pristine","vm.customFieldsForm.$pristine"],function(e,t){u.tab.saved=e[0]&&e[1]}),u.license=t,u.contact=u.tab.contact,u.newContact=!1,u.currentTab=0,u.contact&&u.contact.id?(d.user.addContacts({id:u.user.id,ids:[u.contact.id]}),u.contact.ListId&&(u.tab.userLists.rows=_.unionBy(u.tab.userLists.rows,_.filter(u.tab.lists.rows,{id:u.contact.ListId}),"id"),u.list=_.find(u.tab.userLists.rows,{id:u.contact.ListId})),u.getHoppers(),u.getFinals(),u.getHistories(),u.getMailAccounts(),u.getFaxAccounts(),u.getSmsAccounts()):(u.newContact=!0,e.autoCreate&&(console.log("autoCreate"),u.addNewContact()))},u.hasPermission=function(e){return n.hasPermission(e)},a.on("voice_queue_channel:remove",h),a.on("voice_outbound_channel:remove",h),u.getJscriptyProjects(),l.$watch("currentTab",function(e,t){1===u.currentTab&&(u.getHoppers(),u.getFinals(),u.getHistories())});var p=!0,g=1;function v(t){return function(e){u[t]=e||{count:0,rows:[]}}}function h(t){var n,e,a=_.findLastIndex(u.tab.calls,function(e){return e.uniqueid===t.uniqueid});0<=a&&(u.tab.calls[a].disposedAt=new Date),u.contact&&u.contact.id&&i((n=t.uniqueid,e=u.contact.id,function(){if(_.find(u.tab.calls,function(e){return e.uniqueid===n}))return d.voiceCallReport.update({id:n,ContactId:e}).$promise.catch(function(e){console.error(e)})}),1e3)}l.$watch("queryHopper.filter",function(e,t){p?i(function(){p=!1}):(t||(g=u.queryHopper.page),e!==t&&(u.queryHopper.page=1),e||(u.queryHopper.page=g),u.getHoppers())}),l.$watch("queryFinal.filter",function(e,t){p?i(function(){p=!1}):(t||(g=u.queryFinal.page),e!==t&&(u.queryFinal.page=1),e||(u.queryFinal.page=g),u.getFinals())}),l.$watch("queryHistory.filter",function(e,t){p?i(function(){p=!1}):(t||(g=u.queryHistory.page),e!==t&&(u.queryHistory.page=1),e||(u.queryHistory.page=g),u.getHistories())}),l.$on("$destroy",function(){a.removeAllListeners("voice_queue_channel:remove"),a.removeAllListeners("voice_outbound_channel:remove")})}e.$inject=["$mdDialog","$document","$window","$timeout","$scope","$rootScope","api","toasty","Auth","socket","$translate","msUtils"],angular.module("app.dashboards").controller("AgentGeneralContactController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p){var g=this;function v(){var e=g.choice?g.choice.toLowerCase():void 0;return{id:g.call.uniqueid,disposition:g.choice,dispositionat:moment(),amd:"amd"===e,fax:"fax"===e,blacklist:"blacklist"===e,recallme:"recallme"===e,UserId:"recallme"===e?u.getCurrentUser().id:null}}g.choice=null,g.isReschedule=!1,g.recallme=!1,g.dispositions=d,g.contact=m,g.call=c,g.note=g.call.note||void 0,g.dialerCall=!1,g.hopper={minDate:new Date,dateTime:new Date},g.call&&g.call.variables&&g.call.variables["xmd-voicequeueid"]&&(g.dialerCall=!0),g.saveDisposition=function(e){if(g.choice=_.isNil(e)?g.choice:e,g.call.note=g.note,l.voiceCallReport.update({id:g.call.uniqueid,userDisposition:g.choice,note:g.note,UserId:u.getCurrentUser().id,ContactId:g.contact.id}).$promise.catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICECALLREPORT",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceRecording.get({uniqueid:g.call.uniqueid}).$promise.then(function(e){if(e)for(var t=0;t<e.rows.length;t+=1)l.voiceRecording.update({id:e.rows[t].id,userDisposition:g.choice}).$promise.catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.dialerCall)if(l.cmHopperFinal.update(v()).$promise.catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERFINAL",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.cmHopperHistory.update(v()).$promise.catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERHISTORY",msg:e.data?JSON.stringify(e.data):e.toString()})}),_.isNil(g.choice))a.hide(g.choice?g.choice.toUpperCase():"");else switch(g.choice.toLowerCase()){case"blacklist":g.call&&g.call.variables&&g.call.variables["xmd-voicequeueid"]&&function(e){if(e)l.voiceQueue.getBlackLists({id:e,type:"outbound",fields:"id"}).$promise.then(function(e){var t=[];if(e&&0<e.count){for(var n=0;n<e.rows.length;n+=1){var a=angular.copy(g.contact);delete a.id,a.ListId=e.rows[n].id,t.push(l.cmContact.save(a).$promise)}return o.all(t)}return r.success({title:p.instant("DASHBOARDS.INFO"),msg:p.instant("DASHBOARDS.NOTAVAILABLE")+" "+g.choice}),void(g.choice=void 0)}).then(function(e){e&&a.hide(g.choice?g.choice.toUpperCase():"")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEBLACKLIST",msg:e.data?JSON.stringify(e.data):e.toString()}),a.hide(g.choice?g.choice.toUpperCase():"")})}(g.call.variables["xmd-voicequeueid"]);break;case"reschedule":g.isReschedule=!0,g.recallme=!1;break;case"recallme":g.isReschedule=!0,g.recallme=!0;break;default:a.hide(g.choice?g.choice.toUpperCase():"")}else a.hide(g.choice?g.choice.toUpperCase():"")},g.closeDialog=function(){a.cancel()},g.saveReschedule=function(){return g.disable=!0,l.cmHopper.save({phone:g.contact.phone,UserId:g.recallme?u.getCurrentUser().id:null,ContactId:g.contact.id,ListId:g.contact.ListId,VoiceQueueId:Number(g.call["xmd-voicequeueid"]),scheduledat:moment(g.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),priority:3,recallme:g.recallme}).$promise.then(function(){l.cmHopperFinal.update({id:g.call.uniqueid,rescheduled:!0,rescheduledat:moment(g.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),recallme:g.recallme}).$promise.catch(function(e){console.log(e)})}).then(function(){r.success({title:p.instant("DASHBOARDS.INFO"),msg:p.instant("DASHBOARDS.CALL_DISPOSED")+" "+(g.recallme?p.instant("DASHBOARDS.RECALLME"):p.instant("DASHBOARDS.RESCHEDULE"))})}).catch(function(e){a.cancel(e)}).finally(function(){g.disable=!1,a.hide(g.choice?g.choice.toUpperCase():"")})}}e.$inject=["$scope","$state","$location","$mdDialog","$timeout","$q","$document","toasty","api","dispositions","call","contact","Auth","$translate"],angular.module("app.staff").controller("DisposeCallDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m){var u=this;u.call=l,u.contact=r,u.hopper={minDate:new Date,dateTime:new Date},u.closeDialog=function(){a.cancel()},u.saveDialog=function(){return u.disable=!0,s.cmHopper.save({phone:u.contact.phone,UserId:c?d.getCurrentUser().id:null,ContactId:u.contact.id,ListId:u.contact.ListId,VoiceQueueId:Number(u.call["xmd-voicequeueid"]),scheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),priority:3,recallme:c}).$promise.then(function(){s.cmHopperFinal.update({id:u.call.uniqueid,rescheduled:!0,rescheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),recallme:c}).$promise}).then(function(){o.success({title:m.instant("DASHBOARDS.INFO"),msg:m.instant("DASHBOARDS.CALL_DISPOSED")+" "+(c?m.instant("DASHBOARDS.RECALLME"):m.instant("DASHBOARDS.RESCHEDULE"))}),a.hide()}).catch(function(e){a.cancel(e)}).finally(function(){u.disable=!1})}}e.$inject=["$scope","$state","$location","$mdDialog","$timeout","toasty","api","contact","call","Auth","recallme","$translate"],angular.module("app.staff").controller("RescheduleCallDialogController",e)}(),function(){"use strict";function e(e,t){var n=t(function(){},999);e.$on("$destroy",function(){n&&(t.cancel(n),n=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeAbandonedController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d,c){var m=this,u=!0;function p(){var e=i.localStorage.getItem("motion2.home.abandoned.bull.contacts:"+m.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(m.query=_.merge(e.query,_.omit(m.query,["sort","limit","page"])),m.query=_.omit(m.query,"filter")),s.voiceDisposition.get().$promise.then(function(e){m.disposition=e?e.rows:[]}).catch(function(e){console.log(e)}),s.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){m.queues=e||{count:0,rows:[]},m.queuesMap=_.mapValues(_.keyBy(m.queues.rows,"name"),"name"),m.defaultQueues=m.queues.rows?_.map(m.queues.rows,"name").join(","):void 0}).catch(function(e){console.error(e)}).finally(function(){m.getContacts()})}function g(e){m.contacts=e||{count:0,rows:[]},u=!1,m.refresh=!0}m.showTooltip=!1,m.refresh=!0,m.disable=[],m.disposition,m.currentUser=r.getCurrentUser(),m.localizationMap=c,m.pickerModel={dateStart:null,dateEnd:null},m.queues={},m.contacts={count:0,rows:[]},m.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},m.clearAll=function(){m.query.dateStart=void 0,m.query.dateEnd=void 0,m.pickerModel={dateStart:null,dateEnd:null},m.getContacts()},m.getContacts=function(){m.query.dateStart=void 0,m.query.dateEnd=void 0,m.pickerModel.dateStart&&!u&&(m.query.dateStart=m.pickerModel.dateStart,m.query.dateEnd=m.pickerModel.dateEnd);m.query.queue=m.query.queue||m.defaultQueues,m.query.offset=(m.query.page-1)*m.query.limit,i.localStorage.setItem("motion2.home.abandoned.bull.contacts:"+m.currentUser.id,JSON.stringify({query:_.omit(m.query,"queue")})),m.promise=s.voiceQueueReport.getVoiceQueuesReport(m.query,g).$promise},m.refreshContacts=function(){m.showTooltip=!1,m.getContacts()},m.onInit=p,m.reserved=function(e,t){e&&(m.disable[e.id]=!0,s.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?m.currentUser.name:null,assigned:e.assigned,disposition:t||null}).$promise.catch(function(e){console.log(e)}).finally(function(){m.disable[e.id]=!1}))},m.onSavevoiceQueueReport=function(e){m.queuesMap&&"outbound"===e.type&&m.queuesMap[e.queue]&&(m.showTooltip=!0)},m.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(m.contacts.rows,["id",e.id]);0<=t&&_.merge(m.contacts.rows[t],e)}},m.call=e.$parent.$parent.$parent.$parent.vm.call,m.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,m.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,m.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",m.onSavevoiceQueueReport),l.onWithoutApply("voiceQueueReport:update",m.onUpdatevoiceQueueReport),p();var v=!0,h=1;e.$watch("vm_bull.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=h),m.getContacts())}),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeAbandonedBullController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d,c){var m=this,u=!0;function p(){var e=i.localStorage.getItem("motion2.home.abandoned.voice.contacts:"+m.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(m.query=_.merge(e.query,_.omit(m.query,["sort","limit","page"])),m.query=_.omit(m.query,"filter")),s.voiceDisposition.get().$promise.then(function(e){m.disposition=e?e.rows:[]}).catch(function(e){console.log(e)}),s.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise.then(function(e){m.queues=e||{count:0,rows:[]},m.queuesMap=_.mapValues(_.keyBy(m.queues.rows,"name"),"name"),m.defaultQueues=m.queues.rows?_.map(m.queues.rows,"name").join(","):void 0}).catch(function(e){console.error(e)}).finally(function(){m.getContacts()})}function g(e){m.contacts=e||{count:0,rows:[]},u=!1,m.refresh=!0}m.showTooltip=!1,m.refresh=!0,m.disable=[],m.disposition,m.currentUser=r.getCurrentUser(),m.localizationMap=c,m.pickerModel={dateStart:null,dateEnd:null},m.queues={},m.contacts={count:0,rows:[]},m.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},m.clearAll=function(){m.query.dateStart=void 0,m.query.dateEnd=void 0,m.pickerModel={dateStart:null,dateEnd:null},m.getContacts()},m.getContacts=function(){m.query.dateStart=void 0,m.query.dateEnd=void 0,m.pickerModel.dateStart&&!u&&(m.query.dateStart=m.pickerModel.dateStart,m.query.dateEnd=m.pickerModel.dateEnd);m.query.queue=m.query.queue||m.defaultQueues,m.query.offset=(m.query.page-1)*m.query.limit,i.localStorage.setItem("motion2.home.abandoned.voice.contacts:"+m.currentUser.id,JSON.stringify({query:_.omit(m.query,"queue")})),m.promise=s.voiceQueueReport.getVoiceQueuesReport(m.query,g).$promise},m.refreshContacts=function(){m.showTooltip=!1,m.getContacts()},m.onInit=p,m.reserved=function(e,t){e&&(m.disable[e.id]=!0,s.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?m.currentUser.name:null,assigned:e.assigned,disposition:t||null}).$promise.catch(function(e){console.log(e)}).finally(function(){m.disable[e.id]=!1}))},m.onSavevoiceQueueReport=function(e){m.queuesMap&&"inbound"===e.type&&m.queuesMap[e.queue]&&(m.showTooltip=!0)},m.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(m.contacts.rows,["id",e.id]);0<=t&&_.merge(m.contacts.rows[t],e)}},m.call=e.$parent.$parent.$parent.$parent.vm.call,m.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,m.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,m.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",m.onSavevoiceQueueReport),l.onWithoutApply("voiceQueueReport:update",m.onUpdatevoiceQueueReport),p();var v=!0,h=1;e.$watch("vm_voice.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=h),m.getContacts())}),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeAbandonedVoiceController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s){var r=this;r.user=i.getCurrentUser(),r.license={},r.sidebar="dashboard",r.navigation=s.getNavigation(),r.addContactTab=e.$parent.vm.addContactTab,r.addInteractionTab=e.$parent.vm.addInteractionTab,r.init=function(e){r.license=e;var t=n.localStorage.getItem("motion2.home:"+r.user.id);if(t)try{t=JSON.parse(t),r.sidebar=t.currentSidebarTab?t.currentSidebarTab:"dashboard"}catch(e){console.error(e),r.sidebar="dashboard"}},r.changeSidebarTab=function(e){r.sidebar=e,n.localStorage.setItem("motion2.home:"+r.user.id,JSON.stringify({currentSidebarTab:e}))},r.hasPermission=function(e){return i.hasPermission(e)}}e.$inject=["$scope","$timeout","$window","api","Auth","socket","msNavigationAgentService"],angular.module("app.dashboards").controller("AgentGeneralHomeController",e)}(),function(){"use strict";function e(n,a,e,t,i,o,s,r,l,d){var c=this;function m(e){c.chatInteractions=e||{count:0,rows:[]};for(var t=0;t<c.chatInteractions.rows.length;t+=1)p(c.chatInteractions.rows[t])}function u(){c.query.dateStart=void 0,c.query.dateEnd=void 0,c.pickerModel.dateStart&&(c.query.dateStart=c.pickerModel.dateStart,c.query.dateEnd=c.pickerModel.dateEnd),c.query.offset=(c.query.page-1)*c.query.limit,i.localStorage.setItem("motion2.home.chat:"+c.user.id,JSON.stringify({query:c.query})),c.promise=s.chatInteraction.get(c.query,m).$promise}function p(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}c.user=r.getCurrentUser(),c.tags={count:0,rows:[]},c.chatInteractions={count:0,rows:[]},c.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,substatus:null,ChatWebsiteId:null},c.success=m,c.getChatInteractions=u,c.showChatInteraction=function(e,t){n.$parent.vm.addInteractionTab("chat",t)},c.getContactLabel=function(e){if(e.Contact){var t="";t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||"");var n=e.Account?e.Account.mapKey:void 0;return t+=n&&e.Contact[n]?" <"+e.Contact[n]+">":""}return o.instant("DASHBOARDS.UNKNOWN")},c.getUserLabel=function(e){if(e.UserId)return e.UserId===r.getCurrentUser().id?o.instant("DASHBOARDS.ME"):c.usersByKey[e.UserId].fullname+" <"+c.usersByKey[e.UserId].internal+">";return o.instant("DASHBOARDS.NOT_ASSIGNED")},c.getChatWebsiteLabel=function(e){if(e.Account)return e.Account.key;return o.instant("DASHBOARDS.UNKNOWN")},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.clearAll=function(){c.calendarModel={dateStart:null},c.pickerModel={dateStart:null},c.serviceModel={dateStart:null},c.getChatInteractions()},c.onInit=function(){return s.chatWebsite.get({nolimit:!0}).$promise.then(function(e){return c.chatAccounts=e||{count:0,rows:[]},s.tag.get().$promise}).then(function(e){c.tags=e||{count:0,rows:[]}}).then(function(){return s.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){c.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=i.localStorage.getItem("motion2.home.chat:"+c.user.id);if(e)try{(e=JSON.parse(e)).query&&(c.query=_.merge(c.query,e.query),c.query=_.omit(c.query,"filter"),c.query.sort&&0<=c.query.sort.indexOf("lastMessage")&&(c.query=_.omit(c.query,"sort")),c.query.includeAll=!0)}catch(e){console.error(e)}l.on("chatInteraction:save",c.onChatInteractionSave),l.on("chatInteraction:update",c.onChatInteractionSave),l.on("chatInteractionTags:save",c.onChatInteractionTagsSave),l.on("chatMessage:save",c.onChatMessageSave),l.on("chatMessage:update",c.onChatMessageSave),l.on("user_has_chat_interactions:save",c.onChatInteractionOpen),l.on("user_has_chat_interactions:remove",c.onChatInteractionClose),c.getChatInteractions()})},c.onChatInteractionSave=function(e){if(e){var t=_.find(c.chatInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):u(),p(e)}},c.onChatInteractionTagsSave=function(e){if(e){var t=_.find(c.chatInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},c.onChatMessageSave=function(e){if(e&&!e.secret){var t=_.find(c.chatInteractions.rows,{id:e.ChatInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),p(t)}}},c.onChatInteractionOpen=function(e){var t=_.find(c.chatInteractions.rows,{id:e.ChatInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},c.onChatInteractionClose=function(e){var t=_.find(c.chatInteractions.rows,{id:e.ChatInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},c.localizationMap={Today:o.instant("DASHBOARDS.TODAY"),Yesterday:o.instant("DASHBOARDS.YESTERDAY"),"This Week":o.instant("DASHBOARDS.THIS_WEEK"),"Last Week":o.instant("DASHBOARDS.LAST_WEEK"),"This Month":o.instant("DASHBOARDS.THIS_MONTH"),"Last Month":o.instant("DASHBOARDS.LAST_MONTH"),"This Year":o.instant("DASHBOARDS.THIS_YEAR"),"Last Year":o.instant("DASHBOARDS.LAST_YEAR"),January:o.instant("DASHBOARDS.JANUARY"),February:o.instant("DASHBOARDS.FEBRUARY"),March:o.instant("DASHBOARDS.MARCH"),April:o.instant("DASHBOARDS.APRIL"),May:o.instant("DASHBOARDS.MAY"),June:o.instant("DASHBOARDS.JUNE"),July:o.instant("DASHBOARDS.JULY"),August:o.instant("DASHBOARDS.AUGUST"),September:o.instant("DASHBOARDS.SEPTEMBER"),October:o.instant("DASHBOARDS.OCTOBER"),November:o.instant("DASHBOARDS.NOVEMBER"),December:o.instant("DASHBOARDS.DECEMBER"),Mon:o.instant("DASHBOARDS.MON"),Tue:o.instant("DASHBOARDS.TUE"),Wed:o.instant("DASHBOARDS.WED"),Thu:o.instant("DASHBOARDS.THU"),Fri:o.instant("DASHBOARDS.FRI"),Sat:o.instant("DASHBOARDS.SAT"),Sun:o.instant("DASHBOARDS.SUN")},c.pickerModel={dateStart:null},c.onInit();var g=!0,v=1;n.$watch("vm.query.filter",function(e,t){g?a(function(){g=!1}):(t||(v=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=v),c.getChatInteractions())}),n.$on("$destroy",function(){l.removeAllListeners("chatMessage:save"),l.removeAllListeners("chatMessage:update"),l.removeAllListeners("chatInteraction:save"),l.removeAllListeners("chatInteractionTags:save"),l.removeAllListeners("chatInteraction:update"),l.removeAllListeners("user_has_chat_interactions:save"),l.removeAllListeners("user_has_chat_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeChatController",e)}(),function(){"use strict";function e(n,a,i,o,e,t,s,r){var l=this;l.currentUser=t.getCurrentUser(),l.lists={},l.contacts={count:0,rows:[]},l.query={sort:"-updatedAt",limit:10,page:1},l.getContacts=function(){l.query.ListId=l.query.ListId||l.defaultLists,l.query.offset=(l.query.page-1)*l.query.limit,r.localStorage.setItem("motion2.home.contacts:"+l.currentUser.id,JSON.stringify({query:_.omit(l.query,"ListId")})),l.promise=s.cmContact.get(l.query,m).$promise},l.refreshContacts=function(){l.getContacts()},l.mergeContact=function(e,t){o.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.duplicateContact=function(e,t){o.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.openContact=function(e,t){a.$parent.vm.addContactTab(t)},l.call=a.$parent.vm.call,(l.onInit=u)();var d=!0,c=1;function m(e){l.contacts=e||{count:0,rows:[]}}function u(){var e=r.localStorage.getItem("motion2.home.contacts:"+l.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(l.query=_.merge(l.query,e.query),l.query=_.omit(l.query,"filter")),s.user.getLists({id:l.currentUser.id,fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){l.lists=e||{count:0,rows:[]},l.listsMap=_.keyBy(l.lists.rows,"id"),l.defaultLists=l.lists.rows?_.map(l.lists.rows,"id").join(","):void 0}).catch(function(e){console.error(e)}).finally(function(){l.getContacts()})}a.$watch("vm.query.filter",function(e,t){d?i(function(){d=!1}):(t||(c=l.query.page),e!==t&&(l.query.page=1),e||(l.query.page=c),l.getContacts())})}e.$inject=["$document","$scope","$timeout","$mdDialog","$stateParams","Auth","api","$window"],angular.module("app.dashboards").controller("AgentHomeContactsController",e)}(),function(){"use strict";function e(e,t){var n=t(function(){},999);e.$on("$destroy",function(){n&&(t.cancel(n),n=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeDashboardController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this,m=["type","waiting","dialMethod","dialActive"];function u(e){c.voiceQueuesTotal=e.count?e.count:0,c.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.voiceQueues,function(e,t){c.rpcVoiceQueues[t]&&(c.voiceQueues[t].waiting=c.rpcVoiceQueues[t].waiting||0)})}c.voiceQueues={},c.voiceQueuesTotal=0,c.rpcVoiceQueues={},c.getVoiceQueues={},c.rpcVoiceQueuesChannels={},c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.load=!0,c.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"outbound",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=u,c.getVoiceQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=s.user.getQueues(c.query,u).$promise},c.getSize=function(e){return _.size(e)},c.onSaveQueue=function(e){c.voiceQueues[e.id]&&c.rpcVoiceQueues[e.id]&&(c.rpcVoiceQueues[e.id]=e,_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onSaveChannel=function(e){"outbound"===e.type&&(e.queuecallerleaveAt?(delete c.rpcVoiceQueuesChannels[e.uniqueid],c.load&&c.deleteVoiceQueuesChannels.push(e.uniqueid)):(c.rpcVoiceQueuesChannels[e.uniqueid]=e,c.load&&(c.addVoiceQueuesChannels[e.uniqueid]=e)))},c.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getVoiceQueues()},c.onSaveVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]=_.pick(e,m))},c.onUpdateVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]&&_.merge(c.rpcVoiceQueues[e.id],_.pick(e,m)),c.voiceQueues[e.id]&&_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete c.rpcVoiceQueues[e.id],delete c.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",c.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",c.onSaveChannel),l.onWithoutApply("userVoiceQueue:save",c.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",c.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",c.onUpdateVoiceQueue),s.rpc.getVoiceQueues().$promise.then(function(e){return c.rpcVoiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},s.rpc.getVoiceQueuesChannels().$promise}).then(function(e){c.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,{type:"outbound",queuecallerleaveAt:null}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(c.rpcVoiceQueuesChannels,c.addVoiceQueuesChannels);for(var e=0;e<c.deleteVoiceQueuesChannels.length;e+=1)delete c.rpcVoiceQueuesChannels[c.deleteVoiceQueuesChannels[e]];c.load=!1,c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.getVoiceQueues()});var p=!0,g=1;e.$watch("vm_dc.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardBullController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcChatQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.chatQueuesTotal=e.count?e.count:0,c.chatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.chatQueues,function(e,t){c.rpcChatQueues[t]&&(c.chatQueues[t].waiting=c.rpcChatQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=s.user.getQueues(c.query,g).$promise}c.chatQueues={},c.chatQueuesTotal=0,c.rpcChatQueues={},c.paginatedInteractions=[],c.deleteChatQueuesWaitingInteractions=[],c.rpcChatQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"chat",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getChatQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.chatQueues[e.id]&&c.rpcChatQueues[e.id]&&(_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onSaveChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]=_.pick(e,m))},c.onUpdateChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]&&_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),c.chatQueues[e.id]&&_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onRemoveChatQueue=function(e){_.isNil(e)||(delete c.rpcChatQueues[e.id],delete c.chatQueues[e.id])},c.onSaveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onRemoveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onSaveChatQueueChannel=function(e){c.rpcChatQueuesWaitingInteractions[e.id]=e,p()},c.onRemoveChatQueueChannel=function(e){delete c.rpcChatQueuesWaitingInteractions[e.id],u&&c.deleteChatQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("chat_queue:save",c.onSaveQueue),l.onWithoutApply("chatQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("chatQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("chatQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userChatQueue:save",c.onSaveUserChatQueue),l.onWithoutApply("userChatQueue:remove",c.onRemoveUserChatQueue),l.onWithoutApply("chat_queue_waiting_interaction:save",c.onSaveChatQueueChannel),l.onWithoutApply("chat_queue_waiting_interaction:remove",c.onRemoveChatQueueChannel),s.rpc.getChatQueues().$promise.then(function(e){return c.rpcChatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},s.rpc.getChatQueuesWaitingInteractions().$promise}).then(function(e){_.merge(c.rpcChatQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteChatQueuesWaitingInteractions.length;e+=1)delete c.rpcChatQueuesWaitingInteractions[c.deleteChatQueuesWaitingInteractions[e]];u=!1,c.deleteChatQueuesWaitingInteractions=[],v(),p()});var h=!0,b=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(b=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=b),c.getChatQueues())}),e.$on("$destroy",function(){l.removeAllListeners("chat_queue:save"),l.removeAllListeners("chatQueue:save"),l.removeAllListeners("chatQueue:update"),l.removeAllListeners("chatQueue:remove"),l.removeAllListeners("userChatQueue:save"),l.removeAllListeners("userChatQueue:remove"),l.removeAllListeners("chat_queue_waiting_interaction:save"),l.removeAllListeners("chat_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelChatController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcFaxQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.faxQueuesTotal=e.count?e.count:0,c.faxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.faxQueues,function(e,t){c.rpcFaxQueues[t]&&(c.faxQueues[t].waiting=c.rpcFaxQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=s.user.getQueues(c.query,g).$promise}c.faxQueues={},c.faxQueuesTotal=0,c.rpcFaxQueues={},c.paginatedInteractions=[],c.deleteFaxQueuesWaitingInteractions=[],c.rpcFaxQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"fax",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getFaxQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.faxQueues[e.id]&&c.rpcFaxQueues[e.id]&&(_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onSaveFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]=_.pick(e,m))},c.onUpdateFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]&&_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),c.faxQueues[e.id]&&_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onRemoveFaxQueue=function(e){_.isNil(e)||(delete c.rpcFaxQueues[e.id],delete c.faxQueues[e.id])},c.onSaveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onRemoveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onSaveFaxQueueChannel=function(e){c.rpcFaxQueuesWaitingInteractions[e.id]=e,p()},c.onRemoveFaxQueueChannel=function(e){delete c.rpcFaxQueuesWaitingInteractions[e.id],u&&c.deleteFaxQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("fax_queue:save",c.onSaveQueue),l.onWithoutApply("faxQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("faxQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("faxQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userFaxQueue:save",c.onSaveUserFaxQueue),l.onWithoutApply("userFaxQueue:remove",c.onRemoveUserFaxQueue),l.onWithoutApply("fax_queue_waiting_interaction:save",c.onSaveFaxQueueChannel),l.onWithoutApply("fax_queue_waiting_interaction:remove",c.onRemoveFaxQueueChannel),s.rpc.getFaxQueues().$promise.then(function(e){return c.rpcFaxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},s.rpc.getFaxQueuesWaitingInteractions().$promise}).then(function(e){_.merge(c.rpcFaxQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteFaxQueuesWaitingInteractions.length;e+=1)delete c.rpcFaxQueuesWaitingInteractions[c.deleteFaxQueuesWaitingInteractions[e]];u=!1,c.deleteFaxQueuesWaitingInteractions=[],v(),p()});var h=!0,b=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(b=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=b),c.getFaxQueues())}),e.$on("$destroy",function(){l.removeAllListeners("fax_queue:save"),l.removeAllListeners("faxQueue:save"),l.removeAllListeners("faxQueue:update"),l.removeAllListeners("faxQueue:remove"),l.removeAllListeners("userFaxQueue:save"),l.removeAllListeners("userFaxQueue:remove"),l.removeAllListeners("fax_queue_waiting_interaction:save"),l.removeAllListeners("fax_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelFaxController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcMailQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.mailQueuesTotal=e.count?e.count:0,c.mailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.mailQueues,function(e,t){c.rpcMailQueues[t]&&(c.mailQueues[t].waiting=c.rpcMailQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=s.user.getQueues(c.query,g).$promise}c.mailQueues={},c.mailQueuesTotal=0,c.rpcMailQueues={},c.paginatedInteractions=[],c.deleteMailQueuesWaitingInteractions=[],c.rpcMailQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"mail",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getMailQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.mailQueues[e.id]&&c.rpcMailQueues[e.id]&&(_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onSaveMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]=_.pick(e,m))},c.onUpdateMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]&&_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),c.mailQueues[e.id]&&_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onRemoveMailQueue=function(e){_.isNil(e)||(delete c.rpcMailQueues[e.id],delete c.mailQueues[e.id])},c.onSaveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onRemoveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onSaveMailQueueChannel=function(e){c.rpcMailQueuesWaitingInteractions[e.id]=e,p()},c.onRemoveMailQueueChannel=function(e){delete c.rpcMailQueuesWaitingInteractions[e.id],u&&c.deleteMailQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("mail_queue:save",c.onSaveQueue),l.onWithoutApply("mailQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("mailQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("mailQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userMailQueue:save",c.onSaveUserMailQueue),l.onWithoutApply("userMailQueue:remove",c.onRemoveUserMailQueue),l.onWithoutApply("mail_queue_waiting_interaction:save",c.onSaveMailQueueChannel),l.onWithoutApply("mail_queue_waiting_interaction:remove",c.onRemoveMailQueueChannel),s.rpc.getMailQueues().$promise.then(function(e){return c.rpcMailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},s.rpc.getMailQueuesWaitingInteractions().$promise}).then(function(e){_.merge(c.rpcMailQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteMailQueuesWaitingInteractions.length;e+=1)delete c.rpcMailQueuesWaitingInteractions[c.deleteMailQueuesWaitingInteractions[e]];u=!1,c.deleteMailQueuesWaitingInteractions=[],v(),p()});var h=!0,b=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(b=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=b),c.getMailQueues())}),e.$on("$destroy",function(){l.removeAllListeners("mail_queue:save"),l.removeAllListeners("mailQueue:save"),l.removeAllListeners("mailQueue:update"),l.removeAllListeners("mailQueue:remove"),l.removeAllListeners("userMailQueue:save"),l.removeAllListeners("userMailQueue:remove"),l.removeAllListeners("mail_queue_waiting_interaction:save"),l.removeAllListeners("mail_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelMailController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcOpenchannelQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.openchannelQueuesTotal=e.count?e.count:0,c.openchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.openchannelQueues,function(e,t){c.rpcOpenchannelQueues[t]&&(c.openchannelQueues[t].waiting=c.rpcOpenchannelQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=s.user.getQueues(c.query,g).$promise}c.openchannelQueues={},c.openchannelQueuesTotal=0,c.rpcOpenchannelQueues={},c.paginatedInteractions=[],c.deleteOpenchannelQueuesWaitingInteractions=[],c.rpcOpenchannelQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"openchannel",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getOpenchannelQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.openchannelQueues[e.id]&&c.rpcOpenchannelQueues[e.id]&&(_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onSaveOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]=_.pick(e,m))},c.onUpdateOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]&&_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),c.openchannelQueues[e.id]&&_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onRemoveOpenchannelQueue=function(e){_.isNil(e)||(delete c.rpcOpenchannelQueues[e.id],delete c.openchannelQueues[e.id])},c.onSaveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onRemoveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onSaveOpenchannelQueueChannel=function(e){c.rpcOpenchannelQueuesWaitingInteractions[e.id]=e,p()},c.onRemoveOpenchannelQueueChannel=function(e){delete c.rpcOpenchannelQueuesWaitingInteractions[e.id],u&&c.deleteOpenchannelQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("openchannel_queue:save",c.onSaveQueue),l.onWithoutApply("openchannelQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("openchannelQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("openchannelQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userOpenchannelQueue:save",c.onSaveUserOpenchannelQueue),l.onWithoutApply("userOpenchannelQueue:remove",c.onRemoveUserOpenchannelQueue),l.onWithoutApply("openchannel_queue_waiting_interaction:save",c.onSaveOpenchannelQueueChannel),l.onWithoutApply("openchannel_queue_waiting_interaction:remove",c.onRemoveOpenchannelQueueChannel),s.rpc.getOpenchannelQueues().$promise.then(function(e){return c.rpcOpenchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},s.rpc.getOpenchannelQueuesWaitingInteractions().$promise}).then(function(e){_.merge(c.rpcOpenchannelQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteOpenchannelQueuesWaitingInteractions.length;e+=1)delete c.rpcOpenchannelQueuesWaitingInteractions[c.deleteOpenchannelQueuesWaitingInteractions[e]];u=!1,c.deleteOpenchannelQueuesWaitingInteractions=[],v(),p()});var h=!0,b=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(b=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=b),c.getOpenchannelQueues())}),e.$on("$destroy",function(){l.removeAllListeners("openchannel_queue:save"),l.removeAllListeners("openchannelQueue:save"),l.removeAllListeners("openchannelQueue:update"),l.removeAllListeners("openchannelQueue:remove"),l.removeAllListeners("userOpenchannelQueue:save"),l.removeAllListeners("userOpenchannelQueue:remove"),l.removeAllListeners("openchannel_queue_waiting_interaction:save"),l.removeAllListeners("openchannel_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelOpenchannelController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcSmsQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.smsQueuesTotal=e.count?e.count:0,c.smsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.smsQueues,function(e,t){c.rpcSmsQueues[t]&&(c.smsQueues[t].waiting=c.rpcSmsQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=s.user.getQueues(c.query,g).$promise}c.smsQueues={},c.smsQueuesTotal=0,c.rpcSmsQueues={},c.paginatedInteractions=[],c.deleteSmsQueuesWaitingInteractions=[],c.rpcSmsQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"sms",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getSmsQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.smsQueues[e.id]&&c.rpcSmsQueues[e.id]&&(_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onSaveSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]=_.pick(e,m))},c.onUpdateSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]&&_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),c.smsQueues[e.id]&&_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onRemoveSmsQueue=function(e){_.isNil(e)||(delete c.rpcSmsQueues[e.id],delete c.smsQueues[e.id])},c.onSaveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onRemoveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onSaveSmsQueueChannel=function(e){c.rpcSmsQueuesWaitingInteractions[e.id]=e,p()},c.onRemoveSmsQueueChannel=function(e){delete c.rpcSmsQueuesWaitingInteractions[e.id],u&&c.deleteSmsQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("sms_queue:save",c.onSaveQueue),l.onWithoutApply("smsQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("smsQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("smsQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userSmsQueue:save",c.onSaveUserSmsQueue),l.onWithoutApply("userSmsQueue:remove",c.onRemoveUserSmsQueue),l.onWithoutApply("sms_queue_waiting_interaction:save",c.onSaveSmsQueueChannel),l.onWithoutApply("sms_queue_waiting_interaction:remove",c.onRemoveSmsQueueChannel),s.rpc.getSmsQueues().$promise.then(function(e){return c.rpcSmsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},s.rpc.getSmsQueuesWaitingInteractions().$promise}).then(function(e){_.merge(c.rpcSmsQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteSmsQueuesWaitingInteractions.length;e+=1)delete c.rpcSmsQueuesWaitingInteractions[c.deleteSmsQueuesWaitingInteractions[e]];u=!1,c.deleteSmsQueuesWaitingInteractions=[],v(),p()});var h=!0,b=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(b=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=b),c.getSmsQueues())}),e.$on("$destroy",function(){l.removeAllListeners("sms_queue:save"),l.removeAllListeners("smsQueue:save"),l.removeAllListeners("smsQueue:update"),l.removeAllListeners("smsQueue:remove"),l.removeAllListeners("userSmsQueue:save"),l.removeAllListeners("userSmsQueue:remove"),l.removeAllListeners("sms_queue_waiting_interaction:save"),l.removeAllListeners("sms_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelSmsController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this,m=["type","waiting","dialMethod","dialActive"];function u(e){c.voiceQueuesTotal=e.count?e.count:0,c.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.voiceQueues,function(e,t){c.rpcVoiceQueues[t]&&(c.voiceQueues[t].waiting=c.rpcVoiceQueues[t].waiting||0)})}c.voiceQueues={},c.voiceQueuesTotal=0,c.rpcVoiceQueues={},c.getVoiceQueues={},c.rpcVoiceQueuesChannels={},c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.load=!0,c.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"inbound",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=u,c.getVoiceQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=s.user.getQueues(c.query,u).$promise},c.getSize=function(e){return _.size(e)},c.onSaveQueue=function(e){c.voiceQueues[e.id]&&c.rpcVoiceQueues[e.id]&&(c.rpcVoiceQueues[e.id]=e,_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onSaveChannel=function(e){"inbound"===e.type&&(e.queuecallerleaveAt?(delete c.rpcVoiceQueuesChannels[e.uniqueid],c.load&&c.deleteVoiceQueuesChannels.push(e.uniqueid)):(c.rpcVoiceQueuesChannels[e.uniqueid]=e,c.load&&(c.addVoiceQueuesChannels[e.uniqueid]=e)))},c.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getVoiceQueues()},c.onSaveVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]=_.pick(e,m))},c.onUpdateVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]&&_.merge(c.rpcVoiceQueues[e.id],_.pick(e,m)),c.voiceQueues[e.id]&&_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete c.rpcVoiceQueues[e.id],delete c.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",c.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",c.onSaveChannel),l.onWithoutApply("userVoiceQueue:save",c.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",c.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",c.onUpdateVoiceQueue),s.rpc.getVoiceQueues().$promise.then(function(e){return c.rpcVoiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},s.rpc.getVoiceQueuesChannels().$promise}).then(function(e){c.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,{type:"inbound",queuecallerleaveAt:null}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(c.rpcVoiceQueuesChannels,c.addVoiceQueuesChannels);for(var e=0;e<c.deleteVoiceQueuesChannels.length;e+=1)delete c.rpcVoiceQueuesChannels[c.deleteVoiceQueuesChannels[e]];c.load=!1,c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.getVoiceQueues()});var p=!0,g=1;e.$watch("vm_dc.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardVoiceController",e)}(),function(){"use strict";function e(n,a,i,o,t,s,r,l,d,c){var m=this;function e(e){m.faxInteractions=e||{count:0,rows:[]};for(var t=0;t<m.faxInteractions.rows.length;t+=1)p(m.faxInteractions.rows[t])}function u(){m.query.dateStart=void 0,m.query.dateEnd=void 0,m.pickerModel.dateStart&&(m.query.dateStart=m.pickerModel.dateStart,m.query.dateEnd=m.pickerModel.dateEnd),m.query.offset=(m.query.page-1)*m.query.limit,t.localStorage.setItem("motion2.home.fax:"+m.user.id,JSON.stringify({query:m.query})),m.promise=r.faxInteraction.get(m.query,e).$promise}function p(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=l.getCurrentUser(),m.tags={count:0,rows:[]},m.faxInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,substatus:null,FaxAccountId:null},m.success=e,m.getFaxInteractions=u,m.showFaxInteraction=function(e,t){n.$parent.vm.addInteractionTab("fax",t)},m.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),t+=" <"+(e.Contact.fax||"unknown")+">"}return s.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===l.getCurrentUser().id?s.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return s.instant("DASHBOARDS.NOT_ASSIGNED")},m.getFaxAccountLabel=function(e){if(e.Account)return e.Account.key;return s.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getFaxInteractions()},m.composeFaxInteraction=function(e,t){i.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeFax/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){return r.faxAccount.send({id:t.id},e).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),n.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})})},m.onInit=function(){return r.faxAccount.get({nolimit:!0}).$promise.then(function(e){return m.faxAccounts=e||{count:0,rows:[]},r.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return r.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.fax:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}d.on("faxInteraction:save",m.onFaxInteractionSave),d.on("faxInteraction:update",m.onFaxInteractionSave),d.on("faxInteractionTags:save",m.onFaxInteractionTagsSave),d.on("faxMessage:save",m.onFaxMessageSave),d.on("faxMessage:update",m.onFaxMessageSave),d.on("user_has_fax_interactions:save",m.onFaxInteractionOpen),d.on("user_has_fax_interactions:remove",m.onFaxInteractionClose),m.getFaxInteractions()})},m.onFaxInteractionSave=function(e){if(e){var t=_.find(m.faxInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):u(),p(e)}},m.onFaxInteractionTagsSave=function(e){if(e){var t=_.find(m.faxInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onFaxMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),p(t)}}},m.onFaxInteractionOpen=function(e){var t=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onFaxInteractionClose=function(e){var t=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap={Today:s.instant("DASHBOARDS.TODAY"),Yesterday:s.instant("DASHBOARDS.YESTERDAY"),"This Week":s.instant("DASHBOARDS.THIS_WEEK"),"Last Week":s.instant("DASHBOARDS.LAST_WEEK"),"This Month":s.instant("DASHBOARDS.THIS_MONTH"),"Last Month":s.instant("DASHBOARDS.LAST_MONTH"),"This Year":s.instant("DASHBOARDS.THIS_YEAR"),"Last Year":s.instant("DASHBOARDS.LAST_YEAR"),January:s.instant("DASHBOARDS.JANUARY"),February:s.instant("DASHBOARDS.FEBRUARY"),March:s.instant("DASHBOARDS.MARCH"),April:s.instant("DASHBOARDS.APRIL"),May:s.instant("DASHBOARDS.MAY"),June:s.instant("DASHBOARDS.JUNE"),July:s.instant("DASHBOARDS.JULY"),August:s.instant("DASHBOARDS.AUGUST"),September:s.instant("DASHBOARDS.SEPTEMBER"),October:s.instant("DASHBOARDS.OCTOBER"),November:s.instant("DASHBOARDS.NOVEMBER"),December:s.instant("DASHBOARDS.DECEMBER"),Mon:s.instant("DASHBOARDS.MON"),Tue:s.instant("DASHBOARDS.TUE"),Wed:s.instant("DASHBOARDS.WED"),Thu:s.instant("DASHBOARDS.THU"),Fri:s.instant("DASHBOARDS.FRI"),Sat:s.instant("DASHBOARDS.SAT"),Sun:s.instant("DASHBOARDS.SUN")},m.pickerModel={dateStart:null},m.onInit();var g=!0,v=1;n.$watch("vm.query.filter",function(e,t){g?a(function(){g=!1}):(t||(v=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=v),m.getFaxInteractions())}),n.$on("$destroy",function(){d.removeAllListeners("faxMessage:save"),d.removeAllListeners("faxMessage:update"),d.removeAllListeners("faxInteraction:save"),d.removeAllListeners("faxInteractionTags:save"),d.removeAllListeners("faxInteraction:update"),d.removeAllListeners("user_has_fax_interactions:save"),d.removeAllListeners("user_has_fax_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeFaxController",e)}(),function(){"use strict";function e(a,n,i,o,t,s,r,l,d,c){var m=this;function e(e){m.mailInteractions=e||{count:0,rows:[]};for(var t=0;t<m.mailInteractions.rows.length;t+=1)p(m.mailInteractions.rows[t])}function u(){m.query.dateStart=void 0,m.query.dateEnd=void 0,m.pickerModel.dateStart&&(m.query.dateStart=m.pickerModel.dateStart,m.query.dateEnd=m.pickerModel.dateEnd),0!=m.query.closed&&(m.query.substatus=null),m.query.offset=(m.query.page-1)*m.query.limit,t.localStorage.setItem("motion2.home.mail:"+m.user.id,JSON.stringify({query:m.query})),m.promise=r.mailInteraction.get(m.query,e).$promise}function p(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=l.getCurrentUser(),m.tags={count:0,rows:[]},m.mailInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,substatus:null,MailAccountId:null},m.success=e,m.getMailInteractions=u,m.showMailInteraction=function(e,t){a.$parent.vm.addInteractionTab("mail",t)},m.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),e.to&&e.Account&&e.to.indexOf(e.Account.email)<0?t=e.to:t+=" <"+(e.Contact.email||"unknown")+">",t}return s.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===l.getCurrentUser().id?s.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return s.instant("DASHBOARDS.NOT_ASSIGNED")},m.getMailAccountLabel=function(e){if(e.Account)return e.Account.key;return s.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getMailInteractions()},m.composeMailInteraction=function(e,t){i.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeMail/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(n){return r.mailAccount.send({id:t.id},n).$promise.then(function(e){if(e&&e.Messages&&e.Messages.length){if(n.attachments&&n.attachments.length)for(var t=0;t<n.attachments.length;t+=1)r.attachment.update({id:n.attachments[t].id},{MailMessageId:_.head(e.Messages).id});c.success({title:"Message properly sent!",msg:"Message has been sent!"}),e.closed?(e.disposition=null,i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!0,locals:{channel:"mail",interaction:e}})):a.$parent.vm.addInteractionTab("mail",e)}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"MAILACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.onInit=function(){return r.mailAccount.get({nolimit:!0}).$promise.then(function(e){return m.mailAccounts=e||{count:0,rows:[]},r.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return r.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).then(function(){return r.mailSubstatus.get({nolimit:!0}).$promise}).then(function(e){m.subStatuses=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.mail:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}d.on("mailInteraction:save",m.onMailInteractionSave),d.on("mailInteraction:update",m.onMailInteractionSave),d.on("mailInteractionTags:save",m.onMailInteractionTagsSave),d.on("mailMessage:save",m.onMailMessageSave),d.on("mailMessage:update",m.onMailMessageSave),d.on("user_has_mail_interactions:save",m.onMailInteractionOpen),d.on("user_has_mail_interactions:remove",m.onMailInteractionClose),m.getMailInteractions()})},m.onMailInteractionSave=function(e){if(e){var t=_.find(m.mailInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):u(),p(e)}},m.onMailInteractionTagsSave=function(e){if(e){var t=_.find(m.mailInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onMailMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.mailInteractions.rows,{id:e.MailInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),p(t)}}},m.onMailInteractionOpen=function(e){var t=_.find(m.mailInteractions.rows,{id:e.MailInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onMailInteractionClose=function(e){var t=_.find(m.mailInteractions.rows,{id:e.MailInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap={Today:s.instant("DASHBOARDS.TODAY"),Yesterday:s.instant("DASHBOARDS.YESTERDAY"),"This Week":s.instant("DASHBOARDS.THIS_WEEK"),"Last Week":s.instant("DASHBOARDS.LAST_WEEK"),"This Month":s.instant("DASHBOARDS.THIS_MONTH"),"Last Month":s.instant("DASHBOARDS.LAST_MONTH"),"This Year":s.instant("DASHBOARDS.THIS_YEAR"),"Last Year":s.instant("DASHBOARDS.LAST_YEAR"),January:s.instant("DASHBOARDS.JANUARY"),February:s.instant("DASHBOARDS.FEBRUARY"),March:s.instant("DASHBOARDS.MARCH"),April:s.instant("DASHBOARDS.APRIL"),May:s.instant("DASHBOARDS.MAY"),June:s.instant("DASHBOARDS.JUNE"),July:s.instant("DASHBOARDS.JULY"),August:s.instant("DASHBOARDS.AUGUST"),September:s.instant("DASHBOARDS.SEPTEMBER"),October:s.instant("DASHBOARDS.OCTOBER"),November:s.instant("DASHBOARDS.NOVEMBER"),December:s.instant("DASHBOARDS.DECEMBER"),Mon:s.instant("DASHBOARDS.MON"),Tue:s.instant("DASHBOARDS.TUE"),Wed:s.instant("DASHBOARDS.WED"),Thu:s.instant("DASHBOARDS.THU"),Fri:s.instant("DASHBOARDS.FRI"),Sat:s.instant("DASHBOARDS.SAT"),Sun:s.instant("DASHBOARDS.SUN")},m.pickerModel={dateStart:null},m.onInit();var g=!0,v=1;a.$watch("vm.query.filter",function(e,t){g?n(function(){g=!1}):(t||(v=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=v),m.getMailInteractions())}),a.$on("$destroy",function(){d.removeAllListeners("mailMessage:save"),d.removeAllListeners("mailMessage:update"),d.removeAllListeners("mailInteraction:save"),d.removeAllListeners("mailInteractionTags:save"),d.removeAllListeners("mailInteraction:update"),d.removeAllListeners("user_has_mail_interactions:save"),d.removeAllListeners("user_has_mail_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeMailController",e)}(),function(){"use strict";function e(n,a,i,o,e,t,s){var r=this;r.currentUser=e.getCurrentUser(),r.lists={},r.contacts={count:0,rows:[]},r.query={id:r.currentUser.id,sort:"-updatedAt",limit:10,page:1},r.getContacts=function(){r.query.ListId=r.query.ListId||r.defaultLists,r.query.offset=(r.query.page-1)*r.query.limit,s.localStorage.setItem("motion2.home.mycontacts:"+r.currentUser.id,JSON.stringify({query:r.query})),r.promise=t.user.getContacts(r.query,c).$promise},r.refreshContacts=function(){r.getContacts()},r.mergeContact=function(e,t){o.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:r.currentUser.id,fields:"id,name"})}]},locals:{contacts:r.contacts.rows}})},r.duplicateContact=function(e,t){o.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:r.currentUser.id,fields:"id,name"})}]},locals:{contacts:r.contacts.rows}})},r.openContact=function(e,t){a.$parent.vm.addContactTab(t)},r.call=a.$parent.vm.call,r.onInit=function(){var e=s.localStorage.getItem("motion2.home.mycontacts:"+r.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(r.query=_.omit(e.query,"filter"))}catch(e){console.error(e)}r.getContacts()},t.cmList.get({fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){r.lists=e||{count:0,rows:[]},r.listsMap=_.keyBy(r.lists.rows,"id"),r.defaultLists=r.lists.rows?_.map(r.lists.rows,"id").join(","):void 0}).catch(function(e){console.error(e)}).finally(function(){r.getContacts()});var l=!0,d=1;function c(e){r.contacts=e||{count:0,rows:[]}}a.$watch("vm.query.filter",function(e,t){l?i(function(){l=!1}):(t||(d=r.query.page),e!==t&&(r.query.page=1),e||(r.query.page=d),r.getContacts())})}e.$inject=["$document","$scope","$timeout","$mdDialog","Auth","api","$window"],angular.module("app.dashboards").controller("AgentHomeMyContactsController",e)}(),function(){"use strict";function e(n,a,e,t,i,o,s,r,l,d){var c=this;function m(e){c.openchannelInteractions=e||{count:0,rows:[]};for(var t=0;t<c.openchannelInteractions.rows.length;t+=1)p(c.openchannelInteractions.rows[t])}function u(){c.query.dateStart=void 0,c.query.dateEnd=void 0,c.pickerModel.dateStart&&(c.query.dateStart=c.pickerModel.dateStart,c.query.dateEnd=c.pickerModel.dateEnd),c.query.offset=(c.query.page-1)*c.query.limit,i.localStorage.setItem("motion2.home.openchannel:"+c.user.id,JSON.stringify({query:c.query})),c.promise=s.openchannelInteraction.get(c.query,m).$promise}function p(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}c.user=r.getCurrentUser(),c.tags={count:0,rows:[]},c.openchannelInteractions={count:0,rows:[]},c.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,substatus:null,OpenchannelAccountId:null},c.success=m,c.getOpenchannelInteractions=u,c.showOpenchannelInteraction=function(e,t){n.$parent.vm.addInteractionTab("openchannel",t)},c.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),e.from&&(t=e.from),t}return o.instant("DASHBOARDS.UNKNOWN")},c.getUserLabel=function(e){if(e.UserId)return e.UserId===r.getCurrentUser().id?o.instant("DASHBOARDS.ME"):c.usersByKey[e.UserId].fullname+" <"+c.usersByKey[e.UserId].internal+">";return o.instant("DASHBOARDS.NOT_ASSIGNED")},c.getOpenchannelAccountLabel=function(e){if(e.Account)return e.Account.key;return o.instant("DASHBOARDS.UNKNOWN")},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.clearAll=function(){c.calendarModel={dateStart:null},c.pickerModel={dateStart:null},c.serviceModel={dateStart:null},c.getOpenchannelInteractions()},c.onInit=function(){return s.openchannelAccount.get({nolimit:!0}).$promise.then(function(e){return c.openchannelAccounts=e||{count:0,rows:[]},s.tag.get().$promise}).then(function(e){c.tags=e||{count:0,rows:[]}}).then(function(){return s.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){c.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=i.localStorage.getItem("motion2.home.openchannel:"+c.user.id);if(e)try{(e=JSON.parse(e)).query&&(c.query=_.merge(c.query,e.query),c.query=_.omit(c.query,"filter"),c.query.sort&&0<=c.query.sort.indexOf("lastMessage")&&(c.query=_.omit(c.query,"sort")),c.query.includeAll=!0)}catch(e){console.error(e)}l.on("openchannelInteraction:save",c.onOpenchannelInteractionSave),l.on("openchannelInteraction:update",c.onOpenchannelInteractionSave),l.on("openchannelInteractionTags:save",c.onOpenchannelInteractionTagsSave),l.on("openchannelMessage:save",c.onOpenchannelMessageSave),l.on("openchannelMessage:update",c.onOpenchannelMessageSave),l.on("user_has_openchannel_interactions:save",c.onOpenchannelInteractionOpen),l.on("user_has_openchannel_interactions:remove",c.onOpenchannelInteractionClose),c.getOpenchannelInteractions()})},c.onOpenchannelInteractionSave=function(e){if(e){var t=_.find(c.openchannelInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):u(),p(e)}},c.onOpenchannelInteractionTagsSave=function(e){if(e){var t=_.find(c.openchannelInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},c.onOpenchannelMessageSave=function(e){if(e&&!e.secret){var t=_.find(c.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),p(t)}}},c.onOpenchannelInteractionOpen=function(e){var t=_.find(c.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},c.onOpenchannelInteractionClose=function(e){var t=_.find(c.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},c.localizationMap={Today:o.instant("DASHBOARDS.TODAY"),Yesterday:o.instant("DASHBOARDS.YESTERDAY"),"This Week":o.instant("DASHBOARDS.THIS_WEEK"),"Last Week":o.instant("DASHBOARDS.LAST_WEEK"),"This Month":o.instant("DASHBOARDS.THIS_MONTH"),"Last Month":o.instant("DASHBOARDS.LAST_MONTH"),"This Year":o.instant("DASHBOARDS.THIS_YEAR"),"Last Year":o.instant("DASHBOARDS.LAST_YEAR"),January:o.instant("DASHBOARDS.JANUARY"),February:o.instant("DASHBOARDS.FEBRUARY"),March:o.instant("DASHBOARDS.MARCH"),April:o.instant("DASHBOARDS.APRIL"),May:o.instant("DASHBOARDS.MAY"),June:o.instant("DASHBOARDS.JUNE"),July:o.instant("DASHBOARDS.JULY"),August:o.instant("DASHBOARDS.AUGUST"),September:o.instant("DASHBOARDS.SEPTEMBER"),October:o.instant("DASHBOARDS.OCTOBER"),November:o.instant("DASHBOARDS.NOVEMBER"),December:o.instant("DASHBOARDS.DECEMBER"),Mon:o.instant("DASHBOARDS.MON"),Tue:o.instant("DASHBOARDS.TUE"),Wed:o.instant("DASHBOARDS.WED"),Thu:o.instant("DASHBOARDS.THU"),Fri:o.instant("DASHBOARDS.FRI"),Sat:o.instant("DASHBOARDS.SAT"),Sun:o.instant("DASHBOARDS.SUN")},c.pickerModel={dateStart:null},c.onInit();var g=!0,v=1;n.$watch("vm.query.filter",function(e,t){g?a(function(){g=!1}):(t||(v=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=v),c.getOpenchannelInteractions())}),n.$on("$destroy",function(){l.removeAllListeners("openchannelMessage:save"),l.removeAllListeners("openchannelMessage:update"),l.removeAllListeners("openchannelInteraction:save"),l.removeAllListeners("openchannelInteractionTags:save"),l.removeAllListeners("openchannelInteraction:update"),l.removeAllListeners("user_has_openchannel_interactions:save"),l.removeAllListeners("user_has_openchannel_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeOpenchannelController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u){var p=this;function g(e){p.voiceRecordings=e||{count:0,rows:[]}}p.currentUser=c.getCurrentUser(),p.voiceRecordings={},p.localizationMap=u,p.pickerModel={dateStart:null},p.table="voiceRecordings",p.query={UserId:p.currentUser.id,fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,rating,audio,UserId",sort:"-updatedAt",limit:10,page:1,type:null},p.downloadfile=function(i,e){return r.voiceRecording.download({id:i.id,exists:!0}).$promise.then(function(e){var t=[e.buffer],n=new Blob(t,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(n)),a.setAttribute("download",i.uniqueid+i.format),a.click()}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})},p.success=g,p.getVoiceRecordings=function(){p.query.dateStart=void 0,p.query.dateEnd=void 0,p.pickerModel.dateStart&&(p.query.dateStart=p.pickerModel.dateStart,p.query.dateEnd=p.pickerModel.dateEnd);p.query.offset=(p.query.page-1)*p.query.limit,t.localStorage.setItem("motion2.home.recordings:"+p.currentUser.id,JSON.stringify({query:p.query})),p.promise=r.voiceRecording.get(p.query,g).$promise},p.onInit=function(){var e=t.localStorage.getItem("motion2.home.recordings:"+p.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(p.query=_.omit(e.query,["filter","id"]),p.query.fields="createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,rating,audio,UserId",p.query.UserId=p.currentUser.id)}catch(e){console.error(e)}p.getVoiceRecordings()},p.clearAll=function(){p.pickerModel={dateStart:null},p.getVoiceRecordings()};var v=!0,h=1;e.$watch("vm.query.filter",function(e,t){v?s(function(){v=!1}):(t||(h=p.query.page),e!==t&&(p.query.page=1),e||(p.query.page=h),p.getVoiceRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","api","msUtils","toasty","Auth","$translate","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeRecordingsController",e)}(),function(){"use strict";function e(n,a,i,o,t,s,r,l,d,c){var m=this;function e(e){m.smsInteractions=e||{count:0,rows:[]};for(var t=0;t<m.smsInteractions.rows.length;t+=1)p(m.smsInteractions.rows[t])}function u(){m.query.dateStart=void 0,m.query.dateEnd=void 0,m.pickerModel.dateStart&&(m.query.dateStart=m.pickerModel.dateStart,m.query.dateEnd=m.pickerModel.dateEnd),m.query.offset=(m.query.page-1)*m.query.limit,t.localStorage.setItem("motion2.home.sms:"+m.user.id,JSON.stringify({query:m.query})),m.promise=r.smsInteraction.get(m.query,e).$promise}function p(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=l.getCurrentUser(),m.tags={count:0,rows:[]},m.smsInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,substatus:null,SmsAccountId:null},m.success=e,m.getSmsInteractions=u,m.showSmsInteraction=function(e,t){n.$parent.vm.addInteractionTab("sms",t)},m.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),t+=" <"+(e.Contact.mobile||"unknown")+">"}return s.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===l.getCurrentUser().id?s.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return s.instant("DASHBOARDS.NOT_ASSIGNED")},m.getSmsAccountLabel=function(e){if(e.Account)return e.Account.key;return s.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getSmsInteractions()},m.composeSmsInteraction=function(e,t){i.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeSms/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){return r.smsAccount.send({id:t.id},e).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),n.$parent.vm.addInteractionTab("sms",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SMSACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.onInit=function(){return r.smsAccount.get({nolimit:!0}).$promise.then(function(e){return m.smsAccounts=e||{count:0,rows:[]},r.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return r.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.sms:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}d.on("smsInteraction:save",m.onSmsInteractionSave),d.on("smsInteraction:update",m.onSmsInteractionSave),d.on("smsInteractionTags:save",m.onSmsInteractionTagsSave),d.on("smsMessage:save",m.onSmsMessageSave),d.on("smsMessage:update",m.onSmsMessageSave),d.on("user_has_sms_interactions:save",m.onSmsInteractionOpen),d.on("user_has_sms_interactions:remove",m.onSmsInteractionClose),m.getSmsInteractions()})},m.onSmsInteractionSave=function(e){if(e){var t=_.find(m.smsInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):u(),p(e)}},m.onSmsInteractionTagsSave=function(e){if(e){var t=_.find(m.smsInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onSmsMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),p(t)}}},m.onSmsInteractionOpen=function(e){var t=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onSmsInteractionClose=function(e){var t=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap={Today:s.instant("DASHBOARDS.TODAY"),Yesterday:s.instant("DASHBOARDS.YESTERDAY"),"This Week":s.instant("DASHBOARDS.THIS_WEEK"),"Last Week":s.instant("DASHBOARDS.LAST_WEEK"),"This Month":s.instant("DASHBOARDS.THIS_MONTH"),"Last Month":s.instant("DASHBOARDS.LAST_MONTH"),"This Year":s.instant("DASHBOARDS.THIS_YEAR"),"Last Year":s.instant("DASHBOARDS.LAST_YEAR"),January:s.instant("DASHBOARDS.JANUARY"),February:s.instant("DASHBOARDS.FEBRUARY"),March:s.instant("DASHBOARDS.MARCH"),April:s.instant("DASHBOARDS.APRIL"),May:s.instant("DASHBOARDS.MAY"),June:s.instant("DASHBOARDS.JUNE"),July:s.instant("DASHBOARDS.JULY"),August:s.instant("DASHBOARDS.AUGUST"),September:s.instant("DASHBOARDS.SEPTEMBER"),October:s.instant("DASHBOARDS.OCTOBER"),November:s.instant("DASHBOARDS.NOVEMBER"),December:s.instant("DASHBOARDS.DECEMBER"),Mon:s.instant("DASHBOARDS.MON"),Tue:s.instant("DASHBOARDS.TUE"),Wed:s.instant("DASHBOARDS.WED"),Thu:s.instant("DASHBOARDS.THU"),Fri:s.instant("DASHBOARDS.FRI"),Sat:s.instant("DASHBOARDS.SAT"),Sun:s.instant("DASHBOARDS.SUN")},m.pickerModel={dateStart:null},m.onInit();var g=!0,v=1;n.$watch("vm.query.filter",function(e,t){g?a(function(){g=!1}):(t||(v=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=v),m.getSmsInteractions())}),n.$on("$destroy",function(){d.removeAllListeners("smsMessage:save"),d.removeAllListeners("smsMessage:update"),d.removeAllListeners("smsInteraction:save"),d.removeAllListeners("smsInteractionTags:save"),d.removeAllListeners("smsInteraction:update"),d.removeAllListeners("user_has_sms_interactions:save"),d.removeAllListeners("user_has_sms_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeSmsController",e)}(),function(){"use strict";function e(t,n,e,a,i,o,s,r,l,d){var c=this;function m(e){c.voiceCalls=e||{count:0,rows:[]}}c.currentUser=i.getCurrentUser(),c.voiceCalls={},c.localizationMap=d,c.pickerModel={dateStart:null},c.table="voiceCalls",c.query={UserId:c.currentUser.id,fields:"id,type,uniqueid,tag,starttime,endtime,source,destination,userDisposition,note,duration,billableseconds,answertime",sort:"-updatedAt",limit:10,page:1,type:null},c.success=m,c.getVoiceCalls=function(){c.query.dateStart=void 0,c.query.dateEnd=void 0,c.pickerModel.dateStart&&(c.query.dateStart=c.pickerModel.dateStart,c.query.dateEnd=c.pickerModel.dateEnd);c.query.offset=(c.query.page-1)*c.query.limit,s.localStorage.setItem("motion2.home.voice:"+c.currentUser.id,JSON.stringify({query:c.query})),c.promise=e.voiceCallReport.get(c.query,m).$promise},c.onInit=function(){return e.tag.get().$promise.then(function(e){c.tags=e||{count:0,rows:[]}}).catch(function(e){a.error({title:"Init error",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}),c.tags={count:0,rows:[]}}).finally(function(){var e=s.localStorage.getItem("motion2.home.voice:"+c.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(c.query=_.omit(e.query,"filter"))}catch(e){console.error(e)}c.getVoiceCalls()})},c.showDetails=function(e){t.show({controller:"AgentHomeVoiceDetailsController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{call:e}})},c.clearAll=function(){c.pickerModel={dateStart:null},c.getVoiceCalls()};var u=!0,p=1;r.$watch("vm.query.filter",function(e,t){u?l(function(){u=!1}):(t||(p=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=p),c.getVoiceCalls())})}e.$inject=["$mdDialog","$document","api","toasty","Auth","$translate","$window","$scope","$timeout","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeVoiceController",e)}(),function(){"use strict";function e(e,t){this.call=t,this.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","call"],angular.module("app.dashboards").controller("AgentHomeVoiceDetailsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p){var g=this;function v(){i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{channel:g.tab.channel,interaction:g.tab.interaction}}).then(function(e){g.tab.saved=!!e,e&&a.$parent.$parent.$parent.vm.closeTab(g.tab)})}function h(e,t){i.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeMail/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!1,locals:{account:g.account,message:t,type:e,interaction:g.interaction},fullscreen:!0,skipHide:!!g.tab.spy}).then(function(t){t&&f(t),t.Interaction&&g.interaction&&g.interaction.id&&(t.Interaction.id=g.interaction.id,d.mailInteraction.update(t.Interaction).$promise.then(function(e){e&&e.closed?(g.tab.saved=!0,g.interaction.closed=!0,g.interaction.closedAt=e.closedAt,v()):null!==t.Interaction.substatus&&(g.tab.saved=!0,g.tab.interaction.substatus=t.Interaction.substatus,a.$parent.$parent.$parent.vm.closeTab(g.tab))}).catch(function(e){console.error(e)}))})}function b(){"mail"!==g.tab.channel&&t(function(){var e=angular.element(n.find("md-content[name*='interaction-content-"+g.tab.id+"']"));e&&e[0]&&(e[0].scrollTop=e[0].scrollHeight)},0)}function f(n){if(n)return n["chat"===g.tab.channel?"ChatWebsiteId":_.capitalize(g.tab.channel)+"AccountId"]=g.interaction["chat"===g.tab.channel?"ChatWebsiteId":_.capitalize(g.tab.channel)+"AccountId"],n[_.capitalize(g.tab.channel)+"InteractionId"]=g.interaction.id,n.UserId=g.user.id,n.ContactId=g.interaction.ContactId,n.direction="out",n.secret=!(!g.tab.spy&&!n.secret),d[g.tab.channel+"Message"].save(n).$promise.then(function(e){if(e&&e.id&&n.attachments&&n.attachments.length)for(var t=0;t<n.attachments.length;t+=1)d.attachment.update({id:n.attachments[t].id},{MailMessageId:e.id})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SENDMESSAGE",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){g.setText(),b()})}function A(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";default:return"blue-A700"}}function E(e){e&&e.count&&e.rows.length&&(g.journey=_.concat(g.journey,e.rows))}g.showFooter=!1,g.showInteraction=!1,g.user=m.getCurrentUser(),g.detectBrowser=p.detectBrowser(),g.journey=[],g.acceptedMessages=[],g.omniChannels=["mail","chat","sms","openchannel","fax"],g.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,singleFile:!0,target:"api/attachments",allowDuplicateUploads:!0},g.ngFlow={flow:{}},g.selectedMailShowDetails={},g.selectedMailShowSystemMessage={},g.init=function(e){g.tab=e,g.tab.saved=!0,g.tab.badges=0,g.tab&&g.tab.channel&&g.tab.interaction&&(g.interaction=g.tab.interaction,d[g.tab.channel+"Interaction"].get({id:g.tab.interaction.id,includeAll:!0}).$promise.then(function(e){return e&&(g.interaction=e,g.tab.interaction=e),g.tab.saved=g.interaction.closed,g.queryMessage={id:g.interaction.id,includeAll:!0},"mail"===g.tab.channel?(g.queryMessage.sort="-id",g.queryMessage.offset=0,g.queryMessage.limit=3):(g.queryMessage.sort="id",g.queryMessage.nolimit=!0),d[g.tab.channel+"Interaction"].getMessages(g.queryMessage).$promise}).then(function(e){return g.messages=e||{count:0,rows:[]},d["chat"===g.tab.channel?"chatWebsite":g.tab.channel+"Account"].get({id:g.interaction["chat"===g.tab.channel?"ChatWebsiteId":_.capitalize(g.tab.channel)+"AccountId"]}).$promise}).then(function(e){return g.account=e,g.tab.title=g.account.key||g.account.name,d.cmContact.get({id:g.interaction.ContactId}).$promise}).then(function(e){return g.contact=e,g.contact&&(!function(e){if(e&&e.id){for(var t=0;t<g.omniChannels.length;t++)d[g.omniChannels[t]+"Interaction"].get({ContactId:e.id,includeAll:!0}).$promise.then(E);d.voiceCallReport.get({ContactId:e.id,includeAll:!0}).$promise.then(E)}}(g.contact),g.tab.title+=" - "+g.contact.firstName),d.user.get({fields:"id,fullname",nolimit:!0}).$promise}).then(function(e){g.users=e||{count:0,rows:[]},g.usersMap=_.mapValues(_.keyBy(g.users.rows,"id"),"fullname")}).then(function(){if(g.tab.channel&&g.interaction)return d.user["add"+_.upperFirst(g.tab.channel)+"Interactions"]({id:g.user.id,ids:[g.interaction.id]})}).then(function(){return d.mailSubstatus.get({nolimit:!0}).$promise}).then(function(e){g.subStatuses=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}).finally(function(){!function(){if(!g.tab.spy)for(var e=0;e<g.messages.rows.length;e+=1)"in"!==g.messages.rows[e].direction||g.messages.rows[e].read||(d[g.tab.channel+"Message"].accept({id:g.messages.rows[e].id,UserId:g.user.id}),g.acceptedMessages.push(g.messages.rows[e].id))}(),b(),u.on(g.tab.channel+"Message:save",g.onMessageSave),u.on(g.tab.channel+"Message:update",g.onMessageSave),u.on(g.tab.channel+"Interaction:save",g.onInteractionSave),u.on(g.tab.channel+"Interaction:update",g.onInteractionSave),u.on("user_has_"+g.tab.channel+"_interactions:save",g.onInteractionOpen),u.on("user_has_"+g.tab.channel+"_interactions:remove",g.onInteractionClose),g.showFooter=!0,g.showInteraction=!0}))},g.getLabelByMessage=function(e){var t="loading...";if(e)return"in"===e.direction?e.Contact?e.Contact.firstName||"Anonymous":t:e.UserId?g.usersMap?g.usersMap[e.UserId]:t:"System"},g.openContact=function(e,t){try{a.$parent.$parent.$parent.vm.addContactTab(t||g.contact)}catch(e){c.error({title:"ERROR OPEN CONTACT",msg:"Jscripty can't open the contact"})}},g.openInteraction=function(e,t){try{if(t.MailAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("mail",t);if(t.ChatWebsiteId)return a.$parent.$parent.$parent.vm.addInteractionTab("chat",t);if(t.SmsAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("sms",t);if(t.OpenchannelAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("openchannel",t);if(t.FaxAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("fax",t)}catch(e){c.error({title:"ERROR OPEN INTERACTION",msg:"Customer Journey can't open the interaction"})}},g.disposeInteraction=v,g.tagInteraction=function(){i.show({controller:"TagInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,skipHide:!!g.tab.spy,resolve:{tags:["apiResolver",function(e){return e.resolve("tag@get",{nolimit:!0,fields:"id,name,color"})}]},locals:{channel:g.tab.channel,interaction:g.tab.interaction}})},g.composeMailInteraction=function(t,e){if(e.inReplyTo){var n=_.find(g.messages.rows,{messageId:e.inReplyTo});if(!n)return d.mailMessage.get({messageId:e.inReplyTo}).$promise.then(function(e){h(t,e&&e.count?e.rows[0]:void 0)}).catch(function(e){console.error(e),h(t,void 0)});h(t,n)}else h(t,e)},g.composeFaxInteraction=function(e){var t={to:[]};t.to.push(g.contact.fax),i.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeFax/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!1,locals:{account:g.account,message:t,type:e},fullscreen:!0}).then(function(e){return d.faxAccount.send({id:g.account.id},e).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})})},g.composeSmsInteraction=function(e,t){i.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeSms/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!1,locals:{account:g.account,message:t,type:e},fullscreen:!0,skipHide:!!g.tab.spy}).then(function(e){e&&f(e)})},g.reply=function(e,t){if(e&&13===e.keyCode&&e.shiftKey)return;if(e&&13!==e.keyCode)return;if(""===t)return;f(function(e){var t={},n="chat"===g.tab.channel?"ChatWebsiteId":_.capitalize(g.tab.channel)+"AccountId";t[n]=g.interaction[n].toString(),t[_.capitalize(g.tab.channel)+"InteractionId"]=g.interaction.id,"sms"===g.tab.channel&&(t.phone=g.interaction.phone);e&&(t.UserId=g.user.id,t.ContactId=g.interaction.ContactId,t.body=e,t.createdAt=Date.now());return t}(t))},g.upload=function(){g.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},g.ngFlow.flow.upload()},g.setTextWrapper=function(e){g.setText=e},g.getTextWrapper=function(e){g.getText=e},g.fileAdded=function(e){{if("fax"===g.tab.channel){var t=["pdf","tif"];return!!_.includes(t,e.getExtension())||(c.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1)}return!0}},g.fileSuccess=function(e,t){var n=JSON.parse(t),a=n.name;"chat"===g.tab.channel&&(a='<a href="'+(g.account.remote?g.account.remote:l.protocol()+"://"+l.host())+"/api/chat/interactions/"+g.interaction.id+"/attachment_download?attachId="+n.id+"&token="+g.account.token+'" target="_self">'+n.name+"</a>");f({body:a,AttachmentId:n.id})},g.onMessageSave=function(e){if(e&&g.interaction.id!=e[_.capitalize(g.tab.channel)+"InteractionId"])return;var t=!1;g.messages?t=_.find(g.messages.rows,{id:e.id}):g.messages={rows:[],count:0};t?_.merge(t,e):("mail"===g.tab.channel?g.messages.rows.unshift(e):g.messages.rows.push(e),b())},g.onInteractionSave=function(e){if(e&&g.interaction.id!==e.id)return;_.merge(g.interaction,e)},g.searchTextChange=function(t){var n=o.defer(),a=[],e={},i="chat"===g.tab.channel?"ChatWebsiteId":_.capitalize(g.tab.channel)+"AccountId";return e.filter=t,e[i]=g.account.id,d.cannedAnswer.get(e).$promise.then(function(e){return a=_.concat(a,e.rows),d.cannedAnswer.get({filter:t}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),n.resolve(a)}).catch(function(e){n.reject(e)}),n.promise},g.selectedItemChange=function(t){if(t){var n=g.getText();try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(t.value),a={user:g.user,account:g.account,interaction:g.interaction,contact:g.interaction&&g.interaction.Contact?g.interaction.Contact:{}};g.setText(n+" "+e(a))}catch(e){g.setText(n+" "+t.value)}g.selectedItem=null,g.changeDisplayCannedAnswerInputValue()}},g.getIconByChannel=function(e){switch(e){case"chat":return"icon-hangouts";case"mail":return"icon-email";case"sms":return"icon-message-text";case"openchannel":return"icon-google-earth";case"fax":return"icon-deskphone";default:return"icon-hangouts"}},g.getColorByChannel=A,g.getColorByItem=function(e){var t="";e.FaxAccountId?t="fax":e.OpenchannelAccountId?t="openchannel":e.SmsAccountId?t="sms":e.MailAccountId?t="mail":e.ChatWebsiteId?t="chat":e.amaflags&&(t="voice");return A(t)},g.displayCannedAnswerInput=!1,g.changeDisplayCannedAnswerInputValue=function(){g.displayCannedAnswerInput=!g.displayCannedAnswerInput},g.setAs=function(e){g.tab.channel&&g.interaction&&g.interaction.id&&d[g.tab.channel+"Interaction"].update({id:g.interaction.id,substatus:e,substatusAt:Date.now()}).$promise.catch(function(e){console.error(e)})},g.markAsUnread=function(){if(g.tab.channel&&g.interaction&&g.interaction.id)if(g.acceptedMessages.length)for(var e=0;e<g.acceptedMessages.length;e+=1)d[g.tab.channel+"Message"].update({id:g.acceptedMessages[e],read:!1,UserId:null});else for(var t=0;t<g.messages.rows.length;t+=1)if("in"===g.messages.rows[t].direction){g.messages.rows[t].UserId===g.user.id?d[g.tab.channel+"Message"].update({id:g.messages.rows[t].id,read:!1,UserId:null}):c.error({title:"You can't mark as unread",msg:"You are not the owner of the last message!"});break}g.tab.saved=!0,a.$parent.$parent.$parent.vm.closeTab(g.tab)},g.getAttachments=function(t){return d.attachment.get({MailMessageId:t.id}).$promise.then(function(e){e&&e.rows&&(t.attachments=e.rows)}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},g.getAttachment=function(i){return d.attachment.download({id:i.id}).$promise.then(function(e){if(e){var t=new Blob([e.buffer],{type:e.type}),n=document.createElement("a"),a=window.URL.createObjectURL(t);n.href=a,n.target="_self",n.download=i.name,document.body.appendChild(n),n.click(),setTimeout(function(){document.body.removeChild(n),window.URL.revokeObjectURL(a)},100)}}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},g.htmlToPlaintext=function(e){return e?String(e).replace(/<[^>]+>/gm,""):""},g.onInteractionOpen=function(e){var t;g.interaction.id==e[_.upperFirst(g.tab.channel)+"InteractionId"]&&(g.interaction.Users&&(t=_.find(g.interaction.Users,{id:e.UserId})),t||g.interaction.Users.push({id:e.UserId}))},g.onInteractionClose=function(e){g.interaction.id==e[_.upperFirst(g.tab.channel)+"InteractionId"]&&g.interaction.Users&&_.remove(g.interaction.Users,{id:e.UserId})},g.loadNextPage=function(){var n=o.defer();return g.queryMessage?(g.queryMessage.offset=g.messages.rows.length,d[g.tab.channel+"Interaction"].getMessages(g.queryMessage).$promise.then(function(e){for(var t=0;t<e.rows.length;t+=1)g.messages.rows.push(e.rows[t]),"in"!==e.rows[t].direction||e.rows[t].read||(d[g.tab.channel+"Message"].accept({id:e.rows[t].id,UserId:g.user.id}),g.acceptedMessages.push(e.rows[t].id));return n.resolve(e)}).catch(function(e){return n.reject(e)})):n.reject()},g.timelineOptions={scrollEl:"#interaction-content"},a.$on("$destroy",function(){u.removeAllListeners(g.tab.channel+"Message:save"),u.removeAllListeners(g.tab.channel+"Message:update"),u.removeAllListeners(g.tab.channel+"Interaction:save"),u.removeAllListeners(g.tab.channel+"Interaction:update"),u.removeAllListeners("user_has_"+g.tab.channel+"_interactions:save"),u.removeAllListeners("user_has_"+g.tab.channel+"_interactions:remove")})}function t(a){return{scope:{ngBindHtmlUnsafe:"="},template:"<div ng-bind-html='trustedHtml'></div>",link:function(n){n.updateView=function(){var e,t=_.replace(n.ngBindHtmlUnsafe,'<div id="xm-mail-content"','<a style="cursor:pointer" class="toggle-details md-accent-color" onclick="document.getElementById(\''+(e="xm-mail-content-"+Math.floor(9999*Math.random()+1))+"').style.display='block'; this.parentNode.removeChild(this)\">See More</a><div id=\""+e+'" style="display:none"');n.trustedHtml=a.trustAsHtml(t)},n.$watch("ngBindHtmlUnsafe",function(e,t){n.updateView(e)})}}}e.$inject=["$cookies","$timeout","$document","$scope","$mdDialog","$q","$sce","$window","$location","api","toasty","Auth","socket","msUtils"],t.$inject=["$sce"],angular.module("app.dashboards").directive("ngBindHtmlUnsafe",t).controller("AgentGeneralInteractionController",e)}(),function(){"use strict";angular.module("app.dashboards").factory("Emojis",function(){return{watchEmbedData:!1,sanitizeHtml:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank",pdf:{embed:!0},image:{embed:!0},audio:{embed:!0},basicVideo:!1,gdevAuth:"xxxxxxxx",video:{embed:!1,width:null,height:null,ytTheme:"dark",details:!1,thumbnailQuality:"medium",autoPlay:!0},twitchtvEmbed:!0,dailymotionEmbed:!0,tedEmbed:!0,dotsubEmbed:!0,liveleakEmbed:!0,ustreamEmbed:!0,soundCloudEmbed:!0,soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},spotifyEmbed:!0,tweetEmbed:!0,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},code:{highlight:!0,lineNumbers:!1},codepenEmbed:!0,codepenHeight:300,jsfiddleEmbed:!0,jsfiddleHeight:300,jsbinEmbed:!0,jsbinHeight:300,plunkerEmbed:!0,githubgistEmbed:!0,ideoneEmbed:!0,ideoneHeight:300}})}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.separatorKeys=[a.KEY_CODE.ENTER,a.KEY_CODE.COMMA,a.KEY_CODE.TAB],c.fileAdded=function(e){var t=["pdf","tif"];if(!_.includes(t,e.getExtension()))return l.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;return!0},c.message={from:i.localstationid,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,attachments:[]},c.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,singleFile:!0,target:"api/attachments",allowDuplicateUploads:!0},c.ngFlow={flow:{}},c.send=function(e){1===c.message.attachments.length?c.message.to.length?(o.draft=void 0,n.hide({from:c.message.from,to:c.message.to,attach:c.message.attachments.length,attachments:c.message.attachments})):l.error("To is mandatory"):l.error("Attachment is mandatory")},c.upload=function(){c.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},c.ngFlow.flow.upload()},c.fileSuccess=function(e,t){try{(t=JSON.parse(t)).size=e.size,c.message.attachments.push(t)}catch(e){console.error(e)}},c.getContact=function(e){var t="";e.firstName&&e.firstName!==e.fax&&(t+=e.firstName+" ");e.lastName&&e.lastName!==e.fax&&(t+=e.lastName+" ");return t+="<"+e.fax+">"},c.contactSearch=function(e){return i&&i.ListId?r.cmContact.get({ListId:i.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,fax"}).$promise.then(function(e){return e.rows}):[]},c.transformContact=function(e){var t=e;if(_.isObject(e))return e.fax;if(n=t,!/[&\/\\#,()$~%.'":;*?<>{}\s\\|a-zA-Z\pS!òàùè…_§°çéì-]/.test(n))return t;var n;return l.error("Fax "+t+" is not valid"),null},c.closeDialog=function(){o.draft=c.message,n.cancel()}}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q"],angular.module("app.dashboards").controller("ComposeFaxInteractionDialogController",e)}(),function(){"use strict";function e(t,e,i,n,o,s,a,r,l,d,c,m){var u=this;switch(u.currentUser=c.getCurrentUser(),u.secret="note"===a,u.hiddenCC=!0,u.hiddenBCC=!0,u.verifySmtp=!0,u.errors=[],u.separatorKeys=[n.KEY_CODE.ENTER,n.KEY_CODE.COMMA,n.KEY_CODE.TAB],u.searchTextChange=function(t){var n=d.defer(),a=[];return r.cannedAnswer.get({filter:t,MailAccountId:o.id}).$promise.then(function(e){return a=_.concat(a,e.rows),r.cannedAnswer.get({filter:t}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),n.resolve(a)}).catch(function(e){n.reject(e)}),n.promise},u.selectedItemChange=function(t){if(t&&t.value&&u.ckEditorInstance)try{var e=_.template(t.value),n={user:u.currentUser,account:o,interaction:m,contact:m&&m.Contact?m.Contact:{}};u.ckEditorInstance.insertText(e(n))}catch(e){console.error(e),u.ckEditorInstance.insertText(t.value)}document.getElementById("html-area").focus(),u.selectedItem=null},u.onReadyEditor=function(e){try{u.ckEditorInstance=CKEDITOR.instances["html-area"]}catch(e){console.error("Unable to get Html Editor instance",e)}},_.templateSettings.interpolate=/{{([\s\S]+?)}}/g,u.replyTemplate=_.template("On {{ date }}, at {{ time }}, {{ from }} wrote:"),u.forwardTemplate=_.template("Begin forwarded message:<br><br><strong>From:</strong> {{ from }}<br><strong>Subject:</strong> {{ subject }}<br><strong>Date:</strong> {{ date }}, at {{ time }}<br><strong>To:</strong> {{ to }}"),u.message={from:o.email,to:[],cc:[],bcc:[],body:g(),type:a,attachments:[],showLastMessage:!0},u.ckeditor={skin:"office2013",startupFocus:!0,language:"en",allowedContent:!0,extraPlugins:"font,colorbutton,autogrow,autoembed,autocorrect,googlethisterm,pastebase64",toolbarGroups:[{name:"styles",groups:["styles"]},{name:"clipboard",groups:["undo"]},{name:"colors",groups:["colors"]},{name:"basicstyles",groups:["basicstyles"]},{name:"paragraph",groups:["list","indent","align"]}],autoGrow_onStartup:!0,autoGrow_minHeight:u.secret?160:300,autoGrow_maxHeight:e.innerHeight-400,autocorrect_enabled:!0,disableNativeSpellChecker:!1,font_defaultLabel:o.fontFamily?o.fontFamily.split(",")[0]:"Arial",fontSize_defaultLabel:o.fontSize||"12",removePlugins:"magicline"},u.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,singleFile:!0,target:"api/attachments",allowDuplicateUploads:!0},u.ngFlow={flow:{}},u.reply=function(e){angular.isDefined(s)&&(u.message.type="reply",u.message.to="in"===s.direction?s.from.split(","):s.to.split(","),u.message.subject=_.startsWith(s.subject,"Re:")?s.subject:"Re: "+s.subject,u.message.inReplyTo=s.messageId,u.message.body=s.draft&&s.draft.inReplyTo?s.draft.body:g(),u.message.attachments=s.draft?s.draft.attachments:[],e&&s.cc&&(u.hiddenCC=!1,u.message.cc=s.cc.split(",")),u.message.showLastMessage=!!s.draft&&s.draft.showLastMessage)},u.newMail=function(){angular.isDefined(s)&&(u.message.type="new",u.message.to=s.to?s.to.split(","):[])},u.forward=function(){if(angular.isDefined(s)){if(u.message.type="forward",u.message.subject=_.startsWith(s.subject,"Fwd:")?s.subject:"Fwd: "+s.subject,u.message.body=s.draft&&!s.draft.inReplyTo?s.draft.body:g(),s.Attachments&&s.Attachments.length)for(var e=0;e<s.Attachments.length;e++)u.message.attachments.push(s.Attachments[e]);u.message.showLastMessage=!!s.draft&&s.draft.showLastMessage}},u.send=function(e,t,n){if(u.message.to&&u.message.body)if(u.message.to.length)if(s.draft=void 0,_.isEmpty(u.message.subject)){var a=i.confirm({skipHide:!0}).title("Warning").textContent("This message has no subject. Are you sure you want to send it?").ariaLabel("Warning").targetEvent(e).ok("Send Anyway").cancel("Cancel");i.show(a).then(function(){p(t,n)})}else p(t,n);else l.error("To is mandatory")},u.note=function(){u.type="note",u.secret=!0,u.message.body='<div style="font-family:'+o.fontFamily+";font-size:"+o.fontSize+'px"><p></p></div>'},u.addNote=function(){u.message.body&&(u.message.draft=void 0,i.hide({secret:!0,body:u.message.body,attach:u.message.attachments.length,attachments:u.message.attachments}))},u.upload=function(e){u.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+t.get("motion.token")},u.ngFlow.flow.upload()},u.fileSuccess=function(e,t){try{(t=JSON.parse(t)).size=e.size,u.message.attachments.push(t)}catch(e){console.error(e)}},u.deleteAttachment=function(e){u.message.attachments=_.reject(u.message.attachments,{id:e.id}),r.attachment.delete({id:e.id}).$promise.then(function(){l.success({title:"Attachment deleted!",msg:e.name?e.name+" has been deleted!":""})})},u.getContact=function(e){var t="";e.firstName&&e.firstName!==e.email&&(t+=e.firstName+" ");e.lastName&&e.lastName!==e.email&&(t+=e.lastName+" ");return t+="<"+e.email+">"},u.contactSearch=function(e){return o&&o.ListId?r.cmContact.get({ListId:o.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,email"}).$promise.then(function(e){return e.rows}):[]},u.transformContact=function(e){var t=e;if(_.isObject(e))return e.email;if(n=t,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n))return t;var n;return l.error("Email "+t+" is not valid"),null},u.closeDialog=function(){angular.isDefined(s)&&(s.draft=u.message);i.cancel()},u.loadLastMessage=function(){u.message.body+=v(u.message.type)},a){case"reply":u.reply(!1);break;case"replyAll":u.reply(!0);break;case"forward":u.forward();break;case"new":u.newMail();break;case"note":u.note()}function p(e,t){var n={from:u.message.from,to:u.message.to.join(","),cc:u.message.cc.join(","),bcc:u.message.bcc.join(","),subject:u.message.subject,body:u.message.showLastMessage?u.message.body:u.message.body+v(u.message.type),inReplyTo:u.message.inReplyTo,attach:u.message.attachments.length,attachments:u.message.attachments,Interaction:{lastMsgAt:moment().format("YYYY-MM-DD HH:mm:ss"),lastMsgDirection:"out",lastMsgBody:u.message.body,substatus:t,substatusAt:moment().format("YYYY-MM-DD HH:mm:ss")}};n.html='<div id="xm-mail-content">'+_.replace(n.body,'<div id="xm-mail-content"',"<div")+"</div>",e&&(n.Interaction.closed=!0,n.Interaction.closedAt=moment().format("YYYY-MM-DD HH:mm:ss")),i.hide(n)}function g(){return'<div style="font-family:'+o.fontFamily+";font-size:"+o.fontSize+'px">'+function(){if(_.isNil(o.template))return"";try{return _.template(o.template)({user:u.currentUser,account:o,interaction:m,contact:m&&m.Contact?m.Contact:{}})}catch(e){return console.error(e),""}}()+"</div>"}function v(e){var t,n,a='<div id="xm-mail-content"><blockquote type="cite">';switch(e){case"reply":case"replyAll":a+=u.replyTemplate({date:moment(s.createdAt).format("D MMM YYYY")||"",time:moment(s.createdAt).format("HH:mm")||"",from:_.escape(s.from)||""});break;case"forward":a+=u.forwardTemplate({date:moment(s.createdAt).format("D MMM YYYY")||"",time:moment(s.createdAt).format("HH:mm")||"",from:_.escape(s.from)||"",to:_.escape(s.to)||"",subject:_.escape(s.subject)||""})}return a+="<br><br>",a+=(t=s.body?_.replace(s.body,'<div id="xm-mail-content"',"<div"):"",(n=t.match(/\<body[^>]*\>([^]*)\<\/body/m))?n[1]:t),a+="</blockquote></div>",e?a:""}r.mailSubstatus.get({nolimit:!0}).$promise.then(function(e){u.subStatuses=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}),u.secret||r.mailAccount.verifySmtp({id:o.id}).$promise.catch(function(e){u.verifySmtp=!1,u.errors.push({message:e.data,type:e.status}),u.errors.push({message:"You can't reply or send an email. Please contact the administrator!",type:"500"})})}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","Auth","interaction"],angular.module("app.dashboards").controller("ComposeMailInteractionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(t){var n=c.defer(),a=[];return l.cannedAnswer.get({filter:t,SmsAccountId:o.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:t}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),n.resolve(a)}).catch(function(e){n.reject(e)}),n.promise},p.selectedItemChange=function(t){if(t){var n=p.getText();try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(t.value),a={user:p.currentUser,account:o};p.setText(n+" "+e(a))}catch(e){p.setText(n+" "+t.value)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){var e=p.getText();e&&a.hide({secret:!0,body:e})},p.message={from:o.phone,to:_.isNil(s.to)||_.isEmpty(s.to)?[]:s.to,body:""},p.send=function(e){var t=p.getText();p.message.to&&t&&(p.message.to.length?(n=t,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var t="";e.firstName&&e.firstName!==e.mobile&&(t+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(t+=e.lastName+" ");return t+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){return o&&o.ListId?l.cmContact.get({ListId:o.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows}):[]},p.setTextWrapper=function(e){p.setText=e},p.getTextWrapper=function(e){p.getText=e},p.transformContact=function(e){var t=e;if(_.isObject(t))return e.mobile;if(n=t,/^(\+|\d)[0-9]{7,16}$/.test(n))return t;var n;return d.error("Mobile "+t+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeSmsInteractionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;function d(e){a.hide(e)}l.errors=[],l.interaction=angular.copy(s),l.interaction.disposition||(l.interaction.disposition=null),l.channel=r,l.saveDisposition=function(e){l.errors=[],l.interaction.closed||(l.interaction.closedAt=Date.now());l.interaction.closed=!0,o[l.interactionMethod]?o[l.interactionMethod].update(_.pick(l.interaction,["MailAccountId","closed","closedAt","disposition","id","note"])).$promise.then(function(e){l.interaction=e,i.success({title:"Interaction properly closed!",msg:"Interaction has been closed!"}),d(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})}):d(!1)},l.closeDialog=d,l.dispositionMethod="chat"===l.channel?"chatWebsite":l.channel+"Account",l.interactionMethod=l.channel+"Interaction",o[l.dispositionMethod]&&o[l.dispositionMethod].getDispositions({fields:"id,name",sort:"name",nolimit:!0,id:l.interaction["chat"===l.channel?"ChatWebsiteId":_.capitalize(l.channel)+"AccountId"]}).$promise.then(function(e){l.dispositions=e||{count:0,rows:[]}}).catch(function(e){console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","interaction","channel"],angular.module("app.dashboards").controller("DisposeInteractionDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i,o){var s=this;function r(e){t.hide(e)}s.errors=[],s.tags=o,s.interaction=angular.copy(a),s.interaction.Tags=_.map(s.interaction.Tags,function(e){return{id:e.id,name:e.name,color:e.color}}),s.channel=i,s.autocompleteRequireMatch=!0,s.saveTag=function(){{if(s.errors=[],e[s.interactionMethod])return e[s.interactionMethod].addTags({id:s.interaction.id,ids:_.map(s.interaction.Tags,"id")}).$promise.then(function(){n.success({title:"Interaction properly tagged!",msg:"Interaction has been tagged!"}),a.Tags=s.interaction.Tags,r(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})});r(!1)}},s.closeDialog=r,s.interactionMethod=s.channel+"Interaction"}e.$inject=["$mdDialog","toasty","api","interaction","channel","tags"],angular.module("app.dashboards").controller("TagInteractionDialogController",e)}(),function(){"use strict";function e(i,o,s,e,l,d,t,n,a,r,c){var m=this;function u(){try{i.$parent.$parent.$parent.vm.updateLocalStorage()}catch(e){d.error({title:"ERROR UPDATE LOCAL TABS",msg:"Error updating locally stored tabs"})}}function p(n,e){var r=t.getCurrentUser();l.jscriptySessionReport.save({starttime:m.starttime,membername:m.call&&m.call.membername?m.call.membername:r.name,calleridname:m.call&&m.call.calleridname?m.call.calleridname:void 0,calleridnum:m.call&&m.call.calleridnum?m.call.calleridnum:void 0,queue:m.call&&m.call.queue?m.call.queue:void 0,uniqueid:m.call&&m.call.uniqueid?m.call.uniqueid:void 0,VoiceQueueId:m.call&&m.call["xmd-voicequeueid"]?m.call["xmd-voicequeueid"]:void 0,ProjectId:m.project&&m.project.id?m.project.id:void 0,projectname:m.project&&m.project.name?m.project.name:void 0,ContactId:m.contact&&m.contact.id?m.contact.id:void 0,completed:e}).$promise.then(function(e){if(e)for(var t=m.getResponseSheetHeaders(),n=m.getResponseSheetRow(),a=m.getQuestionWithResponseList(),i=0;i<t.length;i+=1)if(!_.isEmpty(n[i])){l.jscriptyQuestionReport.save({question:t[i],answer:n[i],questionId:a[i].id,membername:m.call&&m.call.membername?m.call.membername:r.name,calleridname:m.call&&m.call.calleridname?m.call.calleridname:void 0,calleridnum:m.call&&m.call.calleridnum?m.call.calleridnum:void 0,queue:m.call&&m.call.queue?m.call.queue:void 0,uniqueid:m.call&&m.call.uniqueid?m.call.uniqueid:void 0,SessionId:e.id,ProjectId:m.project.id,projectname:m.project.name});for(var o=n[i].toString().split(";"),s=0;s<o.length;s+=1)l.jscriptyAnswerReport.save({question:t[i],questionId:a[i].id,answer:o[s].trim(),membername:m.call&&m.call.membername?m.call.membername:r.name,calleridname:m.call&&m.call.calleridname?m.call.calleridname:void 0,calleridnum:m.call&&m.call.calleridnum?m.call.calleridnum:void 0,queue:m.call&&m.call.queue?m.call.queue:void 0,uniqueid:m.call&&m.call.uniqueid?m.call.uniqueid:void 0,SessionId:e.id,ProjectId:m.project.id,projectname:m.project.name})}return e}).then(function(e){e?n.resolve(!0):n.reject()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var t=0;t<e.data.errors.length;t+=1)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()});n.reject()})}m.formViewer={},m.showResetButton=!0,m.showIncompleteSubmitButton=!1,m.detectBrowser=c.detectBrowser(),m.onSubmit=function(e,t){var n=o.defer();if(t){var a=s.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("YES").cancel("NO");s.show(a).then(function(){p(n,!1)},function(){n.resolve()})}else p(n,!0);return n.promise.then(function(e){e&&(d.success({title:"Session saved",msg:"Your survey session has been properly saved!"}),function(e){try{i.$parent.$parent.$parent.vm.removeTab(e)}catch(e){d.error({title:"ERROR REMOVE TAB",msg:"Error while removing tab"})}}(m.tab.id))}).catch(function(e){d.error({title:"Session save error",msg:"There has been an error while trying to save your survey session!"})})},m.openContact=function(e,t){try{i.$parent.$parent.$parent.vm.addContactTab(t)}catch(e){d.error({title:"ERROR OPEN CONTACT",msg:"Jscripty can't open the contact"})}},m.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0},m.getResponseSheet=function(){return e.getResponseSheet(m.project.formData,m.project.responseData,!1)},m.getResponseSheetRow=function(){return e.getResponseSheetRow(m.project.formData,m.project.responseData)},m.getResponseSheetHeaders=function(){return e.getResponseSheetHeaders(m.project.formData,!1)},m.getQuestionWithResponseList=function(){return e.getQuestionWithResponseList(m.project.formData,m.project.responseData)},m.init=function(e){m.tab=e,m.tab&&(m.call=m.tab.call,m.starttime=m.tab.openedAt,m.contact=m.tab.contact,m.project=m.tab.project,m.project&&(_.isObjectLike(m.project.formData)?m.project.formData=m.project.formData:m.isJsonString(m.project.formData)?m.project.formData=JSON.parse(m.project.formData):m.project.formData=void 0,m.project.responseData=m.project.responseData||{},void 0!==m.project.currentPage&&r(function(){a.$broadcast("mwForm.pageEvents.changePage",{page:m.project.currentPage})}),i.$on("mwForm.pageEvents.pageCurrentChanged",function(e,t){if(t.currentPage&&(m.project.currentPage=t.currentPage.number-1,u(),m.project.enableUncompleteSave&&(1<=t.currentPage.number&&t.currentPage.number<m.project.formData.pages.length?m.showIncompleteSubmitButton=!0:m.showIncompleteSubmitButton=!1),m.project.formData&&m.project.formData.pages))for(var n=0,a=m.project.formData.pages.length;n<a;n++)if(t.currentPage.number<n+1&&m.project.formData.pages[n].elements)for(var i=0,o=m.project.formData.pages[n].elements.length;i<o;i++)"question"===m.project.formData.pages[n].elements[i].type&&m.project.formData.pages[n].elements[i].question&&delete m.project.responseData[m.project.formData.pages[n].elements[i].question.id]})))},m.resetViewer=function(e){if(m.formViewer.reset){var t=s.confirm().title(n.instant("JSCRIPTY.DO_YOU_WANT_TO_RESET_SESSION")).content(n.instant("JSCRIPTY.ALL_SURVEY_DATA_WILL_BE_LOST")).textContent("").ariaLabel("survey").targetEvent(e).ok(n.instant("JSCRIPTY.YES")).cancel(n.instant("JSCRIPTY.NO"));s.show(t).then(function(){m.showIncompleteSubmitButton=!1,m.project.currentPage=void 0,u(),m.formViewer.reset()})}}}e.$inject=["$scope","$q","$mdDialog","mwFormResponseUtils","api","toasty","Auth","$translate","$rootScope","$timeout","msUtils"],angular.module("app.dashboards").controller("AgentGeneralJscriptyController",e)}(),function(){"use strict";function e(n,a,e,t,i){var o=this;function s(){return function(e){if(404===e.status)a.info({title:n.instant("DASHBOARDS.ATTENTION"),msg:n.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){o.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}o.notification=e,o.user=i.getCurrentUser(),o.accept=function(e){{if(t[o.notification.channel+"Message"])return t[o.notification.channel+"Message"].accept({id:o.notification.id,UserId:o.user.id,manual:!0}).$promise.then(function(e){a.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(s());a.error({title:"API:ERROR",msg:"API accept message not found: "+o.notification.channel+"Message"})}},o.reject=function(e){{if(t[o.notification.channel+"Message"])return t[o.notification.channel+"Message"].reject({id:o.notification.id,UserId:o.user.id}).$promise.then(function(e){a.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(s());a.error({title:"API:ERROR",msg:"API reject message not found: "+o.notification.channel+"Message"})}}}e.$inject=["$translate","toasty","notification","api","Auth"],angular.module("app.dashboards").controller("NotificationController",e)}(),function(){"use strict";angular.module("app.dashboards").controller("AgentGeneralPopupController",function(){var t=this;t.init=function(e){t.tab=e,t.tab&&(t.tab.saved=!0,t.html=t.tab.html)}})}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(){l({queues:m.outboundQueues,rpcQueues:m.rpcQueues}).then(function(e){m.inbound=e})}function p(){d({rpcCampaigns:m.rpcCampaigns}).then(function(e){m.ivr=e})}m.outboundQueues=s?_.keyBy(s.rows?s.rows:[],"id"):{},m.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.rpcCampaigns=c?_.keyBy(c.rows?c.rows:[],"id"):{},m.inbound={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0},m.ivr={originated:0,limitCalls:0},m.onSaveQueue=function(e){m.outboundQueues[e.id]&&m.rpcQueues[e.id]&&(m.rpcQueues[e.id]=e)},m.onSaveCampaign=function(e){m.rpcCampaigns[e.id]&&(m.rpcCampaigns[e.id]=e)},i.onWithoutApply("voice_queue:save",m.onSaveQueue),m.interval=t(function(){u(),p()},999),i.onWithoutApply("campaign:save",m.onSaveCampaign),u(),p(),e.$on("$destroy",function(){i.removeAllListeners("voice_queue:save"),i.removeAllListeners("campaign:save"),m.interval&&t.cancel(m.interval)})}e.$inject=["$scope","$interval","$mdSidenav","Auth","socket","api","outboundQueues","rpcQueues","initializeRealtimeQueue","initializeRealtimeCampaign","rpcCampaigns"],angular.module("app.dashboards").controller("UserVoiceDashboardDialerController",e)}(),function(){"use strict";function e(n){var o=[],s=function(){var a=o[0],i={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,originated:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0};_.forIn(a.queues,function(e,t){if(a.rpcQueues[t]){i.waiting+=a.rpcQueues[t].waiting||0,i.talking+=(a.rpcQueues[t].talking||0)+(a.rpcQueues[t].pTalking||0),i.answered+=a.rpcQueues[t].answered||0,i.unmanaged+=a.rpcQueues[t].unmanaged||0,i.sumHoldTime+=a.rpcQueues[t].sumHoldTime||0,i.sumBillable+=a.rpcQueues[t].sumBillable||0,i.total+=a.rpcQueues[t].total||0,i.originated+=a.rpcQueues[t].originated||0,i.outboundDropCallsDayCallersExit+=a.rpcQueues[t].outboundDropCallsDayCallersExit||0,i.outboundDropCallsDayTimeout+=a.rpcQueues[t].outboundDropCallsDayTimeout||0;var n=a.rpcQueues[t].total-a.rpcQueues[t].answered-a.rpcQueues[t].unmanaged;i.abandoned+=0<n?n:0}}),i.avgHoldTime=Math.round(0<i.total?i.sumHoldTime/i.total:0),i.avgHoldTime=new Date(1e3*i.avgHoldTime).toISOString().substr(11,8),i.avgTalkTime=Math.round(0<i.answered?i.sumBillable/i.answered:0),i.avgTalkTime=new Date(1e3*i.avgTalkTime).toISOString().substr(11,8),i.answerRate=Math.round((0<i.total?i.answered/i.total*100:0)*Math.pow(10,1))/Math.pow(10,1),i.abandonRate=Math.round((0<i.total?i.abandoned/i.total*100:0)*Math.pow(10,1))/Math.pow(10,1),i.outboundDropRate=Math.round((0<i.total?i.outboundDropCallsDayTimeout/i.total*100:0)*Math.pow(10,1))/Math.pow(10,1),i.outboundAbandonRate=Math.round((0<i.total?i.outboundDropCallsDayCallersExit/i.total*100:0)*Math.pow(10,1))/Math.pow(10,1),i.outboundanswerRate=0<100-i.outboundDropRate-i.outboundAbandonRate&&i.total?100-i.outboundDropRate-i.outboundAbandonRate:0,o.shift(),a.defer.resolve(i),0<o.length&&s()};return function(e){var t=n.defer();return o.push({queues:e.queues,rpcQueues:e.rpcQueues,defer:t}),1===o.length&&s(),t.promise}}function t(n){var i=[],o=function(){var n=i[0],a={originated:0,limitCalls:0};_.forIn(n.rpcCampaigns,function(e,t){n.rpcCampaigns[t]&&(a.originated+=n.rpcCampaigns[t].originated||0,a.limitCalls+=n.rpcCampaigns[t].limitCalls||0)}),i.shift(),n.defer.resolve(a),0<i.length&&o()};return function(e){var t=n.defer();return i.push({rpcCampaigns:e.rpcCampaigns,defer:t}),1===i.length&&o(),t.promise}}function n(e,o,t,n){var s=this;s.hasPermission=function(){return t.hasPermission(101)||t.hasRole("admin")},s.license=n,e.$on("$stateChangeSuccess",function(e,t,n,a,i){if(t.data)switch(s.currentTab=t.data.selectedTab,s.currentTab){case 1:o.go("app.dashboards.general.dialer");break;default:o.go("app.dashboards.general.voice")}})}e.$inject=["$q"],t.$inject=["$q"],n.$inject=["$scope","$state","Auth","license"],angular.module("app.dashboards").filter("secToTime",function(){return function(e){return new Date(1e3*e).toISOString().substr(11,8)}}).factory("initializeRealtimeQueue",e).factory("initializeRealtimeCampaign",t).controller("UserDashboardGeneralController",n)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;function m(){d({queues:c.inboundQueues,rpcQueues:c.rpcQueues}).then(function(e){c.inbound=e})}c.inboundQueues=s?_.keyBy(s.rows?s.rows:[],"id"):{},c.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},c.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},c.outbound=l||{answered:0,sumBillable:0,sumDuration:0,sumHoldTime:0,total:0},c.onSaveQueue=function(e){c.inboundQueues[e.id]&&c.rpcQueues[e.id]&&(c.rpcQueues[e.id]=e,m())},c.onSaveOutbound=function(e){c.outbound=e},i.on("voice_queue:save",c.onSaveQueue),i.on("voice_outbound:save",c.onSaveOutbound),m(),e.$on("$destroy",function(){i.removeAllListeners("voice_queue:save"),i.removeAllListeners("voice_outbound:save")})}e.$inject=["$scope","$interval","$mdSidenav","Auth","socket","api","inboundQueues","rpcQueues","outbound","initializeRealtimeQueue"],angular.module("app.dashboards").controller("UserVoiceDashboardGeneralController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="FAX.EDIT_FAXACCOUNT",m.faxAccount=angular.copy(s),m.faxAccounts=o,m.newFaxAccount=!1,m.faxAccount||(m.faxAccount={waitForTheAssignedAgent:10,notificationSound:!0},m.title="FAX.NEW_FAXACCOUNT",m.newFaxAccount=!0),t.params.id&&(m.faxAccount.FaxAccountId=t.params.id),m.addNewFaxAccount=function(){m.errors=[],r.faxAccount.addAccountApplications(m.faxAccount).$promise.then(function(e){m.faxAccounts.unshift(e.toJSON()),i.success({title:"FaxAccount properly created",msg:m.faxAccount.name?m.faxAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveFaxAccount=function(){m.errors=[],r.faxAccount.updateAccountApplications(m.faxAccount).$promise.then(function(e){var t=_.find(m.faxAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"FaxAccount properly saved!",msg:m.faxAccount.name?m.faxAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteFaxAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The faxAccount will be deleted.").ariaLabel("Delete FaxAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.faxAccount.delete({id:m.faxAccount.id}).$promise.then(function(){_.remove(m.faxAccounts,{id:m.faxAccount.id}),i.success({title:"FaxAccount properly deleted!",msg:(m.faxAccount.name||"faxAccount")+" has been deleted!"}),u(m.faxAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.trunks=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","faxAccounts","faxAccount","api","Auth","license","setting"],angular.module("app.fax").controller("CreateOrEditFaxAccountDialogController",e)}(),function(){"use strict";function e(s,i,a,o,e){var r=this;function t(e,t){if(r.faxAccountApps.rows.length){var n=r.faxAccountApps.rows[t]?r.faxAccountApps.rows[t]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccountApp:n,faxAccount:r.faxAccount}}).then(function(e){e&&(e.id?r.faxAccountApps.rows[t]=e:r.faxAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.faxAccountApps.rows.length;n++,0){var a=r.faxAccountApps.rows[n],i=[],o=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.faxAccount.context,a.exten=r.faxAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(o.length?_.last(o).priority:a.priority)+1,t=_.concat(t,i,[a],o)}s.faxAccount.addApplications({id:r.faxAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.faxAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.faxAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.faxAccount={},r.faxAccountApps={count:0,rows:[]},r.selectedFaxAccountApps=[],r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"FaxQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",route:"faxQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e){r.faxAccount=e,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getFaxAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.faxAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getFaxAccountApps=function(){r.promise=s.faxAccount.getApplications(r.query,n).$promise},r.editFaxAccountApp=t,r.editInterval=function(e,t){if(r.faxAccountApps.rows.length){var n=r.faxAccountApps.rows[t]?r.faxAccountApps.rows[t]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteFaxAccountApp=function(e){_.remove(r.faxAccountApps.rows,{id:e.id}),l(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedFaxAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedFaxAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedFaxAccountApps.forEach(function(e){_.remove(r.faxAccountApps.rows,{id:e.id})}),r.selectedFaxAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return s.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.fax").controller("FaxAccountActionsController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="FAX.EDIT_"+(e.appType||e.app).toUpperCase(),o.agent=angular.copy(e),o.agent.appdata)switch(o.agent.appType?o.agent.appType.toLowerCase():o.agent.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.agent.appdata.split(",");o.agent.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.agent.text=s.slice(1,s.length).join(",");break;case"message":o.agent.text=o.agent.appdata;break;case"set":o.agent.name=o.agent.appdata.split("=")[0],o.agent.value=o.agent.appdata.split("=")[1];break;case"agi":o.agent.project=o.agent.appdata;break;default:var r=o.agent.appdata.split(",");o.agent.agent=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.agent.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.agent.timeout=30;function l(e){t.hide(e)}o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outbounddial"===o.agent.appType.toLowerCase()&&(o.agent.prefix=o.agent.phone?o.agent.phone.split("$")[0]:void 0,o.agent.callerId=o.agent.callerID?"CALLERID(all)="+o.agent.callerID:void 0),o.saveFaxAccountApp=function(){o.errors=[];var e=[];o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outboundDial"===o.agent.appType&&(o.agent.phone=a.cutdigits?(o.agent.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.agent.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.agent.options+="U(xcally-mixmonitor-context)"):o.agent.options=o.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.agents,{name:o.agent.agent});t&&(o.agent.UserId=t.id);if(o.agent.appType&&"custom"===o.agent.appType);else switch((o.agent.app||o.agent.appType).toLowerCase()){case"set":o.agent.appdata=o.agent.name+"="+o.agent.value;break;case"custom":break;default:e[0]=o.agent.agent,e[1]=o.agent.timeout,o.agent.appdata=e.join(",")}l(o.agent)},o.closeDialog=l,i.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){o.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","faxAccountApp","faxAccount","api"],angular.module("app.fax").controller("EditFaxAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="FAX.EDIT_"+(n.appType||n.app).toUpperCase(),o.close=angular.copy(n),o.close.appdata)switch(o.close.appType?o.close.appType.toLowerCase():o.close.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.close.appdata.split(",");o.close.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.close.text=s.slice(1,s.length).join(",");break;case"message":o.close.text=o.close.appdata;break;case"set":o.close.name=o.close.appdata.split("=")[0],o.close.value=o.close.appdata.split("=")[1];break;case"agi":o.close.project=o.close.appdata;break;default:var r=o.close.appdata.split(",");o.close.disposition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outbounddial"===o.close.appType.toLowerCase()&&(o.close.prefix=o.close.phone?o.close.phone.split("$")[0]:void 0,o.close.callerId=o.close.callerID?"CALLERID(all)="+o.close.callerID:void 0),o.saveFaxAccountApp=function(){o.errors=[];var e=[];o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outboundDial"===o.close.appType&&(o.close.phone=a.cutdigits?(o.close.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.close.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.close.options+="U(xcally-mixmonitor-context)"):o.close.options=o.close.options.replace("U(xcally-mixmonitor-context)",""));if(o.close.appType&&"custom"===o.close.appType);else switch((o.close.app||o.close.appType).toLowerCase()){case"set":o.close.appdata=o.close.name+"="+o.close.value;break;case"custom":break;default:e[0]=o.close.disposition,o.close.appdata=e.join(",")}l(o.close)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","faxAccountApp","faxAccount","api"],angular.module("app.fax").controller("EditFaxAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="FAX.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotoif=angular.copy(n),o.gotoif.appdata)switch(o.gotoif.appType?o.gotoif.appType.toLowerCase():o.gotoif.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotoif.appdata.split(",");o.gotoif.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotoif.text=s.slice(1,s.length).join(",");break;case"message":o.gotoif.text=o.gotoif.appdata;break;case"set":o.gotoif.name=o.gotoif.appdata.split("=")[0],o.gotoif.value=o.gotoif.appdata.split("=")[1];break;case"agi":o.gotoif.project=o.gotoif.appdata;break;default:var r=o.gotoif.appdata.split(",");o.gotoif.condition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.gotoif.truepriority=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.gotoif.falsepriority=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10)}function l(e){t.hide(e)}o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outbounddial"===o.gotoif.appType.toLowerCase()&&(o.gotoif.prefix=o.gotoif.phone?o.gotoif.phone.split("$")[0]:void 0,o.gotoif.callerId=o.gotoif.callerID?"CALLERID(all)="+o.gotoif.callerID:void 0),o.saveFaxAccountApp=function(){o.errors=[];var e=[];o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outboundDial"===o.gotoif.appType&&(o.gotoif.phone=a.cutdigits?(o.gotoif.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotoif.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotoif.options+="U(xcally-mixmonitor-context)"):o.gotoif.options=o.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotoif.appType&&"custom"===o.gotoif.appType);else switch((o.gotoif.app||o.gotoif.appType).toLowerCase()){case"set":o.gotoif.appdata=o.gotoif.name+"="+o.gotoif.value;break;case"custom":break;default:e[0]=o.gotoif.condition,e[1]=o.gotoif.truepriority,e[2]=o.gotoif.falsepriority,o.gotoif.appdata=e.join(",")}l(o.gotoif)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","faxAccountApp","faxAccount","api"],angular.module("app.fax").controller("EditFaxAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="FAX.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotop=angular.copy(n),o.gotop.appdata)switch(o.gotop.appType?o.gotop.appType.toLowerCase():o.gotop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotop.appdata.split(",");o.gotop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotop.text=s.slice(1,s.length).join(",");break;case"message":o.gotop.text=o.gotop.appdata;break;case"set":o.gotop.name=o.gotop.appdata.split("=")[0],o.gotop.value=o.gotop.appdata.split("=")[1];break;case"agi":o.gotop.project=o.gotop.appdata;break;default:var r=o.gotop.appdata.split(",");o.gotop.priority=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outbounddial"===o.gotop.appType.toLowerCase()&&(o.gotop.prefix=o.gotop.phone?o.gotop.phone.split("$")[0]:void 0,o.gotop.callerId=o.gotop.callerID?"CALLERID(all)="+o.gotop.callerID:void 0),o.saveFaxAccountApp=function(){o.errors=[];var e=[];o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outboundDial"===o.gotop.appType&&(o.gotop.phone=a.cutdigits?(o.gotop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotop.options+="U(xcally-mixmonitor-context)"):o.gotop.options=o.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotop.appType&&"custom"===o.gotop.appType);else switch((o.gotop.app||o.gotop.appType).toLowerCase()){case"set":o.gotop.appdata=o.gotop.name+"="+o.gotop.value;break;case"custom":break;default:e[0]=o.gotop.priority,o.gotop.appdata=e.join(",")}l(o.gotop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","faxAccountApp","faxAccount","api"],angular.module("app.fax").controller("EditFaxAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditFaxAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="FAX.EDIT_"+(n.appType||n.app).toUpperCase(),o.noop=angular.copy(n),o.noop.appdata)switch(o.noop.appType?o.noop.appType.toLowerCase():o.noop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.noop.appdata.split(",");o.noop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.noop.text=s.slice(1,s.length).join(",");break;case"message":o.noop.text=o.noop.appdata;break;case"set":o.noop.name=o.noop.appdata.split("=")[0],o.noop.value=o.noop.appdata.split("=")[1];break;case"agi":o.noop.project=o.noop.appdata;break;default:var r=o.noop.appdata.split(",");o.noop.value=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outbounddial"===o.noop.appType.toLowerCase()&&(o.noop.prefix=o.noop.phone?o.noop.phone.split("$")[0]:void 0,o.noop.callerId=o.noop.callerID?"CALLERID(all)="+o.noop.callerID:void 0),o.saveFaxAccountApp=function(){o.errors=[];var e=[];o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outboundDial"===o.noop.appType&&(o.noop.phone=a.cutdigits?(o.noop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.noop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.noop.options+="U(xcally-mixmonitor-context)"):o.noop.options=o.noop.options.replace("U(xcally-mixmonitor-context)",""));if(o.noop.appType&&"custom"===o.noop.appType);else switch((o.noop.app||o.noop.appType).toLowerCase()){case"set":o.noop.appdata=o.noop.name+"="+o.noop.value;break;case"custom":break;default:e[0]=o.noop.value,o.noop.appdata=e.join(",")}l(o.noop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","faxAccountApp","faxAccount","api"],angular.module("app.fax").controller("EditFaxAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="FAX.EDIT_"+(e.appType||e.app).toUpperCase(),o.queue=angular.copy(e),o.queue.appdata)switch(o.queue.appType?o.queue.appType.toLowerCase():o.queue.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.queue.appdata.split(",");o.queue.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.queue.text=s.slice(1,s.length).join(",");break;case"message":o.queue.text=o.queue.appdata;break;case"set":o.queue.name=o.queue.appdata.split("=")[0],o.queue.value=o.queue.appdata.split("=")[1];break;case"agi":o.queue.project=o.queue.appdata;break;default:var r=o.queue.appdata.split(",");o.queue.queue=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.queue.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.queue.queue=300,o.queue.timeout=300;function l(e){t.hide(e)}o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outbounddial"===o.queue.appType.toLowerCase()&&(o.queue.prefix=o.queue.phone?o.queue.phone.split("$")[0]:void 0,o.queue.callerId=o.queue.callerID?"CALLERID(all)="+o.queue.callerID:void 0),o.saveFaxAccountApp=function(){o.errors=[];var e=[];o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outboundDial"===o.queue.appType&&(o.queue.phone=a.cutdigits?(o.queue.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.queue.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.queue.options+="U(xcally-mixmonitor-context)"):o.queue.options=o.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.queues,{name:o.queue.queue});t&&(o.queue[_.capitalize("fax")+"QueueId"]=t.id);if(o.queue.appType&&"custom"===o.queue.appType);else switch((o.queue.app||o.queue.appType).toLowerCase()){case"set":o.queue.appdata=o.queue.name+"="+o.queue.value;break;case"custom":break;default:e[0]=o.queue.queue,e[1]=o.queue.timeout,o.queue.appdata=e.join(",")}l(o.queue)},o.closeDialog=l,i.faxQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){o.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","faxAccountApp","faxAccount","api"],angular.module("app.fax").controller("EditFaxAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="FAX.EDIT_"+(e.appType||e.app).toUpperCase(),o.system=angular.copy(e),o.system.appdata)switch(o.system.appType?o.system.appType.toLowerCase():o.system.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.system.appdata.split(",");o.system.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.system.text=s.slice(1,s.length).join(",");break;case"message":o.system.text=o.system.appdata;break;case"set":o.system.name=o.system.appdata.split("=")[0],o.system.value=o.system.appdata.split("=")[1];break;case"agi":o.system.project=o.system.appdata;break;default:var r=o.system.appdata.split(",");o.system.command=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.system.variable=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.system.variable="";function l(e){t.hide(e)}o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outbounddial"===o.system.appType.toLowerCase()&&(o.system.prefix=o.system.phone?o.system.phone.split("$")[0]:void 0,o.system.callerId=o.system.callerID?"CALLERID(all)="+o.system.callerID:void 0),o.saveFaxAccountApp=function(){o.errors=[];var e=[];o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outboundDial"===o.system.appType&&(o.system.phone=a.cutdigits?(o.system.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.system.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.system.options+="U(xcally-mixmonitor-context)"):o.system.options=o.system.options.replace("U(xcally-mixmonitor-context)",""));if(o.system.appType&&"custom"===o.system.appType);else switch((o.system.app||o.system.appType).toLowerCase()){case"set":o.system.appdata=o.system.name+"="+o.system.value;break;case"custom":break;default:e[0]=o.system.command,e[1]=o.system.variable,o.system.appdata=e.join(",")}l(o.system)},o.closeDialog=l,i.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){o.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","faxAccountApp","faxAccount","api"],angular.module("app.fax").controller("EditFaxAccountAppsystemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.faxAccount={},c.faxAccountFaxDispositions={count:0,rows:[]},c.selectedFaxAccountFaxDispositions=[],c.query={fields:"createdAt,updatedAt,id,name,createdAt",limit:10,page:1},c.init=function(e){c.faxAccount=e,c.query.id=c.faxAccount.id,c.query.FaxAccountId=c.faxAccount.id,c.getFaxAccountFaxDispositions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the faxDisposition?").htmlContent("<b>"+(e.name||"faxDisposition")+"</b> will be deleted.").ariaLabel("delete faxDisposition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getFaxAccountFaxDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.faxAccount.getDispositions(c.query,p).$promise},c.createOrEditFaxAccountFaxDisposition=function(e,t){o.show({controller:"CreateOrEditFaxDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/faxDispositions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:c.faxAccount,faxDisposition:t,faxDispositions:c.faxAccountFaxDispositions.rows,license:null,setting:null}})},c.exportSelectedFaxAccountFaxDispositions=function(){var e=angular.copy(c.selectedFaxAccountFaxDispositions);return c.selectedFaxAccountFaxDispositions=[],e},c.deleteFaxAccountFaxDisposition=g,c.deleteSelectedFaxAccountFaxDispositions=function(e){var t=o.confirm().title("Are you sure want to delete the selected faxDispositions?").htmlContent("<b>"+c.selectedFaxAccountFaxDispositions.length+" selected</b> will be deleted.").ariaLabel("delete faxDispositions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedFaxAccountFaxDispositions.forEach(function(e){g(e)}),c.selectedFaxAccountFaxDispositions=[]})};var m=!0,u=1;function p(e){c.faxAccountFaxDispositions=e||{count:0,rows:[]}}function g(e){l.faxDisposition.delete({id:e.id}).$promise.then(function(){_.remove(c.faxAccountFaxDispositions.rows,{id:e.id}),c.faxAccountFaxDispositions.count-=1,c.faxAccountFaxDispositions.rows.length||c.getFaxAccountFaxDispositions(),r.success({title:"FaxDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETfaxAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getFaxAccountFaxDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.fax").controller("FaxAccountFaxDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="FAX.EDIT_FAXDISPOSITION",m.faxDisposition=angular.copy(s),m.faxDispositions=o,m.newFaxDisposition=!1,m.faxDisposition||(m.faxDisposition={},m.title="FAX.NEW_FAXDISPOSITION",m.newFaxDisposition=!0),t.params.id&&(m.faxDisposition.FaxAccountId=t.params.id),m.addNewFaxDisposition=function(){m.errors=[],r.faxDisposition.save(m.faxDisposition).$promise.then(function(e){m.faxDispositions.unshift(e.toJSON()),i.success({title:"FaxDisposition properly created",msg:m.faxDisposition.name?m.faxDisposition.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxDisposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxDisposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveFaxDisposition=function(){m.errors=[],r.faxDisposition.update({id:m.faxDisposition.id},m.faxDisposition).$promise.then(function(e){var t=_.find(m.faxDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"FaxDisposition properly saved!",msg:m.faxDisposition.name?m.faxDisposition.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxDisposition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxDisposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteFaxDisposition=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The faxDisposition will be deleted.").ariaLabel("Delete FaxDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.faxDisposition.delete({id:m.faxDisposition.id}).$promise.then(function(){_.remove(m.faxDispositions,{id:m.faxDisposition.id}),i.success({title:"FaxDisposition properly deleted!",msg:(m.faxDisposition.name||"faxDisposition")+" has been deleted!"}),u(m.faxDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxDisposition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxDisposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","faxDispositions","faxDisposition","api","Auth","license","setting"],angular.module("app.fax").controller("CreateOrEditFaxDispositionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.faxAccount={},c.faxAccountInteractions={count:0,rows:[]},c.selectedFaxAccountInteractions=[],c.query={fields:"createdAt,updatedAt,id,createdAt,Contact.firstName,Owner.name,closedAt,disposition,note,UserId,ContactId,FaxAccountId,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e){c.faxAccount=e,c.query.id=c.faxAccount.id,c.getFaxAccountInteractions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getFaxAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.faxAccount.getInteractions(c.query,p).$promise},c.createOrEditFaxAccountInteraction=function(e,t){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/interactions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:c.faxAccount,interaction:t,interactions:c.faxAccountInteractions.rows,license:null,setting:null}})},c.spyfaxInteraction=function(e,n){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"fax",interaction:n,spy:!0})}})},c.exportSelectedFaxAccountInteractions=function(){var e=angular.copy(c.selectedFaxAccountInteractions);return c.selectedFaxAccountInteractions=[],e},c.deleteFaxAccountInteraction=g,c.deleteSelectedFaxAccountInteractions=function(e){var t=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedFaxAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedFaxAccountInteractions.forEach(function(e){g(e)}),c.selectedFaxAccountInteractions=[]})};var m=!0,u=1;function p(e){c.faxAccountInteractions=e||{count:0,rows:[]}}function g(e){l.faxInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.faxAccountInteractions.rows,{id:e.id}),c.faxAccountInteractions.count-=1,c.faxAccountInteractions.rows.length||c.getFaxAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETfaxAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getFaxAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.fax").controller("FaxAccountInteractionsController",e)}(),function(){"use strict";function e(n,e,t,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.faxAccount=d||n.params.faxAccount||{},c.selectedTab=n.params.tab||0,c.gotogoto=function(e,t){n.go("app.fax.realtime.accounts",{})},c.alert=r.info,c.gotoFaxAccounts=function(){n.go("app.fax.faxAccounts")},c.saveFaxAccount=function(){s.faxAccount.updateAccountApplications(c.faxAccount).$promise.then(function(){r.success({title:"FaxAccount updated!",msg:c.faxAccount.name?c.faxAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.trunks=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.lists=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","faxAccount"],angular.module("app.fax").controller("FaxAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.faxAccounts=r||{count:0,rows:[]},v.table="faxAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedFaxAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,page:1},v.arrayecm=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayminrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraymaxrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytech=_.keyBy([{option:"SIP",value:"'SIP'"},{option:"IAX",value:"'IAX'"},{option:"DADHI",value:"'DADHI'"},{option:"KHOMP",value:"'KHOMP'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayacceptMethod=_.keyBy([{option:"HTTP GET",value:"'GET'"},{option:"HTTP POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayrejectMethod=_.keyBy([{option:"HTTP GET",value:"'GET'"},{option:"HTTP POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraycloseMethod=_.keyBy([{option:"HTTP GET",value:"'GET'"},{option:"HTTP POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.fax.faxAccounts.edit",{id:e.id,faxAccount:e})},v.interactionsgoto=function(e,t){n.go("app.fax.faxAccounts.edit",{id:e.id,tab:5})},v.gotorealtimegoto=function(e,t){n.go("app.fax.realtime.accounts",{})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the faxAccount?").htmlContent("<b>"+(e.name||"faxAccount")+"</b> will be deleted.").ariaLabel("delete faxAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getFaxAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.faxAccount.get(v.query,f).$promise},v.createOrEditFaxAccount=function(e,t){i.show({controller:"CreateOrEditFaxAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:t,faxAccounts:v.faxAccounts.rows,license:v.license,setting:v.setting}})},v.deleteFaxAccount=A,v.exportSelectedFaxAccounts=function(){var e=angular.copy(v.selectedFaxAccounts);return v.selectedFaxAccounts=[],e},v.deleteSelectedFaxAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected faxAccounts?").htmlContent("<b>"+v.selectedFaxAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FaxAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedFaxAccounts.forEach(function(e){A(e)}),v.selectedFaxAccounts=[]})},v.deselectFaxAccounts=function(){v.selectedFaxAccounts=[]},v.selectAllFaxAccounts=function(){v.selectedFaxAccounts=v.faxAccounts.rows},l.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.trunks=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.lists=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.faxAccounts=e||{count:0,rows:[]}}function A(e){l.faxAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.faxAccounts.rows,{id:e.id}),v.faxAccounts.count-=1,v.faxAccounts.rows.length||v.getFaxAccounts(),c.success({title:"FaxAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getFaxAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","faxAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.fax").controller("FaxAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="FAX.EDIT_FAXQUEUE",m.faxQueue=angular.copy(s),m.faxQueues=o,m.newFaxQueue=!1,m.faxQueue||(m.faxQueue={strategy:"beepall",timeout:10},m.title="FAX.NEW_FAXQUEUE",m.newFaxQueue=!0),m.addNewFaxQueue=function(){m.errors=[],r.faxQueue.save(m.faxQueue).$promise.then(function(e){m.faxQueues.unshift(e.toJSON()),i.success({title:"FaxQueue properly created",msg:m.faxQueue.name?m.faxQueue.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveFaxQueue=function(){m.errors=[],r.faxQueue.update({id:m.faxQueue.id},m.faxQueue).$promise.then(function(e){var t=_.find(m.faxQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"FaxQueue properly saved!",msg:m.faxQueue.name?m.faxQueue.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteFaxQueue=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The faxQueue will be deleted.").ariaLabel("Delete FaxQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.faxQueue.delete({id:m.faxQueue.id}).$promise.then(function(){_.remove(m.faxQueues,{id:m.faxQueue.id}),i.success({title:"FaxQueue properly deleted!",msg:(m.faxQueue.name||"faxQueue")+" has been deleted!"}),u(m.faxQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","faxQueues","faxQueue","api","Auth","license","setting"],angular.module("app.fax").controller("CreateOrEditFaxQueueDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.faxQueue[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.faxQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserFaxQueue?"penalty "+e.UserFaxQueue.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserFaxQueue?"penalty "+e.UserFaxQueue.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.faxQueue=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("FAX.ALL_AGENTS"),labelSelected:s.instant("FAX.SELECTED_AGENTS"),transferCallback:function(e,t){a.faxQueue[t?"removeAgents":"addAgents"]({id:l.faxQueue.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"FaxQueue properly "+(t?"removed":"added"),msg:"FaxQueue has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:faxQueue.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","faxQueue","faxQueues","realtime","$translate","Auth"],angular.module("app.fax").controller("FaxQueueagentaddController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.faxQueue=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("FAX.ALL_TEAMS"),labelSelected:i.instant("FAX.SELECTED_TEAMS"),transferCallback:function(e,t){a.faxQueue[t?"removeTeams":"addTeams"]({id:o.faxQueue.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:faxQueue.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.faxQueue.getTeams({id:o.faxQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","faxQueue","$translate"],angular.module("app.fax").controller("FaxQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.faxQueue=d||e.params.faxQueue||{},c.selectedTab=e.params.tab||0,c.teamadddialog=function(e,t){n.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:c.faxQueues?c.faxQueues.rows:[]}})},c.agentadddialog=function(e,t){n.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:c.faxQueues?c.faxQueues.rows:[],realtime:!1}})},c.alert=r.info,c.gotoFaxQueues=function(){e.go("app.fax.faxQueues")},c.saveFaxQueue=function(){s.faxQueue.update({id:c.faxQueue.id},c.faxQueue).$promise.then(function(){r.success({title:"FaxQueue updated!",msg:c.faxQueue.name?c.faxQueue.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","faxQueue"],angular.module("app.fax").controller("FaxQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.faxQueues=r||{count:0,rows:[]},v.table="faxQueues",v.listOrder="",v.listOrderAsc=null,v.selectedFaxQueues=[],v.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,page:1},v.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.fax.faxQueues.edit",{id:e.id,faxQueue:e})},v.teamadddialog=function(e,t){i.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:v.faxQueues?v.faxQueues.rows:[]}})},v.agentadddialog=function(e,t){i.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:v.faxQueues?v.faxQueues.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the faxQueue?").htmlContent("<b>"+(e.name||"faxQueue")+"</b> will be deleted.").ariaLabel("delete faxQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.fax.realtime.queues",{})},v.success=f,v.getFaxQueues=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.faxQueue.get(v.query,f).$promise},v.createOrEditFaxQueue=function(e,t){i.show({controller:"CreateOrEditFaxQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:t,faxQueues:v.faxQueues.rows,license:v.license,setting:v.setting}})},v.deleteFaxQueue=A,v.exportSelectedFaxQueues=function(){var e=angular.copy(v.selectedFaxQueues);return v.selectedFaxQueues=[],e},v.deleteSelectedFaxQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected faxQueues?").htmlContent("<b>"+v.selectedFaxQueues.length+" selected</b> will be deleted.").ariaLabel("delete FaxQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedFaxQueues.forEach(function(e){A(e)}),v.selectedFaxQueues=[]})},v.deselectFaxQueues=function(){v.selectedFaxQueues=[]},v.selectAllFaxQueues=function(){v.selectedFaxQueues=v.faxQueues.rows};var h=!0,b=1;function f(e){v.faxQueues=e||{count:0,rows:[]}}function A(e){l.faxQueue.delete({id:e.id}).$promise.then(function(){_.remove(v.faxQueues.rows,{id:e.id}),v.faxQueues.count-=1,v.faxQueues.rows.length||v.getFaxQueues(),c.success({title:"FaxQueue deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxQueue"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getFaxQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","faxQueues","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.fax").controller("FaxQueuesController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this;function m(){_.forIn(c.faxAccounts,function(e,t){c.rpcFaxAccounts[t]&&_.merge(e,c.rpcFaxAccounts[t])}),_.forIn(c.faxAccounts,function(t,e){var n={id:e,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss")};o.faxAccount.getMessages(n).$promise.then(function(e){return e&&(t.in=e.count||0,t.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),n.direction="out",o.faxAccount.getMessages(n).$promise}).then(function(e){e&&(t.out=e.count||0,t.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){console.log(e)})})}c.count=l&&l.count?l.count:0,c.faxAccounts=l?_.keyBy(l.rows?l.rows:[],"id"):{},c.rpcFaxAccounts=d?_.keyBy(d.rows?d.rows:[],"id"):{},c.query={sort:"-name",limit:10,page:1},c.success=g,c.$onInit=m,c.getFaxAccounts=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.faxAccount.get(c.query,g).$promise},c.onSave=function(e){c.faxAccounts[e.id]&&_.merge(c.faxAccounts[e.id],e)},c.onFaxMessageSave=function(e){c.faxAccounts[e.FaxAccountId]&&("in"==e.direction?(c.faxAccounts[e.FaxAccountId].in+=1,c.faxAccounts[e.FaxAccountId].lastIn=e.createdAt):(c.faxAccounts[e.FaxAccountId].out+=1,c.faxAccounts[e.FaxAccountId].lastOut=e.createdAt))},c.goToFaxAccount=function(e,t){i.go("app.fax.faxAccounts.edit",{id:t.id,faxAccount:t})},c.order=[],_.forIn(c.faxAccounts,function(e,t){c.order.push(e.id)}),s.on("faxAccount:save",c.onSave),s.on("faxAccount:update",c.onSave),s.on("faxMessage:save",c.onFaxMessageSave);var u=!0,p=1;function g(e){if(c.faxAccounts=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){c.order=[];for(var t=0;t<e.rows.length;t++)c.order.push(e.rows[t].id)}m()}e.$watch("vm.query.filter",function(e,t){u?n(function(){u=!1}):(t||(p=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=p),c.getFaxAccounts())}),e.$on("$destroy",function(){s.removeAllListeners("faxAccount:save"),s.removeAllListeners("faxAccount:update"),s.removeAllListeners("faxMessage:save")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$state","api","socket","toasty","faxAccounts","rpcFaxAccounts"],angular.module("app.fax").controller("FaxAccountsRealtimeController",e)}(),function(){"use strict";function e(e,s,t,n,a,i,o,r,l,d,c,m,u,p,g,v){var h=this,b=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum"],f=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var A in h.availableStates=["ringing","inuse","busy","onhold","not_inuse"],h.pauses=o||{count:0,rows:[]},h.license=g,h.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},h.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},h.paginatedAgents={},h.load=!1,h.order=[],h.agentInternal={},h.agents)h.agents.hasOwnProperty(A)&&(h.agents[A].init=!0);h.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},h.logout=function(e,t){return d.user.logout({id:e.id}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),h.agents[e.id]&&(h.agents[e.id].online=!1),h.rpcAgents[e.id]&&(h.rpcAgents[e.id].online=!1),y()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"fax",realtime:!0,direction:"inbound"}})},h.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},h.getAgentStatus=C,h.getAgentGlobalStatus=x,h.isPause=S,h.checkPause=function(e){return"pause"===e},h.isPartialPause=function(e){return"*pause"===e},h.onSave=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(_.omit(e,f),b)),_.merge(h.rpcAgents[e.id],_.pick(_.omit(e,f),b)),x(h.agents[e.id]))},h.onUpdate=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(e,b)),_.merge(h.rpcAgents[e.id],_.pick(e,b)),x(h.agents[e.id]))},h.onInit=y,h.onConnect=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(_.merge(h.agents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(h.rpcAgents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},h.onComplete=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(h.agents[h.agentInternal[e.destaccountcode]]=_.omit(h.agents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),h.rpcAgents[h.agentInternal[e.destaccountcode]]=_.omit(h.rpcAgents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",h.onSave),c.on("user:update",h.onUpdate),c.on("user:agentconnect",h.onConnect),c.on("user:agentcomplete",h.onComplete),y();var E=v(function(){h.load&&(h.load=!1,y())},999);function y(e){h.load=!1;var t,n,a=s.defer();h.promise=a.promise,h.filteredAgents=[],h.order=[],_.forIn(h.agents,function(e,t){h.rpcAgents[t]&&_.merge(e,_.pick(_.omit(h.rpcAgents[t],f),b)),x(e),e.online?(h.filteredAgents.push(e),h.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),h.query.globalStatusFilter&&_.remove(h.filteredAgents,function(e){return e.globalStatus!==h.query.globalStatusFilter}),h.query.pauseTypeFilter&&_.remove(h.filteredAgents,function(e){return e.pauseType!==h.query.pauseTypeFilter}),h.query.filter&&_.remove(h.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(h.query.filter.toLowerCase())<0}),h.filteredAgents=(t=h.filteredAgents,n=_.startsWith(h.query.order,"-")?"desc":"asc",_.orderBy(t,[h.query.order.replace("-","")],[n]));var i=(h.query.page-1)*h.query.limit;h.paginatedAgents=_.drop(h.filteredAgents,i).slice(0,h.query.limit);for(var o=0;o<h.paginatedAgents.length;o+=1)h.order.push(h.paginatedAgents[o].id);a.resolve(),h.load=!0}function S(e){return"pause"===e||"*pause"===e}function T(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function C(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function x(e){var t="unknown";t=_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"pause":_.some([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"*pause":_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],T)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=S(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),E&&(v.cancel(E),E=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","Auth","license","$interval"],angular.module("app.voice").controller("AgentsFaxRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function g(){var n=[];return _.forIn(u.queues,function(e,t){e.paused=0,e.loggedInDb=0,u.queues[t].agents={},n.push(l.faxQueue.getMembers({id:t}).$promise),u.rpcQueues[t]&&_.merge(e,_.pick(u.rpcQueues[t],p))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&u.queues[e[t].rows[n].FaxQueueId].paused++,u.queues[e[t].rows[n].FaxQueueId].loggedInDb++,u.queues[e[t].rows[n].FaxQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].FaxQueueId}).catch(function(e){console.error(e)})}u.count=s.count?s.count:0,u.queues=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.hasRole("admin")?u.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:u.query={id:m.getCurrentUser().id,channel:"fax",type:"inbound",sort:"-updatedAt",limit:10,page:1},u.success=b,u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=l.faxQueue.get(u.query,b).$promise:u.promise=l.user.getQueues(u.query,b).$promise},u.createOrEditFaxQueue=function(e,t){a.show({controller:"CreateOrEditFaxQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:t,faxQueues:_.values(u.queues),license:null,setting:null}})},u.agentAdd=function(e,t){a.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:t,faxQueues:u.queues?u.queues.rows:[],realtime:!1}})},u.updateQueue=function(e){return l.faxQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},u.onSave=function(e){u.queues[e.id]&&_.merge(u.queues[e.id],_.pick(e,p))},u.onSaveMember=function(e){u.queues[e.FaxQueueId]&&u.queues[e.FaxQueueId].loggedInDb++},u.onRemoveMember=function(e){u.queues[e.FaxQueueId]&&u.queues[e.FaxQueueId].loggedInDb--},u.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(u.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(u.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},u.onLogin=function(e){console.log("onLogged",e),u.queues[e.FaxQueueId]&&(u.queues[e.FaxQueueId].loggedInDb+=1,u.queues[e.FaxQueueId].agents[e.UserId]=e.FaxQueueId)},u.onLogout=function(e){console.log("onLogout",e),u.queues[e.FaxQueueId]&&0<u.queues[e.FaxQueueId].loggedInDb&&(u.queues[e.FaxQueueId].loggedInDb-=1,delete u.queues[e.FaxQueueId].agents[e.UserId])},u.$onInit=g,u.order=[],_.forIn(u.queues,function(e,t){u.order.push(e.id)}),d.on("fax_queue:save",u.onSave),d.on("userFaxQueue:save",u.onSaveMember),d.on("userFaxQueue:remove",u.onRemoveMember),d.on("user:update",u.onPause),d.on("userVoiceQueue:remove",u.onLogout),d.on("userVoiceQueue:save",u.onLogin);var v=!0,h=1;function b(e){if(u.count=e.count,u.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){u.order=[];for(var t=0;t<e.rows.length;t++)u.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("fax_queue:save"),d.removeAllListeners("userFaxQueue:remove"),d.removeAllListeners("userFaxQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","Auth"],angular.module("app.fax").controller("QueuesFaxRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.fax.realtime.agents":this.selectedTab=0;break;case"app.fax.realtime.trunks":this.selectedTab=1;break;case"app.fax.realtime.queues":this.selectedTab=2;break;case"app.fax.realtime.accounts":this.selectedTab=3;break;default:this.selectedTab=0,n.go("app.fax.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.fax.realtime.agents");break;case 1:n.go("app.fax.realtime.trunks");break;case 2:n.go("app.fax.realtime.queues");break;case 3:n.go("app.fax.realtime.accounts");break;default:n.go("app.fax.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.fax").controller("FaxRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l){var d=this,c=["status","stateRegistry","registry","host","port","internal","state","status"];function m(){for(var e,t=0;t<d.trunks.length;t+=1)0<=(e=_.findIndex(d.rpcTrunks,["id",d.trunks[t].id]))&&_.merge(d.trunks[t],_.pick(d.rpcTrunks[e],c))}function u(e,t,n){0<=t&&_.merge(e[t],_.pick(n,c))}d.count=a.count,d.trunks=a?a.rows:[],d.rpcTrunks=i&&i.rows?i.rows:[],d.query={fields:"id,name",active:!0,sort:"-updatedAt",limit:10,page:1},d.statusClass=r.status,d.stateClass=r.state,d.success=v,d.$onInit=m,d.showInfo=function(e){t.show(t.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},d.getTrunks=function(){d.query.offset=(d.query.page-1)*d.query.limit,d.promise=o.trunk.get(d.query,v).$promise},d.goToTrunk=function(e,t){l.go("app.tools.trunks.edit",{id:t.id})},d.onSave=function(e){var t=_.findIndex(d.trunks,["id",e.id]),n=_.findIndex(d.rpcTrunks,["id",e.id]);u(d.trunks,t,e),u(d.rpcTrunks,n,e)},s.on("trunk:save",d.onSave);var p=!0,g=1;function v(e){d.count=e.count,d.trunks=e&&e.rows?e.rows:[],m()}e.$watch("vm.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=d.query.page),e!==t&&(d.query.page=1),e||(d.query.page=g),d.getTrunks())}),e.$on("$destroy",function(){s.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","helperClasses","$state"],angular.module("app.fax").controller("TrunksFaxRealtimeController",e)}(),function(){"use strict";function e(e,t){this.info=e,this.license=t}e.$inject=["info","license"],angular.module("app.help.about").controller("AboutController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_DESKACCOUNT",m.deskAccount=angular.copy(s),m.deskAccounts=o,m.newDeskAccount=!1,m.deskAccount||(m.deskAccount={type:"integrationTab",authType:"basic",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},m.title="INTEGRATIONS.NEW_DESKACCOUNT",m.newDeskAccount=!0),m.addNewDeskAccount=function(){m.errors=[],r.intDeskAccount.save(m.deskAccount).$promise.then(function(e){m.deskAccounts.unshift(e.toJSON()),i.success({title:"DeskAccount properly created",msg:m.deskAccount.name?m.deskAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveDeskAccount=function(){m.errors=[],r.intDeskAccount.update({id:m.deskAccount.id},m.deskAccount).$promise.then(function(e){var t=_.find(m.deskAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"DeskAccount properly saved!",msg:m.deskAccount.name?m.deskAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteDeskAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The deskAccount will be deleted.").ariaLabel("Delete DeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intDeskAccount.delete({id:m.deskAccount.id}).$promise.then(function(){_.remove(m.deskAccounts,{id:m.deskAccount.id}),i.success({title:"DeskAccount properly deleted!",msg:(m.deskAccount.name||"deskAccount")+" has been deleted!"}),u(m.deskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","deskAccounts","deskAccount","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditDeskAccountDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.deskAccounts=r||{count:0,rows:[]},v.table="deskAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedDeskAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",limit:10,page:1},v.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayauthType=_.keyBy([{option:"Basic",value:"'basic'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.integrations.deskAccounts.edit",{id:e.id,deskAccount:e})},v.testtestintegrationaccount=function(e,t){return l.intDeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){c.success({title:"DeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"DeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the deskAccount?").htmlContent("<b>"+(e.name||"deskAccount")+"</b> will be deleted.").ariaLabel("delete deskAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getDeskAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.intDeskAccount.get(v.query,f).$promise},v.createOrEditDeskAccount=function(e,t){i.show({controller:"CreateOrEditDeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskAccount:t,deskAccounts:v.deskAccounts.rows,license:v.license,setting:v.setting}})},v.deleteDeskAccount=A,v.exportSelectedDeskAccounts=function(){var e=angular.copy(v.selectedDeskAccounts);return v.selectedDeskAccounts=[],e},v.deleteSelectedDeskAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected deskAccounts?").htmlContent("<b>"+v.selectedDeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete DeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedDeskAccounts.forEach(function(e){A(e)}),v.selectedDeskAccounts=[]})},v.deselectDeskAccounts=function(){v.selectedDeskAccounts=[]},v.selectAllDeskAccounts=function(){v.selectedDeskAccounts=v.deskAccounts.rows};var h=!0,b=1;function f(e){v.deskAccounts=e||{count:0,rows:[]}}function A(e){l.intDeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.deskAccounts.rows,{id:e.id}),v.deskAccounts.count-=1,v.deskAccounts.rows.length||v.getDeskAccounts(),c.success({title:"DeskAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintDeskAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintDeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getDeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","deskAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("DeskAccountsController",e)}(),function(){"use strict";function e(a,n,i,o,e){var s=this;function r(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.subjects,{id:e.id}),o.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.descriptions,{id:e.id}),o.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.fields,{id:e.id}),o.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}s.currentUser=e.getCurrentUser(),s.deskAccount={},s.deskConfiguration={},s.configurations=[],s.selectedDeskConfiguration=-1,s.init=function(e){s.deskAccount=e,i.intDeskAccount.getConfigurations({id:s.deskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return s.configurations=e.rows?e.rows:[],s.configurations.length&&s.getDeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){s.variables=e.rows?e.rows:[],s.variablesById=_.keyBy(s.variables,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.getDeskConfiguration=function(e){s.deskConfiguration=s.configurations[e],s.selectedDeskConfiguration=e,i.intDeskConfiguration.getSubjects({id:s.deskConfiguration.id}).$promise.then(function(e){return s.subjects=e.rows?e.rows:[],i.intDeskConfiguration.getDescriptions({id:s.deskConfiguration.id}).$promise}).then(function(e){return s.descriptions=e.rows?e.rows:[],i.intDeskConfiguration.getFields({id:s.deskConfiguration.id}).$promise}).then(function(e){s.fields=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intDeskConfiguration.getTags({id:s.deskConfiguration.id}).$promise.then(function(e){s.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.createOrEditDeskConfiguration=function(e,t){a.show({controller:"CreateOrEditDeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskConfiguration:t,configurations:s.configurations,license:null,setting:null}}).finally(function(){s.getDeskConfiguration(0)})},s.deleteDeskConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the deskConfiguration?").htmlContent("<b>"+(t.name||"deskConfiguration")+"</b> will be deleted.").ariaLabel("delete deskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intDeskConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(s.configurations,{id:t.id}),o.success({title:"DeskConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){s.getDeskConfiguration(0)})},function(){console.log("CANCEL")})},s.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:s.deskConfiguration.id},s.deskConfiguration).$promise.then(function(){o.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.selectedTags=[],s.selectTagsChanged=function(e){i.intDeskConfiguration.setTags({id:s.deskConfiguration.id,ids:s.selectedTags}).$promise.then(function(){o.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){s.tags=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.selectedSubjects=[],s.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:s.subjects,configuration:s.deskConfiguration,account:s.deskAccount,license:null,setting:null}})},s.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},s.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+s.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedSubjects.forEach(function(e){r(e)}),s.selectedSubjects=[]})},s.selectedDescriptions=[],s.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:s.descriptions,configuration:s.deskConfiguration,account:s.deskAccount,license:null,setting:null}})},s.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},s.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+s.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedDescriptions.forEach(function(e){l(e)}),s.selectedDescriptions=[]})},s.selectedFields=[],s.createOrEditField=function(e,t){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:s.fields,configuration:s.deskConfiguration,account:s.deskAccount,license:null,setting:null}})},s.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},s.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+s.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedFields.forEach(function(e){d(e)}),s.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("DeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_DESKCONFIGURATION",m.deskConfiguration=angular.copy(s),m.configurations=o,m.newDeskConfiguration=!1,m.deskConfiguration||(m.deskConfiguration={channel:"voice",type:"inbound"},m.title="INTEGRATIONS.NEW_DESKCONFIGURATION",m.newDeskConfiguration=!0),m.addNewDeskConfiguration=function(){m.errors=[],r.intDeskAccount.addConfiguration({id:t.params.id},m.deskConfiguration).$promise.then(function(e){m.configurations.unshift(e.toJSON()),i.success({title:"DeskConfiguration properly created",msg:m.deskConfiguration.name?m.deskConfiguration.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveDeskConfiguration=function(){m.errors=[],r.intDeskConfiguration.update({id:m.deskConfiguration.id},m.deskConfiguration).$promise.then(function(e){var t=_.find(m.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"DeskConfiguration properly saved!",msg:m.deskConfiguration.name?m.deskConfiguration.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteDeskConfiguration=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The deskConfiguration will be deleted.").ariaLabel("Delete DeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intDeskConfiguration.delete({id:m.deskConfiguration.id}).$promise.then(function(){_.remove(m.configurations,{id:m.deskConfiguration.id}),i.success({title:"DeskConfiguration properly deleted!",msg:(m.deskConfiguration.name||"deskConfiguration")+" has been deleted!"}),u(m.deskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configurations","deskConfiguration","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditDeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(){a.hide()}m.errors=[],m.title="INTEGRATIONS.EDIT_"+_.toUpper(d),m.item=angular.copy(r),m.items=s,m.type=d,m.newItem=!1,m.item||(m.item={type:"string"},m.item[_.capitalize(d)+"Id"]=o.id,m.title="INTEGRATIONS.NEW_"+_.toUpper(d),m.newItem=!0),m.addNewItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intDeskField.save(m.item).$promise.then(function(e){m.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},m.saveItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intDeskField.update({id:m.item.id},m.item).$promise.then(function(e){var t=_.find(m.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},m.deleteItem=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intDeskField.delete({id:m.item.id}).$promise.then(function(){_.remove(m.items,{id:m.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},m.getSelectedVariable=function(){return void 0!==m.item.variableName?m.item.variableName:"Please select a variable"},m.closeDialog=u,c.variable.get({nolimit:!0}).$promise.then(function(e){return m.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return m.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){m.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDeskAccount.getFields({id:l.id}).$promise.then(function(e){m.accountConnected=!0,m.fields=e.rows?e.rows:[],m.item.idField&&(m.customField=_.find(m.fields,{id:m.item.idField}))}).catch(function(e){m.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api"],angular.module("app.integrations").controller("CreateOrEditDeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.deskAccount=d||e.params.deskAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoDeskAccounts=function(){e.go("app.integrations.deskAccounts")},c.saveDeskAccount=function(){s.intDeskAccount.update({id:c.deskAccount.id},c.deskAccount).$promise.then(function(){r.success({title:"DeskAccount updated!",msg:c.deskAccount.name?c.deskAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintDeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","deskAccount"],angular.module("app.integrations").controller("DeskAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_FRESHDESKACCOUNT",m.freshdeskAccount=angular.copy(s),m.freshdeskAccounts=o,m.newFreshdeskAccount=!1,m.freshdeskAccount||(m.freshdeskAccount={serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},m.title="INTEGRATIONS.NEW_FRESHDESKACCOUNT",m.newFreshdeskAccount=!0),m.addNewFreshdeskAccount=function(){m.errors=[],r.intFreshdeskAccount.save(m.freshdeskAccount).$promise.then(function(e){m.freshdeskAccounts.unshift(e.toJSON()),i.success({title:"FreshdeskAccount properly created",msg:m.freshdeskAccount.name?m.freshdeskAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveFreshdeskAccount=function(){m.errors=[],r.intFreshdeskAccount.update({id:m.freshdeskAccount.id},m.freshdeskAccount).$promise.then(function(e){var t=_.find(m.freshdeskAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"FreshdeskAccount properly saved!",msg:m.freshdeskAccount.name?m.freshdeskAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteFreshdeskAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The freshdeskAccount will be deleted.").ariaLabel("Delete FreshdeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intFreshdeskAccount.delete({id:m.freshdeskAccount.id}).$promise.then(function(){_.remove(m.freshdeskAccounts,{id:m.freshdeskAccount.id}),i.success({title:"FreshdeskAccount properly deleted!",msg:(m.freshdeskAccount.name||"freshdeskAccount")+" has been deleted!"}),u(m.freshdeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","freshdeskAccounts","freshdeskAccount","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,o,e){var s=this;function r(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.subjects,{id:e.id}),o.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.descriptions,{id:e.id}),o.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.fields,{id:e.id}),o.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}s.currentUser=e.getCurrentUser(),s.freshdeskAccount={},s.freshdeskConfiguration={},s.configurations=[],s.selectedFreshdeskConfiguration=-1,s.init=function(e){s.freshdeskAccount=e,i.intFreshdeskAccount.getConfigurations({id:s.freshdeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return s.configurations=e.rows?e.rows:[],s.configurations.length&&s.getFreshdeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){s.variables=e.rows?e.rows:[],s.variablesById=_.keyBy(s.variables,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.getFreshdeskConfiguration=function(e){s.freshdeskConfiguration=s.configurations[e],s.selectedFreshdeskConfiguration=e,i.intFreshdeskConfiguration.getSubjects({id:s.freshdeskConfiguration.id}).$promise.then(function(e){return s.subjects=e.rows?e.rows:[],i.intFreshdeskConfiguration.getDescriptions({id:s.freshdeskConfiguration.id}).$promise}).then(function(e){return s.descriptions=e.rows?e.rows:[],i.intFreshdeskConfiguration.getFields({id:s.freshdeskConfiguration.id}).$promise}).then(function(e){s.fields=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intFreshdeskConfiguration.getTags({id:s.freshdeskConfiguration.id}).$promise.then(function(e){s.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.createOrEditFreshdeskConfiguration=function(e,t){a.show({controller:"CreateOrEditFreshdeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskConfiguration:t,configurations:s.configurations,license:null,setting:null}}).finally(function(){s.getFreshdeskConfiguration(0)})},s.deleteFreshdeskConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the freshdeskConfiguration?").htmlContent("<b>"+(t.name||"freshdeskConfiguration")+"</b> will be deleted.").ariaLabel("delete freshdeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intFreshdeskConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(s.configurations,{id:t.id}),o.success({title:"FreshdeskConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){s.getFreshdeskConfiguration(0)})},function(){console.log("CANCEL")})},s.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:s.freshdeskConfiguration.id},s.freshdeskConfiguration).$promise.then(function(){o.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.selectedTags=[],s.selectTagsChanged=function(e){i.intFreshdeskConfiguration.setTags({id:s.freshdeskConfiguration.id,ids:s.selectedTags}).$promise.then(function(){o.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){s.tags=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.selectedSubjects=[],s.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:s.subjects,configuration:s.freshdeskConfiguration,account:s.freshdeskAccount,license:null,setting:null}})},s.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},s.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+s.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedSubjects.forEach(function(e){r(e)}),s.selectedSubjects=[]})},s.selectedDescriptions=[],s.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:s.descriptions,configuration:s.freshdeskConfiguration,account:s.freshdeskAccount,license:null,setting:null}})},s.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},s.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+s.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedDescriptions.forEach(function(e){l(e)}),s.selectedDescriptions=[]})},s.selectedFields=[],s.createOrEditField=function(e,t){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:s.fields,configuration:s.freshdeskConfiguration,account:s.freshdeskAccount,license:null,setting:null}})},s.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},s.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+s.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedFields.forEach(function(e){d(e)}),s.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("FreshdeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_FRESHDESKCONFIGURATION",m.freshdeskConfiguration=angular.copy(s),m.configurations=o,m.newFreshdeskConfiguration=!1,m.freshdeskConfiguration||(m.freshdeskConfiguration={channel:"voice",type:"inbound"},m.title="INTEGRATIONS.NEW_FRESHDESKCONFIGURATION",m.newFreshdeskConfiguration=!0),m.addNewFreshdeskConfiguration=function(){m.errors=[],r.intFreshdeskAccount.addConfiguration({id:t.params.id},m.freshdeskConfiguration).$promise.then(function(e){m.configurations.unshift(e.toJSON()),i.success({title:"FreshdeskConfiguration properly created",msg:m.freshdeskConfiguration.name?m.freshdeskConfiguration.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveFreshdeskConfiguration=function(){m.errors=[],r.intFreshdeskConfiguration.update({id:m.freshdeskConfiguration.id},m.freshdeskConfiguration).$promise.then(function(e){var t=_.find(m.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"FreshdeskConfiguration properly saved!",msg:m.freshdeskConfiguration.name?m.freshdeskConfiguration.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteFreshdeskConfiguration=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The freshdeskConfiguration will be deleted.").ariaLabel("Delete FreshdeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intFreshdeskConfiguration.delete({id:m.freshdeskConfiguration.id}).$promise.then(function(){_.remove(m.configurations,{id:m.freshdeskConfiguration.id}),i.success({title:"FreshdeskConfiguration properly deleted!",msg:(m.freshdeskConfiguration.name||"freshdeskConfiguration")+" has been deleted!"}),u(m.freshdeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configurations","freshdeskConfiguration","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditFreshdeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(){a.hide()}m.errors=[],m.title="INTEGRATIONS.EDIT_"+_.toUpper(d),m.item=angular.copy(r),m.items=s,m.type=d,m.newItem=!1,m.item||(m.item={type:"string"},m.item[_.capitalize(d)+"Id"]=o.id,m.title="INTEGRATIONS.NEW_"+_.toUpper(d),m.newItem=!0),m.addNewItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intFreshdeskField.save(m.item).$promise.then(function(e){m.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},m.saveItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intFreshdeskField.update({id:m.item.id},m.item).$promise.then(function(e){var t=_.find(m.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},m.deleteItem=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intFreshdeskField.delete({id:m.item.id}).$promise.then(function(){_.remove(m.items,{id:m.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},m.getSelectedVariable=function(){return void 0!==m.item.variableName?m.item.variableName:"Please select a variable"},m.closeDialog=u,c.variable.get({nolimit:!0}).$promise.then(function(e){return m.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return m.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){m.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshdeskAccount.getFields({id:l.id}).$promise.then(function(e){m.accountConnected=!0,m.fields=e.rows?e.rows:[],m.item.idField&&(m.customField=_.find(m.fields,{id:m.item.idField}))}).catch(function(e){m.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.freshdeskAccount=d||e.params.freshdeskAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoFreshdeskAccounts=function(){e.go("app.integrations.freshdeskAccounts")},c.saveFreshdeskAccount=function(){s.intFreshdeskAccount.update({id:c.freshdeskAccount.id},c.freshdeskAccount).$promise.then(function(){r.success({title:"FreshdeskAccount updated!",msg:c.freshdeskAccount.name?c.freshdeskAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintFreshdeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","freshdeskAccount"],angular.module("app.integrations").controller("FreshdeskAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.freshdeskAccounts=r||{count:0,rows:[]},v.table="freshdeskAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedFreshdeskAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",limit:10,page:1},v.editstate=function(e,t){n.go("app.integrations.freshdeskAccounts.edit",{id:e.id,freshdeskAccount:e})},v.testtestintegrationaccount=function(e,t){return l.intFreshdeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){c.success({title:"FreshdeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"FreshdeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the freshdeskAccount?").htmlContent("<b>"+(e.name||"freshdeskAccount")+"</b> will be deleted.").ariaLabel("delete freshdeskAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getFreshdeskAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.intFreshdeskAccount.get(v.query,f).$promise},v.createOrEditFreshdeskAccount=function(e,t){i.show({controller:"CreateOrEditFreshdeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskAccount:t,freshdeskAccounts:v.freshdeskAccounts.rows,license:v.license,setting:v.setting}})},v.deleteFreshdeskAccount=A,v.exportSelectedFreshdeskAccounts=function(){var e=angular.copy(v.selectedFreshdeskAccounts);return v.selectedFreshdeskAccounts=[],e},v.deleteSelectedFreshdeskAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected freshdeskAccounts?").htmlContent("<b>"+v.selectedFreshdeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FreshdeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedFreshdeskAccounts.forEach(function(e){A(e)}),v.selectedFreshdeskAccounts=[]})},v.deselectFreshdeskAccounts=function(){v.selectedFreshdeskAccounts=[]},v.selectAllFreshdeskAccounts=function(){v.selectedFreshdeskAccounts=v.freshdeskAccounts.rows};var h=!0,b=1;function f(e){v.freshdeskAccounts=e||{count:0,rows:[]}}function A(e){l.intFreshdeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.freshdeskAccounts.rows,{id:e.id}),v.freshdeskAccounts.count-=1,v.freshdeskAccounts.rows.length||v.getFreshdeskAccounts(),c.success({title:"FreshdeskAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintFreshdeskAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintFreshdeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getFreshdeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","freshdeskAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("FreshdeskAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_SALESFORCEACCOUNT",m.salesforceAccount=angular.copy(s),m.salesforceAccounts=o,m.newSalesforceAccount=!1,m.salesforceAccount||(m.salesforceAccount={type:"integrationTab",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},m.title="INTEGRATIONS.NEW_SALESFORCEACCOUNT",m.newSalesforceAccount=!0),m.addNewSalesforceAccount=function(){m.errors=[],r.intSalesforceAccount.save(m.salesforceAccount).$promise.then(function(e){m.salesforceAccounts.unshift(e.toJSON()),i.success({title:"SalesforceAccount properly created",msg:m.salesforceAccount.name?m.salesforceAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSalesforceAccount=function(){m.errors=[],r.intSalesforceAccount.update({id:m.salesforceAccount.id},m.salesforceAccount).$promise.then(function(e){var t=_.find(m.salesforceAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SalesforceAccount properly saved!",msg:m.salesforceAccount.name?m.salesforceAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSalesforceAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The salesforceAccount will be deleted.").ariaLabel("Delete SalesforceAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intSalesforceAccount.delete({id:m.salesforceAccount.id}).$promise.then(function(){_.remove(m.salesforceAccounts,{id:m.salesforceAccount.id}),i.success({title:"SalesforceAccount properly deleted!",msg:(m.salesforceAccount.name||"salesforceAccount")+" has been deleted!"}),u(m.salesforceAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","salesforceAccounts","salesforceAccount","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,o,e){var s=this;function r(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(s.subjects,{id:e.id}),o.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(s.descriptions,{id:e.id}),o.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(s.fields,{id:e.id}),o.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}s.currentUser=e.getCurrentUser(),s.salesforceAccount={},s.salesforceConfiguration={},s.configurations=[],s.selectedSalesforceConfiguration=-1,s.init=function(e){s.salesforceAccount=e,i.intSalesforceAccount.getConfigurations({id:s.salesforceAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return s.configurations=e.rows?e.rows:[],s.configurations.length&&s.getSalesforceConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){s.variables=e.rows?e.rows:[],s.variablesById=_.keyBy(s.variables,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.getSalesforceConfiguration=function(e){s.salesforceConfiguration=s.configurations[e],s.selectedSalesforceConfiguration=e,i.intSalesforceConfiguration.getSubjects({id:s.salesforceConfiguration.id}).$promise.then(function(e){return s.subjects=e.rows?e.rows:[],i.intSalesforceConfiguration.getDescriptions({id:s.salesforceConfiguration.id}).$promise}).then(function(e){return s.descriptions=e.rows?e.rows:[],i.intSalesforceConfiguration.getFields({id:s.salesforceConfiguration.id}).$promise}).then(function(e){s.fields=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.createOrEditSalesforceConfiguration=function(e,t){a.show({controller:"CreateOrEditSalesforceConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceConfiguration:t,configurations:s.configurations,license:null,setting:null}}).finally(function(){s.getSalesforceConfiguration(0)})},s.deleteSalesforceConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the salesforceConfiguration?").htmlContent("<b>"+(t.name||"salesforceConfiguration")+"</b> will be deleted.").ariaLabel("delete salesforceConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intSalesforceConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(s.configurations,{id:t.id}),o.success({title:"SalesforceConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){s.getSalesforceConfiguration(0)})},function(){console.log("CANCEL")})},s.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:s.salesforceConfiguration.id},s.salesforceConfiguration).$promise.then(function(){o.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.selectedSubjects=[],s.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:s.subjects,configuration:s.salesforceConfiguration,account:s.salesforceAccount,license:null,setting:null}})},s.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},s.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+s.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedSubjects.forEach(function(e){r(e)}),s.selectedSubjects=[]})},s.selectedDescriptions=[],s.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:s.descriptions,configuration:s.salesforceConfiguration,account:s.salesforceAccount,license:null,setting:null}})},s.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},s.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+s.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedDescriptions.forEach(function(e){l(e)}),s.selectedDescriptions=[]})},s.selectedFields=[],s.createOrEditField=function(e,t){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:s.fields,configuration:s.salesforceConfiguration,account:s.salesforceAccount,license:null,setting:null}})},s.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},s.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+s.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedFields.forEach(function(e){d(e)}),s.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SalesforceAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_SALESFORCECONFIGURATION",m.salesforceConfiguration=angular.copy(s),m.configurations=o,m.newSalesforceConfiguration=!1,m.salesforceConfiguration||(m.salesforceConfiguration={channel:"voice",type:"inbound"},m.title="INTEGRATIONS.NEW_SALESFORCECONFIGURATION",m.newSalesforceConfiguration=!0),m.addNewSalesforceConfiguration=function(){m.errors=[],r.intSalesforceAccount.addConfiguration({id:t.params.id},m.salesforceConfiguration).$promise.then(function(e){m.configurations.unshift(e.toJSON()),i.success({title:"SalesforceConfiguration properly created",msg:m.salesforceConfiguration.name?m.salesforceConfiguration.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSalesforceConfiguration=function(){m.errors=[],r.intSalesforceConfiguration.update({id:m.salesforceConfiguration.id},m.salesforceConfiguration).$promise.then(function(e){var t=_.find(m.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SalesforceConfiguration properly saved!",msg:m.salesforceConfiguration.name?m.salesforceConfiguration.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSalesforceConfiguration=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The salesforceConfiguration will be deleted.").ariaLabel("Delete SalesforceConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intSalesforceConfiguration.delete({id:m.salesforceConfiguration.id}).$promise.then(function(){_.remove(m.configurations,{id:m.salesforceConfiguration.id}),i.success({title:"SalesforceConfiguration properly deleted!",msg:(m.salesforceConfiguration.name||"salesforceConfiguration")+" has been deleted!"}),u(m.salesforceConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configurations","salesforceConfiguration","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditSalesforceConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(){a.hide()}m.errors=[],m.title="INTEGRATIONS.EDIT_"+_.toUpper(d),m.item=angular.copy(r),m.items=s,m.type=d,m.newItem=!1,m.item||(m.item={type:"string"},m.item[_.capitalize(d)+"Id"]=o.id,m.title="INTEGRATIONS.NEW_"+_.toUpper(d),m.newItem=!0),m.addNewItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intSalesforceField.save(m.item).$promise.then(function(e){m.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},m.saveItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intSalesforceField.update({id:m.item.id},m.item).$promise.then(function(e){var t=_.find(m.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},m.deleteItem=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intSalesforceField.delete({id:m.item.id}).$promise.then(function(){_.remove(m.items,{id:m.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},m.getSelectedVariable=function(){return void 0!==m.item.variableName?m.item.variableName:"Please select a variable"},m.closeDialog=u,c.variable.get({nolimit:!0}).$promise.then(function(e){return m.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return m.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){m.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSalesforceAccount.getFields({id:l.id}).$promise.then(function(e){m.accountConnected=!0,m.fields=e.rows?e.rows:[],m.item.idField&&(m.customField=_.find(m.fields,{id:m.item.idField}))}).catch(function(e){m.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.salesforceAccount=d||e.params.salesforceAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoSalesforceAccounts=function(){e.go("app.integrations.salesforceAccounts")},c.saveSalesforceAccount=function(){s.intSalesforceAccount.update({id:c.salesforceAccount.id},c.salesforceAccount).$promise.then(function(){r.success({title:"SalesforceAccount updated!",msg:c.salesforceAccount.name?c.salesforceAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSalesforceAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","salesforceAccount"],angular.module("app.integrations").controller("SalesforceAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.salesforceAccounts=r||{count:0,rows:[]},v.table="salesforceAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedSalesforceAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",limit:10,page:1},v.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.integrations.salesforceAccounts.edit",{id:e.id,salesforceAccount:e})},v.testtestintegrationaccount=function(e,t){return l.intSalesforceAccount.getFields({id:e.id,test:!0}).$promise.then(function(){c.success({title:"SalesforceAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"SalesforceAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the salesforceAccount?").htmlContent("<b>"+(e.name||"salesforceAccount")+"</b> will be deleted.").ariaLabel("delete salesforceAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getSalesforceAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.intSalesforceAccount.get(v.query,f).$promise},v.createOrEditSalesforceAccount=function(e,t){i.show({controller:"CreateOrEditSalesforceAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceAccount:t,salesforceAccounts:v.salesforceAccounts.rows,license:v.license,setting:v.setting}})},v.deleteSalesforceAccount=A,v.exportSelectedSalesforceAccounts=function(){var e=angular.copy(v.selectedSalesforceAccounts);return v.selectedSalesforceAccounts=[],e},v.deleteSelectedSalesforceAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected salesforceAccounts?").htmlContent("<b>"+v.selectedSalesforceAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SalesforceAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedSalesforceAccounts.forEach(function(e){A(e)}),v.selectedSalesforceAccounts=[]})},v.deselectSalesforceAccounts=function(){v.selectedSalesforceAccounts=[]},v.selectAllSalesforceAccounts=function(){v.selectedSalesforceAccounts=v.salesforceAccounts.rows};var h=!0,b=1;function f(e){v.salesforceAccounts=e||{count:0,rows:[]}}function A(e){l.intSalesforceAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.salesforceAccounts.rows,{id:e.id}),v.salesforceAccounts.count-=1,v.salesforceAccounts.rows.length||v.getSalesforceAccounts(),c.success({title:"SalesforceAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSalesforceAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSalesforceAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getSalesforceAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","salesforceAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("SalesforceAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_SUGARCRMACCOUNT",m.sugarcrmAccount=angular.copy(s),m.sugarcrmAccounts=o,m.newSugarcrmAccount=!1,m.sugarcrmAccount||(m.sugarcrmAccount={serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},m.title="INTEGRATIONS.NEW_SUGARCRMACCOUNT",m.newSugarcrmAccount=!0),m.addNewSugarcrmAccount=function(){m.errors=[],r.intSugarcrmAccount.save(m.sugarcrmAccount).$promise.then(function(e){m.sugarcrmAccounts.unshift(e.toJSON()),i.success({title:"SugarcrmAccount properly created",msg:m.sugarcrmAccount.name?m.sugarcrmAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSugarcrmAccount=function(){m.errors=[],r.intSugarcrmAccount.update({id:m.sugarcrmAccount.id},m.sugarcrmAccount).$promise.then(function(e){var t=_.find(m.sugarcrmAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SugarcrmAccount properly saved!",msg:m.sugarcrmAccount.name?m.sugarcrmAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSugarcrmAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The sugarcrmAccount will be deleted.").ariaLabel("Delete SugarcrmAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intSugarcrmAccount.delete({id:m.sugarcrmAccount.id}).$promise.then(function(){_.remove(m.sugarcrmAccounts,{id:m.sugarcrmAccount.id}),i.success({title:"SugarcrmAccount properly deleted!",msg:(m.sugarcrmAccount.name||"sugarcrmAccount")+" has been deleted!"}),u(m.sugarcrmAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","sugarcrmAccounts","sugarcrmAccount","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,o,e){var s=this;function r(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(s.subjects,{id:e.id}),o.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(s.descriptions,{id:e.id}),o.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(s.fields,{id:e.id}),o.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}s.currentUser=e.getCurrentUser(),s.sugarcrmAccount={},s.sugarcrmConfiguration={},s.configurations=[],s.selectedSugarcrmConfiguration=-1,s.init=function(e){s.sugarcrmAccount=e,i.intSugarcrmAccount.getConfigurations({id:s.sugarcrmAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return s.configurations=e.rows?e.rows:[],s.configurations.length&&s.getSugarcrmConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){s.variables=e.rows?e.rows:[],s.variablesById=_.keyBy(s.variables,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.getSugarcrmConfiguration=function(e){s.sugarcrmConfiguration=s.configurations[e],s.selectedSugarcrmConfiguration=e,i.intSugarcrmConfiguration.getSubjects({id:s.sugarcrmConfiguration.id}).$promise.then(function(e){return s.subjects=e.rows?e.rows:[],i.intSugarcrmConfiguration.getDescriptions({id:s.sugarcrmConfiguration.id}).$promise}).then(function(e){return s.descriptions=e.rows?e.rows:[],i.intSugarcrmConfiguration.getFields({id:s.sugarcrmConfiguration.id}).$promise}).then(function(e){s.fields=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.createOrEditSugarcrmConfiguration=function(e,t){a.show({controller:"CreateOrEditSugarcrmConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmConfiguration:t,configurations:s.configurations,license:null,setting:null}}).finally(function(){s.getSugarcrmConfiguration(0)})},s.deleteSugarcrmConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the sugarcrmConfiguration?").htmlContent("<b>"+(t.name||"sugarcrmConfiguration")+"</b> will be deleted.").ariaLabel("delete sugarcrmConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intSugarcrmConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(s.configurations,{id:t.id}),o.success({title:"SugarcrmConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){s.getSugarcrmConfiguration(0)})},function(){console.log("CANCEL")})},s.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:s.sugarcrmConfiguration.id},s.sugarcrmConfiguration).$promise.then(function(){o.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.selectedSubjects=[],s.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:s.subjects,configuration:s.sugarcrmConfiguration,account:s.sugarcrmAccount,license:null,setting:null}})},s.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},s.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+s.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedSubjects.forEach(function(e){r(e)}),s.selectedSubjects=[]})},s.selectedDescriptions=[],s.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:s.descriptions,configuration:s.sugarcrmConfiguration,account:s.sugarcrmAccount,license:null,setting:null}})},s.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},s.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+s.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedDescriptions.forEach(function(e){l(e)}),s.selectedDescriptions=[]})},s.selectedFields=[],s.createOrEditField=function(e,t){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:s.fields,configuration:s.sugarcrmConfiguration,account:s.sugarcrmAccount,license:null,setting:null}})},s.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},s.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+s.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedFields.forEach(function(e){d(e)}),s.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SugarcrmAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_SUGARCRMCONFIGURATION",m.sugarcrmConfiguration=angular.copy(s),m.configurations=o,m.newSugarcrmConfiguration=!1,m.sugarcrmConfiguration||(m.sugarcrmConfiguration={channel:"voice",type:"inbound"},m.title="INTEGRATIONS.NEW_SUGARCRMCONFIGURATION",m.newSugarcrmConfiguration=!0),m.addNewSugarcrmConfiguration=function(){m.errors=[],r.intSugarcrmAccount.addConfiguration({id:t.params.id},m.sugarcrmConfiguration).$promise.then(function(e){m.configurations.unshift(e.toJSON()),i.success({title:"SugarcrmConfiguration properly created",msg:m.sugarcrmConfiguration.name?m.sugarcrmConfiguration.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSugarcrmConfiguration=function(){m.errors=[],r.intSugarcrmConfiguration.update({id:m.sugarcrmConfiguration.id},m.sugarcrmConfiguration).$promise.then(function(e){var t=_.find(m.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SugarcrmConfiguration properly saved!",msg:m.sugarcrmConfiguration.name?m.sugarcrmConfiguration.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSugarcrmConfiguration=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The sugarcrmConfiguration will be deleted.").ariaLabel("Delete SugarcrmConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intSugarcrmConfiguration.delete({id:m.sugarcrmConfiguration.id}).$promise.then(function(){_.remove(m.configurations,{id:m.sugarcrmConfiguration.id}),i.success({title:"SugarcrmConfiguration properly deleted!",msg:(m.sugarcrmConfiguration.name||"sugarcrmConfiguration")+" has been deleted!"}),u(m.sugarcrmConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configurations","sugarcrmConfiguration","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditSugarcrmConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(){a.hide()}m.errors=[],m.title="INTEGRATIONS.EDIT_"+_.toUpper(d),m.item=angular.copy(r),m.items=s,m.type=d,m.newItem=!1,m.item||(m.item={type:"string"},m.item[_.capitalize(d)+"Id"]=o.id,m.title="INTEGRATIONS.NEW_"+_.toUpper(d),m.newItem=!0),m.addNewItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intSugarcrmField.save(m.item).$promise.then(function(e){m.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},m.saveItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intSugarcrmField.update({id:m.item.id},m.item).$promise.then(function(e){var t=_.find(m.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},m.deleteItem=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intSugarcrmField.delete({id:m.item.id}).$promise.then(function(){_.remove(m.items,{id:m.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},m.getSelectedVariable=function(){return void 0!==m.item.variableName?m.item.variableName:"Please select a variable"},m.closeDialog=u,c.variable.get({nolimit:!0}).$promise.then(function(e){return m.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return m.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){m.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSugarcrmAccount.getFields({id:l.id}).$promise.then(function(e){m.accountConnected=!0,m.fields=e.rows?e.rows:[],m.item.idField&&(m.customField=_.find(m.fields,{id:m.item.idField}))}).catch(function(e){m.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.sugarcrmAccount=d||e.params.sugarcrmAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoSugarcrmAccounts=function(){e.go("app.integrations.sugarcrmAccounts")},c.saveSugarcrmAccount=function(){s.intSugarcrmAccount.update({id:c.sugarcrmAccount.id},c.sugarcrmAccount).$promise.then(function(){r.success({title:"SugarcrmAccount updated!",msg:c.sugarcrmAccount.name?c.sugarcrmAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSugarcrmAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","sugarcrmAccount"],angular.module("app.integrations").controller("SugarcrmAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.sugarcrmAccounts=r||{count:0,rows:[]},v.table="sugarcrmAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedSugarcrmAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",limit:10,page:1},v.editstate=function(e,t){n.go("app.integrations.sugarcrmAccounts.edit",{id:e.id,sugarcrmAccount:e})},v.testtestintegrationaccount=function(e,t){return l.intSugarcrmAccount.getFields({id:e.id,test:!0}).$promise.then(function(){c.success({title:"SugarcrmAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"SugarcrmAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the sugarcrmAccount?").htmlContent("<b>"+(e.name||"sugarcrmAccount")+"</b> will be deleted.").ariaLabel("delete sugarcrmAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getSugarcrmAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.intSugarcrmAccount.get(v.query,f).$promise},v.createOrEditSugarcrmAccount=function(e,t){i.show({controller:"CreateOrEditSugarcrmAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmAccount:t,sugarcrmAccounts:v.sugarcrmAccounts.rows,license:v.license,setting:v.setting}})},v.deleteSugarcrmAccount=A,v.exportSelectedSugarcrmAccounts=function(){var e=angular.copy(v.selectedSugarcrmAccounts);return v.selectedSugarcrmAccounts=[],e},v.deleteSelectedSugarcrmAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected sugarcrmAccounts?").htmlContent("<b>"+v.selectedSugarcrmAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SugarcrmAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedSugarcrmAccounts.forEach(function(e){A(e)}),v.selectedSugarcrmAccounts=[]})},v.deselectSugarcrmAccounts=function(){v.selectedSugarcrmAccounts=[]},v.selectAllSugarcrmAccounts=function(){v.selectedSugarcrmAccounts=v.sugarcrmAccounts.rows};var h=!0,b=1;function f(e){v.sugarcrmAccounts=e||{count:0,rows:[]}}function A(e){l.intSugarcrmAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.sugarcrmAccounts.rows,{id:e.id}),v.sugarcrmAccounts.count-=1,v.sugarcrmAccounts.rows.length||v.getSugarcrmAccounts(),c.success({title:"SugarcrmAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSugarcrmAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSugarcrmAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getSugarcrmAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","sugarcrmAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("SugarcrmAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_ZENDESKACCOUNT",m.zendeskAccount=angular.copy(s),m.zendeskAccounts=o,m.newZendeskAccount=!1,m.zendeskAccount||(m.zendeskAccount={type:"integrationTab",authType:"password",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},m.title="INTEGRATIONS.NEW_ZENDESKACCOUNT",m.newZendeskAccount=!0),m.addNewZendeskAccount=function(){m.errors=[],r.intZendeskAccount.save(m.zendeskAccount).$promise.then(function(e){m.zendeskAccounts.unshift(e.toJSON()),i.success({title:"ZendeskAccount properly created",msg:m.zendeskAccount.name?m.zendeskAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveZendeskAccount=function(){m.errors=[],r.intZendeskAccount.update({id:m.zendeskAccount.id},m.zendeskAccount).$promise.then(function(e){var t=_.find(m.zendeskAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ZendeskAccount properly saved!",msg:m.zendeskAccount.name?m.zendeskAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteZendeskAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The zendeskAccount will be deleted.").ariaLabel("Delete ZendeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intZendeskAccount.delete({id:m.zendeskAccount.id}).$promise.then(function(){_.remove(m.zendeskAccounts,{id:m.zendeskAccount.id}),i.success({title:"ZendeskAccount properly deleted!",msg:(m.zendeskAccount.name||"zendeskAccount")+" has been deleted!"}),u(m.zendeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","zendeskAccounts","zendeskAccount","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(){a.hide()}m.errors=[],m.title="INTEGRATIONS.EDIT_"+_.toUpper(d),m.item=angular.copy(r),m.items=s,m.type=d,m.newItem=!1,m.item||(m.item={type:"string"},m.item[_.capitalize(d)+"Id"]=o.id,m.title="INTEGRATIONS.NEW_"+_.toUpper(d),m.newItem=!0),m.addNewItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intZendeskField.save(m.item).$promise.then(function(e){m.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},m.saveItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intZendeskField.update({id:m.item.id},m.item).$promise.then(function(e){var t=_.find(m.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},m.deleteItem=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intZendeskField.delete({id:m.item.id}).$promise.then(function(){_.remove(m.items,{id:m.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},m.getSelectedVariable=function(){return void 0!==m.item.variableName?m.item.variableName:"Please select a variable"},m.closeDialog=u,c.variable.get({nolimit:!0}).$promise.then(function(e){return m.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return m.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){m.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZendeskAccount.getFields({id:l.id}).$promise.then(function(e){m.accountConnected=!0,m.fields=e.rows?e.rows:[],m.item.idField&&(m.customField=_.find(m.fields,{id:m.item.idField}))}).catch(function(e){m.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.zendeskAccount=d||e.params.zendeskAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoZendeskAccounts=function(){e.go("app.integrations.zendeskAccounts")},c.saveZendeskAccount=function(){s.intZendeskAccount.update({id:c.zendeskAccount.id},c.zendeskAccount).$promise.then(function(){r.success({title:"ZendeskAccount updated!",msg:c.zendeskAccount.name?c.zendeskAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZendeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","zendeskAccount"],angular.module("app.integrations").controller("ZendeskAccountController",e)}(),function(){"use strict";function e(a,n,i,o,e){var s=this;function r(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.subjects,{id:e.id}),o.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.descriptions,{id:e.id}),o.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.fields,{id:e.id}),o.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}s.currentUser=e.getCurrentUser(),s.zendeskAccount={},s.zendeskConfiguration={},s.zendeskConfigurations=[],s.selectedZendeskConfiguration=-1,s.init=function(e){s.zendeskAccount=e,i.intZendeskAccount.getConfigurations({id:s.zendeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return s.zendeskConfigurations=e.rows?e.rows:[],s.zendeskConfigurations.length&&s.getZendeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){s.variables=e.rows?e.rows:[],s.variablesById=_.keyBy(s.variables,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.getZendeskConfiguration=function(e){s.zendeskConfiguration=s.zendeskConfigurations[e],s.selectedZendeskConfiguration=e,i.intZendeskConfiguration.getSubjects({id:s.zendeskConfiguration.id}).$promise.then(function(e){return s.subjects=e.rows?e.rows:[],i.intZendeskConfiguration.getDescriptions({id:s.zendeskConfiguration.id}).$promise}).then(function(e){return s.descriptions=e.rows?e.rows:[],i.intZendeskConfiguration.getFields({id:s.zendeskConfiguration.id}).$promise}).then(function(e){s.fields=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intZendeskConfiguration.getTags({id:s.zendeskConfiguration.id}).$promise.then(function(e){s.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.createOrEditZendeskConfiguration=function(e,t){a.show({controller:"CreateOrEditZendeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskConfiguration:t,zendeskConfigurations:s.zendeskConfigurations,license:null,setting:null}}).finally(function(){s.getZendeskConfiguration(0)})},s.deleteZendeskConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the zendeskConfiguration?").htmlContent("<b>"+(t.name||"zendeskConfiguration")+"</b> will be deleted.").ariaLabel("delete zendeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intZendeskConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(s.zendeskConfigurations,{id:t.id}),o.success({title:"ZendeskConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){s.getZendeskConfiguration(0)})},function(){console.log("CANCEL")})},s.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:s.zendeskConfiguration.id},s.zendeskConfiguration).$promise.then(function(){o.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.selectedTags=[],s.selectTagsChanged=function(e){i.intZendeskConfiguration.setTags({id:s.zendeskConfiguration.id,ids:s.selectedTags}).$promise.then(function(){o.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){s.tags=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.selectedSubjects=[],s.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:s.subjects,configuration:s.zendeskConfiguration,account:s.zendeskAccount,license:null,setting:null}})},s.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},s.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+s.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedSubjects.forEach(function(e){r(e)}),s.selectedSubjects=[]})},s.selectedDescriptions=[],s.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:s.descriptions,configuration:s.zendeskConfiguration,account:s.zendeskAccount,license:null,setting:null}})},s.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},s.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+s.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedDescriptions.forEach(function(e){l(e)}),s.selectedDescriptions=[]})},s.selectedFields=[],s.createOrEditField=function(e,t){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:s.fields,configuration:s.zendeskConfiguration,account:s.zendeskAccount,license:null,setting:null}})},s.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},s.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+s.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedFields.forEach(function(e){d(e)}),s.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZendeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_ZENDESKCONFIGURATION",m.zendeskConfiguration=angular.copy(s),m.zendeskConfigurations=o,m.newZendeskConfiguration=!1,m.zendeskConfiguration||(m.zendeskConfiguration={channel:"voice",type:"inbound"},m.title="INTEGRATIONS.NEW_ZENDESKCONFIGURATION",m.newZendeskConfiguration=!0),m.addNewZendeskConfiguration=function(){m.errors=[],r.intZendeskAccount.addConfiguration({id:t.params.id},m.zendeskConfiguration).$promise.then(function(e){m.zendeskConfigurations.unshift(e.toJSON()),i.success({title:"ZendeskConfiguration properly created",msg:m.zendeskConfiguration.name?m.zendeskConfiguration.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveZendeskConfiguration=function(){m.errors=[],r.intZendeskConfiguration.update({id:m.zendeskConfiguration.id},m.zendeskConfiguration).$promise.then(function(e){var t=_.find(m.zendeskConfigurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ZendeskConfiguration properly saved!",msg:m.zendeskConfiguration.name?m.zendeskConfiguration.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteZendeskConfiguration=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The zendeskConfiguration will be deleted.").ariaLabel("Delete ZendeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intZendeskConfiguration.delete({id:m.zendeskConfiguration.id}).$promise.then(function(){_.remove(m.zendeskConfigurations,{id:m.zendeskConfiguration.id}),i.success({title:"ZendeskConfiguration properly deleted!",msg:(m.zendeskConfiguration.name||"zendeskConfiguration")+" has been deleted!"}),u(m.zendeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","zendeskConfigurations","zendeskConfiguration","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditZendeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.zendeskAccounts=r||{count:0,rows:[]},v.table="zendeskAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedZendeskAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",limit:10,page:1},v.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayauthType=_.keyBy([{option:"Password",value:"'password'"},{option:"Token",value:"'token'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.integrations.zendeskAccounts.edit",{id:e.id,zendeskAccount:e})},v.testtestintegrationaccount=function(e,t){return l.intZendeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){c.success({title:"ZendeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"ZendeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the zendeskAccount?").htmlContent("<b>"+(e.name||"zendeskAccount")+"</b> will be deleted.").ariaLabel("delete zendeskAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getZendeskAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.intZendeskAccount.get(v.query,f).$promise},v.createOrEditZendeskAccount=function(e,t){i.show({controller:"CreateOrEditZendeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskAccount:t,zendeskAccounts:v.zendeskAccounts.rows,license:v.license,setting:v.setting}})},v.deleteZendeskAccount=A,v.exportSelectedZendeskAccounts=function(){var e=angular.copy(v.selectedZendeskAccounts);return v.selectedZendeskAccounts=[],e},v.deleteSelectedZendeskAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected zendeskAccounts?").htmlContent("<b>"+v.selectedZendeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZendeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedZendeskAccounts.forEach(function(e){A(e)}),v.selectedZendeskAccounts=[]})},v.deselectZendeskAccounts=function(){v.selectedZendeskAccounts=[]},v.selectAllZendeskAccounts=function(){v.selectedZendeskAccounts=v.zendeskAccounts.rows};var h=!0,b=1;function f(e){v.zendeskAccounts=e||{count:0,rows:[]}}function A(e){l.intZendeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.zendeskAccounts.rows,{id:e.id}),v.zendeskAccounts.count-=1,v.zendeskAccounts.rows.length||v.getZendeskAccounts(),c.success({title:"ZendeskAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZendeskAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZendeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getZendeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","zendeskAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("ZendeskAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_ZOHOACCOUNT",m.zohoAccount=angular.copy(s),m.zohoAccounts=o,m.newZohoAccount=!1,m.zohoAccount||(m.zohoAccount={host:"zoho.com",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},m.title="INTEGRATIONS.NEW_ZOHOACCOUNT",m.newZohoAccount=!0),m.addNewZohoAccount=function(){m.errors=[],r.intZohoAccount.save(m.zohoAccount).$promise.then(function(e){m.zohoAccounts.unshift(e.toJSON()),i.success({title:"ZohoAccount properly created",msg:m.zohoAccount.name?m.zohoAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveZohoAccount=function(){m.errors=[],r.intZohoAccount.update({id:m.zohoAccount.id},m.zohoAccount).$promise.then(function(e){var t=_.find(m.zohoAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ZohoAccount properly saved!",msg:m.zohoAccount.name?m.zohoAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteZohoAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The zohoAccount will be deleted.").ariaLabel("Delete ZohoAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intZohoAccount.delete({id:m.zohoAccount.id}).$promise.then(function(){_.remove(m.zohoAccounts,{id:m.zohoAccount.id}),i.success({title:"ZohoAccount properly deleted!",msg:(m.zohoAccount.name||"zohoAccount")+" has been deleted!"}),u(m.zohoAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","zohoAccounts","zohoAccount","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditZohoAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,o,e){var s=this;function r(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(s.subjects,{id:e.id}),o.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(s.descriptions,{id:e.id}),o.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(s.fields,{id:e.id}),o.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}s.currentUser=e.getCurrentUser(),s.zohoAccount={},s.zohoConfiguration={},s.configurations=[],s.selectedZohoConfiguration=-1,s.init=function(e){s.zohoAccount=e,i.intZohoAccount.getConfigurations({id:s.zohoAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return s.configurations=e.rows?e.rows:[],s.configurations.length&&s.getZohoConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){s.variables=e.rows?e.rows:[],s.variablesById=_.keyBy(s.variables,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.getZohoConfiguration=function(e){s.zohoConfiguration=s.configurations[e],s.selectedZohoConfiguration=e,i.intZohoConfiguration.getSubjects({id:s.zohoConfiguration.id}).$promise.then(function(e){return s.subjects=e.rows?e.rows:[],i.intZohoConfiguration.getDescriptions({id:s.zohoConfiguration.id}).$promise}).then(function(e){return s.descriptions=e.rows?e.rows:[],i.intZohoConfiguration.getFields({id:s.zohoConfiguration.id}).$promise}).then(function(e){s.fields=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.createOrEditZohoConfiguration=function(e,t){a.show({controller:"CreateOrEditZohoConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoConfiguration:t,configurations:s.configurations,license:null,setting:null}}).finally(function(){s.getZohoConfiguration(0)})},s.deleteZohoConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the zohoConfiguration?").htmlContent("<b>"+(t.name||"zohoConfiguration")+"</b> will be deleted.").ariaLabel("delete zohoConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intZohoConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(s.configurations,{id:t.id}),o.success({title:"ZohoConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){s.getZohoConfiguration(0)})},function(){console.log("CANCEL")})},s.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:s.zohoConfiguration.id},s.zohoConfiguration).$promise.then(function(){o.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.selectedSubjects=[],s.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:s.subjects,configuration:s.zohoConfiguration,account:s.zohoAccount,license:null,setting:null}})},s.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},s.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+s.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedSubjects.forEach(function(e){r(e)}),s.selectedSubjects=[]})},s.selectedDescriptions=[],s.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:s.descriptions,configuration:s.zohoConfiguration,account:s.zohoAccount,license:null,setting:null}})},s.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},s.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+s.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedDescriptions.forEach(function(e){l(e)}),s.selectedDescriptions=[]})},s.selectedFields=[],s.createOrEditField=function(e,t){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:s.fields,configuration:s.zohoConfiguration,account:s.zohoAccount,license:null,setting:null}})},s.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},s.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+s.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedFields.forEach(function(e){d(e)}),s.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZohoAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_ZOHOCONFIGURATION",m.zohoConfiguration=angular.copy(s),m.configurations=o,m.newZohoConfiguration=!1,m.zohoConfiguration||(m.zohoConfiguration={channel:"voice",type:"inbound"},m.title="INTEGRATIONS.NEW_ZOHOCONFIGURATION",m.newZohoConfiguration=!0),m.addNewZohoConfiguration=function(){m.errors=[],r.intZohoAccount.addConfiguration({id:t.params.id},m.zohoConfiguration).$promise.then(function(e){m.configurations.unshift(e.toJSON()),i.success({title:"ZohoConfiguration properly created",msg:m.zohoConfiguration.name?m.zohoConfiguration.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveZohoConfiguration=function(){m.errors=[],r.intZohoConfiguration.update({id:m.zohoConfiguration.id},m.zohoConfiguration).$promise.then(function(e){var t=_.find(m.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ZohoConfiguration properly saved!",msg:m.zohoConfiguration.name?m.zohoConfiguration.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteZohoConfiguration=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The zohoConfiguration will be deleted.").ariaLabel("Delete ZohoConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intZohoConfiguration.delete({id:m.zohoConfiguration.id}).$promise.then(function(){_.remove(m.configurations,{id:m.zohoConfiguration.id}),i.success({title:"ZohoConfiguration properly deleted!",msg:(m.zohoConfiguration.name||"zohoConfiguration")+" has been deleted!"}),u(m.zohoConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configurations","zohoConfiguration","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditZohoConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(){a.hide()}m.errors=[],m.title="INTEGRATIONS.EDIT_"+_.toUpper(d),m.item=angular.copy(r),m.items=s,m.type=d,m.newItem=!1,m.item||(m.item={type:"string"},m.item[_.capitalize(d)+"Id"]=o.id,m.title="INTEGRATIONS.NEW_"+_.toUpper(d),m.newItem=!0),m.addNewItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intZohoField.save(m.item).$promise.then(function(e){m.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},m.saveItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intZohoField.update({id:m.item.id},m.item).$promise.then(function(e){var t=_.find(m.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},m.deleteItem=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intZohoField.delete({id:m.item.id}).$promise.then(function(){_.remove(m.items,{id:m.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},m.getSelectedVariable=function(){return void 0!==m.item.variableName?m.item.variableName:"Please select a variable"},m.closeDialog=u,c.variable.get({nolimit:!0}).$promise.then(function(e){return m.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return m.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){m.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZohoAccount.getFields({id:l.id}).$promise.then(function(e){m.accountConnected=!0,m.fields=e.rows?e.rows:[],m.item.idField&&(m.customField=_.find(m.fields,{id:m.item.idField}))}).catch(function(e){m.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api"],angular.module("app.integrations").controller("CreateOrEditZohoAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.zohoAccount=d||e.params.zohoAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoZohoAccounts=function(){e.go("app.integrations.zohoAccounts")},c.saveZohoAccount=function(){s.intZohoAccount.update({id:c.zohoAccount.id},c.zohoAccount).$promise.then(function(){r.success({title:"ZohoAccount updated!",msg:c.zohoAccount.name?c.zohoAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZohoAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","zohoAccount"],angular.module("app.integrations").controller("ZohoAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.zohoAccounts=r||{count:0,rows:[]},v.table="zohoAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedZohoAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,host,authToken,serverUrl,description",limit:10,page:1},v.arrayhost=_.keyBy([{option:"zoho.com",value:"'zoho.com'"},{option:"zoho.eu",value:"'zoho.eu'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.integrations.zohoAccounts.edit",{id:e.id,zohoAccount:e})},v.testtestintegrationaccount=function(e,t){return l.intZohoAccount.getFields({id:e.id,test:!0}).$promise.then(function(){c.success({title:"ZohoAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"ZohoAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the zohoAccount?").htmlContent("<b>"+(e.name||"zohoAccount")+"</b> will be deleted.").ariaLabel("delete zohoAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getZohoAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.intZohoAccount.get(v.query,f).$promise},v.createOrEditZohoAccount=function(e,t){i.show({controller:"CreateOrEditZohoAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoAccount:t,zohoAccounts:v.zohoAccounts.rows,license:v.license,setting:v.setting}})},v.deleteZohoAccount=A,v.exportSelectedZohoAccounts=function(){var e=angular.copy(v.selectedZohoAccounts);return v.selectedZohoAccounts=[],e},v.deleteSelectedZohoAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected zohoAccounts?").htmlContent("<b>"+v.selectedZohoAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZohoAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedZohoAccounts.forEach(function(e){A(e)}),v.selectedZohoAccounts=[]})},v.deselectZohoAccounts=function(){v.selectedZohoAccounts=[]},v.selectAllZohoAccounts=function(){v.selectedZohoAccounts=v.zohoAccounts.rows};var h=!0,b=1;function f(e){v.zohoAccounts=e||{count:0,rows:[]}}function A(e){l.intZohoAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.zohoAccounts.rows,{id:e.id}),v.zohoAccounts.count-=1,v.zohoAccounts.rows.length||v.getZohoAccounts(),c.success({title:"ZohoAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZohoAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZohoAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getZohoAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","zohoAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("ZohoAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="JSCRIPTY.EDIT_PROJECT",m.project=angular.copy(s),m.projects=o,m.newProject=!1,m.project||(m.project={enableUncompleteSave:!0},m.title="JSCRIPTY.NEW_PROJECT",m.newProject=!0),m.addNewProject=function(){m.errors=[],r.jscriptyProject.save(m.project).$promise.then(function(e){m.projects.unshift(e.toJSON()),i.success({title:"Project properly created",msg:m.project.name?m.project.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveProject=function(){m.errors=[],r.jscriptyProject.update({id:m.project.id},m.project).$promise.then(function(e){var t=_.find(m.projects,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Project properly saved!",msg:m.project.name?m.project.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteProject=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.jscriptyProject.delete({id:m.project.id}).$promise.then(function(){_.remove(m.projects,{id:m.project.id}),i.success({title:"Project properly deleted!",msg:(m.project.name||"project")+" has been deleted!"}),u(m.project)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","projects","project","api","Auth","license","setting"],angular.module("app.jscripty").controller("CreateOrEditProjectDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o){var s=this;s.project={},s.localizationMap=o;var r=new Date;r.setHours(0,0,0,0),s.pickerModel={dateStart:r,dateEnd:null,selectedTemplate:"TD"},s.init=function(e){s.project=e,s.getAnswers()},s.getSummary=function(){var e=n.document.createElement("a");e.href="/api/jscripty/projects/"+s.project.id+"/summary",e.target="_self",e.click()},s.getAnswers=function(){return s.hasIdAnswers=!1,a.jscriptyProject.getAnswers({id:s.project.id,sort:"-createdAt,questionId",dateStart:s.pickerModel.dateStart,dateEnd:s.pickerModel.dateEnd,nolimit:!0}).$promise.then(function(e){if(e&&e.rows&&e.hasOwnProperty("count")){s.answers={};for(var t=0,n=e.count;t<n;t++)e.rows[t].questionId&&(s.hasIdAnswers=!0,s.answers.hasOwnProperty(e.rows[t].questionId)||(s.answers[e.rows[t].questionId]={question:e.rows[t].question,answers:{},sum:0}),""===e.rows[t].answer&&(e.rows[t].answer="NO_ANSWER"),s.answers[e.rows[t].questionId].answers[e.rows[t].answer]?s.answers[e.rows[t].questionId].answers[e.rows[t].answer]+=1:s.answers[e.rows[t].questionId].answers[e.rows[t].answer]=1,s.answers[e.rows[t].questionId].sum+=1)}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETANSWERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$mdDialog","$document","$window","api","toasty","dateFilterLocalizationFactory"],angular.module("app.jscripty").controller("ProjectAnswersController",e)}(),function(){"use strict";angular.module("app.jscripty").controller("ProjectBuilderController",function(){var t=this;t.project={},t.optionsBuilder={questionTypes:["text","textarea","radio","checkbox","select","number","date","time","email","range","url"],elementTypes:["question","paragraph"]},t.init=function(e){t.project=e,_.isObjectLike(e.formData)?t.project.formData=e.formData:t.isJsonString(e.formData)?t.project.formData=JSON.parse(e.formData):t.project.formData={}},t.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0}})}(),function(){"use strict";function e(t,n,a,e,i,o,s){var r=this;function l(e){t.hide(e)}r.newProject=!0,r.project=angular.copy(i),r.projects=o,r.title=s.instant("JSCRIPTY.CLONE_PROJECT"),i&&i.name&&(r.title+=": "+i.name),r.cloneProject=function(){return e.jscriptyProject.clone({id:i.id},r.project).$promise.then(function(e){r.projects.unshift(e.toJSON()),a.success({title:"Project properly cloned",msg:r.project.name?r.project.name+" has been cloned!":""}),n.go("app.jscripty.projects.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.clone"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","project","projects","$translate"],angular.module("app.jscripty").controller("ProjectcloneController",e)}(),function(){"use strict";function e(a,i,t){var s=this;s.project={},s.responseData={},s.formViewer={},s.init=function(e){s.project=e,t.$on("mwForm.pageEvents.pageCurrentChanged",function(e,t){if(t.currentPage&&s.project.formData&&s.project.formData.pages)for(var n=0,a=s.project.formData.pages.length;n<a;n++)if(t.currentPage.number<n+1&&s.project.formData.pages[n].elements)for(var i=0,o=s.project.formData.pages[n].elements.length;i<o;i++)"question"===s.project.formData.pages[n].elements[i].type&&s.project.formData.pages[n].elements[i].question&&delete s.responseData[s.project.formData.pages[n].elements[i].question.id]})},s.onSubmit=function(e){var t=a.defer(),n=i.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("SAVE").cancel("CANCEL");return i.show(n).then(function(){t.resolve(!0)},function(){t.reject()}),t.promise},s.resetViewer=function(){s.formViewer.reset&&s.formViewer.reset()}}e.$inject=["$q","$mdDialog","$scope"],angular.module("app.jscripty").controller("ProjectViewerController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.project={},c.projectSessions={count:0,rows:[]},c.selectedProjectSessions=[],c.query={fields:"createdAt,updatedAt,id,starttime,endtime,membername,calleridnum,completed",sort:"-starttime",limit:10,page:1},c.init=function(e){c.project=e,c.query.id=c.project.id,c.getProjectSessions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the session?").htmlContent("<b>"+(e.name||"session")+"</b> will be deleted.").ariaLabel("delete session").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getProjectSessions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.jscriptyProject.getSessions(c.query,p).$promise},c.createOrEditProjectSession=function(e,t){o.show({controller:"CreateOrEditSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:c.project,session:t,sessions:c.projectSessions.rows,license:null,setting:null}})},c.showQuestionsProjectSession=function(e,n){o.show({controller:"ShowQuestionsSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,resolve:{questions:["apiResolver","$stateParams",function(e,t){return e.resolve("jscriptySessionReport@getQuestions",{fields:"question,answer",sort:"id",id:n.id})}]},locals:{project:c.project,session:n}})},c.exportSelectedProjectSessions=function(){var e=angular.copy(c.selectedProjectSessions);return c.selectedProjectSessions=[],e},c.deleteProjectSession=g,c.deleteSelectedProjectSessions=function(e){var t=o.confirm().title("Are you sure want to delete the selected sessions?").htmlContent("<b>"+c.selectedProjectSessions.length+" selected</b> will be deleted.").ariaLabel("delete sessions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedProjectSessions.forEach(function(e){g(e)}),c.selectedProjectSessions=[]})};var m=!0,u=1;function p(e){c.projectSessions=e||{count:0,rows:[]}}function g(e){l.jscriptySessionReport.delete({id:e.id}).$promise.then(function(){_.remove(c.projectSessions.rows,{id:e.id}),c.projectSessions.count-=1,c.projectSessions.rows.length||c.getProjectSessions(),r.success({title:"Session deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETjscriptyProject"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getProjectSessions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.jscripty").controller("ProjectSessionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l){this.title="JSCRIPTY.SESSION_RESULTS",this.session=o,this.questions=s,this.project=r,this.closeDialog=function(e){a.hide(e)}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","session","questions","project","api"],angular.module("app.jscripty").controller("ShowQuestionsSessionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.project=d||e.params.project||{},c.selectedTab=e.params.tab||0,c.clonedialog=function(e,t){n.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{project:e,projects:c.projects?c.projects.rows:[]}})},c.alert=r.info,c.gotoProjects=function(){e.go("app.jscripty.projects")},c.saveProject=function(){s.jscriptyProject.update({id:c.project.id},c.project).$promise.then(function(){r.success({title:"Project updated!",msg:c.project.name?c.project.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","project"],angular.module("app.jscripty").controller("JscriptyProjectController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.projects=r||{count:0,rows:[]},v.table="projects",v.listOrder="",v.listOrderAsc=null,v.selectedProjects=[],v.query={fields:"createdAt,updatedAt,id,name,enableUncompleteSave,description,createdAt,formData",sort:"-updatedAt",limit:10,page:1},v.editstate=function(e,t){n.go("app.jscripty.projects.edit",{id:e.id,project:e})},v.clonedialog=function(e,t){i.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{project:e,projects:v.projects?v.projects.rows:[]}})},v.sessionsgoto=function(e,t){n.go("app.jscripty.projects.edit",{id:e.id,tab:3})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the project?").htmlContent("<b>"+(e.name||"project")+"</b> will be deleted.").ariaLabel("delete project").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getProjects=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.jscriptyProject.get(v.query,f).$promise},v.createOrEditProject=function(e,t){i.show({controller:"CreateOrEditProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:t,projects:v.projects.rows,license:v.license,setting:v.setting}})},v.deleteProject=A,v.exportSelectedProjects=function(){var e=angular.copy(v.selectedProjects);return v.selectedProjects=[],e},v.deleteSelectedProjects=function(e){var t=i.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+v.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedProjects.forEach(function(e){A(e)}),v.selectedProjects=[]})},v.deselectProjects=function(){v.selectedProjects=[]},v.selectAllProjects=function(){v.selectedProjects=v.projects.rows};var h=!0,b=1;function f(e){v.projects=e||{count:0,rows:[]}}function A(e){l.jscriptyProject.delete({id:e.id}).$promise.then(function(){_.remove(v.projects.rows,{id:e.id}),v.projects.count-=1,v.projects.rows.length||v.getProjects(),c.success({title:"Project deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEjscriptyProject"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getProjects())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","projects","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.jscripty").controller("JscriptyProjectsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MAIL.EDIT_MAILACCOUNT",m.mailAccount=angular.copy(s),m.mailAccounts=o,m.newMailAccount=!1,m.mailAccount||(m.mailAccount={active:!0,cservice:"null",cauthentication:!0,fontSize:13,waitForTheAssignedAgent:10,notificationSound:!0},m.title="MAIL.NEW_MAILACCOUNT",m.newMailAccount=!0),t.params.id&&(m.mailAccount.MailAccountId=t.params.id),m.addNewMailAccount=function(){m.errors=[],r.mailAccount.save(m.mailAccount).$promise.then(function(e){m.mailAccounts.unshift(e.toJSON()),i.success({title:"MailAccount properly created",msg:m.mailAccount.name?m.mailAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMailAccount=function(){m.errors=[],r.mailAccount.update({id:m.mailAccount.id},m.mailAccount).$promise.then(function(e){var t=_.find(m.mailAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"MailAccount properly saved!",msg:m.mailAccount.name?m.mailAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMailAccount=function(e){if(m.mailAccount.service)return i.error({title:"Mail Account not deleted!",msg:"You can't remove service account"});m.errors=[];var t=a.confirm().title("Are you sure?").content("The mailAccount will be deleted.").ariaLabel("Delete MailAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.mailAccount.delete({id:m.mailAccount.id}).$promise.then(function(){_.remove(m.mailAccounts,{id:m.mailAccount.id}),i.success({title:"MailAccount properly deleted!",msg:(m.mailAccount.name||"mailAccount")+" has been deleted!"}),u(m.mailAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","mailAccounts","mailAccount","api","Auth","license","setting"],angular.module("app.mail").controller("CreateOrEditMailAccountDialogController",e)}(),function(){"use strict";function e(s,i,a,o,e){var r=this;function t(e,t){if(r.mailAccountApps.rows.length){var n=r.mailAccountApps.rows[t]?r.mailAccountApps.rows[t]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccountApp:n,mailAccount:r.mailAccount}}).then(function(e){e&&(e.id?r.mailAccountApps.rows[t]=e:r.mailAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.mailAccountApps.rows.length;n++,0){var a=r.mailAccountApps.rows[n],i=[],o=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.mailAccount.context,a.exten=r.mailAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(o.length?_.last(o).priority:a.priority)+1,t=_.concat(t,i,[a],o)}s.mailAccount.addApplications({id:r.mailAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.mailAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.mailAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.mailAccount={},r.mailAccountApps={count:0,rows:[]},r.selectedMailAccountApps=[],r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"MailQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",route:"mailQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"html",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e){r.mailAccount=e,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getMailAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.mailAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getMailAccountApps=function(){r.promise=s.mailAccount.getApplications(r.query,n).$promise},r.editMailAccountApp=t,r.editInterval=function(e,t){if(r.mailAccountApps.rows.length){var n=r.mailAccountApps.rows[t]?r.mailAccountApps.rows[t]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteMailAccountApp=function(e){_.remove(r.mailAccountApps.rows,{id:e.id}),l(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedMailAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedMailAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedMailAccountApps.forEach(function(e){_.remove(r.mailAccountApps.rows,{id:e.id})}),r.selectedMailAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return s.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.mail").controller("MailAccountActionsController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(e.appType||e.app).toUpperCase(),o.agent=angular.copy(e),o.agent.appdata)switch(o.agent.appType?o.agent.appType.toLowerCase():o.agent.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.agent.appdata.split(",");o.agent.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.agent.text=s.slice(1,s.length).join(",");break;case"message":o.agent.text=o.agent.appdata;break;case"set":o.agent.name=o.agent.appdata.split("=")[0],o.agent.value=o.agent.appdata.split("=")[1];break;case"agi":o.agent.project=o.agent.appdata;break;default:var r=o.agent.appdata.split(",");o.agent.agent=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.agent.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.agent.timeout=30;function l(e){t.hide(e)}o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outbounddial"===o.agent.appType.toLowerCase()&&(o.agent.prefix=o.agent.phone?o.agent.phone.split("$")[0]:void 0,o.agent.callerId=o.agent.callerID?"CALLERID(all)="+o.agent.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outboundDial"===o.agent.appType&&(o.agent.phone=a.cutdigits?(o.agent.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.agent.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.agent.options+="U(xcally-mixmonitor-context)"):o.agent.options=o.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.agents,{name:o.agent.agent});t&&(o.agent.UserId=t.id);if(o.agent.appType&&"custom"===o.agent.appType);else switch((o.agent.app||o.agent.appType).toLowerCase()){case"set":o.agent.appdata=o.agent.name+"="+o.agent.value;break;case"custom":break;default:e[0]=o.agent.agent,e[1]=o.agent.timeout,o.agent.appdata=e.join(",")}l(o.agent)},o.closeDialog=l,i.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){o.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(n.appType||n.app).toUpperCase(),o.autoreply=angular.copy(n),o.autoreply.appdata)switch(o.autoreply.appType?o.autoreply.appType.toLowerCase():o.autoreply.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.autoreply.appdata.split(",");o.autoreply.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.autoreply.text=s.slice(1,s.length).join(",");break;case"message":o.autoreply.text=o.autoreply.appdata;break;case"set":o.autoreply.name=o.autoreply.appdata.split("=")[0],o.autoreply.value=o.autoreply.appdata.split("=")[1];break;case"agi":o.autoreply.project=o.autoreply.appdata;break;default:var r=o.autoreply.appdata.split(",");o.autoreply.times=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.autoreply.text=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.autoreply.times=1;function l(e){t.hide(e)}o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outbounddial"===o.autoreply.appType.toLowerCase()&&(o.autoreply.prefix=o.autoreply.phone?o.autoreply.phone.split("$")[0]:void 0,o.autoreply.callerId=o.autoreply.callerID?"CALLERID(all)="+o.autoreply.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outboundDial"===o.autoreply.appType&&(o.autoreply.phone=a.cutdigits?(o.autoreply.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.autoreply.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.autoreply.options+="U(xcally-mixmonitor-context)"):o.autoreply.options=o.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(o.autoreply.appType&&"custom"===o.autoreply.appType);else switch((o.autoreply.app||o.autoreply.appType).toLowerCase()){case"set":o.autoreply.appdata=o.autoreply.name+"="+o.autoreply.value;break;case"custom":break;default:e[0]=o.autoreply.times,e[1]=o.autoreply.text,o.autoreply.appdata=e.join(",")}l(o.autoreply)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(n.appType||n.app).toUpperCase(),o.close=angular.copy(n),o.close.appdata)switch(o.close.appType?o.close.appType.toLowerCase():o.close.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.close.appdata.split(",");o.close.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.close.text=s.slice(1,s.length).join(",");break;case"message":o.close.text=o.close.appdata;break;case"set":o.close.name=o.close.appdata.split("=")[0],o.close.value=o.close.appdata.split("=")[1];break;case"agi":o.close.project=o.close.appdata;break;default:var r=o.close.appdata.split(",");o.close.disposition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outbounddial"===o.close.appType.toLowerCase()&&(o.close.prefix=o.close.phone?o.close.phone.split("$")[0]:void 0,o.close.callerId=o.close.callerID?"CALLERID(all)="+o.close.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outboundDial"===o.close.appType&&(o.close.phone=a.cutdigits?(o.close.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.close.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.close.options+="U(xcally-mixmonitor-context)"):o.close.options=o.close.options.replace("U(xcally-mixmonitor-context)",""));if(o.close.appType&&"custom"===o.close.appType);else switch((o.close.app||o.close.appType).toLowerCase()){case"set":o.close.appdata=o.close.name+"="+o.close.value;break;case"custom":break;default:e[0]=o.close.disposition,o.close.appdata=e.join(",")}l(o.close)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotoif=angular.copy(n),o.gotoif.appdata)switch(o.gotoif.appType?o.gotoif.appType.toLowerCase():o.gotoif.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotoif.appdata.split(",");o.gotoif.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotoif.text=s.slice(1,s.length).join(",");break;case"message":o.gotoif.text=o.gotoif.appdata;break;case"set":o.gotoif.name=o.gotoif.appdata.split("=")[0],o.gotoif.value=o.gotoif.appdata.split("=")[1];break;case"agi":o.gotoif.project=o.gotoif.appdata;break;default:var r=o.gotoif.appdata.split(",");o.gotoif.condition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.gotoif.truepriority=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.gotoif.falsepriority=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10)}function l(e){t.hide(e)}o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outbounddial"===o.gotoif.appType.toLowerCase()&&(o.gotoif.prefix=o.gotoif.phone?o.gotoif.phone.split("$")[0]:void 0,o.gotoif.callerId=o.gotoif.callerID?"CALLERID(all)="+o.gotoif.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outboundDial"===o.gotoif.appType&&(o.gotoif.phone=a.cutdigits?(o.gotoif.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotoif.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotoif.options+="U(xcally-mixmonitor-context)"):o.gotoif.options=o.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotoif.appType&&"custom"===o.gotoif.appType);else switch((o.gotoif.app||o.gotoif.appType).toLowerCase()){case"set":o.gotoif.appdata=o.gotoif.name+"="+o.gotoif.value;break;case"custom":break;default:e[0]=o.gotoif.condition,e[1]=o.gotoif.truepriority,e[2]=o.gotoif.falsepriority,o.gotoif.appdata=e.join(",")}l(o.gotoif)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotop=angular.copy(n),o.gotop.appdata)switch(o.gotop.appType?o.gotop.appType.toLowerCase():o.gotop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotop.appdata.split(",");o.gotop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotop.text=s.slice(1,s.length).join(",");break;case"message":o.gotop.text=o.gotop.appdata;break;case"set":o.gotop.name=o.gotop.appdata.split("=")[0],o.gotop.value=o.gotop.appdata.split("=")[1];break;case"agi":o.gotop.project=o.gotop.appdata;break;default:var r=o.gotop.appdata.split(",");o.gotop.priority=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outbounddial"===o.gotop.appType.toLowerCase()&&(o.gotop.prefix=o.gotop.phone?o.gotop.phone.split("$")[0]:void 0,o.gotop.callerId=o.gotop.callerID?"CALLERID(all)="+o.gotop.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outboundDial"===o.gotop.appType&&(o.gotop.phone=a.cutdigits?(o.gotop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotop.options+="U(xcally-mixmonitor-context)"):o.gotop.options=o.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotop.appType&&"custom"===o.gotop.appType);else switch((o.gotop.app||o.gotop.appType).toLowerCase()){case"set":o.gotop.appdata=o.gotop.name+"="+o.gotop.value;break;case"custom":break;default:e[0]=o.gotop.priority,o.gotop.appdata=e.join(",")}l(o.gotop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditMailAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(n.appType||n.app).toUpperCase(),o.noop=angular.copy(n),o.noop.appdata)switch(o.noop.appType?o.noop.appType.toLowerCase():o.noop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.noop.appdata.split(",");o.noop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.noop.text=s.slice(1,s.length).join(",");break;case"message":o.noop.text=o.noop.appdata;break;case"set":o.noop.name=o.noop.appdata.split("=")[0],o.noop.value=o.noop.appdata.split("=")[1];break;case"agi":o.noop.project=o.noop.appdata;break;default:var r=o.noop.appdata.split(",");o.noop.value=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outbounddial"===o.noop.appType.toLowerCase()&&(o.noop.prefix=o.noop.phone?o.noop.phone.split("$")[0]:void 0,o.noop.callerId=o.noop.callerID?"CALLERID(all)="+o.noop.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outboundDial"===o.noop.appType&&(o.noop.phone=a.cutdigits?(o.noop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.noop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.noop.options+="U(xcally-mixmonitor-context)"):o.noop.options=o.noop.options.replace("U(xcally-mixmonitor-context)",""));if(o.noop.appType&&"custom"===o.noop.appType);else switch((o.noop.app||o.noop.appType).toLowerCase()){case"set":o.noop.appdata=o.noop.name+"="+o.noop.value;break;case"custom":break;default:e[0]=o.noop.value,o.noop.appdata=e.join(",")}l(o.noop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(e.appType||e.app).toUpperCase(),o.queue=angular.copy(e),o.queue.appdata)switch(o.queue.appType?o.queue.appType.toLowerCase():o.queue.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.queue.appdata.split(",");o.queue.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.queue.text=s.slice(1,s.length).join(",");break;case"message":o.queue.text=o.queue.appdata;break;case"set":o.queue.name=o.queue.appdata.split("=")[0],o.queue.value=o.queue.appdata.split("=")[1];break;case"agi":o.queue.project=o.queue.appdata;break;default:var r=o.queue.appdata.split(",");o.queue.queue=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.queue.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.queue.queue=300,o.queue.timeout=300;function l(e){t.hide(e)}o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outbounddial"===o.queue.appType.toLowerCase()&&(o.queue.prefix=o.queue.phone?o.queue.phone.split("$")[0]:void 0,o.queue.callerId=o.queue.callerID?"CALLERID(all)="+o.queue.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outboundDial"===o.queue.appType&&(o.queue.phone=a.cutdigits?(o.queue.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.queue.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.queue.options+="U(xcally-mixmonitor-context)"):o.queue.options=o.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.queues,{name:o.queue.queue});t&&(o.queue[_.capitalize("mail")+"QueueId"]=t.id);if(o.queue.appType&&"custom"===o.queue.appType);else switch((o.queue.app||o.queue.appType).toLowerCase()){case"set":o.queue.appdata=o.queue.name+"="+o.queue.value;break;case"custom":break;default:e[0]=o.queue.queue,e[1]=o.queue.timeout,o.queue.appdata=e.join(",")}l(o.queue)},o.closeDialog=l,i.mailQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){o.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(e.appType||e.app).toUpperCase(),o.system=angular.copy(e),o.system.appdata)switch(o.system.appType?o.system.appType.toLowerCase():o.system.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.system.appdata.split(",");o.system.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.system.text=s.slice(1,s.length).join(",");break;case"message":o.system.text=o.system.appdata;break;case"set":o.system.name=o.system.appdata.split("=")[0],o.system.value=o.system.appdata.split("=")[1];break;case"agi":o.system.project=o.system.appdata;break;default:var r=o.system.appdata.split(",");o.system.command=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.system.variable=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.system.variable="";function l(e){t.hide(e)}o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outbounddial"===o.system.appType.toLowerCase()&&(o.system.prefix=o.system.phone?o.system.phone.split("$")[0]:void 0,o.system.callerId=o.system.callerID?"CALLERID(all)="+o.system.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outboundDial"===o.system.appType&&(o.system.phone=a.cutdigits?(o.system.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.system.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.system.options+="U(xcally-mixmonitor-context)"):o.system.options=o.system.options.replace("U(xcally-mixmonitor-context)",""));if(o.system.appType&&"custom"===o.system.appType);else switch((o.system.app||o.system.appType).toLowerCase()){case"set":o.system.appdata=o.system.name+"="+o.system.value;break;case"custom":break;default:e[0]=o.system.command,e[1]=o.system.variable,o.system.appdata=e.join(",")}l(o.system)},o.closeDialog=l,i.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){o.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppsystemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.mailAccount={},c.mailAccountInteractions={count:0,rows:[]},c.selectedMailAccountInteractions=[],c.query={fields:"createdAt,updatedAt,UserId,ContactId,MailAccountId,id,createdAt,Contact.firstName,Owner.name,closedAt,disposition,note,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e){c.mailAccount=e,c.query.id=c.mailAccount.id,c.getMailAccountInteractions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getMailAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.mailAccount.getInteractions(c.query,p).$promise},c.createOrEditMailAccountInteraction=function(e,t){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/interactions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:c.mailAccount,interaction:t,interactions:c.mailAccountInteractions.rows,license:null,setting:null}})},c.spymailInteraction=function(e,n){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"mail",interaction:n,spy:!0})}})},c.exportSelectedMailAccountInteractions=function(){var e=angular.copy(c.selectedMailAccountInteractions);return c.selectedMailAccountInteractions=[],e},c.deleteMailAccountInteraction=g,c.deleteSelectedMailAccountInteractions=function(e){var t=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedMailAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedMailAccountInteractions.forEach(function(e){g(e)}),c.selectedMailAccountInteractions=[]})};var m=!0,u=1;function p(e){c.mailAccountInteractions=e||{count:0,rows:[]}}function g(e){l.mailInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.mailAccountInteractions.rows,{id:e.id}),c.mailAccountInteractions.count-=1,c.mailAccountInteractions.rows.length||c.getMailAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMailAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountInteractionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.mailAccount={},c.mailAccountMailCannedAnswers={count:0,rows:[]},c.selectedMailAccountMailCannedAnswers=[],c.query={fields:"createdAt,updatedAt,id,key,value,description,createdAt",limit:10,page:1},c.init=function(e){c.mailAccount=e,c.query.id=c.mailAccount.id,c.query.MailAccountId=c.mailAccount.id,c.getMailAccountMailCannedAnswers()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the mailCannedAnswer?").htmlContent("<b>"+(e.name||"mailCannedAnswer")+"</b> will be deleted.").ariaLabel("delete mailCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getMailAccountMailCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.mailAccount.getAnswers(c.query,p).$promise},c.createOrEditMailAccountMailCannedAnswer=function(e,t){o.show({controller:"CreateOrEditMailCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:c.mailAccount,mailCannedAnswer:t,mailCannedAnswers:c.mailAccountMailCannedAnswers.rows,license:null,setting:null}})},c.exportSelectedMailAccountMailCannedAnswers=function(){var e=angular.copy(c.selectedMailAccountMailCannedAnswers);return c.selectedMailAccountMailCannedAnswers=[],e},c.deleteMailAccountMailCannedAnswer=g,c.deleteSelectedMailAccountMailCannedAnswers=function(e){var t=o.confirm().title("Are you sure want to delete the selected mailCannedAnswers?").htmlContent("<b>"+c.selectedMailAccountMailCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete mailCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedMailAccountMailCannedAnswers.forEach(function(e){g(e)}),c.selectedMailAccountMailCannedAnswers=[]})};var m=!0,u=1;function p(e){c.mailAccountMailCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.mailAccountMailCannedAnswers.rows,{id:e.id}),c.mailAccountMailCannedAnswers.count-=1,c.mailAccountMailCannedAnswers.rows.length||c.getMailAccountMailCannedAnswers(),r.success({title:"MailCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMailAccountMailCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountMailCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MAIL.EDIT_MAILCANNEDANSWER",m.mailCannedAnswer=angular.copy(s),m.mailCannedAnswers=o,m.newMailCannedAnswer=!1,m.mailCannedAnswer||(m.mailCannedAnswer={},m.title="MAIL.NEW_MAILCANNEDANSWER",m.newMailCannedAnswer=!0),t.params.id&&(m.mailCannedAnswer.MailAccountId=t.params.id),m.addNewMailCannedAnswer=function(){m.errors=[],r.cannedAnswer.save(m.mailCannedAnswer).$promise.then(function(e){m.mailCannedAnswers.unshift(e.toJSON()),i.success({title:"MailCannedAnswer properly created",msg:m.mailCannedAnswer.name?m.mailCannedAnswer.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMailCannedAnswer=function(){m.errors=[],r.cannedAnswer.update({id:m.mailCannedAnswer.id},m.mailCannedAnswer).$promise.then(function(e){var t=_.find(m.mailCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"MailCannedAnswer properly saved!",msg:m.mailCannedAnswer.name?m.mailCannedAnswer.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMailCannedAnswer=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The mailCannedAnswer will be deleted.").ariaLabel("Delete MailCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cannedAnswer.delete({id:m.mailCannedAnswer.id}).$promise.then(function(){_.remove(m.mailCannedAnswers,{id:m.mailCannedAnswer.id}),i.success({title:"MailCannedAnswer properly deleted!",msg:(m.mailCannedAnswer.name||"mailCannedAnswer")+" has been deleted!"}),u(m.mailCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","mailCannedAnswers","mailCannedAnswer","api","Auth","license","setting"],angular.module("app.mail").controller("CreateOrEditMailCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.mailAccount={},c.mailAccountMailDispositions={count:0,rows:[]},c.selectedMailAccountMailDispositions=[],c.query={fields:"createdAt,updatedAt,id,name,createdAt",limit:10,page:1},c.init=function(e){c.mailAccount=e,c.query.id=c.mailAccount.id,c.query.MailAccountId=c.mailAccount.id,c.getMailAccountMailDispositions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the mailDisposition?").htmlContent("<b>"+(e.name||"mailDisposition")+"</b> will be deleted.").ariaLabel("delete mailDisposition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getMailAccountMailDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.mailAccount.getDispositions(c.query,p).$promise},c.createOrEditMailAccountMailDisposition=function(e,t){o.show({controller:"CreateOrEditMailDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/mailDispositions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:c.mailAccount,mailDisposition:t,mailDispositions:c.mailAccountMailDispositions.rows,license:null,setting:null}})},c.exportSelectedMailAccountMailDispositions=function(){var e=angular.copy(c.selectedMailAccountMailDispositions);return c.selectedMailAccountMailDispositions=[],e},c.deleteMailAccountMailDisposition=g,c.deleteSelectedMailAccountMailDispositions=function(e){var t=o.confirm().title("Are you sure want to delete the selected mailDispositions?").htmlContent("<b>"+c.selectedMailAccountMailDispositions.length+" selected</b> will be deleted.").ariaLabel("delete mailDispositions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedMailAccountMailDispositions.forEach(function(e){g(e)}),c.selectedMailAccountMailDispositions=[]})};var m=!0,u=1;function p(e){c.mailAccountMailDispositions=e||{count:0,rows:[]}}function g(e){l.mailDisposition.delete({id:e.id}).$promise.then(function(){_.remove(c.mailAccountMailDispositions.rows,{id:e.id}),c.mailAccountMailDispositions.count-=1,c.mailAccountMailDispositions.rows.length||c.getMailAccountMailDispositions(),r.success({title:"MailDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMailAccountMailDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountMailDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MAIL.EDIT_MAILDISPOSITION",m.mailDisposition=angular.copy(s),m.mailDispositions=o,m.newMailDisposition=!1,m.mailDisposition||(m.mailDisposition={},m.title="MAIL.NEW_MAILDISPOSITION",m.newMailDisposition=!0),t.params.id&&(m.mailDisposition.MailAccountId=t.params.id),m.addNewMailDisposition=function(){m.errors=[],r.mailDisposition.save(m.mailDisposition).$promise.then(function(e){m.mailDispositions.unshift(e.toJSON()),i.success({title:"MailDisposition properly created",msg:m.mailDisposition.name?m.mailDisposition.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailDisposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailDisposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMailDisposition=function(){m.errors=[],r.mailDisposition.update({id:m.mailDisposition.id},m.mailDisposition).$promise.then(function(e){var t=_.find(m.mailDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"MailDisposition properly saved!",msg:m.mailDisposition.name?m.mailDisposition.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailDisposition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailDisposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMailDisposition=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The mailDisposition will be deleted.").ariaLabel("Delete MailDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.mailDisposition.delete({id:m.mailDisposition.id}).$promise.then(function(){_.remove(m.mailDispositions,{id:m.mailDisposition.id}),i.success({title:"MailDisposition properly deleted!",msg:(m.mailDisposition.name||"mailDisposition")+" has been deleted!"}),u(m.mailDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailDisposition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailDisposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","mailDispositions","mailDisposition","api","Auth","license","setting"],angular.module("app.mail").controller("CreateOrEditMailDispositionDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.mailAccount=d||n.params.mailAccount||{},c.selectedTab=n.params.tab||0,c.gotogoto=function(e,t){n.go("app.mail.realtime.accounts",{})},c.alert=r.info,c.gotoMailAccounts=function(){n.go("app.mail.mailAccounts")},c.saveMailAccount=function(){s.mailAccount.update({id:c.mailAccount.id},c.mailAccount).$promise.then(function(){r.success({title:"MailAccount updated!",msg:c.mailAccount.name?c.mailAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.lists=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","mailAccount"],angular.module("app.mail").controller("MailAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.mailAccounts=r||{count:0,rows:[]},v.table="mailAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedMailAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,page:1},v.arraycservice=_.keyBy([{option:"Custom",value:"null"},{option:"Gmail",value:"'gmail'"},{option:"Hotmail",value:"'hotmail'"},{option:"Yahoo",value:"'yahoo'"},{option:"Outlook365",value:"'outlook365'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v["arrayImap.service"]=_.keyBy([{option:"Custom",value:"null"},{option:"Gmail",value:"'gmail'"},{option:"Hotmail",value:"'hotmail'"},{option:"Yahoo",value:"'yahoo'"},{option:"Outlook365",value:"'outlook365'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v["arraySmtp.service"]=_.keyBy([{option:"Custom",value:"null"},{option:"Gmail",value:"'gmail'"},{option:"Hotmail",value:"'hotmail'"},{option:"Yahoo",value:"'yahoo'"},{option:"Outlook365",value:"'outlook365'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.mail.mailAccounts.edit",{id:e.id,mailAccount:e})},v.verifysmtpverifysmtp=function(e,t){{if(e&&e.id)return l.mailAccount.verifySmtp({id:e.id}).$promise.then(function(){c.success({title:"Smtp properly verified",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"Smtp properly verified",msg:e.data?JSON.stringify(e.data):e.toString()})});c.error({title:"Smtp properly verified",msg:"Smpt id unknown"})}},v.interactionsgoto=function(e,t){n.go("app.mail.mailAccounts.edit",{id:e.id,tab:6})},v.gotorealtimegoto=function(e,t){n.go("app.mail.realtime.accounts",{})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the mailAccount?").htmlContent("<b>"+(e.name||"mailAccount")+"</b> will be deleted.").ariaLabel("delete mailAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getMailAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.mailAccount.get(v.query,f).$promise},v.createOrEditMailAccount=function(e,t){i.show({controller:"CreateOrEditMailAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:t,mailAccounts:v.mailAccounts.rows,license:v.license,setting:v.setting}})},v.deleteMailAccount=A,v.exportSelectedMailAccounts=function(){var e=angular.copy(v.selectedMailAccounts);return v.selectedMailAccounts=[],e},v.deleteSelectedMailAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected mailAccounts?").htmlContent("<b>"+v.selectedMailAccounts.length+" selected</b> will be deleted.").ariaLabel("delete MailAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedMailAccounts.forEach(function(e){A(e)}),v.selectedMailAccounts=[]})},v.deselectMailAccounts=function(){v.selectedMailAccounts=[]},v.selectAllMailAccounts=function(){v.selectedMailAccounts=v.mailAccounts.rows},l.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.lists=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.mailAccounts=e||{count:0,rows:[]}}function A(e){if(e.service)return c.error({title:"Mail Account not deleted!",msg:"You can't remove service account"});l.mailAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.mailAccounts.rows,{id:e.id}),v.mailAccounts.count-=1,v.mailAccounts.rows.length||v.getMailAccounts(),c.success({title:"MailAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getMailAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","mailAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.mail").controller("MailAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MAIL.EDIT_MAILQUEUE",m.mailQueue=angular.copy(s),m.mailQueues=o,m.newMailQueue=!1,m.mailQueue||(m.mailQueue={strategy:"beepall",timeout:10},m.title="MAIL.NEW_MAILQUEUE",m.newMailQueue=!0),m.addNewMailQueue=function(){m.errors=[],r.mailQueue.save(m.mailQueue).$promise.then(function(e){m.mailQueues.unshift(e.toJSON()),i.success({title:"MailQueue properly created",msg:m.mailQueue.name?m.mailQueue.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMailQueue=function(){m.errors=[],r.mailQueue.update({id:m.mailQueue.id},m.mailQueue).$promise.then(function(e){var t=_.find(m.mailQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"MailQueue properly saved!",msg:m.mailQueue.name?m.mailQueue.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMailQueue=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The mailQueue will be deleted.").ariaLabel("Delete MailQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.mailQueue.delete({id:m.mailQueue.id}).$promise.then(function(){_.remove(m.mailQueues,{id:m.mailQueue.id}),i.success({title:"MailQueue properly deleted!",msg:(m.mailQueue.name||"mailQueue")+" has been deleted!"}),u(m.mailQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","mailQueues","mailQueue","api","Auth","license","setting"],angular.module("app.mail").controller("CreateOrEditMailQueueDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.mailQueue[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.mailQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserMailQueue?"penalty "+e.UserMailQueue.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserMailQueue?"penalty "+e.UserMailQueue.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.mailQueue=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("MAIL.ALL_AGENTS"),labelSelected:s.instant("MAIL.SELECTED_AGENTS"),transferCallback:function(e,t){a.mailQueue[t?"removeAgents":"addAgents"]({id:l.mailQueue.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"MailQueue properly "+(t?"removed":"added"),msg:"MailQueue has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:mailQueue.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","mailQueue","mailQueues","realtime","$translate","Auth"],angular.module("app.mail").controller("MailQueueagentaddController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.mailQueue=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("MAIL.ALL_TEAMS"),labelSelected:i.instant("MAIL.SELECTED_TEAMS"),transferCallback:function(e,t){a.mailQueue[t?"removeTeams":"addTeams"]({id:o.mailQueue.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:mailQueue.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.mailQueue.getTeams({id:o.mailQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","mailQueue","$translate"],angular.module("app.mail").controller("MailQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.mailQueue=d||e.params.mailQueue||{},c.selectedTab=e.params.tab||0,c.teamadddialog=function(e,t){n.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:c.mailQueues?c.mailQueues.rows:[]}})},c.agentadddialog=function(e,t){n.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:c.mailQueues?c.mailQueues.rows:[],realtime:!1}})},c.alert=r.info,c.gotoMailQueues=function(){e.go("app.mail.mailQueues")},c.saveMailQueue=function(){s.mailQueue.update({id:c.mailQueue.id},c.mailQueue).$promise.then(function(){r.success({title:"MailQueue updated!",msg:c.mailQueue.name?c.mailQueue.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","mailQueue"],angular.module("app.mail").controller("MailQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.mailQueues=r||{count:0,rows:[]},v.table="mailQueues",v.listOrder="",v.listOrderAsc=null,v.selectedMailQueues=[],v.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,page:1},v.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.mail.mailQueues.edit",{id:e.id,mailQueue:e})},v.teamadddialog=function(e,t){i.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:v.mailQueues?v.mailQueues.rows:[]}})},v.agentadddialog=function(e,t){i.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:v.mailQueues?v.mailQueues.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the mailQueue?").htmlContent("<b>"+(e.name||"mailQueue")+"</b> will be deleted.").ariaLabel("delete mailQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.mail.realtime.queues",{})},v.success=f,v.getMailQueues=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.mailQueue.get(v.query,f).$promise},v.createOrEditMailQueue=function(e,t){i.show({controller:"CreateOrEditMailQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:t,mailQueues:v.mailQueues.rows,license:v.license,setting:v.setting}})},v.deleteMailQueue=A,v.exportSelectedMailQueues=function(){var e=angular.copy(v.selectedMailQueues);return v.selectedMailQueues=[],e},v.deleteSelectedMailQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected mailQueues?").htmlContent("<b>"+v.selectedMailQueues.length+" selected</b> will be deleted.").ariaLabel("delete MailQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedMailQueues.forEach(function(e){A(e)}),v.selectedMailQueues=[]})},v.deselectMailQueues=function(){v.selectedMailQueues=[]},v.selectAllMailQueues=function(){v.selectedMailQueues=v.mailQueues.rows};var h=!0,b=1;function f(e){v.mailQueues=e||{count:0,rows:[]}}function A(e){l.mailQueue.delete({id:e.id}).$promise.then(function(){_.remove(v.mailQueues.rows,{id:e.id}),v.mailQueues.count-=1,v.mailQueues.rows.length||v.getMailQueues(),c.success({title:"MailQueue deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailQueue"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getMailQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","mailQueues","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.mail").controller("MailQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MAIL.EDIT_MAILSUBSTATUS",m.mailSubstatus=angular.copy(s),m.mailSubtatuses=o,m.newMailSubstatus=!1,m.mailSubstatus||(m.mailSubstatus={},m.title="MAIL.NEW_MAILSUBSTATUS",m.newMailSubstatus=!0),m.addNewMailSubstatus=function(){m.errors=[],r.mailSubstatus.save(m.mailSubstatus).$promise.then(function(e){m.mailSubtatuses.unshift(e.toJSON()),i.success({title:"MailSubstatus properly created",msg:m.mailSubstatus.name?m.mailSubstatus.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMailSubstatus=function(){m.errors=[],r.mailSubstatus.update({id:m.mailSubstatus.id},m.mailSubstatus).$promise.then(function(e){var t=_.find(m.mailSubtatuses,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"MailSubstatus properly saved!",msg:m.mailSubstatus.name?m.mailSubstatus.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMailSubstatus=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The mailSubstatus will be deleted.").ariaLabel("Delete MailSubstatus").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.mailSubstatus.delete({id:m.mailSubstatus.id}).$promise.then(function(){_.remove(m.mailSubtatuses,{id:m.mailSubstatus.id}),i.success({title:"MailSubstatus properly deleted!",msg:(m.mailSubstatus.name||"mailSubstatus")+" has been deleted!"}),u(m.mailSubstatus)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","mailSubtatuses","mailSubstatus","api","Auth","license","setting"],angular.module("app.mail").controller("CreateOrEditMailSubstatusDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.mailSubtatuses=r||{count:0,rows:[]},v.table="mailSubtatuses",v.listOrder="",v.listOrderAsc=null,v.selectedMailSubstatuses=[],v.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailSubstatus:e,mailSubtatuses:v.mailSubtatuses.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the mailSubstatus?").htmlContent("<b>"+(e.name||"mailSubstatus")+"</b> will be deleted.").ariaLabel("delete mailSubstatus").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getMailSubstatuses=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.mailSubstatus.get(v.query,f).$promise},v.createOrEditMailSubstatus=function(e,t){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailSubstatus:t,mailSubtatuses:v.mailSubtatuses.rows,license:v.license,setting:v.setting}})},v.deleteMailSubstatus=A,v.exportSelectedMailSubstatuses=function(){var e=angular.copy(v.selectedMailSubstatuses);return v.selectedMailSubstatuses=[],e},v.deleteSelectedMailSubstatuses=function(e){var t=i.confirm().title("Are you sure want to delete the selected mailSubtatuses?").htmlContent("<b>"+v.selectedMailSubstatuses.length+" selected</b> will be deleted.").ariaLabel("delete MailSubstatuss").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedMailSubstatuses.forEach(function(e){A(e)}),v.selectedMailSubstatuses=[]})},v.deselectMailSubstatuses=function(){v.selectedMailSubstatuses=[]},v.selectAllMailSubstatuses=function(){v.selectedMailSubstatuses=v.mailSubtatuses.rows};var h=!0,b=1;function f(e){v.mailSubtatuses=e||{count:0,rows:[]}}function A(e){l.mailSubstatus.delete({id:e.id}).$promise.then(function(){_.remove(v.mailSubtatuses.rows,{id:e.id}),v.mailSubtatuses.count-=1,v.mailSubtatuses.rows.length||v.getMailSubstatuses(),c.success({title:"MailSubstatus deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailSubstatus"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailSubstatus",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getMailSubstatuses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","mailSubtatuses","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.mail").controller("MailSubstatusesController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this;function m(){_.forIn(c.mailAccounts,function(e,t){c.rpcMailAccounts[t]&&_.merge(e,c.rpcMailAccounts[t])}),_.forIn(c.mailAccounts,function(t,e){var n={id:e,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss")};o.mailAccount.getMessages(n).$promise.then(function(e){return e&&(t.in=e.count||0,t.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),n.direction="out",o.mailAccount.getMessages(n).$promise}).then(function(e){e&&(t.out=e.count||0,t.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){console.log(e)})})}c.count=l&&l.count?l.count:0,c.mailAccounts=l?_.keyBy(l.rows?l.rows:[],"id"):{},c.rpcMailAccounts=d?_.keyBy(d.rows?d.rows:[],"id"):{},c.query={sort:"-name",limit:10,page:1},c.success=g,c.$onInit=m,c.getMailAccounts=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.mailAccount.get(c.query,g).$promise},c.onSave=function(e){c.mailAccounts[e.id]&&_.merge(c.mailAccounts[e.id],e)},c.onMailMessageSave=function(e){c.mailAccounts[e.MailAccountId]&&("in"==e.direction?(c.mailAccounts[e.MailAccountId].in+=1,c.mailAccounts[e.MailAccountId].lastIn=e.createdAt):(c.mailAccounts[e.MailAccountId].out+=1,c.mailAccounts[e.MailAccountId].lastOut=e.createdAt))},c.goToMailAccount=function(e,t){i.go("app.mail.mailAccounts.edit",{id:t.id,mailAccount:t})},c.verifySmtp=function(e,t){{if(t&&t.id)return o.mailAccount.verifySmtp({id:t.id}).$promise.then(function(){r.success({title:"Smtp properly verified",msg:"Connection succeded!"})}).catch(function(e){r.error({title:"Smtp properly verified",msg:e.data?JSON.stringify(e.data):e.toString()})});r.error({title:"Smtp properly verified",msg:"Smpt id unknown"})}},c.order=[],_.forIn(c.mailAccounts,function(e,t){c.order.push(e.id)}),s.on("mailAccount:save",c.onSave),s.on("mailAccount:update",c.onSave),s.on("mailMessage:save",c.onMailMessageSave);var u=!0,p=1;function g(e){if(c.mailAccounts=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){c.order=[];for(var t=0;t<e.rows.length;t++)c.order.push(e.rows[t].id)}m()}e.$watch("vm.query.filter",function(e,t){u?n(function(){u=!1}):(t||(p=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=p),c.getMailAccounts())}),e.$on("$destroy",function(){s.removeAllListeners("mailAccount:save"),s.removeAllListeners("mailAccount:update"),s.removeAllListeners("mailMessage:save")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$state","api","socket","toasty","mailAccounts","rpcMailAccounts"],angular.module("app.mail").controller("MailAccountsRealtimeController",e)}(),function(){"use strict";function e(e,s,t,n,a,i,o,r,l,d,c,m,u,p,g,v){var h=this,b=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum"],f=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var A in h.availableStates=["ringing","inuse","busy","onhold","not_inuse"],h.pauses=o||{count:0,rows:[]},h.license=g,h.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},h.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},h.paginatedAgents={},h.load=!1,h.order=[],h.agentInternal={},h.agents)h.agents.hasOwnProperty(A)&&(h.agents[A].init=!0);h.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},h.logout=function(e,t){return d.user.logout({id:e.id}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),h.agents[e.id]&&(h.agents[e.id].online=!1),h.rpcAgents[e.id]&&(h.rpcAgents[e.id].online=!1),y()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"mail",realtime:!0,direction:"inbound"}})},h.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},h.getAgentStatus=C,h.getAgentGlobalStatus=x,h.isPause=S,h.checkPause=function(e){return"pause"===e},h.isPartialPause=function(e){return"*pause"===e},h.onSave=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(_.omit(e,f),b)),_.merge(h.rpcAgents[e.id],_.pick(_.omit(e,f),b)),x(h.agents[e.id]))},h.onUpdate=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(e,b)),_.merge(h.rpcAgents[e.id],_.pick(e,b)),x(h.agents[e.id]))},h.onInit=y,h.onConnect=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(_.merge(h.agents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(h.rpcAgents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},h.onComplete=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(h.agents[h.agentInternal[e.destaccountcode]]=_.omit(h.agents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),h.rpcAgents[h.agentInternal[e.destaccountcode]]=_.omit(h.rpcAgents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",h.onSave),c.on("user:update",h.onUpdate),c.on("user:agentconnect",h.onConnect),c.on("user:agentcomplete",h.onComplete),y();var E=v(function(){h.load&&(h.load=!1,y())},999);function y(e){h.load=!1;var t,n,a=s.defer();h.promise=a.promise,h.filteredAgents=[],h.order=[],_.forIn(h.agents,function(e,t){h.rpcAgents[t]&&_.merge(e,_.pick(_.omit(h.rpcAgents[t],f),b)),x(e),e.online?(h.filteredAgents.push(e),h.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),h.query.globalStatusFilter&&_.remove(h.filteredAgents,function(e){return e.globalStatus!==h.query.globalStatusFilter}),h.query.pauseTypeFilter&&_.remove(h.filteredAgents,function(e){return e.pauseType!==h.query.pauseTypeFilter}),h.query.filter&&_.remove(h.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(h.query.filter.toLowerCase())<0}),h.filteredAgents=(t=h.filteredAgents,n=_.startsWith(h.query.order,"-")?"desc":"asc",_.orderBy(t,[h.query.order.replace("-","")],[n]));var i=(h.query.page-1)*h.query.limit;h.paginatedAgents=_.drop(h.filteredAgents,i).slice(0,h.query.limit);for(var o=0;o<h.paginatedAgents.length;o+=1)h.order.push(h.paginatedAgents[o].id);a.resolve(),h.load=!0}function S(e){return"pause"===e||"*pause"===e}function T(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function C(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function x(e){var t="unknown";t=_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"pause":_.some([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"*pause":_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],T)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=S(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),E&&(v.cancel(E),E=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","Auth","license","$interval"],angular.module("app.voice").controller("AgentsMailRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function g(){var n=[];return _.forIn(u.queues,function(e,t){e.paused=0,e.loggedInDb=0,u.queues[t].agents={},n.push(l.mailQueue.getMembers({id:t}).$promise),u.rpcQueues[t]&&_.merge(e,_.pick(u.rpcQueues[t],p))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&u.queues[e[t].rows[n].MailQueueId].paused++,u.queues[e[t].rows[n].MailQueueId].loggedInDb++,u.queues[e[t].rows[n].MailQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].MailQueueId}).catch(function(e){console.error(e)})}u.count=s.count?s.count:0,u.queues=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.hasRole("admin")?u.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:u.query={id:m.getCurrentUser().id,channel:"mail",type:"inbound",sort:"-updatedAt",limit:10,page:1},u.success=b,u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=l.mailQueue.get(u.query,b).$promise:u.promise=l.user.getQueues(u.query,b).$promise},u.createOrEditMailQueue=function(e,t){a.show({controller:"CreateOrEditMailQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:t,mailQueues:_.values(u.queues),license:null,setting:null}})},u.agentAdd=function(e,t){a.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:t,mailQueues:u.queues?u.queues.rows:[],realtime:!1}})},u.updateQueue=function(e){return l.mailQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},u.onSave=function(e){u.queues[e.id]&&_.merge(u.queues[e.id],_.pick(e,p))},u.onSaveMember=function(e){u.queues[e.MailQueueId]&&u.queues[e.MailQueueId].loggedInDb++},u.onRemoveMember=function(e){u.queues[e.MailQueueId]&&u.queues[e.MailQueueId].loggedInDb--},u.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(u.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(u.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},u.onLogin=function(e){console.log("onLogged",e),u.queues[e.MailQueueId]&&(u.queues[e.MailQueueId].loggedInDb+=1,u.queues[e.MailQueueId].agents[e.UserId]=e.MailQueueId)},u.onLogout=function(e){console.log("onLogout",e),u.queues[e.MailQueueId]&&0<u.queues[e.MailQueueId].loggedInDb&&(u.queues[e.MailQueueId].loggedInDb-=1,delete u.queues[e.MailQueueId].agents[e.UserId])},u.$onInit=g,u.order=[],_.forIn(u.queues,function(e,t){u.order.push(e.id)}),d.on("mail_queue:save",u.onSave),d.on("userMailQueue:save",u.onSaveMember),d.on("userMailQueue:remove",u.onRemoveMember),d.on("user:update",u.onPause),d.on("userVoiceQueue:remove",u.onLogout),d.on("userVoiceQueue:save",u.onLogin);var v=!0,h=1;function b(e){if(u.count=e.count,u.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){u.order=[];for(var t=0;t<e.rows.length;t++)u.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("mail_queue:save"),d.removeAllListeners("userMailQueue:remove"),d.removeAllListeners("userMailQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","Auth"],angular.module("app.mail").controller("QueuesMailRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.mail.realtime.agents":this.selectedTab=0;break;case"app.mail.realtime.queues":this.selectedTab=1;break;case"app.mail.realtime.accounts":this.selectedTab=2;break;default:this.selectedTab=0,n.go("app.mail.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.mail.realtime.agents");break;case 1:n.go("app.mail.realtime.queues");break;case 2:n.go("app.mail.realtime.accounts");break;default:n.go("app.mail.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.mail").controller("MailRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MOTIONDIALER.EDIT_IVRCAMPAIGN",m.ivrCampaign=angular.copy(s),m.ivrCampaigns=o,m.newIvrCampaign=!1,m.ivrCampaign||(m.ivrCampaign={active:!0,type:"ivr",dialCheckDuplicateType:"always",limitCalls:30,dialOriginateTimeout:30,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150,dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3},m.title="MOTIONDIALER.NEW_IVRCAMPAIGN",m.newIvrCampaign=!0),m.addNewIvrCampaign=function(){m.errors=[],r.campaign.save(m.ivrCampaign).$promise.then(function(e){m.ivrCampaigns.unshift(e.toJSON()),i.success({title:"IvrCampaign properly created",msg:m.ivrCampaign.name?m.ivrCampaign.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveIvrCampaign=function(){m.errors=[],r.campaign.update({id:m.ivrCampaign.id},m.ivrCampaign).$promise.then(function(e){var t=_.find(m.ivrCampaigns,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"IvrCampaign properly saved!",msg:m.ivrCampaign.name?m.ivrCampaign.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteIvrCampaign=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The ivrCampaign will be deleted.").ariaLabel("Delete IvrCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.campaign.delete({id:m.ivrCampaign.id}).$promise.then(function(){_.remove(m.ivrCampaigns,{id:m.ivrCampaign.id}),i.success({title:"IvrCampaign properly deleted!",msg:(m.ivrCampaign.name||"ivrCampaign")+" has been deleted!"}),u(m.ivrCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.trunks=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.projects=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){m.interval=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","ivrCampaigns","ivrCampaign","api","Auth","license","setting"],angular.module("app.motiondialer").controller("CreateOrEditIvrCampaignDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o){var s=this;s.ivrCampaign=t,s.items=[],s.selectedItems=[],s.loading=!1,s.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:i.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){s.loading=!0,a.campaign[t?"removeBlackLists":"addBlackLists"]({id:s.ivrCampaign.id,ids:_.map(e,"id")}).$promise.then(function(){n.success({title:"List properly "+(t?"removed":"added"),msg:"List has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ivrCampaign.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){s.loading=!1})}},s.closeDialog=function(){e.hide()},a.campaign.getBlackLists({id:s.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return s.selectedItems=e.rows?e.rows:[],s.dualMultiselectOptions.selectedItems=s.selectedItems,a.cmList.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){s.items=e.rows?e.rows:[],s.dualMultiselectOptions.items=_.differenceBy(s.items,s.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","ivrCampaign","$translate","$timeout"],angular.module("app.motiondialer").controller("IvrCampaignblacklistaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.ivrCampaign={},c.ivrCampaignHopperBlacks={count:0,rows:[]},c.selectedIvrCampaignHopperBlacks=[],c.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},c.init=function(e){c.ivrCampaign=e,c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHopperBlacks()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHopperBlacks=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHopperBlacks(c.query,p).$promise},c.createOrEditIvrCampaignHopperBlack=function(e,t){o.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopperBlack:t,hopperBlacks:c.ivrCampaignHopperBlacks.rows,license:null,setting:null}})},c.exportSelectedIvrCampaignHopperBlacks=function(){var e=angular.copy(c.selectedIvrCampaignHopperBlacks);return c.selectedIvrCampaignHopperBlacks=[],e},c.deleteIvrCampaignHopperBlack=g,c.deleteSelectedIvrCampaignHopperBlacks=function(e){var t=o.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+c.selectedIvrCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedIvrCampaignHopperBlacks.forEach(function(e){g(e)}),c.selectedIvrCampaignHopperBlacks=[]})};var m=!0,u=1;function p(e){c.ivrCampaignHopperBlacks=e||{count:0,rows:[]}}function g(e){l.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHopperBlacks.rows,{id:e.id}),c.ivrCampaignHopperBlacks.count-=1,c.ivrCampaignHopperBlacks.rows.length||c.getIvrCampaignHopperBlacks(),r.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHopperBlacks())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.contacts={},c.ivrCampaign={},c.ivrCampaignHopperFinals={count:0,rows:[]},c.selectedIvrCampaignHopperFinals=[],c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},c.init=function(e){c.ivrCampaign=e,c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHopperFinals()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHopperFinals=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHopperFinals(c.query,p).$promise},c.createOrEditIvrCampaignHopperFinal=function(e,t){o.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopperFinal:t,hopperFinals:c.ivrCampaignHopperFinals.rows,license:null,setting:null}})},c.exportSelectedIvrCampaignHopperFinals=function(){var e=angular.copy(c.selectedIvrCampaignHopperFinals);return c.selectedIvrCampaignHopperFinals=[],e},c.deleteIvrCampaignHopperFinal=g,c.deleteSelectedIvrCampaignHopperFinals=function(e){var t=o.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+c.selectedIvrCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedIvrCampaignHopperFinals.forEach(function(e){g(e)}),c.selectedIvrCampaignHopperFinals=[]})},c.moveIvrCampaignHopperFinal=v,c.moveContactsIvrCampaignHopperFinal=function(e){l.cmHopperFinal.moveContactsIvrCampaignHopperFinal({id:c.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?r.info({title:"Restored Contacts",msg:"0"}):r.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.countContactsIvrCampaignHopperFinal=function(e){l.cmHopperFinal.countContactsIvrCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(c.contacts,e[0])}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.moveConfirm=function(e,t){var n=o.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){v(e)},function(){console.log("CANCEL")})},c.moveSelectedIvrCampaignHopperFinals=function(e){var t=o.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedIvrCampaignHopperFinals.forEach(function(e){v(e)}),c.selectedIvrCampaignHopperFinals=[]})};var m=!0,u=1;function p(e){c.ivrCampaignHopperFinals=e||{count:0,rows:[]}}function g(e){l.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHopperFinals.rows,{id:e.id}),c.ivrCampaignHopperFinals.count-=1,c.ivrCampaignHopperFinals.rows.length||c.getIvrCampaignHopperFinals(),r.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){l.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){r.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var t,n;"Not Found"===e.data?l.cmHopper.save((t=a,n={},n.phone=t.calleridnum,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=0,n.countcongestionretry=0,n.countnoanswerretry=0,n.countglobal=0,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=t.deleted?null:t.UserId,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.priority=t.recallme?3:2,n.recallme=!!t.recallme,n)).$promise.then(function(e){var t,n;r.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&l.cmHopperHistory.save(((n={}).calleridnum=(t=a).calleridnum,n.calleridname=t.calleridname,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=t.countbusyretry,n.countcongestionretry=t.countcongestionretry,n.countnoanswerretry=t.countnoanswerretry,n.countglobal=t.countglobal,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=d.getCurrentUser().id,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),n.edited=!0,n.state=25,n.statedesc="Restored",n.campaign=t.campaign,n.campaigntype=t.VoiceQueueId?"queue":"ivr",n))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):r.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHopperFinals())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.ivrCampaign={},c.ivrCampaignHopperHistories={count:0,rows:[]},c.selectedIvrCampaignHopperHistories=[],c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},c.init=function(e){c.ivrCampaign=e,c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHopperHistories()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHopperHistories=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHopperHistories(c.query,p).$promise},c.createOrEditIvrCampaignHopperHistory=function(e,t){o.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopperHistory:t,hopperHistories:c.ivrCampaignHopperHistories.rows,license:null,setting:null}})},c.exportSelectedIvrCampaignHopperHistories=function(){var e=angular.copy(c.selectedIvrCampaignHopperHistories);return c.selectedIvrCampaignHopperHistories=[],e},c.deleteIvrCampaignHopperHistory=g,c.deleteSelectedIvrCampaignHopperHistories=function(e){var t=o.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+c.selectedIvrCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedIvrCampaignHopperHistories.forEach(function(e){g(e)}),c.selectedIvrCampaignHopperHistories=[]})};var m=!0,u=1;function p(e){c.ivrCampaignHopperHistories=e||{count:0,rows:[]}}function g(e){l.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHopperHistories.rows,{id:e.id}),c.ivrCampaignHopperHistories.count-=1,c.ivrCampaignHopperHistories.rows.length||c.getIvrCampaignHopperHistories(),r.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHopperHistories())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.ivrCampaign={},c.ivrCampaignHoppers={count:0,rows:[]},c.selectedIvrCampaignHoppers=[],c.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,scheduledat,priority",sort:"-updatedAt",limit:10,page:1},c.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e){c.ivrCampaign=e,c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHoppers()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHoppers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHoppers(c.query,p).$promise},c.createOrEditIvrCampaignHopper=function(e,t){o.show({controller:"CreateOrEditHopperCampaignIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopper:t,hoppers:c.ivrCampaignHoppers.rows,license:null,setting:null}})},c.exportSelectedIvrCampaignHoppers=function(){var e=angular.copy(c.selectedIvrCampaignHoppers);return c.selectedIvrCampaignHoppers=[],e},c.deleteIvrCampaignHopper=g,c.deleteSelectedIvrCampaignHoppers=function(e){var t=o.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+c.selectedIvrCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedIvrCampaignHoppers.forEach(function(e){g(e)}),c.selectedIvrCampaignHoppers=[]})},l.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){c.agents=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.ivrCampaignHoppers=e||{count:0,rows:[]}}function g(e){l.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHoppers.rows,{id:e.id}),c.ivrCampaignHoppers.count-=1,c.ivrCampaignHoppers.rows.length||c.getIvrCampaignHoppers(),r.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHoppers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHoppersController",e)}(),function(){"use strict";function e(e,t,n,a,s,i,o,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MOTIONDIALER.EDIT_HOPPER",m.hopper=angular.copy(o),m.hoppers=i,m.newHopper=!1,m.hopper||(m.hopper={},m.title="MOTIONDIALER.NEW_HOPPER",m.newHopper=!0),t.params.id&&(m.hopper.CampaignId=t.params.id),m.addNewHopper=function(){m.errors=[],r.cmHopper.save(m.hopper).$promise.then(function(e){m.hoppers.unshift(e.toJSON()),s.success({title:"Hopper properly created",msg:m.hopper.name?m.hopper.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var t=0;t<e.data.errors.length;t+=1)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveHopper=function(){var n,a,i,o;m.errors=[],m.hopper.UserId=m.hopper.recallme?m.hopper.UserId:null,r.cmHopper.get({id:m.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){n=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){r.cmHopper.update({id:m.hopper.id},_.omit(m.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,r.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){r.campaign.get({raw:!1,id:a.CampaignId,attributes:["name"]}).$promise.then(function(e){o=e.name}).catch(function(e){o=void 0}).finally(function(){r.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:n,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:o,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:l.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme})})});var t=_.find(m.hoppers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),s.success({title:"Hopper properly saved!",msg:m.hopper.name?m.hopper.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},m.deleteHopper=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cmHopper.delete({id:m.hopper.id}).$promise.then(function(){_.remove(m.hoppers,{id:m.hopper.id}),s.success({title:"Hopper properly deleted!",msg:(m.hopper.name||"hopper")+" has been deleted!"}),u(m.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","hoppers","hopper","api","Auth","license","setting"],angular.module("app.motiondialer").controller("CreateOrEditHopperCampaignIdDialogController",e)}(),function(){"use strict";function e(n,a){var i=this;i.ivrCampaign={},i.init=function(t){i.ivrCampaign=t,n.cmHopper.get({limit:0,CampaignId:t.id}).$promise.then(function(e){return i.total=e.count||0,n.cmHopper.get({limit:0,CampaignId:t.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,n.cmHopperFinal.get({limit:0,CampaignId:t.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("IvrCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,n,a,t,i,o){var s=this;s.ivrCampaign=t,s.items=[],s.selectedItems=[],s.loading=!1,s.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:i.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){s.loading=!0,a.campaign[t?"removeLists":"addLists"]({id:s.ivrCampaign.id,ids:_.map(e,"id")}).$promise.then(function(){n.success({title:"List properly "+(t?"removed":"added"),msg:"List has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ivrCampaign.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){s.loading=!1})}},s.closeDialog=function(){e.hide()},a.campaign.getLists({id:s.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return s.selectedItems=e.rows?e.rows:[],s.dualMultiselectOptions.selectedItems=s.selectedItems,a.cmList.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){s.items=e.rows?e.rows:[],s.dualMultiselectOptions.items=_.differenceBy(s.items,s.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","ivrCampaign","$translate","$timeout"],angular.module("app.motiondialer").controller("IvrCampaignlistaddController",e)}(),function(){"use strict";function e(e,t,a,i,o,n,s,r){var l=this;function d(){t.hide()}function c(e,t){var n=t.id;s.enqueue(function(){return i.campaign.removeLists({id:e,ids:n}).$promise.then(function(){return i.campaign.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=n||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,t){return-1<t.indexOf(e)},l.toggle=function(e,t){var n=t.indexOf(e);-1<n?t.splice(n,1):t.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,t){for(var n=0;n<l.selected.length;n+=1)c(o.id,l.selected[n]);var a;a=e,s.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","ivrCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("IvrCampaignresetlistController",e)}(),function(){"use strict";function e(n,e,i,o,t,a,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=t,c.setting=a,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.ivrCampaign=d||n.params.ivrCampaign||{},c.selectedTab=n.params.tab||0,c.listadddialog=function(e,t){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:c.ivrCampaigns?c.ivrCampaigns.rows:[]}})},c.blacklistadddialog=function(e,t){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:c.ivrCampaigns?c.ivrCampaigns.rows:[]}})},c.resetlistdialog=function(t,n){s.campaign.getLists({id:t.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))r.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(n).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,t,n;e=c.ivrCampaign.id,t=a.rows[0],n=t.id,s.campaign.removeLists({id:e,ids:n}).$promise.then(function(){return s.campaign.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){r.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ivrCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"IvrCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",parent:angular.element(o.body),targetEvent:n,clickOutsideToClose:!1,locals:{ivrCampaign:t,listsCampaign:a?a.rows:[]}})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.gotogoto=function(e,t){n.go("app.motiondialer.realtime.ivr_campaigns",{})},c.alert=r.info,c.gotoIvrCampaigns=function(){n.go("app.motiondialer.ivrCampaigns")},c.saveIvrCampaign=function(){s.campaign.update({id:c.ivrCampaign.id},c.ivrCampaign).$promise.then(function(){r.success({title:"IvrCampaign updated!",msg:c.ivrCampaign.name?c.ivrCampaign.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.trunks=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.projects=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){c.interval=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","ivrCampaign"],angular.module("app.motiondialer").controller("IvrCampaignController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.ivrCampaigns=r||{count:0,rows:[]},v.table="ivrCampaigns",v.listOrder="",v.listOrderAsc=null,v.selectedIvrCampaigns=[],v.query={fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,page:1},v.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.motiondialer.ivrCampaigns.edit",{id:e.id,ivrCampaign:e})},v.listadddialog=function(e,t){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:v.ivrCampaigns?v.ivrCampaigns.rows:[]}})},v.blacklistadddialog=function(e,t){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:v.ivrCampaigns?v.ivrCampaigns.rows:[]}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the ivrCampaign?").htmlContent("<b>"+(e.name||"ivrCampaign")+"</b> will be deleted.").ariaLabel("delete ivrCampaign").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.motiondialer.realtime.ivr_campaigns",{})},v.success=f,v.getIvrCampaigns=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.campaign.get(v.query,f).$promise},v.createOrEditIvrCampaign=function(e,t){i.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:t,ivrCampaigns:v.ivrCampaigns.rows,license:v.license,setting:v.setting}})},v.deleteIvrCampaign=A,v.exportSelectedIvrCampaigns=function(){var e=angular.copy(v.selectedIvrCampaigns);return v.selectedIvrCampaigns=[],e},v.deleteSelectedIvrCampaigns=function(e){var t=i.confirm().title("Are you sure want to delete the selected ivrCampaigns?").htmlContent("<b>"+v.selectedIvrCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete IvrCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedIvrCampaigns.forEach(function(e){A(e)}),v.selectedIvrCampaigns=[]})},v.deselectIvrCampaigns=function(){v.selectedIvrCampaigns=[]},v.selectAllIvrCampaigns=function(){v.selectedIvrCampaigns=v.ivrCampaigns.rows},l.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.trunks=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.projects=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){v.interval=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.ivrCampaigns=e||{count:0,rows:[]}}function A(e){l.campaign.delete({id:e.id}).$promise.then(function(){_.remove(v.ivrCampaigns.rows,{id:e.id}),v.ivrCampaigns.count-=1,v.ivrCampaigns.rows.length||v.getIvrCampaigns(),c.success({title:"IvrCampaign deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcampaign"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getIvrCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","ivrCampaigns","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.motiondialer").controller("IvrCampaignsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MOTIONDIALER.EDIT_QUEUECAMPAIGN",m.queueCampaign=angular.copy(s),m.queueCampaigns=o,m.newQueueCampaign=!1,m.queueCampaign||(m.queueCampaign={dialActive:!0,type:"outbound",dialCheckDuplicateType:"always",autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no",dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3,dialMethod:"progressive",dialPowerLevel:1,dialPredictiveOptimization:"dropRate",dialPredictiveOptimizationPercentage:3,dialPredictiveInterval:10,dialLimitQueue:0,dialOriginateTimeout:30,dialQueueOptions:"tTxX",dialQueueTimeout:3,strategy:"rrmemory",timeout:3,retry:3,weight:1,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150},m.title="MOTIONDIALER.NEW_QUEUECAMPAIGN",m.newQueueCampaign=!0),m.addNewQueueCampaign=function(){m.errors=[],r.voiceQueue.save(m.queueCampaign).$promise.then(function(e){m.queueCampaigns.unshift(e.toJSON()),i.success({title:"QueueCampaign properly created",msg:m.queueCampaign.name?m.queueCampaign.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveQueueCampaign=function(){m.errors=[],r.voiceQueue.update({id:m.queueCampaign.id},m.queueCampaign).$promise.then(function(e){var t=_.find(m.queueCampaigns,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"QueueCampaign properly saved!",msg:m.queueCampaign.name?m.queueCampaign.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteQueueCampaign=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The queueCampaign will be deleted.").ariaLabel("Delete QueueCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceQueue.delete({id:m.queueCampaign.id}).$promise.then(function(){_.remove(m.queueCampaigns,{id:m.queueCampaign.id}),i.success({title:"QueueCampaign properly deleted!",msg:(m.queueCampaign.name||"queueCampaign")+" has been deleted!"}),u(m.queueCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.trunks=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){m.interval=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","queueCampaigns","queueCampaign","api","Auth","license","setting"],angular.module("app.motiondialer").controller("CreateOrEditQueueCampaignDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.voiceQueue[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.queueCampaign.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserQueueCampaign?"penalty "+e.UserQueueCampaign.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserQueueCampaign?"penalty "+e.UserQueueCampaign.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.queueCampaign=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("MOTIONDIALER.ALL_AGENTS"),labelSelected:s.instant("MOTIONDIALER.SELECTED_AGENTS"),transferCallback:function(e,t){a.voiceQueue[t?"removeAgents":"addAgents"]({id:l.queueCampaign.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"QueueCampaign properly "+(t?"removed":"added"),msg:"QueueCampaign has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:voiceQueue.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","queueCampaign","queueCampaigns","realtime","$translate","Auth"],angular.module("app.motiondialer").controller("QueueCampaignagentaddController",e)}(),function(){"use strict";function e(e,n,a,t,i,o){var s=this;s.queueCampaign=t,s.items=[],s.selectedItems=[],s.loading=!1,s.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:i.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){s.loading=!0,a.voiceQueue[t?"removeBlackLists":"addBlackLists"]({id:s.queueCampaign.id,ids:_.map(e,"id")}).$promise.then(function(){n.success({title:"List properly "+(t?"removed":"added"),msg:"List has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){s.loading=!1})}},s.closeDialog=function(){e.hide()},a.voiceQueue.getBlackLists({id:s.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return s.selectedItems=e.rows?e.rows:[],s.dualMultiselectOptions.selectedItems=s.selectedItems,a.cmList.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){s.items=e.rows?e.rows:[],s.dualMultiselectOptions.items=_.differenceBy(s.items,s.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","queueCampaign","$translate","$timeout"],angular.module("app.motiondialer").controller("QueueCampaignblacklistaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.queueCampaign={},c.queueCampaignHopperBlacks={count:0,rows:[]},c.selectedQueueCampaignHopperBlacks=[],c.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},c.init=function(e){c.queueCampaign=e,c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHopperBlacks()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHopperBlacks=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHopperBlacks(c.query,p).$promise},c.createOrEditQueueCampaignHopperBlack=function(e,t){o.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopperBlack:t,hopperBlacks:c.queueCampaignHopperBlacks.rows,license:null,setting:null}})},c.exportSelectedQueueCampaignHopperBlacks=function(){var e=angular.copy(c.selectedQueueCampaignHopperBlacks);return c.selectedQueueCampaignHopperBlacks=[],e},c.deleteQueueCampaignHopperBlack=g,c.deleteSelectedQueueCampaignHopperBlacks=function(e){var t=o.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+c.selectedQueueCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedQueueCampaignHopperBlacks.forEach(function(e){g(e)}),c.selectedQueueCampaignHopperBlacks=[]})};var m=!0,u=1;function p(e){c.queueCampaignHopperBlacks=e||{count:0,rows:[]}}function g(e){l.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHopperBlacks.rows,{id:e.id}),c.queueCampaignHopperBlacks.count-=1,c.queueCampaignHopperBlacks.rows.length||c.getQueueCampaignHopperBlacks(),r.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHopperBlacks())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.contacts={},c.queueCampaign={},c.queueCampaignHopperFinals={count:0,rows:[]},c.selectedQueueCampaignHopperFinals=[],c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},c.init=function(e){c.queueCampaign=e,c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHopperFinals()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHopperFinals=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHopperFinals(c.query,p).$promise},c.createOrEditQueueCampaignHopperFinal=function(e,t){o.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopperFinal:t,hopperFinals:c.queueCampaignHopperFinals.rows,license:null,setting:null}})},c.exportSelectedQueueCampaignHopperFinals=function(){var e=angular.copy(c.selectedQueueCampaignHopperFinals);return c.selectedQueueCampaignHopperFinals=[],e},c.deleteQueueCampaignHopperFinal=g,c.deleteSelectedQueueCampaignHopperFinals=function(e){var t=o.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+c.selectedQueueCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedQueueCampaignHopperFinals.forEach(function(e){g(e)}),c.selectedQueueCampaignHopperFinals=[]})},c.moveQueueCampaignHopperFinal=v,c.moveContactsQueueCampaignHopperFinal=function(e){l.cmHopperFinal.moveContactsQueueCampaignHopperFinal({id:c.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?r.info({title:"Restored Contacts",msg:"0"}):r.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.countContactsQueueCampaignHopperFinal=function(e){l.cmHopperFinal.countContactsQueueCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(c.contacts,e[0])}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.moveConfirm=function(e,t){var n=o.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){v(e)},function(){console.log("CANCEL")})},c.moveSelectedQueueCampaignHopperFinals=function(e){var t=o.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedQueueCampaignHopperFinals.forEach(function(e){v(e)}),c.selectedQueueCampaignHopperFinals=[]})};var m=!0,u=1;function p(e){c.queueCampaignHopperFinals=e||{count:0,rows:[]}}function g(e){l.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHopperFinals.rows,{id:e.id}),c.queueCampaignHopperFinals.count-=1,c.queueCampaignHopperFinals.rows.length||c.getQueueCampaignHopperFinals(),r.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){l.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){r.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var t,n;"Not Found"===e.data?l.cmHopper.save((t=a,n={},n.phone=t.calleridnum,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=0,n.countcongestionretry=0,n.countnoanswerretry=0,n.countglobal=0,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=t.deleted?null:t.UserId,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.priority=t.recallme?3:2,n.recallme=!!t.recallme,n)).$promise.then(function(e){var t,n;r.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&l.cmHopperHistory.save(((n={}).calleridnum=(t=a).calleridnum,n.calleridname=t.calleridname,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=t.countbusyretry,n.countcongestionretry=t.countcongestionretry,n.countnoanswerretry=t.countnoanswerretry,n.countglobal=t.countglobal,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=d.getCurrentUser().id,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),n.edited=!0,n.state=25,n.statedesc="Restored",n.campaign=t.campaign,n.campaigntype=t.VoiceQueueId?"queue":"ivr",n))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):r.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHopperFinals())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.queueCampaign={},c.queueCampaignHopperHistories={count:0,rows:[]},c.selectedQueueCampaignHopperHistories=[],c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},c.init=function(e){c.queueCampaign=e,c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHopperHistories()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHopperHistories=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHopperHistories(c.query,p).$promise},c.createOrEditQueueCampaignHopperHistory=function(e,t){o.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopperHistory:t,hopperHistories:c.queueCampaignHopperHistories.rows,license:null,setting:null}})},c.exportSelectedQueueCampaignHopperHistories=function(){var e=angular.copy(c.selectedQueueCampaignHopperHistories);return c.selectedQueueCampaignHopperHistories=[],e},c.deleteQueueCampaignHopperHistory=g,c.deleteSelectedQueueCampaignHopperHistories=function(e){var t=o.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+c.selectedQueueCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedQueueCampaignHopperHistories.forEach(function(e){g(e)}),c.selectedQueueCampaignHopperHistories=[]})};var m=!0,u=1;function p(e){c.queueCampaignHopperHistories=e||{count:0,rows:[]}}function g(e){l.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHopperHistories.rows,{id:e.id}),c.queueCampaignHopperHistories.count-=1,c.queueCampaignHopperHistories.rows.length||c.getQueueCampaignHopperHistories(),r.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHopperHistories())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.queueCampaign={},c.queueCampaignHoppers={count:0,rows:[]},c.selectedQueueCampaignHoppers=[],c.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,scheduledat,priority,recallme,UserId",sort:"-updatedAt",limit:10,page:1},c.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e){c.queueCampaign=e,c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHoppers()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHoppers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHoppers(c.query,p).$promise},c.createOrEditQueueCampaignHopper=function(e,t){o.show({controller:"CreateOrEditHopperVoiceQueueIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopper:t,hoppers:c.queueCampaignHoppers.rows,license:null,setting:null}})},c.exportSelectedQueueCampaignHoppers=function(){var e=angular.copy(c.selectedQueueCampaignHoppers);return c.selectedQueueCampaignHoppers=[],e},c.deleteQueueCampaignHopper=g,c.deleteSelectedQueueCampaignHoppers=function(e){var t=o.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+c.selectedQueueCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedQueueCampaignHoppers.forEach(function(e){g(e)}),c.selectedQueueCampaignHoppers=[]})},l.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){c.agents=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.queueCampaignHoppers=e||{count:0,rows:[]}}function g(e){l.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHoppers.rows,{id:e.id}),c.queueCampaignHoppers.count-=1,c.queueCampaignHoppers.rows.length||c.getQueueCampaignHoppers(),r.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHoppers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHoppersController",e)}(),function(){"use strict";function e(e,t,n,a,s,i,o,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MOTIONDIALER.EDIT_HOPPER",m.hopper=angular.copy(o),m.hoppers=i,m.newHopper=!1,m.hopper||(m.hopper={},m.title="MOTIONDIALER.NEW_HOPPER",m.newHopper=!0),t.params.id&&(m.hopper.VoiceQueueId=t.params.id),m.addNewHopper=function(){m.errors=[],r.cmHopper.save(m.hopper).$promise.then(function(e){m.hoppers.unshift(e.toJSON()),s.success({title:"Hopper properly created",msg:m.hopper.name?m.hopper.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var t=0;t<e.data.errors.length;t+=1)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveHopper=function(){var n,a,i,o;m.errors=[],m.hopper.UserId=m.hopper.recallme?m.hopper.UserId:null,r.cmHopper.get({id:m.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){n=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){r.cmHopper.update({id:m.hopper.id},_.omit(m.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,r.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){r.voiceQueue.get({raw:!1,id:a.VoiceQueueId,attributes:["name"]}).$promise.then(function(e){o=e.name}).catch(function(e){o=void 0}).finally(function(){r.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:n,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:o,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:l.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme})})});var t=_.find(m.hoppers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),s.success({title:"Hopper properly saved!",msg:m.hopper.name?m.hopper.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},m.deleteHopper=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cmHopper.delete({id:m.hopper.id}).$promise.then(function(){_.remove(m.hoppers,{id:m.hopper.id}),s.success({title:"Hopper properly deleted!",msg:(m.hopper.name||"hopper")+" has been deleted!"}),u(m.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","hoppers","hopper","api","Auth","license","setting"],angular.module("app.motiondialer").controller("CreateOrEditHopperVoiceQueueIdDialogController",e)}(),function(){"use strict";function e(n,a){var i=this;i.queueCampaign={},i.init=function(t){i.queueCampaign=t,n.cmHopper.get({limit:0,VoiceQueueId:t.id}).$promise.then(function(e){return i.total=e.count||0,n.cmHopper.get({limit:0,VoiceQueueId:t.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,n.cmHopperFinal.get({limit:0,VoiceQueueId:t.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("QueueCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,n,a,t,i,o){var s=this;s.queueCampaign=t,s.items=[],s.selectedItems=[],s.loading=!1,s.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:i.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){s.loading=!0,a.voiceQueue[t?"removeLists":"addLists"]({id:s.queueCampaign.id,ids:_.map(e,"id")}).$promise.then(function(){n.success({title:"List properly "+(t?"removed":"added"),msg:"List has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){s.loading=!1})}},s.closeDialog=function(){e.hide()},a.voiceQueue.getLists({id:s.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return s.selectedItems=e.rows?e.rows:[],s.dualMultiselectOptions.selectedItems=s.selectedItems,a.cmList.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){s.items=e.rows?e.rows:[],s.dualMultiselectOptions.items=_.differenceBy(s.items,s.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","queueCampaign","$translate","$timeout"],angular.module("app.motiondialer").controller("QueueCampaignlistaddController",e)}(),function(){"use strict";function e(e,t,a,i,o,n,s,r){var l=this;function d(){t.hide()}function c(e,t){var n=t.id;s.enqueue(function(){return i.voiceQueue.removeLists({id:e,ids:n}).$promise.then(function(){return i.voiceQueue.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=n||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,t){return-1<t.indexOf(e)},l.toggle=function(e,t){var n=t.indexOf(e);-1<n?t.splice(n,1):t.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,t){for(var n=0;n<l.selected.length;n+=1)c(o.id,l.selected[n]);var a;a=e,s.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","queueCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("QueueCampaignresetlistController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.queueCampaign=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("MOTIONDIALER.ALL_TEAMS"),labelSelected:i.instant("MOTIONDIALER.SELECTED_TEAMS"),transferCallback:function(e,t){a.voiceQueue[t?"removeTeams":"addTeams"]({id:o.queueCampaign.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.voiceQueue.getTeams({id:o.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","queueCampaign","$translate"],angular.module("app.motiondialer").controller("QueueCampaignteamaddController",e)}(),function(){"use strict";function e(n,e,i,o,t,a,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=t,c.setting=a,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.queueCampaign=d||n.params.queueCampaign||{},c.selectedTab=n.params.tab||0,c.listadddialog=function(e,t){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:c.queueCampaigns?c.queueCampaigns.rows:[]}})},c.blacklistadddialog=function(e,t){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:c.queueCampaigns?c.queueCampaigns.rows:[]}})},c.teamadddialog=function(e,t){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:c.queueCampaigns?c.queueCampaigns.rows:[]}})},c.agentadddialog=function(e,t){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:c.queueCampaigns?c.queueCampaigns.rows:[],realtime:!1}})},c.resetlistdialog=function(t,n){s.voiceQueue.getLists({id:t.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))r.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(n).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,t,n;e=c.queueCampaign.id,t=a.rows[0],n=t.id,s.voiceQueue.removeLists({id:e,ids:n}).$promise.then(function(){return s.voiceQueue.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){r.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"QueueCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",parent:angular.element(o.body),targetEvent:n,clickOutsideToClose:!1,locals:{queueCampaign:t,listsCampaign:a?a.rows:[]}})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.gotogoto=function(e,t){n.go("app.motiondialer.realtime.queues",{})},c.alert=r.info,c.gotoQueueCampaigns=function(){n.go("app.motiondialer.queueCampaigns")},c.saveQueueCampaign=function(){s.voiceQueue.update({id:c.queueCampaign.id},c.queueCampaign).$promise.then(function(){r.success({title:"QueueCampaign updated!",msg:c.queueCampaign.name?c.queueCampaign.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceMusicOnHold.get({fields:"name",nolimit:"true"}).$promise.then(function(e){c.musiconholds=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.trunks=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.squareProject.get({fields:"name",sort:"name"}).$promise.then(function(e){c.projects=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){c.interval=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","queueCampaign"],angular.module("app.motiondialer").controller("QueueCampaignController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.queueCampaigns=r||{count:0,rows:[]},v.table="queueCampaigns",v.listOrder="",v.listOrderAsc=null,v.selectedQueueCampaigns=[],v.query={fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},v.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraydialMethod=_.keyBy([{option:"Progressive",value:"'progressive'"},{option:"PowerDialing",value:"'power'"},{option:"Predictive",value:"'predictive'"},{option:"Preview",value:"'preview'"},{option:"BookedProgressive",value:"'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraydialPredictiveOptimization=_.keyBy([{option:"AgentBusyFactor",value:"'agentBusyFactor'"},{option:"DropRate",value:"'dropRate'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraystrategy=_.keyBy([{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Round Robin",value:"'roundrobin'",ngIf:"vm.queueCampaign.dialMethod === 'booked'"},{option:"Least Recent",value:"'leastrecent'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Fewest Calls",value:"'fewestcalls'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Random",value:"'random'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Linear",value:"'linear'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Weight Random",value:"'wrandom'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.motiondialer.queueCampaigns.edit",{id:e.id,queueCampaign:e})},v.listadddialog=function(e,t){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:v.queueCampaigns?v.queueCampaigns.rows:[]}})},v.blacklistadddialog=function(e,t){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:v.queueCampaigns?v.queueCampaigns.rows:[]}})},v.teamadddialog=function(e,t){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:v.queueCampaigns?v.queueCampaigns.rows:[]}})},v.agentadddialog=function(e,t){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:v.queueCampaigns?v.queueCampaigns.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the queueCampaign?").htmlContent("<b>"+(e.name||"queueCampaign")+"</b> will be deleted.").ariaLabel("delete queueCampaign").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.motiondialer.realtime.queues",{})},v.success=f,v.getQueueCampaigns=function(){v.query.offset=(v.query.page-1)*v.query.limit,m.hasRole("admin")?v.promise=l.voiceQueue.get(v.query,f).$promise:(v.query.id=v.currentUser.id,v.promise=l.user.getQueues(v.query,f).$promise)},v.createOrEditQueueCampaign=function(e,t){i.show({controller:"CreateOrEditQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:t,queueCampaigns:v.queueCampaigns.rows,license:v.license,setting:v.setting}})},v.deleteQueueCampaign=A,v.exportSelectedQueueCampaigns=function(){var e=angular.copy(v.selectedQueueCampaigns);return v.selectedQueueCampaigns=[],e},v.deleteSelectedQueueCampaigns=function(e){var t=i.confirm().title("Are you sure want to delete the selected queueCampaigns?").htmlContent("<b>"+v.selectedQueueCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete QueueCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedQueueCampaigns.forEach(function(e){A(e)}),v.selectedQueueCampaigns=[]})},v.deselectQueueCampaigns=function(){v.selectedQueueCampaigns=[]},v.selectAllQueueCampaigns=function(){v.selectedQueueCampaigns=v.queueCampaigns.rows},l.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.trunks=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){v.interval=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.queueCampaigns=e||{count:0,rows:[]}}function A(e){l.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(v.queueCampaigns.rows,{id:e.id}),v.queueCampaigns.count-=1,v.queueCampaigns.rows.length||v.getQueueCampaigns(),c.success({title:"QueueCampaign deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getQueueCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","queueCampaigns","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.motiondialer").controller("QueueCampaignsController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d,c,m){var u=this,p=!0;function g(){var e=i.localStorage.getItem("motion2.realtime.abandoned.bull.contacts:"+u.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(u.query=_.merge(e.query,_.omit(u.query,["sort","limit","page"])),u.query=_.omit(u.query,"filter")),s.voiceDisposition.get().$promise.then(function(e){u.disposition=e?e.rows:[]}).catch(function(e){console.log(e)}),s.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){u.queues=e||{count:0,rows:[]},u.queuesMap=_.mapValues(_.keyBy(u.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){u.getContacts()})}function v(e){u.contacts=e||{count:0,rows:[]},p=!1,u.refresh=!0}u.showTooltip=!1,u.refresh=!0,u.disable=[],u.agents=m||[],u.currentUser=r.getCurrentUser(),u.localizationMap=c,u.pickerModel={dateStart:null,dateEnd:null},u.queues={},u.contacts={count:0,rows:[]},u.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},u.clearAll=function(){u.query.dateStart=void 0,u.query.dateEnd=void 0,u.pickerModel={dateStart:null,dateEnd:null},u.getContacts()},u.getContacts=function(){u.refresh=!1,u.query.dateStart=void 0,u.query.dateEnd=void 0,u.pickerModel.dateStart&&!p&&(u.query.dateStart=u.pickerModel.dateStart,u.query.dateEnd=u.pickerModel.dateEnd);u.query.queue=u.query.queue,u.query.offset=(u.query.page-1)*u.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.bull.contacts:"+u.currentUser.id,JSON.stringify({query:_.omit(u.query,"queue")})),u.promise=s.voiceQueueReport.getVoiceQueuesReport(u.query,v).$promise},u.refreshContacts=function(){u.showTooltip=!1,u.getContacts()},u.onInit=g,u.assignedA=function(e,t){e&&(u.disable[e.id]=!0,s.voiceQueueReport.update({id:e.id,lastAssignedTo:t?t.name:null,assigned:!!t}).$promise.catch(function(e){console.log(e)}).finally(function(){u.disable[e.id]=!1}))},u.disposed=function(e,t){e&&s.voiceQueueReport.update({id:e.id,disposition:t||null}).$promise.catch(function(e){console.log(e)})},u.onSavevoiceQueueReport=function(e){e&&u.queuesMap&&"outbound"===e.type&&u.queuesMap[e.queue]&&(u.showTooltip=!0)},u.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(u.contacts.rows,["id",e.id]);0<=t&&_.merge(u.contacts.rows[t],e)}},l.onWithoutApply("voiceQueueReport:save",u.onSavevoiceQueueReport),l.on("voiceQueueReport:update",u.onUpdatevoiceQueueReport),g();var h=!0,b=1;e.$watch("vm.query.filter",function(e,t){h?n(function(){h=!1}):(t||(b=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=b),u.getContacts())}),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory","agents"],angular.module("app.motiondialer").controller("AbandonedCallsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,s,t,n,a,i,o,r,l,d,c,m,u,p,g,v){var h=this,b=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum"],f=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var A in h.availableStates=["ringing","inuse","busy","onhold","not_inuse"],h.pauses=o||{count:0,rows:[]},h.license=g,h.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},h.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},h.paginatedAgents={},h.load=!1,h.order=[],h.agentInternal={},h.agents)h.agents.hasOwnProperty(A)&&(h.agents[A].init=!0);h.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},h.logout=function(e,t){return d.user.logout({id:e.id}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),h.agents[e.id]&&(h.agents[e.id].online=!1),h.rpcAgents[e.id]&&(h.rpcAgents[e.id].online=!1),y()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"voice",realtime:!0,direction:"outbound"}})},h.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},h.getAgentStatus=C,h.getAgentGlobalStatus=x,h.isPause=S,h.checkPause=function(e){return"pause"===e},h.isPartialPause=function(e){return"*pause"===e},h.onSave=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(_.omit(e,f),b)),_.merge(h.rpcAgents[e.id],_.pick(_.omit(e,f),b)),x(h.agents[e.id]))},h.onUpdate=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(e,b)),_.merge(h.rpcAgents[e.id],_.pick(e,b)),x(h.agents[e.id]))},h.onInit=y,h.onConnect=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(_.merge(h.agents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(h.rpcAgents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},h.onComplete=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(h.agents[h.agentInternal[e.destaccountcode]]=_.omit(h.agents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),h.rpcAgents[h.agentInternal[e.destaccountcode]]=_.omit(h.rpcAgents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",h.onSave),c.on("user:update",h.onUpdate),c.on("user:agentconnect",h.onConnect),c.on("user:agentcomplete",h.onComplete),y();var E=v(function(){h.load&&(h.load=!1,y())},999);function y(e){h.load=!1;var t,n,a=s.defer();h.promise=a.promise,h.filteredAgents=[],h.order=[],_.forIn(h.agents,function(e,t){h.rpcAgents[t]&&_.merge(e,_.pick(_.omit(h.rpcAgents[t],f),b)),x(e),e.online?(h.filteredAgents.push(e),h.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),h.query.globalStatusFilter&&_.remove(h.filteredAgents,function(e){return e.globalStatus!==h.query.globalStatusFilter}),h.query.pauseTypeFilter&&_.remove(h.filteredAgents,function(e){return e.pauseType!==h.query.pauseTypeFilter}),h.query.filter&&_.remove(h.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(h.query.filter.toLowerCase())<0}),h.filteredAgents=(t=h.filteredAgents,n=_.startsWith(h.query.order,"-")?"desc":"asc",_.orderBy(t,[h.query.order.replace("-","")],[n]));var i=(h.query.page-1)*h.query.limit;h.paginatedAgents=_.drop(h.filteredAgents,i).slice(0,h.query.limit);for(var o=0;o<h.paginatedAgents.length;o+=1)h.order.push(h.paginatedAgents[o].id);a.resolve(),h.load=!0}function S(e){return"pause"===e||"*pause"===e}function T(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function C(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function x(e){var t="unknown";t=_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"pause":_.some([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"*pause":_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],T)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=S(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),E&&(v.cancel(E),E=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","Auth","license","$interval"],angular.module("app.voice").controller("AgentsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,a,i,t,o,s,r,l,d){var c=this,m=["name","active","limitCalls","message","originated","IntervalId","SquareProjectId","Trunk","TrunkId","ivrAnswerCallsDay","dialQueueProject","ivrTotalCallsDays","description"];function u(){_.forIn(c.campaigns,function(e,t){c.rpcCampaigns[t]&&_.merge(e,_.pick(c.rpcCampaigns[t],m))})}c.count=s.count,c.campaigns=s?_.keyBy(s.rows?s.rows:[],"id"):{},c.rpcCampaigns=o?_.keyBy(o.rows?o.rows:[],"id"):{},c.query={sort:"-updatedAt",limit:10,page:1},c.success=v,c.getCampaigns=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=r.campaign.get(c.query,v).$promise},c.onSave=function(e){c.campaigns[e.id]&&(_.merge(c.campaigns[e.id],_.pick(e,m)),_.merge(c.rpcCampaigns[e.id],_.pick(e,m)))},c.$onInit=u,c.createOrEditIvrCampaign=function(e,t){a.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:t,ivrCampaigns:_.values(c.campaigns),license:null,setting:null}})},l.onWithoutApply("campaign:save",c.onSave),c.interval=t(function(){},999);var p=!0,g=1;function v(e){c.count=e.count,c.campaigns=e?_.keyBy(e.rows?e.rows:[],"id"):{},u()}e.$watch("vm.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getCampaigns())}),e.$on("$destroy",function(){l.removeAllListeners("campaign:save"),c.interval&&t.cancel(c.interval)})}e.$inject=["$scope","$timeout","$mdDialog","$document","$interval","rpcCampaigns","campaigns","api","socket","Auth"],angular.module("app.motiondialer").controller("IvrCampaignsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,o,s,r,l){var d=this;d.agents=n||{count:0,rows:[]},d.rpcVoiceQueuesChannels=i?_.keyBy(i.rows?_.filter(i.rows,{type:"outbound"}):[],"uniqueid"):{},d.queryChannels={limit:10,page:1},d.getSize=function(e){return _.size(e)},d.onSave=function(e){"outbound"===e.type&&(d.rpcVoiceQueuesChannels[e.uniqueid]=e)},d.onRemove=function(e){d.rpcVoiceQueuesChannels[e.uniqueid]&&delete d.rpcVoiceQueuesChannels[e.uniqueid]},d.hangup=function(t){return o.rpc.getVoiceQueuesChannelHangup({uniqueid:t}).$promise.then(function(e){l.success({title:"Channel "+t+" properly hangup!",msg:e.message||""})}).catch(function(e){l.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},d.redirectToAgent=function(t,e){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e}).$promise.then(function(e){l.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){l.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},d.redirectToNumber=function(e,t){var n=a.prompt().title("Which number do you want transfer the call to?").placeholder("Number").targetEvent(e).ok("Ok").cancel("Cancel");return a.show(n).then(function(e){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e}).$promise}).then(function(e){l.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){l.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},s.on("voice_queue_channel:save",d.onSave),s.on("voice_queue_channel:remove",d.onRemove),e.$on("$destroy",function(){s.removeAllListeners("voice_queue_channel:save"),s.removeAllListeners("voice_queue_channel:remove")})}e.$inject=["$scope","$timeout","$mdDialog","agents","rpcVoiceQueuesChannels","api","socket","helperClasses","toasty"],angular.module("app.motiondialer").controller("QueueCallsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r){var l=this,d=["total","answered","sumHoldTime","sumDuration","sumBillable","outboundNoAnswerCallsDay","outboundBusyCallsDay","outboundCongestionCallsDay","outboundNoSuchCallsDay","outboundUnknownCallsDay","outboundDropCallsDayTimeout","outboundDropCallsDayCallersExit","outboundBlacklistCallsDay","outboundOriginateFailureCallsDay","outboundAnswerAgiCallsDay","outboundReCallsDay","outboundRejectCallsDay"];function c(){_.forIn(l.queues,function(e,t){l.rpcQueues[t]&&_.merge(e,_.pick(l.rpcQueues[t],d))})}l.count=a.count,l.queues=a?_.keyBy(a.rows?a.rows:[],"id"):{},l.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},r.hasRole("admin")?l.query={type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1}:l.query={id:r.getCurrentUser().id,channel:"voice",type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1},l.success=p,l.getQueues=function(){l.query.offset=(l.query.page-1)*l.query.limit,r.hasRole("admin")?l.promise=o.voiceQueue.get(l.query,p).$promise:l.promise=o.user.getQueues(l.query,p).$promise},l.onSave=function(e){l.queues[e.id]&&_.merge(l.queues[e.id],_.pick(e,d))},l.$onInit=c,s.onWithoutApply("voice_queue:save",l.onSave),l.interval=t(function(){},999);var m=!0,u=1;function p(e){l.count=e.count,l.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},c()}e.$watch("vm.query.filter",function(e,t){m?n(function(){m=!1}):(t||(u=l.query.page),e!==t&&(l.query.page=1),e||(l.query.page=u),l.getQueues())}),e.$on("$destroy",function(){s.removeAllListeners("voice_queue:save"),l.interval&&t.cancel(l.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","Auth"],angular.module("app.motiondialer").controller("QueueParamsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function g(){var n=[];return _.forIn(u.queues,function(e,t){e.paused=0,e.loggedInDb=0,u.queues[t].agents={},n.push(l.voiceQueue.getMembers({id:t}).$promise),u.rpcQueues[t]&&_.merge(e,_.pick(u.rpcQueues[t],p))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&u.queues[e[t].rows[n].VoiceQueueId].paused++,u.queues[e[t].rows[n].VoiceQueueId].loggedInDb++,u.queues[e[t].rows[n].VoiceQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].VoiceQueueId}).catch(function(e){console.error(e)})}u.count=s.count?s.count:0,u.queues=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.hasRole("admin")?u.query={type:"outbound",sort:"-updatedAt",limit:10,page:1}:u.query={id:m.getCurrentUser().id,channel:"voice",type:"outbound",sort:"-updatedAt",limit:10,page:1},u.success=b,u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=l.voiceQueue.get(u.query,b).$promise:u.promise=l.user.getQueues(u.query,b).$promise},u.createOrEditMotionDialerQueue=function(e,t){a.show({controller:"CreateOrEditQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:t,queueCampaigns:_.values(u.queues),license:null,setting:null}})},u.agentAdd=function(e,t){a.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:t,queueCampaigns:u.queues?u.queues.rows:[],realtime:!0}})},u.updateQueue=function(e){return l.voiceQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},u.onSave=function(e){u.queues[e.id]&&_.merge(u.queues[e.id],_.pick(e,p))},u.onSaveMember=function(e){u.queues[e.MotionDialerQueueId]&&u.queues[e.MotionDialerQueueId].loggedInDb++},u.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(u.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(u.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},u.onLogin=function(e){console.log("onLogged",e),u.queues[e.VoiceQueueId]&&(u.queues[e.VoiceQueueId].loggedInDb+=1,u.queues[e.VoiceQueueId].agents[e.UserId]=e.VoiceQueueId)},u.onLogout=function(e){console.log("onLogout",e),u.queues[e.VoiceQueueId]&&0<u.queues[e.VoiceQueueId].loggedInDb&&(u.queues[e.VoiceQueueId].loggedInDb-=1,delete u.queues[e.VoiceQueueId].agents[e.UserId])},u.$onInit=g,u.order=[],_.forIn(u.queues,function(e,t){u.order.push(e.id)}),d.onWithoutApply("voice_queue:save",u.onSave),u.interval=o(function(){},999),d.on("userVoiceQueueRt:save",u.onSaveMember),d.on("user:update",u.onPause),d.on("userVoiceQueue:remove",u.onLogout),d.on("userVoiceQueue:save",u.onLogin);var v=!0,h=1;function b(e){if(u.count=e.count,u.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){u.order=[];for(var t=0;t<e.rows.length;t++)u.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("voice_queue:save"),u.interval&&o.cancel(u.interval),d.removeAllListeners("userVoiceQueueRt:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","Auth"],angular.module("app.motiondialer").controller("QueuesMotionDialerRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.motiondialer.realtime.agents":this.selectedTab=0;break;case"app.motiondialer.realtime.queues":this.selectedTab=1;break;case"app.motiondialer.realtime.queue_calls":this.selectedTab=2;break;case"app.motiondialer.realtime.abandonedcalls":this.selectedTab=3;break;case"app.motiondialer.realtime.queue_params":this.selectedTab=4;break;case"app.motiondialer.realtime.ivr_campaigns":this.selectedTab=5;break;default:this.selectedTab=0,n.go("app.motiondialer.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.motiondialer.realtime.agents");break;case 1:n.go("app.motiondialer.realtime.queues");break;case 2:n.go("app.motiondialer.realtime.queue_calls");break;case 3:n.go("app.motiondialer.realtime.abandonedcalls");break;case 4:n.go("app.motiondialer.realtime.queue_params");break;case 5:n.go("app.motiondialer.realtime.ivr_campaigns");break;default:n.go("app.motiondialer.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.motiondialer").controller("MotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT",m.openchannelAccount=angular.copy(s),m.openchannelAccounts=o,m.newOpenchannelAccount=!1,m.openchannelAccount||(m.openchannelAccount={waitForTheAssignedAgent:10,notificationSound:!0},m.title="OPENCHANNEL.NEW_OPENCHANNELACCOUNT",m.newOpenchannelAccount=!0),t.params.id&&(m.openchannelAccount.OpenchannelAccountId=t.params.id),m.addNewOpenchannelAccount=function(){m.errors=[],r.openchannelAccount.save(m.openchannelAccount).$promise.then(function(e){m.openchannelAccounts.unshift(e.toJSON()),i.success({title:"OpenchannelAccount properly created",msg:m.openchannelAccount.name?m.openchannelAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveOpenchannelAccount=function(){m.errors=[],r.openchannelAccount.update({id:m.openchannelAccount.id},m.openchannelAccount).$promise.then(function(e){var t=_.find(m.openchannelAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"OpenchannelAccount properly saved!",msg:m.openchannelAccount.name?m.openchannelAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteOpenchannelAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelAccount will be deleted.").ariaLabel("Delete OpenchannelAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.openchannelAccount.delete({id:m.openchannelAccount.id}).$promise.then(function(){_.remove(m.openchannelAccounts,{id:m.openchannelAccount.id}),i.success({title:"OpenchannelAccount properly deleted!",msg:(m.openchannelAccount.name||"openchannelAccount")+" has been deleted!"}),u(m.openchannelAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","openchannelAccounts","openchannelAccount","api","Auth","license","setting"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelAccountDialogController",e)}(),function(){"use strict";function e(s,i,a,o,e){var r=this;function t(e,t){if(r.openchannelAccountApps.rows.length){var n=r.openchannelAccountApps.rows[t]?r.openchannelAccountApps.rows[t]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccountApp:n,openchannelAccount:r.openchannelAccount}}).then(function(e){e&&(e.id?r.openchannelAccountApps.rows[t]=e:r.openchannelAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.openchannelAccountApps.rows.length;n++,0){var a=r.openchannelAccountApps.rows[n],i=[],o=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.openchannelAccount.context,a.exten=r.openchannelAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(o.length?_.last(o).priority:a.priority)+1,t=_.concat(t,i,[a],o)}s.openchannelAccount.addApplications({id:r.openchannelAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.openchannelAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.openchannelAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.openchannelAccount={},r.openchannelAccountApps={count:0,rows:[]},r.selectedOpenchannelAccountApps=[],r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"OpenchannelQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",route:"openchannelQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",maxlength:255,required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e){r.openchannelAccount=e,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getOpenchannelAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.openchannelAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getOpenchannelAccountApps=function(){r.promise=s.openchannelAccount.getApplications(r.query,n).$promise},r.editOpenchannelAccountApp=t,r.editInterval=function(e,t){if(r.openchannelAccountApps.rows.length){var n=r.openchannelAccountApps.rows[t]?r.openchannelAccountApps.rows[t]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteOpenchannelAccountApp=function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id}),l(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedOpenchannelAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedOpenchannelAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedOpenchannelAccountApps.forEach(function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id})}),r.selectedOpenchannelAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return s.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountActionsController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(e.appType||e.app).toUpperCase(),o.agent=angular.copy(e),o.agent.appdata)switch(o.agent.appType?o.agent.appType.toLowerCase():o.agent.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.agent.appdata.split(",");o.agent.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.agent.text=s.slice(1,s.length).join(",");break;case"message":o.agent.text=o.agent.appdata;break;case"set":o.agent.name=o.agent.appdata.split("=")[0],o.agent.value=o.agent.appdata.split("=")[1];break;case"agi":o.agent.project=o.agent.appdata;break;default:var r=o.agent.appdata.split(",");o.agent.agent=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.agent.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.agent.timeout=30;function l(e){t.hide(e)}o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outbounddial"===o.agent.appType.toLowerCase()&&(o.agent.prefix=o.agent.phone?o.agent.phone.split("$")[0]:void 0,o.agent.callerId=o.agent.callerID?"CALLERID(all)="+o.agent.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outboundDial"===o.agent.appType&&(o.agent.phone=a.cutdigits?(o.agent.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.agent.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.agent.options+="U(xcally-mixmonitor-context)"):o.agent.options=o.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.agents,{name:o.agent.agent});t&&(o.agent.UserId=t.id);if(o.agent.appType&&"custom"===o.agent.appType);else switch((o.agent.app||o.agent.appType).toLowerCase()){case"set":o.agent.appdata=o.agent.name+"="+o.agent.value;break;case"custom":break;default:e[0]=o.agent.agent,e[1]=o.agent.timeout,o.agent.appdata=e.join(",")}l(o.agent)},o.closeDialog=l,i.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){o.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(n.appType||n.app).toUpperCase(),o.autoreply=angular.copy(n),o.autoreply.appdata)switch(o.autoreply.appType?o.autoreply.appType.toLowerCase():o.autoreply.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.autoreply.appdata.split(",");o.autoreply.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.autoreply.text=s.slice(1,s.length).join(",");break;case"message":o.autoreply.text=o.autoreply.appdata;break;case"set":o.autoreply.name=o.autoreply.appdata.split("=")[0],o.autoreply.value=o.autoreply.appdata.split("=")[1];break;case"agi":o.autoreply.project=o.autoreply.appdata;break;default:var r=o.autoreply.appdata.split(",");o.autoreply.times=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.autoreply.text=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.autoreply.times=1;function l(e){t.hide(e)}o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outbounddial"===o.autoreply.appType.toLowerCase()&&(o.autoreply.prefix=o.autoreply.phone?o.autoreply.phone.split("$")[0]:void 0,o.autoreply.callerId=o.autoreply.callerID?"CALLERID(all)="+o.autoreply.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outboundDial"===o.autoreply.appType&&(o.autoreply.phone=a.cutdigits?(o.autoreply.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.autoreply.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.autoreply.options+="U(xcally-mixmonitor-context)"):o.autoreply.options=o.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(o.autoreply.appType&&"custom"===o.autoreply.appType);else switch((o.autoreply.app||o.autoreply.appType).toLowerCase()){case"set":o.autoreply.appdata=o.autoreply.name+"="+o.autoreply.value;break;case"custom":break;default:e[0]=o.autoreply.times,e[1]=o.autoreply.text,o.autoreply.appdata=e.join(",")}l(o.autoreply)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(n.appType||n.app).toUpperCase(),o.close=angular.copy(n),o.close.appdata)switch(o.close.appType?o.close.appType.toLowerCase():o.close.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.close.appdata.split(",");o.close.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.close.text=s.slice(1,s.length).join(",");break;case"message":o.close.text=o.close.appdata;break;case"set":o.close.name=o.close.appdata.split("=")[0],o.close.value=o.close.appdata.split("=")[1];break;case"agi":o.close.project=o.close.appdata;break;default:var r=o.close.appdata.split(",");o.close.disposition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outbounddial"===o.close.appType.toLowerCase()&&(o.close.prefix=o.close.phone?o.close.phone.split("$")[0]:void 0,o.close.callerId=o.close.callerID?"CALLERID(all)="+o.close.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outboundDial"===o.close.appType&&(o.close.phone=a.cutdigits?(o.close.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.close.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.close.options+="U(xcally-mixmonitor-context)"):o.close.options=o.close.options.replace("U(xcally-mixmonitor-context)",""));if(o.close.appType&&"custom"===o.close.appType);else switch((o.close.app||o.close.appType).toLowerCase()){case"set":o.close.appdata=o.close.name+"="+o.close.value;break;case"custom":break;default:e[0]=o.close.disposition,o.close.appdata=e.join(",")}l(o.close)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotoif=angular.copy(n),o.gotoif.appdata)switch(o.gotoif.appType?o.gotoif.appType.toLowerCase():o.gotoif.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotoif.appdata.split(",");o.gotoif.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotoif.text=s.slice(1,s.length).join(",");break;case"message":o.gotoif.text=o.gotoif.appdata;break;case"set":o.gotoif.name=o.gotoif.appdata.split("=")[0],o.gotoif.value=o.gotoif.appdata.split("=")[1];break;case"agi":o.gotoif.project=o.gotoif.appdata;break;default:var r=o.gotoif.appdata.split(",");o.gotoif.condition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.gotoif.truepriority=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.gotoif.falsepriority=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10)}function l(e){t.hide(e)}o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outbounddial"===o.gotoif.appType.toLowerCase()&&(o.gotoif.prefix=o.gotoif.phone?o.gotoif.phone.split("$")[0]:void 0,o.gotoif.callerId=o.gotoif.callerID?"CALLERID(all)="+o.gotoif.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outboundDial"===o.gotoif.appType&&(o.gotoif.phone=a.cutdigits?(o.gotoif.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotoif.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotoif.options+="U(xcally-mixmonitor-context)"):o.gotoif.options=o.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotoif.appType&&"custom"===o.gotoif.appType);else switch((o.gotoif.app||o.gotoif.appType).toLowerCase()){case"set":o.gotoif.appdata=o.gotoif.name+"="+o.gotoif.value;break;case"custom":break;default:e[0]=o.gotoif.condition,e[1]=o.gotoif.truepriority,e[2]=o.gotoif.falsepriority,o.gotoif.appdata=e.join(",")}l(o.gotoif)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotop=angular.copy(n),o.gotop.appdata)switch(o.gotop.appType?o.gotop.appType.toLowerCase():o.gotop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotop.appdata.split(",");o.gotop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotop.text=s.slice(1,s.length).join(",");break;case"message":o.gotop.text=o.gotop.appdata;break;case"set":o.gotop.name=o.gotop.appdata.split("=")[0],o.gotop.value=o.gotop.appdata.split("=")[1];break;case"agi":o.gotop.project=o.gotop.appdata;break;default:var r=o.gotop.appdata.split(",");o.gotop.priority=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outbounddial"===o.gotop.appType.toLowerCase()&&(o.gotop.prefix=o.gotop.phone?o.gotop.phone.split("$")[0]:void 0,o.gotop.callerId=o.gotop.callerID?"CALLERID(all)="+o.gotop.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outboundDial"===o.gotop.appType&&(o.gotop.phone=a.cutdigits?(o.gotop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotop.options+="U(xcally-mixmonitor-context)"):o.gotop.options=o.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotop.appType&&"custom"===o.gotop.appType);else switch((o.gotop.app||o.gotop.appType).toLowerCase()){case"set":o.gotop.appdata=o.gotop.name+"="+o.gotop.value;break;case"custom":break;default:e[0]=o.gotop.priority,o.gotop.appdata=e.join(",")}l(o.gotop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditOpenchannelAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(n.appType||n.app).toUpperCase(),o.noop=angular.copy(n),o.noop.appdata)switch(o.noop.appType?o.noop.appType.toLowerCase():o.noop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.noop.appdata.split(",");o.noop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.noop.text=s.slice(1,s.length).join(",");break;case"message":o.noop.text=o.noop.appdata;break;case"set":o.noop.name=o.noop.appdata.split("=")[0],o.noop.value=o.noop.appdata.split("=")[1];break;case"agi":o.noop.project=o.noop.appdata;break;default:var r=o.noop.appdata.split(",");o.noop.value=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outbounddial"===o.noop.appType.toLowerCase()&&(o.noop.prefix=o.noop.phone?o.noop.phone.split("$")[0]:void 0,o.noop.callerId=o.noop.callerID?"CALLERID(all)="+o.noop.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outboundDial"===o.noop.appType&&(o.noop.phone=a.cutdigits?(o.noop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.noop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.noop.options+="U(xcally-mixmonitor-context)"):o.noop.options=o.noop.options.replace("U(xcally-mixmonitor-context)",""));if(o.noop.appType&&"custom"===o.noop.appType);else switch((o.noop.app||o.noop.appType).toLowerCase()){case"set":o.noop.appdata=o.noop.name+"="+o.noop.value;break;case"custom":break;default:e[0]=o.noop.value,o.noop.appdata=e.join(",")}l(o.noop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(e.appType||e.app).toUpperCase(),o.queue=angular.copy(e),o.queue.appdata)switch(o.queue.appType?o.queue.appType.toLowerCase():o.queue.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.queue.appdata.split(",");o.queue.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.queue.text=s.slice(1,s.length).join(",");break;case"message":o.queue.text=o.queue.appdata;break;case"set":o.queue.name=o.queue.appdata.split("=")[0],o.queue.value=o.queue.appdata.split("=")[1];break;case"agi":o.queue.project=o.queue.appdata;break;default:var r=o.queue.appdata.split(",");o.queue.queue=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.queue.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.queue.queue=300,o.queue.timeout=300;function l(e){t.hide(e)}o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outbounddial"===o.queue.appType.toLowerCase()&&(o.queue.prefix=o.queue.phone?o.queue.phone.split("$")[0]:void 0,o.queue.callerId=o.queue.callerID?"CALLERID(all)="+o.queue.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outboundDial"===o.queue.appType&&(o.queue.phone=a.cutdigits?(o.queue.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.queue.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.queue.options+="U(xcally-mixmonitor-context)"):o.queue.options=o.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.queues,{name:o.queue.queue});t&&(o.queue[_.capitalize("openChannel")+"QueueId"]=t.id);if(o.queue.appType&&"custom"===o.queue.appType);else switch((o.queue.app||o.queue.appType).toLowerCase()){case"set":o.queue.appdata=o.queue.name+"="+o.queue.value;break;case"custom":break;default:e[0]=o.queue.queue,e[1]=o.queue.timeout,o.queue.appdata=e.join(",")}l(o.queue)},o.closeDialog=l,i.openchannelQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){o.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(e.appType||e.app).toUpperCase(),o.system=angular.copy(e),o.system.appdata)switch(o.system.appType?o.system.appType.toLowerCase():o.system.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.system.appdata.split(",");o.system.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.system.text=s.slice(1,s.length).join(",");break;case"message":o.system.text=o.system.appdata;break;case"set":o.system.name=o.system.appdata.split("=")[0],o.system.value=o.system.appdata.split("=")[1];break;case"agi":o.system.project=o.system.appdata;break;default:var r=o.system.appdata.split(",");o.system.command=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.system.variable=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.system.variable="";function l(e){t.hide(e)}o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outbounddial"===o.system.appType.toLowerCase()&&(o.system.prefix=o.system.phone?o.system.phone.split("$")[0]:void 0,o.system.callerId=o.system.callerID?"CALLERID(all)="+o.system.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outboundDial"===o.system.appType&&(o.system.phone=a.cutdigits?(o.system.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.system.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.system.options+="U(xcally-mixmonitor-context)"):o.system.options=o.system.options.replace("U(xcally-mixmonitor-context)",""));if(o.system.appType&&"custom"===o.system.appType);else switch((o.system.app||o.system.appType).toLowerCase()){case"set":o.system.appdata=o.system.name+"="+o.system.value;break;case"custom":break;default:e[0]=o.system.command,e[1]=o.system.variable,o.system.appdata=e.join(",")}l(o.system)},o.closeDialog=l,i.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){o.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppsystemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.openchannelAccount={},c.openchannelAccountInteractions={count:0,rows:[]},c.selectedOpenchannelAccountInteractions=[],c.query={fields:"createdAt,updatedAt,id,createdAt,Contact.firstName,Owner.name,closedAt,disposition,note,UserId,ContactId,OpenchannelAccountId,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e){c.openchannelAccount=e,c.query.id=c.openchannelAccount.id,c.getOpenchannelAccountInteractions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getOpenchannelAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.openchannelAccount.getInteractions(c.query,p).$promise},c.createOrEditOpenchannelAccountInteraction=function(e,t){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/interactions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:c.openchannelAccount,interaction:t,interactions:c.openchannelAccountInteractions.rows,license:null,setting:null}})},c.spyopenchannelInteraction=function(e,n){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"openchannel",interaction:n,spy:!0})}})},c.exportSelectedOpenchannelAccountInteractions=function(){var e=angular.copy(c.selectedOpenchannelAccountInteractions);return c.selectedOpenchannelAccountInteractions=[],e},c.deleteOpenchannelAccountInteraction=g,c.deleteSelectedOpenchannelAccountInteractions=function(e){var t=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedOpenchannelAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedOpenchannelAccountInteractions.forEach(function(e){g(e)}),c.selectedOpenchannelAccountInteractions=[]})};var m=!0,u=1;function p(e){c.openchannelAccountInteractions=e||{count:0,rows:[]}}function g(e){l.openchannelInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.openchannelAccountInteractions.rows,{id:e.id}),c.openchannelAccountInteractions.count-=1,c.openchannelAccountInteractions.rows.length||c.getOpenchannelAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getOpenchannelAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountInteractionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.openchannelAccount={},c.openchannelAccountOpenchannelCannedAnswers={count:0,rows:[]},c.selectedOpenchannelAccountOpenchannelCannedAnswers=[],c.query={fields:"createdAt,updatedAt,id,key,value,description,createdAt",limit:10,page:1},c.init=function(e){c.openchannelAccount=e,c.query.id=c.openchannelAccount.id,c.query.OpenchannelAccountId=c.openchannelAccount.id,c.getOpenchannelAccountOpenchannelCannedAnswers()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the openchannelCannedAnswer?").htmlContent("<b>"+(e.name||"openchannelCannedAnswer")+"</b> will be deleted.").ariaLabel("delete openchannelCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getOpenchannelAccountOpenchannelCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.openchannelAccount.getAnswers(c.query,p).$promise},c.createOrEditOpenchannelAccountOpenchannelCannedAnswer=function(e,t){o.show({controller:"CreateOrEditOpenchannelCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:c.openchannelAccount,openchannelCannedAnswer:t,openchannelCannedAnswers:c.openchannelAccountOpenchannelCannedAnswers.rows,license:null,setting:null}})},c.exportSelectedOpenchannelAccountOpenchannelCannedAnswers=function(){var e=angular.copy(c.selectedOpenchannelAccountOpenchannelCannedAnswers);return c.selectedOpenchannelAccountOpenchannelCannedAnswers=[],e},c.deleteOpenchannelAccountOpenchannelCannedAnswer=g,c.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers=function(e){var t=o.confirm().title("Are you sure want to delete the selected openchannelCannedAnswers?").htmlContent("<b>"+c.selectedOpenchannelAccountOpenchannelCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete openchannelCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedOpenchannelAccountOpenchannelCannedAnswers.forEach(function(e){g(e)}),c.selectedOpenchannelAccountOpenchannelCannedAnswers=[]})};var m=!0,u=1;function p(e){c.openchannelAccountOpenchannelCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.openchannelAccountOpenchannelCannedAnswers.rows,{id:e.id}),c.openchannelAccountOpenchannelCannedAnswers.count-=1,c.openchannelAccountOpenchannelCannedAnswers.rows.length||c.getOpenchannelAccountOpenchannelCannedAnswers(),r.success({title:"OpenchannelCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getOpenchannelAccountOpenchannelCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountOpenchannelCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER",m.openchannelCannedAnswer=angular.copy(s),m.openchannelCannedAnswers=o,m.newOpenchannelCannedAnswer=!1,m.openchannelCannedAnswer||(m.openchannelCannedAnswer={},m.title="OPENCHANNEL.NEW_OPENCHANNELCANNEDANSWER",m.newOpenchannelCannedAnswer=!0),t.params.id&&(m.openchannelCannedAnswer.OpenchannelAccountId=t.params.id),m.addNewOpenchannelCannedAnswer=function(){m.errors=[],r.cannedAnswer.save(m.openchannelCannedAnswer).$promise.then(function(e){m.openchannelCannedAnswers.unshift(e.toJSON()),i.success({title:"OpenchannelCannedAnswer properly created",msg:m.openchannelCannedAnswer.name?m.openchannelCannedAnswer.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveOpenchannelCannedAnswer=function(){m.errors=[],r.cannedAnswer.update({id:m.openchannelCannedAnswer.id},m.openchannelCannedAnswer).$promise.then(function(e){var t=_.find(m.openchannelCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"OpenchannelCannedAnswer properly saved!",msg:m.openchannelCannedAnswer.name?m.openchannelCannedAnswer.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteOpenchannelCannedAnswer=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelCannedAnswer will be deleted.").ariaLabel("Delete OpenchannelCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cannedAnswer.delete({id:m.openchannelCannedAnswer.id}).$promise.then(function(){_.remove(m.openchannelCannedAnswers,{id:m.openchannelCannedAnswer.id}),i.success({title:"OpenchannelCannedAnswer properly deleted!",msg:(m.openchannelCannedAnswer.name||"openchannelCannedAnswer")+" has been deleted!"}),u(m.openchannelCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","openchannelCannedAnswers","openchannelCannedAnswer","api","Auth","license","setting"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.openchannelAccount={},c.openchannelAccountOpenchannelDispositions={count:0,rows:[]},c.selectedOpenchannelAccountOpenchannelDispositions=[],c.query={fields:"createdAt,updatedAt,id,name,createdAt",limit:10,page:1},c.init=function(e){c.openchannelAccount=e,c.query.id=c.openchannelAccount.id,c.query.OpenchannelAccountId=c.openchannelAccount.id,c.getOpenchannelAccountOpenchannelDispositions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the openchannelDisposition?").htmlContent("<b>"+(e.name||"openchannelDisposition")+"</b> will be deleted.").ariaLabel("delete openchannelDisposition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getOpenchannelAccountOpenchannelDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.openchannelAccount.getDispositions(c.query,p).$promise},c.createOrEditOpenchannelAccountOpenchannelDisposition=function(e,t){o.show({controller:"CreateOrEditOpenchannelDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelDispositions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:c.openchannelAccount,openchannelDisposition:t,openchannelDispositions:c.openchannelAccountOpenchannelDispositions.rows,license:null,setting:null}})},c.exportSelectedOpenchannelAccountOpenchannelDispositions=function(){var e=angular.copy(c.selectedOpenchannelAccountOpenchannelDispositions);return c.selectedOpenchannelAccountOpenchannelDispositions=[],e},c.deleteOpenchannelAccountOpenchannelDisposition=g,c.deleteSelectedOpenchannelAccountOpenchannelDispositions=function(e){var t=o.confirm().title("Are you sure want to delete the selected openchannelDispositions?").htmlContent("<b>"+c.selectedOpenchannelAccountOpenchannelDispositions.length+" selected</b> will be deleted.").ariaLabel("delete openchannelDispositions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedOpenchannelAccountOpenchannelDispositions.forEach(function(e){g(e)}),c.selectedOpenchannelAccountOpenchannelDispositions=[]})};var m=!0,u=1;function p(e){c.openchannelAccountOpenchannelDispositions=e||{count:0,rows:[]}}function g(e){l.openchannelDisposition.delete({id:e.id}).$promise.then(function(){_.remove(c.openchannelAccountOpenchannelDispositions.rows,{id:e.id}),c.openchannelAccountOpenchannelDispositions.count-=1,c.openchannelAccountOpenchannelDispositions.rows.length||c.getOpenchannelAccountOpenchannelDispositions(),r.success({title:"OpenchannelDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getOpenchannelAccountOpenchannelDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountOpenchannelDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="OPENCHANNEL.EDIT_OPENCHANNELDISPOSITION",m.openchannelDisposition=angular.copy(s),m.openchannelDispositions=o,m.newOpenchannelDisposition=!1,m.openchannelDisposition||(m.openchannelDisposition={},m.title="OPENCHANNEL.NEW_OPENCHANNELDISPOSITION",m.newOpenchannelDisposition=!0),t.params.id&&(m.openchannelDisposition.OpenchannelAccountId=t.params.id),m.addNewOpenchannelDisposition=function(){m.errors=[],r.openchannelDisposition.save(m.openchannelDisposition).$promise.then(function(e){m.openchannelDispositions.unshift(e.toJSON()),i.success({title:"OpenchannelDisposition properly created",msg:m.openchannelDisposition.name?m.openchannelDisposition.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelDisposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelDisposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveOpenchannelDisposition=function(){m.errors=[],r.openchannelDisposition.update({id:m.openchannelDisposition.id},m.openchannelDisposition).$promise.then(function(e){var t=_.find(m.openchannelDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"OpenchannelDisposition properly saved!",msg:m.openchannelDisposition.name?m.openchannelDisposition.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelDisposition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelDisposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteOpenchannelDisposition=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelDisposition will be deleted.").ariaLabel("Delete OpenchannelDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.openchannelDisposition.delete({id:m.openchannelDisposition.id}).$promise.then(function(){_.remove(m.openchannelDispositions,{id:m.openchannelDisposition.id}),i.success({title:"OpenchannelDisposition properly deleted!",msg:(m.openchannelDisposition.name||"openchannelDisposition")+" has been deleted!"}),u(m.openchannelDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelDisposition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelDisposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","openchannelDispositions","openchannelDisposition","api","Auth","license","setting"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelDispositionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.openchannelAccount=d||e.params.openchannelAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoOpenchannelAccounts=function(){e.go("app.openchannel.openchannelAccounts")},c.saveOpenchannelAccount=function(){s.openchannelAccount.update({id:c.openchannelAccount.id},c.openchannelAccount).$promise.then(function(){r.success({title:"OpenchannelAccount updated!",msg:c.openchannelAccount.name?c.openchannelAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.lists=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","openchannelAccount"],angular.module("app.openchannel").controller("OpenchannelAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.openchannelAccounts=r||{count:0,rows:[]},v.table="openchannelAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedOpenchannelAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,key,replyUri,ListId,waitForTheAssignedAgent,description,receiveUri,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,page:1},v.editstate=function(e,t){n.go("app.openchannel.openchannelAccounts.edit",{id:e.id,openchannelAccount:e})},v.interactionsgoto=function(e,t){n.go("app.openchannel.openchannelAccounts.edit",{id:e.id,tab:4})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the openchannelAccount?").htmlContent("<b>"+(e.name||"openchannelAccount")+"</b> will be deleted.").ariaLabel("delete openchannelAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getOpenchannelAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.openchannelAccount.get(v.query,f).$promise},v.createOrEditOpenchannelAccount=function(e,t){i.show({controller:"CreateOrEditOpenchannelAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:t,openchannelAccounts:v.openchannelAccounts.rows,license:v.license,setting:v.setting}})},v.deleteOpenchannelAccount=A,v.exportSelectedOpenchannelAccounts=function(){var e=angular.copy(v.selectedOpenchannelAccounts);return v.selectedOpenchannelAccounts=[],e},v.deleteSelectedOpenchannelAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected openchannelAccounts?").htmlContent("<b>"+v.selectedOpenchannelAccounts.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedOpenchannelAccounts.forEach(function(e){A(e)}),v.selectedOpenchannelAccounts=[]})},v.deselectOpenchannelAccounts=function(){v.selectedOpenchannelAccounts=[]},v.selectAllOpenchannelAccounts=function(){v.selectedOpenchannelAccounts=v.openchannelAccounts.rows},l.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.lists=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.openchannelAccounts=e||{count:0,rows:[]}}function A(e){l.openchannelAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.openchannelAccounts.rows,{id:e.id}),v.openchannelAccounts.count-=1,v.openchannelAccounts.rows.length||v.getOpenchannelAccounts(),c.success({title:"OpenchannelAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getOpenchannelAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","openchannelAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.openchannel").controller("OpenchannelAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="OPENCHANNEL.EDIT_OPENCHANNELQUEUE",m.openchannelQueue=angular.copy(s),m.openchannelQueues=o,m.newOpenchannelQueue=!1,m.openchannelQueue||(m.openchannelQueue={strategy:"beepall",timeout:10},m.title="OPENCHANNEL.NEW_OPENCHANNELQUEUE",m.newOpenchannelQueue=!0),m.addNewOpenchannelQueue=function(){m.errors=[],r.openchannelQueue.save(m.openchannelQueue).$promise.then(function(e){m.openchannelQueues.unshift(e.toJSON()),i.success({title:"OpenchannelQueue properly created",msg:m.openchannelQueue.name?m.openchannelQueue.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveOpenchannelQueue=function(){m.errors=[],r.openchannelQueue.update({id:m.openchannelQueue.id},m.openchannelQueue).$promise.then(function(e){var t=_.find(m.openchannelQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"OpenchannelQueue properly saved!",msg:m.openchannelQueue.name?m.openchannelQueue.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteOpenchannelQueue=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelQueue will be deleted.").ariaLabel("Delete OpenchannelQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.openchannelQueue.delete({id:m.openchannelQueue.id}).$promise.then(function(){_.remove(m.openchannelQueues,{id:m.openchannelQueue.id}),i.success({title:"OpenchannelQueue properly deleted!",msg:(m.openchannelQueue.name||"openchannelQueue")+" has been deleted!"}),u(m.openchannelQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","openchannelQueues","openchannelQueue","api","Auth","license","setting"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelQueueDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.openchannelQueue[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.openchannelQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserOpenchannelQueue?"penalty "+e.UserOpenchannelQueue.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserOpenchannelQueue?"penalty "+e.UserOpenchannelQueue.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.openchannelQueue=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("OPENCHANNEL.ALL_AGENTS"),labelSelected:s.instant("OPENCHANNEL.SELECTED_AGENTS"),transferCallback:function(e,t){a.openchannelQueue[t?"removeAgents":"addAgents"]({id:l.openchannelQueue.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"OpenchannelQueue properly "+(t?"removed":"added"),msg:"OpenchannelQueue has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:openchannelQueue.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","openchannelQueue","openchannelQueues","realtime","$translate","Auth"],angular.module("app.openchannel").controller("OpenchannelQueueagentaddController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.openchannelQueue=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("OPENCHANNEL.ALL_TEAMS"),labelSelected:i.instant("OPENCHANNEL.SELECTED_TEAMS"),transferCallback:function(e,t){a.openchannelQueue[t?"removeTeams":"addTeams"]({id:o.openchannelQueue.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:openchannelQueue.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.openchannelQueue.getTeams({id:o.openchannelQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","openchannelQueue","$translate"],angular.module("app.openchannel").controller("OpenchannelQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.openchannelQueue=d||e.params.openchannelQueue||{},c.selectedTab=e.params.tab||0,c.teamadddialog=function(e,t){n.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:c.openchannelQueues?c.openchannelQueues.rows:[]}})},c.agentadddialog=function(e,t){n.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:c.openchannelQueues?c.openchannelQueues.rows:[],realtime:!1}})},c.alert=r.info,c.gotoOpenchannelQueues=function(){e.go("app.openchannel.openchannelQueues")},c.saveOpenchannelQueue=function(){s.openchannelQueue.update({id:c.openchannelQueue.id},c.openchannelQueue).$promise.then(function(){r.success({title:"OpenchannelQueue updated!",msg:c.openchannelQueue.name?c.openchannelQueue.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","openchannelQueue"],angular.module("app.openchannel").controller("OpenchannelQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.openchannelQueues=r||{count:0,rows:[]},v.table="openchannelQueues",v.listOrder="",v.listOrderAsc=null,v.selectedOpenchannelQueues=[],v.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,page:1},v.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.openchannel.openchannelQueues.edit",{id:e.id,openchannelQueue:e})},v.teamadddialog=function(e,t){i.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:v.openchannelQueues?v.openchannelQueues.rows:[]}})},v.agentadddialog=function(e,t){i.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:v.openchannelQueues?v.openchannelQueues.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the openchannelQueue?").htmlContent("<b>"+(e.name||"openchannelQueue")+"</b> will be deleted.").ariaLabel("delete openchannelQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.openchannel.realtime.queues",{})},v.success=f,v.getOpenchannelQueues=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.openchannelQueue.get(v.query,f).$promise},v.createOrEditOpenchannelQueue=function(e,t){i.show({controller:"CreateOrEditOpenchannelQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:t,openchannelQueues:v.openchannelQueues.rows,license:v.license,setting:v.setting}})},v.deleteOpenchannelQueue=A,v.exportSelectedOpenchannelQueues=function(){var e=angular.copy(v.selectedOpenchannelQueues);return v.selectedOpenchannelQueues=[],e},v.deleteSelectedOpenchannelQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected openchannelQueues?").htmlContent("<b>"+v.selectedOpenchannelQueues.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedOpenchannelQueues.forEach(function(e){A(e)}),v.selectedOpenchannelQueues=[]})},v.deselectOpenchannelQueues=function(){v.selectedOpenchannelQueues=[]},v.selectAllOpenchannelQueues=function(){v.selectedOpenchannelQueues=v.openchannelQueues.rows};var h=!0,b=1;function f(e){v.openchannelQueues=e||{count:0,rows:[]}}function A(e){l.openchannelQueue.delete({id:e.id}).$promise.then(function(){_.remove(v.openchannelQueues.rows,{id:e.id}),v.openchannelQueues.count-=1,v.openchannelQueues.rows.length||v.getOpenchannelQueues(),c.success({title:"OpenchannelQueue deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelQueue"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getOpenchannelQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","openchannelQueues","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.openchannel").controller("OpenchannelQueuesController",e)}(),function(){"use strict";function e(e,s,t,n,a,i,o,r,l,d,c,m,u,p,g,v){var h=this,b=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum"],f=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var A in h.availableStates=["ringing","inuse","busy","onhold","not_inuse"],h.pauses=o||{count:0,rows:[]},h.license=g,h.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},h.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},h.paginatedAgents={},h.load=!1,h.order=[],h.agentInternal={},h.agents)h.agents.hasOwnProperty(A)&&(h.agents[A].init=!0);h.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},h.logout=function(e,t){return d.user.logout({id:e.id}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),h.agents[e.id]&&(h.agents[e.id].online=!1),h.rpcAgents[e.id]&&(h.rpcAgents[e.id].online=!1),y()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"openchannel",realtime:!0,direction:"inbound"}})},h.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},h.getAgentStatus=C,h.getAgentGlobalStatus=x,h.isPause=S,h.checkPause=function(e){return"pause"===e},h.isPartialPause=function(e){return"*pause"===e},h.onSave=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(_.omit(e,f),b)),_.merge(h.rpcAgents[e.id],_.pick(_.omit(e,f),b)),x(h.agents[e.id]))},h.onUpdate=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(e,b)),_.merge(h.rpcAgents[e.id],_.pick(e,b)),x(h.agents[e.id]))},h.onInit=y,h.onConnect=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(_.merge(h.agents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(h.rpcAgents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},h.onComplete=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(h.agents[h.agentInternal[e.destaccountcode]]=_.omit(h.agents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),h.rpcAgents[h.agentInternal[e.destaccountcode]]=_.omit(h.rpcAgents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",h.onSave),c.on("user:update",h.onUpdate),c.on("user:agentconnect",h.onConnect),c.on("user:agentcomplete",h.onComplete),y();var E=v(function(){h.load&&(h.load=!1,y())},999);function y(e){h.load=!1;var t,n,a=s.defer();h.promise=a.promise,h.filteredAgents=[],h.order=[],_.forIn(h.agents,function(e,t){h.rpcAgents[t]&&_.merge(e,_.pick(_.omit(h.rpcAgents[t],f),b)),x(e),e.online?(h.filteredAgents.push(e),h.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),h.query.globalStatusFilter&&_.remove(h.filteredAgents,function(e){return e.globalStatus!==h.query.globalStatusFilter}),h.query.pauseTypeFilter&&_.remove(h.filteredAgents,function(e){return e.pauseType!==h.query.pauseTypeFilter}),h.query.filter&&_.remove(h.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(h.query.filter.toLowerCase())<0}),h.filteredAgents=(t=h.filteredAgents,n=_.startsWith(h.query.order,"-")?"desc":"asc",_.orderBy(t,[h.query.order.replace("-","")],[n]));var i=(h.query.page-1)*h.query.limit;h.paginatedAgents=_.drop(h.filteredAgents,i).slice(0,h.query.limit);for(var o=0;o<h.paginatedAgents.length;o+=1)h.order.push(h.paginatedAgents[o].id);a.resolve(),h.load=!0}function S(e){return"pause"===e||"*pause"===e}function T(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function C(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function x(e){var t="unknown";t=_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"pause":_.some([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"*pause":_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],T)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=S(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),E&&(v.cancel(E),E=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","Auth","license","$interval"],angular.module("app.voice").controller("AgentsOpenchannelRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function g(){var n=[];return _.forIn(u.queues,function(e,t){e.paused=0,e.loggedInDb=0,u.queues[t].agents={},n.push(l.openchannelQueue.getMembers({id:t}).$promise),u.rpcQueues[t]&&_.merge(e,_.pick(u.rpcQueues[t],p))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&u.queues[e[t].rows[n].OpenchannelQueueId].paused++,u.queues[e[t].rows[n].OpenchannelQueueId].loggedInDb++,u.queues[e[t].rows[n].OpenchannelQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].OpenchannelQueueId}).catch(function(e){console.error(e)})}u.count=s.count?s.count:0,u.queues=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.hasRole("admin")?u.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:u.query={id:m.getCurrentUser().id,channel:"openchannel",type:"inbound",sort:"-updatedAt",limit:10,page:1},u.success=b,u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=l.openchannelQueue.get(u.query,b).$promise:u.promise=l.user.getQueues(u.query,b).$promise},u.createOrEditOpenchannelQueue=function(e,t){a.show({controller:"CreateOrEditOpenchannelQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:t,openchannelQueues:_.values(u.queues),license:null,setting:null}})},u.agentAdd=function(e,t){a.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:t,openchannelQueues:u.queues?u.queues.rows:[],realtime:!1}})},u.updateQueue=function(e){return l.openchannelQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},u.onSave=function(e){u.queues[e.id]&&_.merge(u.queues[e.id],_.pick(e,p))},u.onSaveMember=function(e){u.queues[e.OpenchannelQueueId]&&u.queues[e.OpenchannelQueueId].loggedInDb++},u.onRemoveMember=function(e){u.queues[e.OpenchannelQueueId]&&u.queues[e.OpenchannelQueueId].loggedInDb--},u.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(u.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(u.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},u.onLogin=function(e){console.log("onLogged",e),u.queues[e.OpenchannelQueueId]&&(u.queues[e.OpenchannelQueueId].loggedInDb+=1,u.queues[e.OpenchannelQueueId].agents[e.UserId]=e.OpenchannelQueueId)},u.onLogout=function(e){console.log("onLogout",e),u.queues[e.OpenchannelQueueId]&&0<u.queues[e.OpenchannelQueueId].loggedInDb&&(u.queues[e.OpenchannelQueueId].loggedInDb-=1,delete u.queues[e.OpenchannelQueueId].agents[e.UserId])},u.$onInit=g,u.order=[],_.forIn(u.queues,function(e,t){u.order.push(e.id)}),d.on("openchannel_queue:save",u.onSave),d.on("userOpenchannelQueue:save",u.onSaveMember),d.on("userOpenchannelQueue:remove",u.onRemoveMember),d.on("user:update",u.onPause),d.on("userVoiceQueue:remove",u.onLogout),d.on("userVoiceQueue:save",u.onLogin);var v=!0,h=1;function b(e){if(u.count=e.count,u.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){u.order=[];for(var t=0;t<e.rows.length;t++)u.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("openchannel_queue:save"),d.removeAllListeners("userOpenchannelQueue:remove"),d.removeAllListeners("userOpenchannelQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","Auth"],angular.module("app.openchannel").controller("QueuesOpenchannelRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.openchannel.realtime.agents":this.selectedTab=0;break;case"app.openchannel.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,n.go("app.openchannel.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.openchannel.realtime.agents");break;case 1:n.go("app.openchannel.realtime.queues");break;default:n.go("app.openchannel.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.openchannel").controller("OpenchannelRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SETTINGS.EDIT_CUSTOMIZATION",m.customization=angular.copy(s),m.customizations=o,m.newCustomization=!1,m.customization||(m.customization={},m.title="SETTINGS.NEW_CUSTOMIZATION",m.newCustomization=!0),m.addNewCustomization=function(){m.errors=[],r.setting.save(m.customization).$promise.then(function(e){m.customizations.unshift(e.toJSON()),i.success({title:"Customization properly created",msg:m.customization.name?m.customization.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveCustomization=function(){m.errors=[],r.setting.update({id:m.customization.id},m.customization).$promise.then(function(e){var t=_.find(m.customizations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Customization properly saved!",msg:m.customization.name?m.customization.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteCustomization=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The customization will be deleted.").ariaLabel("Delete Customization").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.setting.delete({id:m.customization.id}).$promise.then(function(){_.remove(m.customizations,{id:m.customization.id}),i.success({title:"Customization properly deleted!",msg:(m.customization.name||"customization")+" has been deleted!"}),u(m.customization)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","customizations","customization","api","Auth","license","setting"],angular.module("app.settings").controller("CreateOrEditCustomizationDialogController",e)}(),function(){"use strict";function e(e,t,n){var a=this;a.customizations=e,a.customization={},a.customizations&&a.customizations.rows&&a.customizations.rows.length&&(a.customization=a.customizations.rows[0]),a.saveCustomization=function(){a.customization.id?t.setting.update({id:a.customization.id},a.customization).$promise.then(function(){n.success({title:"Customization updated!",msg:a.customization.name?a.customization.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):t.setting.save(a.customization).$promise.then(function(e){_.merge(a.customization,e),n.success({title:"Customization updated!",msg:a.customization.name?a.customization.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["customizations","api","toasty"],angular.module("app.settings").controller("CustomizationsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size for image files is 8 Mb"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogoController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size for image files is 8 Mb"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo_login".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogologinController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SETTINGS.EDIT_GENERAL",m.general=angular.copy(s),m.generals=o,m.newGeneral=!1,m.general||(m.general={min_internal:1e3,phoneBarAutoUpdater:!0,phoneBarAutoUpdaterUrl:"https://www.xcally.com/bar/phonebar/autoupdater.xml"},m.title="SETTINGS.NEW_GENERAL",m.newGeneral=!0),m.addNewGeneral=function(){m.errors=[],r.setting.save(m.general).$promise.then(function(e){m.generals.unshift(e.toJSON()),i.success({title:"General properly created",msg:m.general.name?m.general.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveGeneral=function(){m.errors=[],r.setting.update({id:m.general.id},m.general).$promise.then(function(e){var t=_.find(m.generals,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"General properly saved!",msg:m.general.name?m.general.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteGeneral=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The general will be deleted.").ariaLabel("Delete General").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.setting.delete({id:m.general.id}).$promise.then(function(){_.remove(m.generals,{id:m.general.id}),i.success({title:"General properly deleted!",msg:(m.general.name||"general")+" has been deleted!"}),u(m.general)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","generals","general","api","Auth","license","setting"],angular.module("app.settings").controller("CreateOrEditGeneralDialogController",e)}(),function(){"use strict";function e(e,t,n){var a=this;a.generals=e,a.general={},a.generals&&a.generals.rows&&a.generals.rows.length&&(a.general=a.generals.rows[0]),a.saveGeneral=function(){a.general.id?t.setting.update({id:a.general.id},a.general).$promise.then(function(){n.success({title:"General updated!",msg:a.general.name?a.general.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):t.setting.save(a.general).$promise.then(function(e){_.merge(a.general,e),n.success({title:"General updated!",msg:a.general.name?a.general.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["generals","api","toasty"],angular.module("app.settings").controller("GeneralsController",e)}(),function(){"use strict";function e(t,n,a,i,o,s){var r=this;r.license=i||{},r.agents=0,r.users=0,r.telephones=0,r.license.gray&&(r.license.deadline=moment(r.license.gray).add(7,"days").format()),r.channels=[{name:"chat",icon:"icon-hangouts"},{name:"mail",icon:"icon-email"},{name:"messaging",icon:"icon-message-text"},{name:"fax",icon:"icon-deskphone"},{name:"openchannel",icon:"icon-google-earth"}],r.modules=[{name:"cm",icon:"icon-account-circle"},{name:"dialer",icon:"icon-crosshairs"},{name:"jscripty",icon:"icon-console"}],r.others=[{name:"callysquare",icon:"icon-sitemap"},{name:"webrtc",icon:"icon-server-plus"},{name:"custom",icon:"icon-table-edit"},{name:"update",icon:"icon-cloud-download"}],r.requestLicense=function(e){n.show({controller:"RequestLicenseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/license/request/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:i,channels:r.channels,modules:r.modules,others:r.others}})},r.updateLicense=function(e){var t=n.prompt().title("Do you want to update your license manually?").textContent("Enter your license.").targetEvent(e).ok("Ok").cancel("Cancel");n.show(t).then(function(e){if(e)return s.license.update({id:1,license:e}).$promise.then(function(){o.success({title:"License properly updated!",msg:"The license has been updated!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATElicense",msg:e.data?JSON.stringify(e.data):e.toString()})})}).catch(function(e){e&&console.error(e)})},r.gotoProcess=function(e){a.go("app.settings.system",{tab:1})},s.user.get({fields:"id",role:"agent",online:!0}).$promise.then(function(e){return r.agents=e&&e.count?e.count:0,s.user.get({fields:"id",role:"user,admin"}).$promise}).then(function(e){return r.users=e&&e.count?e.count:0,s.user.get({fields:"id",role:"telephone"}).$promise}).then(function(e){r.telephones=e&&e.count?e.count:0}).catch(function(e){console.log(e)})}e.$inject=["$document","$mdDialog","$state","license","toasty","api"],angular.module("app.settings.license").controller("LicenseController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l){var d=this;function c(){e.hide()}d.errors=[],d.user=r.getCurrentUser(),d.license=angular.copy(n),d.channels=a,d.modules=i,d.others=o,d.license.name=d.user.fullname,d.license.email=d.user.email,d.sendRequest=function(){for(var e in d.errors=[],d.table="||FIELD||OLD||NEW||\n",d.license)d.license.hasOwnProperty(e)&&!_.includes(["$promise","$resolved"],e)&&(n[e]===d.license[e]?d.table+="|"+e+"|"+(void 0!==n[e]?n[e]:"")+"|"+d.license[e]+"|\n":d.table+="|"+e+"|{color:red}"+(void 0!==n[e]?n[e]:"")+"{color}|*"+d.license[e]+"*|\n");s.jira.save({key:"MOTLICENSE",summary:"Motion License Request",description:d.table,issuetype:"Task"}).$promise.then(function(e){t.success({title:"Request sent!",msg:l.instant("SETTINGS.LICENSE_REQUEST_SENT"),timeout:15e3}),c()}).catch(function(e){console.error(e),d.errors=[{message:l.instant("SETTINGS.JIRA_ERROR_MESSAGE"),type:"api.jira"}]})},d.closeDialog=c}e.$inject=["$mdDialog","toasty","license","channels","modules","others","api","Auth","$translate"],angular.module("app.settings.license").controller("RequestLicenseDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SETTINGS.EDIT_NETWORK",m.network=angular.copy(s),m.networks=o,m.newNetwork=!1,m.network||(m.network={type:"localnet"},m.title="SETTINGS.NEW_NETWORK",m.newNetwork=!0),m.addNewNetwork=function(){m.errors=[],r.network.save(m.network).$promise.then(function(e){m.networks.unshift(e.toJSON()),i.success({title:"Network properly created",msg:m.network.name?m.network.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.network.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveNetwork=function(){m.errors=[],r.network.update({id:m.network.id},m.network).$promise.then(function(e){var t=_.find(m.networks,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Network properly saved!",msg:m.network.name?m.network.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.network.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteNetwork=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The network will be deleted.").ariaLabel("Delete Network").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.network.delete({id:m.network.id}).$promise.then(function(){_.remove(m.networks,{id:m.network.id}),i.success({title:"Network properly deleted!",msg:(m.network.name||"network")+" has been deleted!"}),u(m.network)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.network.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","networks","network","api","Auth","license","setting"],angular.module("app.settings").controller("CreateOrEditNetworkDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.networks=r||{count:0,rows:[]},v.table="networks",v.listOrder="",v.listOrderAsc=null,v.selectedNetworks=[],v.query={fields:"createdAt,updatedAt,id,type,value,value,createdAt",sort:"-updatedAt",limit:10,page:1},v.arraytype=_.keyBy([{option:"LocalNET",value:"'localnet'"},{option:"ExternIP",value:"'externip'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editdialog=function(e,t){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{network:e,networks:v.networks.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the network?").htmlContent("<b>"+(e.name||"network")+"</b> will be deleted.").ariaLabel("delete network").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getNetworks=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.network.get(v.query,f).$promise},v.createOrEditNetwork=function(e,t){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{network:t,networks:v.networks.rows,license:v.license,setting:v.setting}})},v.deleteNetwork=A,v.exportSelectedNetworks=function(){var e=angular.copy(v.selectedNetworks);return v.selectedNetworks=[],e},v.deleteSelectedNetworks=function(e){var t=i.confirm().title("Are you sure want to delete the selected networks?").htmlContent("<b>"+v.selectedNetworks.length+" selected</b> will be deleted.").ariaLabel("delete Networks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedNetworks.forEach(function(e){A(e)}),v.selectedNetworks=[]})},v.deselectNetworks=function(){v.selectedNetworks=[]},v.selectAllNetworks=function(){v.selectedNetworks=v.networks.rows};var h=!0,b=1;function f(e){v.networks=e||{count:0,rows:[]}}function A(e){l.network.delete({id:e.id}).$promise.then(function(){_.remove(v.networks.rows,{id:e.id}),v.networks.count-=1,v.networks.rows.length||v.getNetworks(),c.success({title:"Network deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEnetwork"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEnetwork",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getNetworks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","networks","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.settings").controller("NetworksController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SETTINGS.EDIT_SMTP",m.smtp=angular.copy(s),m.smtps=o,m.newSmtp=!1,m.smtp||(m.smtp={service:!0},m.title="SETTINGS.NEW_SMTP",m.newSmtp=!0),m.addNewSmtp=function(){m.errors=[],r.mailAccount.save(m.smtp).$promise.then(function(e){m.smtps.unshift(e.toJSON()),i.success({title:"Smtp properly created",msg:m.smtp.name?m.smtp.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSmtp=function(){m.errors=[],r.mailAccount.update({id:m.smtp.id},m.smtp).$promise.then(function(e){var t=_.find(m.smtps,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Smtp properly saved!",msg:m.smtp.name?m.smtp.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSmtp=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The smtp will be deleted.").ariaLabel("Delete Smtp").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.mailAccount.delete({id:m.smtp.id}).$promise.then(function(){_.remove(m.smtps,{id:m.smtp.id}),i.success({title:"Smtp properly deleted!",msg:(m.smtp.name||"smtp")+" has been deleted!"}),u(m.smtp)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","smtps","smtp","api","Auth","license","setting"],angular.module("app.settings").controller("CreateOrEditSmtpDialogController",e)}(),function(){"use strict";function e(e,t,n){var a=this;a.smtps=e,a.smtp={},a.smtps&&a.smtps.rows&&a.smtps.rows.length?a.smtp=a.smtps.rows[0]:a.smtp={service:!0,Smtp:{service:null}},a.saveSmtp=function(){a.smtp.id?t.mailAccount.update({id:a.smtp.id},a.smtp).$promise.then(function(){n.success({title:"Smtp updated!",msg:a.smtp.name?a.smtp.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}):t.mailAccount.save(a.smtp).$promise.then(function(e){_.merge(a.smtp,e),n.success({title:"Smtp updated!",msg:a.smtp.name?a.smtp.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},a.verifySmtp=function(){a.smtp.id&&t.mailAccount.verifySmtp({id:a.smtp.id}).$promise.then(function(){n.success({title:"Smtp verified!",msg:a.smtp.name?a.smtp.name+" has been verified!":""})}).catch(function(e){n.error({title:"Smtp not verified! Remember to save before to verify!",msg:e.data?JSON.stringify(e.data):e.toString(),timeout:1e4})})}}e.$inject=["smtps","api","toasty"],angular.module("app.settings").controller("SmtpController",e)}(),function(){"use strict";function e(e,i,o,t,n,a,s,r){var l,d=this;d.system=n||{},d.processes=a?a.rows:[],d.processLimit=7,d.selectedTab=t.params.tab||0,d.getInfo=function(){return r.system.get().$promise.then(function(e){_.merge(d.system,e)}).catch(d.cancelInterval)},d.getProcesses=function(){return r.pm2.get().$promise.then(function(e){_.merge(d.processes,e?e.rows:[])}).catch(d.cancelInterval)},d.cancelInterval=function(e){i.cancel(l)},d.updateProcess=function(e,t,n){var a=o.confirm().title("Would you like to change the status of the process #"+t+"?").textContent("The status will be changed to: "+n.toUpperCase()).ariaLabel("Lucky day").targetEvent(e).ok("Ok").cancel("Cancel");o.show(a).then(function(){return r.pm2.update({id:t,status:n})}).then(function(){i(d.getProcesses,1e3,1)}).then(function(){s.success({title:"Process updated!",msg:"Status properly changed to: "+n})})},l=i(d.getInfo,5e3),e.$on("$destroy",function(){d.cancelInterval()})}e.$inject=["$scope","$interval","$mdDialog","$state","system","processes","toasty","api"],angular.module("app.settings.system").controller("SystemController",e)}(),function(){"use strict";function e(e,t,n,a,i){var o=this;o.title="SETTINGS.UPDATE",o.progress=0,o.updating=!0,o.output="Waiting...",o.success=!0,o.interval=t(function(){o.progress<90&&(o.progress+=1)},1e3),o.closeDialog=function(){e.hide()},o.reload=function(){n.location.reload()},o.stopInterval=function(){angular.isDefined(o.interval)&&(t.cancel(o.interval),o.interval=void 0);o.progress=100,o.updating=!1},i.version.fetch().$promise.then(function(e){return o.output=e.output+"...",i.version.reset().$promise}).then(function(e){return o.output=e.output+"...",i.version.pull().$promise}).then(function(e){return o.output=e.output+"...",i.version.migrations().$promise}).then(function(e){return o.output=e.output+"...",i.version.restart().$promise}).then(function(e){o.output="Waiting to restart motion...",a(function(){o.stopInterval()},3e4)}).catch(function(e){o.success=!1,o.stopInterval(),o.output=JSON.stringify(e)})}e.$inject=["$mdDialog","$interval","$window","$timeout","api"],angular.module("app.settings").controller("UpdateDialogController",e)}(),function(){"use strict";function e(n,e,a,t,i){this.version=t||{},this.updateConfirm=function(e){var t=n.confirm().title("Would you like to update your system?").htmlContent('The system request time for the update should be below 1 minute.<br><br>Do you agree the terms of this <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">End User License Agreement<a>?').ariaLabel("").targetEvent(e).clickOutsideToClose(!0).parent(angular.element(a.body)).ok("I agree").cancel("Disagree");n.show(t).then(function(){n.show({controller:"UpdateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/updates/update/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!1})})}}e.$inject=["$mdDialog","$interval","$document","version","toasty"],angular.module("app.settings").controller("UpdatesController",e)}(),function(){"use strict";function e(e,s,t,n,a,i,o,r,l,d,c,m,u,p,g,v){var h=this,b=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum"],f=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var A in h.availableStates=["ringing","inuse","busy","onhold","not_inuse"],h.pauses=o||{count:0,rows:[]},h.license=g,h.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},h.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},h.paginatedAgents={},h.load=!1,h.order=[],h.agentInternal={},h.agents)h.agents.hasOwnProperty(A)&&(h.agents[A].init=!0);h.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},h.logout=function(e,t){return d.user.logout({id:e.id}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),h.agents[e.id]&&(h.agents[e.id].online=!1),h.rpcAgents[e.id]&&(h.rpcAgents[e.id].online=!1),y()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"sms",realtime:!0,direction:"inbound"}})},h.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},h.getAgentStatus=C,h.getAgentGlobalStatus=x,h.isPause=S,h.checkPause=function(e){return"pause"===e},h.isPartialPause=function(e){return"*pause"===e},h.onSave=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(_.omit(e,f),b)),_.merge(h.rpcAgents[e.id],_.pick(_.omit(e,f),b)),x(h.agents[e.id]))},h.onUpdate=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(e,b)),_.merge(h.rpcAgents[e.id],_.pick(e,b)),x(h.agents[e.id]))},h.onInit=y,h.onConnect=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(_.merge(h.agents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(h.rpcAgents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},h.onComplete=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(h.agents[h.agentInternal[e.destaccountcode]]=_.omit(h.agents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),h.rpcAgents[h.agentInternal[e.destaccountcode]]=_.omit(h.rpcAgents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",h.onSave),c.on("user:update",h.onUpdate),c.on("user:agentconnect",h.onConnect),c.on("user:agentcomplete",h.onComplete),y();var E=v(function(){h.load&&(h.load=!1,y())},999);function y(e){h.load=!1;var t,n,a=s.defer();h.promise=a.promise,h.filteredAgents=[],h.order=[],_.forIn(h.agents,function(e,t){h.rpcAgents[t]&&_.merge(e,_.pick(_.omit(h.rpcAgents[t],f),b)),x(e),e.online?(h.filteredAgents.push(e),h.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),h.query.globalStatusFilter&&_.remove(h.filteredAgents,function(e){return e.globalStatus!==h.query.globalStatusFilter}),h.query.pauseTypeFilter&&_.remove(h.filteredAgents,function(e){return e.pauseType!==h.query.pauseTypeFilter}),h.query.filter&&_.remove(h.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(h.query.filter.toLowerCase())<0}),h.filteredAgents=(t=h.filteredAgents,n=_.startsWith(h.query.order,"-")?"desc":"asc",_.orderBy(t,[h.query.order.replace("-","")],[n]));var i=(h.query.page-1)*h.query.limit;h.paginatedAgents=_.drop(h.filteredAgents,i).slice(0,h.query.limit);for(var o=0;o<h.paginatedAgents.length;o+=1)h.order.push(h.paginatedAgents[o].id);a.resolve(),h.load=!0}function S(e){return"pause"===e||"*pause"===e}function T(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function C(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function x(e){var t="unknown";t=_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"pause":_.some([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"*pause":_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],T)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=S(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),E&&(v.cancel(E),E=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","Auth","license","$interval"],angular.module("app.voice").controller("AgentsSmsRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function g(){var n=[];return _.forIn(u.queues,function(e,t){e.paused=0,e.loggedInDb=0,u.queues[t].agents={},n.push(l.smsQueue.getMembers({id:t}).$promise),u.rpcQueues[t]&&_.merge(e,_.pick(u.rpcQueues[t],p))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&u.queues[e[t].rows[n].SmsQueueId].paused++,u.queues[e[t].rows[n].SmsQueueId].loggedInDb++,u.queues[e[t].rows[n].SmsQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].SmsQueueId}).catch(function(e){console.error(e)})}u.count=s.count?s.count:0,u.queues=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.hasRole("admin")?u.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:u.query={id:m.getCurrentUser().id,channel:"sms",type:"inbound",sort:"-updatedAt",limit:10,page:1},u.success=b,u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=l.smsQueue.get(u.query,b).$promise:u.promise=l.user.getQueues(u.query,b).$promise},u.createOrEditSmsQueue=function(e,t){a.show({controller:"CreateOrEditSmsQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:t,smsQueues:_.values(u.queues),license:null,setting:null}})},u.agentAdd=function(e,t){a.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:t,smsQueues:u.queues?u.queues.rows:[],realtime:!1}})},u.updateQueue=function(e){return l.smsQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},u.onSave=function(e){u.queues[e.id]&&_.merge(u.queues[e.id],_.pick(e,p))},u.onSaveMember=function(e){u.queues[e.SmsQueueId]&&u.queues[e.SmsQueueId].loggedInDb++},u.onRemoveMember=function(e){u.queues[e.SmsQueueId]&&u.queues[e.SmsQueueId].loggedInDb--},u.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(u.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(u.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},u.onLogin=function(e){console.log("onLogged",e),u.queues[e.SmsQueueId]&&(u.queues[e.SmsQueueId].loggedInDb+=1,u.queues[e.SmsQueueId].agents[e.UserId]=e.SmsQueueId)},u.onLogout=function(e){console.log("onLogout",e),u.queues[e.SmsQueueId]&&0<u.queues[e.SmsQueueId].loggedInDb&&(u.queues[e.SmsQueueId].loggedInDb-=1,delete u.queues[e.SmsQueueId].agents[e.UserId])},u.$onInit=g,u.order=[],_.forIn(u.queues,function(e,t){u.order.push(e.id)}),d.on("sms_queue:save",u.onSave),d.on("userSmsQueue:save",u.onSaveMember),d.on("userSmsQueue:remove",u.onRemoveMember),d.on("user:update",u.onPause),d.on("userVoiceQueue:remove",u.onLogout),d.on("userVoiceQueue:save",u.onLogin);var v=!0,h=1;function b(e){if(u.count=e.count,u.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){u.order=[];for(var t=0;t<e.rows.length;t++)u.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("sms_queue:save"),d.removeAllListeners("userSmsQueue:remove"),d.removeAllListeners("userSmsQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","Auth"],angular.module("app.sms").controller("QueuesSmsRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.sms.realtime.agents":this.selectedTab=0;break;case"app.sms.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,n.go("app.sms.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.sms.realtime.agents");break;case 1:n.go("app.sms.realtime.queues");break;default:n.go("app.sms.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.sms").controller("SmsRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SMS.EDIT_SMSACCOUNT",m.smsAccount=angular.copy(s),m.smsAccounts=o,m.newSmsAccount=!1,m.smsAccount||(m.smsAccount={remote:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():""),type:"twilio",waitForTheAssignedAgent:10,notificationSound:!0},m.title="SMS.NEW_SMSACCOUNT",m.newSmsAccount=!0),t.params.id&&(m.smsAccount.SmsAccountId=t.params.id),m.addNewSmsAccount=function(){m.errors=[],r.smsAccount.save(m.smsAccount).$promise.then(function(e){m.smsAccounts.unshift(e.toJSON()),i.success({title:"SmsAccount properly created",msg:m.smsAccount.name?m.smsAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSmsAccount=function(){m.errors=[],r.smsAccount.update({id:m.smsAccount.id},m.smsAccount).$promise.then(function(e){var t=_.find(m.smsAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SmsAccount properly saved!",msg:m.smsAccount.name?m.smsAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSmsAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The smsAccount will be deleted.").ariaLabel("Delete SmsAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.smsAccount.delete({id:m.smsAccount.id}).$promise.then(function(){_.remove(m.smsAccounts,{id:m.smsAccount.id}),i.success({title:"SmsAccount properly deleted!",msg:(m.smsAccount.name||"smsAccount")+" has been deleted!"}),u(m.smsAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","smsAccounts","smsAccount","api","Auth","license","setting"],angular.module("app.sms").controller("CreateOrEditSmsAccountDialogController",e)}(),function(){"use strict";function e(s,i,a,o,e){var r=this;function t(e,t){if(r.smsAccountApps.rows.length){var n=r.smsAccountApps.rows[t]?r.smsAccountApps.rows[t]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccountApp:n,smsAccount:r.smsAccount}}).then(function(e){e&&(e.id?r.smsAccountApps.rows[t]=e:r.smsAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.smsAccountApps.rows.length;n++,0){var a=r.smsAccountApps.rows[n],i=[],o=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.smsAccount.context,a.exten=r.smsAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(o.length?_.last(o).priority:a.priority)+1,t=_.concat(t,i,[a],o)}s.smsAccount.addApplications({id:r.smsAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.smsAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.smsAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.smsAccount={},r.smsAccountApps={count:0,rows:[]},r.selectedSmsAccountApps=[],r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"SmsQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",route:"smsQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",maxlength:255,required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e){r.smsAccount=e,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getSmsAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.smsAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getSmsAccountApps=function(){r.promise=s.smsAccount.getApplications(r.query,n).$promise},r.editSmsAccountApp=t,r.editInterval=function(e,t){if(r.smsAccountApps.rows.length){var n=r.smsAccountApps.rows[t]?r.smsAccountApps.rows[t]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteSmsAccountApp=function(e){_.remove(r.smsAccountApps.rows,{id:e.id}),l(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedSmsAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedSmsAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedSmsAccountApps.forEach(function(e){_.remove(r.smsAccountApps.rows,{id:e.id})}),r.selectedSmsAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return s.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.sms").controller("SmsAccountActionsController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(e.appType||e.app).toUpperCase(),o.agent=angular.copy(e),o.agent.appdata)switch(o.agent.appType?o.agent.appType.toLowerCase():o.agent.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.agent.appdata.split(",");o.agent.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.agent.text=s.slice(1,s.length).join(",");break;case"message":o.agent.text=o.agent.appdata;break;case"set":o.agent.name=o.agent.appdata.split("=")[0],o.agent.value=o.agent.appdata.split("=")[1];break;case"agi":o.agent.project=o.agent.appdata;break;default:var r=o.agent.appdata.split(",");o.agent.agent=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.agent.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.agent.timeout=30;function l(e){t.hide(e)}o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outbounddial"===o.agent.appType.toLowerCase()&&(o.agent.prefix=o.agent.phone?o.agent.phone.split("$")[0]:void 0,o.agent.callerId=o.agent.callerID?"CALLERID(all)="+o.agent.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outboundDial"===o.agent.appType&&(o.agent.phone=a.cutdigits?(o.agent.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.agent.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.agent.options+="U(xcally-mixmonitor-context)"):o.agent.options=o.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.agents,{name:o.agent.agent});t&&(o.agent.UserId=t.id);if(o.agent.appType&&"custom"===o.agent.appType);else switch((o.agent.app||o.agent.appType).toLowerCase()){case"set":o.agent.appdata=o.agent.name+"="+o.agent.value;break;case"custom":break;default:e[0]=o.agent.agent,e[1]=o.agent.timeout,o.agent.appdata=e.join(",")}l(o.agent)},o.closeDialog=l,i.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){o.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(n.appType||n.app).toUpperCase(),o.autoreply=angular.copy(n),o.autoreply.appdata)switch(o.autoreply.appType?o.autoreply.appType.toLowerCase():o.autoreply.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.autoreply.appdata.split(",");o.autoreply.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.autoreply.text=s.slice(1,s.length).join(",");break;case"message":o.autoreply.text=o.autoreply.appdata;break;case"set":o.autoreply.name=o.autoreply.appdata.split("=")[0],o.autoreply.value=o.autoreply.appdata.split("=")[1];break;case"agi":o.autoreply.project=o.autoreply.appdata;break;default:var r=o.autoreply.appdata.split(",");o.autoreply.times=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.autoreply.text=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.autoreply.times=1;function l(e){t.hide(e)}o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outbounddial"===o.autoreply.appType.toLowerCase()&&(o.autoreply.prefix=o.autoreply.phone?o.autoreply.phone.split("$")[0]:void 0,o.autoreply.callerId=o.autoreply.callerID?"CALLERID(all)="+o.autoreply.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outboundDial"===o.autoreply.appType&&(o.autoreply.phone=a.cutdigits?(o.autoreply.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.autoreply.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.autoreply.options+="U(xcally-mixmonitor-context)"):o.autoreply.options=o.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(o.autoreply.appType&&"custom"===o.autoreply.appType);else switch((o.autoreply.app||o.autoreply.appType).toLowerCase()){case"set":o.autoreply.appdata=o.autoreply.name+"="+o.autoreply.value;break;case"custom":break;default:e[0]=o.autoreply.times,e[1]=o.autoreply.text,o.autoreply.appdata=e.join(",")}l(o.autoreply)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(n.appType||n.app).toUpperCase(),o.close=angular.copy(n),o.close.appdata)switch(o.close.appType?o.close.appType.toLowerCase():o.close.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.close.appdata.split(",");o.close.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.close.text=s.slice(1,s.length).join(",");break;case"message":o.close.text=o.close.appdata;break;case"set":o.close.name=o.close.appdata.split("=")[0],o.close.value=o.close.appdata.split("=")[1];break;case"agi":o.close.project=o.close.appdata;break;default:var r=o.close.appdata.split(",");o.close.disposition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outbounddial"===o.close.appType.toLowerCase()&&(o.close.prefix=o.close.phone?o.close.phone.split("$")[0]:void 0,o.close.callerId=o.close.callerID?"CALLERID(all)="+o.close.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outboundDial"===o.close.appType&&(o.close.phone=a.cutdigits?(o.close.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.close.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.close.options+="U(xcally-mixmonitor-context)"):o.close.options=o.close.options.replace("U(xcally-mixmonitor-context)",""));if(o.close.appType&&"custom"===o.close.appType);else switch((o.close.app||o.close.appType).toLowerCase()){case"set":o.close.appdata=o.close.name+"="+o.close.value;break;case"custom":break;default:e[0]=o.close.disposition,o.close.appdata=e.join(",")}l(o.close)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotoif=angular.copy(n),o.gotoif.appdata)switch(o.gotoif.appType?o.gotoif.appType.toLowerCase():o.gotoif.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotoif.appdata.split(",");o.gotoif.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotoif.text=s.slice(1,s.length).join(",");break;case"message":o.gotoif.text=o.gotoif.appdata;break;case"set":o.gotoif.name=o.gotoif.appdata.split("=")[0],o.gotoif.value=o.gotoif.appdata.split("=")[1];break;case"agi":o.gotoif.project=o.gotoif.appdata;break;default:var r=o.gotoif.appdata.split(",");o.gotoif.condition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.gotoif.truepriority=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.gotoif.falsepriority=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10)}function l(e){t.hide(e)}o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outbounddial"===o.gotoif.appType.toLowerCase()&&(o.gotoif.prefix=o.gotoif.phone?o.gotoif.phone.split("$")[0]:void 0,o.gotoif.callerId=o.gotoif.callerID?"CALLERID(all)="+o.gotoif.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outboundDial"===o.gotoif.appType&&(o.gotoif.phone=a.cutdigits?(o.gotoif.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotoif.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotoif.options+="U(xcally-mixmonitor-context)"):o.gotoif.options=o.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotoif.appType&&"custom"===o.gotoif.appType);else switch((o.gotoif.app||o.gotoif.appType).toLowerCase()){case"set":o.gotoif.appdata=o.gotoif.name+"="+o.gotoif.value;break;case"custom":break;default:e[0]=o.gotoif.condition,e[1]=o.gotoif.truepriority,e[2]=o.gotoif.falsepriority,o.gotoif.appdata=e.join(",")}l(o.gotoif)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotop=angular.copy(n),o.gotop.appdata)switch(o.gotop.appType?o.gotop.appType.toLowerCase():o.gotop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotop.appdata.split(",");o.gotop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotop.text=s.slice(1,s.length).join(",");break;case"message":o.gotop.text=o.gotop.appdata;break;case"set":o.gotop.name=o.gotop.appdata.split("=")[0],o.gotop.value=o.gotop.appdata.split("=")[1];break;case"agi":o.gotop.project=o.gotop.appdata;break;default:var r=o.gotop.appdata.split(",");o.gotop.priority=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outbounddial"===o.gotop.appType.toLowerCase()&&(o.gotop.prefix=o.gotop.phone?o.gotop.phone.split("$")[0]:void 0,o.gotop.callerId=o.gotop.callerID?"CALLERID(all)="+o.gotop.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outboundDial"===o.gotop.appType&&(o.gotop.phone=a.cutdigits?(o.gotop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotop.options+="U(xcally-mixmonitor-context)"):o.gotop.options=o.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotop.appType&&"custom"===o.gotop.appType);else switch((o.gotop.app||o.gotop.appType).toLowerCase()){case"set":o.gotop.appdata=o.gotop.name+"="+o.gotop.value;break;case"custom":break;default:e[0]=o.gotop.priority,o.gotop.appdata=e.join(",")}l(o.gotop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditSmsAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(n.appType||n.app).toUpperCase(),o.noop=angular.copy(n),o.noop.appdata)switch(o.noop.appType?o.noop.appType.toLowerCase():o.noop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.noop.appdata.split(",");o.noop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.noop.text=s.slice(1,s.length).join(",");break;case"message":o.noop.text=o.noop.appdata;break;case"set":o.noop.name=o.noop.appdata.split("=")[0],o.noop.value=o.noop.appdata.split("=")[1];break;case"agi":o.noop.project=o.noop.appdata;break;default:var r=o.noop.appdata.split(",");o.noop.value=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outbounddial"===o.noop.appType.toLowerCase()&&(o.noop.prefix=o.noop.phone?o.noop.phone.split("$")[0]:void 0,o.noop.callerId=o.noop.callerID?"CALLERID(all)="+o.noop.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outboundDial"===o.noop.appType&&(o.noop.phone=a.cutdigits?(o.noop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.noop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.noop.options+="U(xcally-mixmonitor-context)"):o.noop.options=o.noop.options.replace("U(xcally-mixmonitor-context)",""));if(o.noop.appType&&"custom"===o.noop.appType);else switch((o.noop.app||o.noop.appType).toLowerCase()){case"set":o.noop.appdata=o.noop.name+"="+o.noop.value;break;case"custom":break;default:e[0]=o.noop.value,o.noop.appdata=e.join(",")}l(o.noop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(e.appType||e.app).toUpperCase(),o.queue=angular.copy(e),o.queue.appdata)switch(o.queue.appType?o.queue.appType.toLowerCase():o.queue.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.queue.appdata.split(",");o.queue.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.queue.text=s.slice(1,s.length).join(",");break;case"message":o.queue.text=o.queue.appdata;break;case"set":o.queue.name=o.queue.appdata.split("=")[0],o.queue.value=o.queue.appdata.split("=")[1];break;case"agi":o.queue.project=o.queue.appdata;break;default:var r=o.queue.appdata.split(",");o.queue.queue=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.queue.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.queue.queue=300,o.queue.timeout=300;function l(e){t.hide(e)}o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outbounddial"===o.queue.appType.toLowerCase()&&(o.queue.prefix=o.queue.phone?o.queue.phone.split("$")[0]:void 0,o.queue.callerId=o.queue.callerID?"CALLERID(all)="+o.queue.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outboundDial"===o.queue.appType&&(o.queue.phone=a.cutdigits?(o.queue.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.queue.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.queue.options+="U(xcally-mixmonitor-context)"):o.queue.options=o.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.queues,{name:o.queue.queue});t&&(o.queue[_.capitalize("sms")+"QueueId"]=t.id);if(o.queue.appType&&"custom"===o.queue.appType);else switch((o.queue.app||o.queue.appType).toLowerCase()){case"set":o.queue.appdata=o.queue.name+"="+o.queue.value;break;case"custom":break;default:e[0]=o.queue.queue,e[1]=o.queue.timeout,o.queue.appdata=e.join(",")}l(o.queue)},o.closeDialog=l,i.smsQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){o.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(e.appType||e.app).toUpperCase(),o.system=angular.copy(e),o.system.appdata)switch(o.system.appType?o.system.appType.toLowerCase():o.system.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.system.appdata.split(",");o.system.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.system.text=s.slice(1,s.length).join(",");break;case"message":o.system.text=o.system.appdata;break;case"set":o.system.name=o.system.appdata.split("=")[0],o.system.value=o.system.appdata.split("=")[1];break;case"agi":o.system.project=o.system.appdata;break;default:var r=o.system.appdata.split(",");o.system.command=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.system.variable=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.system.variable="";function l(e){t.hide(e)}o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outbounddial"===o.system.appType.toLowerCase()&&(o.system.prefix=o.system.phone?o.system.phone.split("$")[0]:void 0,o.system.callerId=o.system.callerID?"CALLERID(all)="+o.system.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outboundDial"===o.system.appType&&(o.system.phone=a.cutdigits?(o.system.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.system.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.system.options+="U(xcally-mixmonitor-context)"):o.system.options=o.system.options.replace("U(xcally-mixmonitor-context)",""));if(o.system.appType&&"custom"===o.system.appType);else switch((o.system.app||o.system.appType).toLowerCase()){case"set":o.system.appdata=o.system.name+"="+o.system.value;break;case"custom":break;default:e[0]=o.system.command,e[1]=o.system.variable,o.system.appdata=e.join(",")}l(o.system)},o.closeDialog=l,i.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){o.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppsystemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.smsAccount={},c.smsAccountInteractions={count:0,rows:[]},c.selectedSmsAccountInteractions=[],c.query={fields:"createdAt,updatedAt,id,createdAt,Contact.firstName,Owner.name,closedAt,disposition,note,UserId,ContactId,SmsAccountId,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e){c.smsAccount=e,c.query.id=c.smsAccount.id,c.getSmsAccountInteractions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getSmsAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.smsAccount.getInteractions(c.query,p).$promise},c.createOrEditSmsAccountInteraction=function(e,t){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/interactions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:c.smsAccount,interaction:t,interactions:c.smsAccountInteractions.rows,license:null,setting:null}})},c.spysmsInteraction=function(e,n){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"sms",interaction:n,spy:!0})}})},c.exportSelectedSmsAccountInteractions=function(){var e=angular.copy(c.selectedSmsAccountInteractions);return c.selectedSmsAccountInteractions=[],e},c.deleteSmsAccountInteraction=g,c.deleteSelectedSmsAccountInteractions=function(e){var t=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedSmsAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedSmsAccountInteractions.forEach(function(e){g(e)}),c.selectedSmsAccountInteractions=[]})};var m=!0,u=1;function p(e){c.smsAccountInteractions=e||{count:0,rows:[]}}function g(e){l.smsInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.smsAccountInteractions.rows,{id:e.id}),c.smsAccountInteractions.count-=1,c.smsAccountInteractions.rows.length||c.getSmsAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getSmsAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountInteractionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.smsAccount={},c.smsAccountSmsCannedAnswers={count:0,rows:[]},c.selectedSmsAccountSmsCannedAnswers=[],c.query={fields:"createdAt,updatedAt,id,key,value,description,createdAt",limit:10,page:1},c.init=function(e){c.smsAccount=e,c.query.id=c.smsAccount.id,c.query.SmsAccountId=c.smsAccount.id,c.getSmsAccountSmsCannedAnswers()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the smsCannedAnswer?").htmlContent("<b>"+(e.name||"smsCannedAnswer")+"</b> will be deleted.").ariaLabel("delete smsCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getSmsAccountSmsCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.smsAccount.getAnswers(c.query,p).$promise},c.createOrEditSmsAccountSmsCannedAnswer=function(e,t){o.show({controller:"CreateOrEditSmsCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:c.smsAccount,smsCannedAnswer:t,smsCannedAnswers:c.smsAccountSmsCannedAnswers.rows,license:null,setting:null}})},c.exportSelectedSmsAccountSmsCannedAnswers=function(){var e=angular.copy(c.selectedSmsAccountSmsCannedAnswers);return c.selectedSmsAccountSmsCannedAnswers=[],e},c.deleteSmsAccountSmsCannedAnswer=g,c.deleteSelectedSmsAccountSmsCannedAnswers=function(e){var t=o.confirm().title("Are you sure want to delete the selected smsCannedAnswers?").htmlContent("<b>"+c.selectedSmsAccountSmsCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete smsCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedSmsAccountSmsCannedAnswers.forEach(function(e){g(e)}),c.selectedSmsAccountSmsCannedAnswers=[]})};var m=!0,u=1;function p(e){c.smsAccountSmsCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.smsAccountSmsCannedAnswers.rows,{id:e.id}),c.smsAccountSmsCannedAnswers.count-=1,c.smsAccountSmsCannedAnswers.rows.length||c.getSmsAccountSmsCannedAnswers(),r.success({title:"SmsCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getSmsAccountSmsCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountSmsCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SMS.EDIT_SMSCANNEDANSWER",m.smsCannedAnswer=angular.copy(s),m.smsCannedAnswers=o,m.newSmsCannedAnswer=!1,m.smsCannedAnswer||(m.smsCannedAnswer={},m.title="SMS.NEW_SMSCANNEDANSWER",m.newSmsCannedAnswer=!0),t.params.id&&(m.smsCannedAnswer.SmsAccountId=t.params.id),m.addNewSmsCannedAnswer=function(){m.errors=[],r.cannedAnswer.save(m.smsCannedAnswer).$promise.then(function(e){m.smsCannedAnswers.unshift(e.toJSON()),i.success({title:"SmsCannedAnswer properly created",msg:m.smsCannedAnswer.name?m.smsCannedAnswer.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSmsCannedAnswer=function(){m.errors=[],r.cannedAnswer.update({id:m.smsCannedAnswer.id},m.smsCannedAnswer).$promise.then(function(e){var t=_.find(m.smsCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SmsCannedAnswer properly saved!",msg:m.smsCannedAnswer.name?m.smsCannedAnswer.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSmsCannedAnswer=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The smsCannedAnswer will be deleted.").ariaLabel("Delete SmsCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cannedAnswer.delete({id:m.smsCannedAnswer.id}).$promise.then(function(){_.remove(m.smsCannedAnswers,{id:m.smsCannedAnswer.id}),i.success({title:"SmsCannedAnswer properly deleted!",msg:(m.smsCannedAnswer.name||"smsCannedAnswer")+" has been deleted!"}),u(m.smsCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","smsCannedAnswers","smsCannedAnswer","api","Auth","license","setting"],angular.module("app.sms").controller("CreateOrEditSmsCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.smsAccount={},c.smsAccountSmsDispositions={count:0,rows:[]},c.selectedSmsAccountSmsDispositions=[],c.query={fields:"createdAt,updatedAt,id,name,createdAt",limit:10,page:1},c.init=function(e){c.smsAccount=e,c.query.id=c.smsAccount.id,c.query.SmsAccountId=c.smsAccount.id,c.getSmsAccountSmsDispositions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the smsDisposition?").htmlContent("<b>"+(e.name||"smsDisposition")+"</b> will be deleted.").ariaLabel("delete smsDisposition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getSmsAccountSmsDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.smsAccount.getDispositions(c.query,p).$promise},c.createOrEditSmsAccountSmsDisposition=function(e,t){o.show({controller:"CreateOrEditSmsDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/smsDispositions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:c.smsAccount,smsDisposition:t,smsDispositions:c.smsAccountSmsDispositions.rows,license:null,setting:null}})},c.exportSelectedSmsAccountSmsDispositions=function(){var e=angular.copy(c.selectedSmsAccountSmsDispositions);return c.selectedSmsAccountSmsDispositions=[],e},c.deleteSmsAccountSmsDisposition=g,c.deleteSelectedSmsAccountSmsDispositions=function(e){var t=o.confirm().title("Are you sure want to delete the selected smsDispositions?").htmlContent("<b>"+c.selectedSmsAccountSmsDispositions.length+" selected</b> will be deleted.").ariaLabel("delete smsDispositions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedSmsAccountSmsDispositions.forEach(function(e){g(e)}),c.selectedSmsAccountSmsDispositions=[]})};var m=!0,u=1;function p(e){c.smsAccountSmsDispositions=e||{count:0,rows:[]}}function g(e){l.smsDisposition.delete({id:e.id}).$promise.then(function(){_.remove(c.smsAccountSmsDispositions.rows,{id:e.id}),c.smsAccountSmsDispositions.count-=1,c.smsAccountSmsDispositions.rows.length||c.getSmsAccountSmsDispositions(),r.success({title:"SmsDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getSmsAccountSmsDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountSmsDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SMS.EDIT_SMSDISPOSITION",m.smsDisposition=angular.copy(s),m.smsDispositions=o,m.newSmsDisposition=!1,m.smsDisposition||(m.smsDisposition={},m.title="SMS.NEW_SMSDISPOSITION",m.newSmsDisposition=!0),t.params.id&&(m.smsDisposition.SmsAccountId=t.params.id),m.addNewSmsDisposition=function(){m.errors=[],r.smsDisposition.save(m.smsDisposition).$promise.then(function(e){m.smsDispositions.unshift(e.toJSON()),i.success({title:"SmsDisposition properly created",msg:m.smsDisposition.name?m.smsDisposition.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsDisposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsDisposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSmsDisposition=function(){m.errors=[],r.smsDisposition.update({id:m.smsDisposition.id},m.smsDisposition).$promise.then(function(e){var t=_.find(m.smsDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SmsDisposition properly saved!",msg:m.smsDisposition.name?m.smsDisposition.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsDisposition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsDisposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSmsDisposition=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The smsDisposition will be deleted.").ariaLabel("Delete SmsDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.smsDisposition.delete({id:m.smsDisposition.id}).$promise.then(function(){_.remove(m.smsDispositions,{id:m.smsDisposition.id}),i.success({title:"SmsDisposition properly deleted!",msg:(m.smsDisposition.name||"smsDisposition")+" has been deleted!"}),u(m.smsDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsDisposition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsDisposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","smsDispositions","smsDisposition","api","Auth","license","setting"],angular.module("app.sms").controller("CreateOrEditSmsDispositionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.smsAccount=d||e.params.smsAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoSmsAccounts=function(){e.go("app.sms.smsAccounts")},c.saveSmsAccount=function(){s.smsAccount.update({id:c.smsAccount.id},c.smsAccount).$promise.then(function(){r.success({title:"SmsAccount updated!",msg:c.smsAccount.name?c.smsAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.lists=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","smsAccount"],angular.module("app.sms").controller("SmsAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.smsAccounts=r||{count:0,rows:[]},v.table="smsAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedSmsAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,smsMethod,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,page:1},v.arraytype=_.keyBy([{option:"Twilio",value:"'twilio'"},{option:"Skebby",value:"'skebby'"},{option:"Connectel",value:"'connectel'"},{option:"ClickSend",value:"'clicksend'"},{option:"Plivo",value:"'plivo'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysmsMethod=_.keyBy([{option:"Basic",value:"'basic'"},{option:"Classic",value:"'classic'"},{option:"Classic+",value:"'classic+'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.sms.smsAccounts.edit",{id:e.id,smsAccount:e})},v.interactionsgoto=function(e,t){n.go("app.sms.smsAccounts.edit",{id:e.id,tab:5})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the smsAccount?").htmlContent("<b>"+(e.name||"smsAccount")+"</b> will be deleted.").ariaLabel("delete smsAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getSmsAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.smsAccount.get(v.query,f).$promise},v.createOrEditSmsAccount=function(e,t){i.show({controller:"CreateOrEditSmsAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:t,smsAccounts:v.smsAccounts.rows,license:v.license,setting:v.setting}})},v.deleteSmsAccount=A,v.exportSelectedSmsAccounts=function(){var e=angular.copy(v.selectedSmsAccounts);return v.selectedSmsAccounts=[],e},v.deleteSelectedSmsAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected smsAccounts?").htmlContent("<b>"+v.selectedSmsAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SmsAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedSmsAccounts.forEach(function(e){A(e)}),v.selectedSmsAccounts=[]})},v.deselectSmsAccounts=function(){v.selectedSmsAccounts=[]},v.selectAllSmsAccounts=function(){v.selectedSmsAccounts=v.smsAccounts.rows},l.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.lists=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.smsAccounts=e||{count:0,rows:[]}}function A(e){l.smsAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.smsAccounts.rows,{id:e.id}),v.smsAccounts.count-=1,v.smsAccounts.rows.length||v.getSmsAccounts(),c.success({title:"SmsAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getSmsAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","smsAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.sms").controller("SmsAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SMS.EDIT_SMSQUEUE",m.smsQueue=angular.copy(s),m.smsQueues=o,m.newSmsQueue=!1,m.smsQueue||(m.smsQueue={strategy:"beepall",timeout:10},m.title="SMS.NEW_SMSQUEUE",m.newSmsQueue=!0),m.addNewSmsQueue=function(){m.errors=[],r.smsQueue.save(m.smsQueue).$promise.then(function(e){m.smsQueues.unshift(e.toJSON()),i.success({title:"SmsQueue properly created",msg:m.smsQueue.name?m.smsQueue.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSmsQueue=function(){m.errors=[],r.smsQueue.update({id:m.smsQueue.id},m.smsQueue).$promise.then(function(e){var t=_.find(m.smsQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SmsQueue properly saved!",msg:m.smsQueue.name?m.smsQueue.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSmsQueue=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The smsQueue will be deleted.").ariaLabel("Delete SmsQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.smsQueue.delete({id:m.smsQueue.id}).$promise.then(function(){_.remove(m.smsQueues,{id:m.smsQueue.id}),i.success({title:"SmsQueue properly deleted!",msg:(m.smsQueue.name||"smsQueue")+" has been deleted!"}),u(m.smsQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","smsQueues","smsQueue","api","Auth","license","setting"],angular.module("app.sms").controller("CreateOrEditSmsQueueDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.smsQueue[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.smsQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserSmsQueue?"penalty "+e.UserSmsQueue.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserSmsQueue?"penalty "+e.UserSmsQueue.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.smsQueue=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("SMS.ALL_AGENTS"),labelSelected:s.instant("SMS.SELECTED_AGENTS"),transferCallback:function(e,t){a.smsQueue[t?"removeAgents":"addAgents"]({id:l.smsQueue.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"SmsQueue properly "+(t?"removed":"added"),msg:"SmsQueue has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:smsQueue.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","smsQueue","smsQueues","realtime","$translate","Auth"],angular.module("app.sms").controller("SmsQueueagentaddController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.smsQueue=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("SMS.ALL_TEAMS"),labelSelected:i.instant("SMS.SELECTED_TEAMS"),transferCallback:function(e,t){a.smsQueue[t?"removeTeams":"addTeams"]({id:o.smsQueue.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:smsQueue.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.smsQueue.getTeams({id:o.smsQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","smsQueue","$translate"],angular.module("app.sms").controller("SmsQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.smsQueue=d||e.params.smsQueue||{},c.selectedTab=e.params.tab||0,c.teamadddialog=function(e,t){n.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:c.smsQueues?c.smsQueues.rows:[]}})},c.agentadddialog=function(e,t){n.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:c.smsQueues?c.smsQueues.rows:[],realtime:!1}})},c.alert=r.info,c.gotoSmsQueues=function(){e.go("app.sms.smsQueues")},c.saveSmsQueue=function(){s.smsQueue.update({id:c.smsQueue.id},c.smsQueue).$promise.then(function(){r.success({title:"SmsQueue updated!",msg:c.smsQueue.name?c.smsQueue.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","smsQueue"],angular.module("app.sms").controller("SmsQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.smsQueues=r||{count:0,rows:[]},v.table="smsQueues",v.listOrder="",v.listOrderAsc=null,v.selectedSmsQueues=[],v.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,page:1},v.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.sms.smsQueues.edit",{id:e.id,smsQueue:e})},v.teamadddialog=function(e,t){i.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:v.smsQueues?v.smsQueues.rows:[]}})},v.agentadddialog=function(e,t){i.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:v.smsQueues?v.smsQueues.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the smsQueue?").htmlContent("<b>"+(e.name||"smsQueue")+"</b> will be deleted.").ariaLabel("delete smsQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.sms.realtime.queues",{})},v.success=f,v.getSmsQueues=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.smsQueue.get(v.query,f).$promise},v.createOrEditSmsQueue=function(e,t){i.show({controller:"CreateOrEditSmsQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:t,smsQueues:v.smsQueues.rows,license:v.license,setting:v.setting}})},v.deleteSmsQueue=A,v.exportSelectedSmsQueues=function(){var e=angular.copy(v.selectedSmsQueues);return v.selectedSmsQueues=[],e},v.deleteSelectedSmsQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected smsQueues?").htmlContent("<b>"+v.selectedSmsQueues.length+" selected</b> will be deleted.").ariaLabel("delete SmsQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedSmsQueues.forEach(function(e){A(e)}),v.selectedSmsQueues=[]})},v.deselectSmsQueues=function(){v.selectedSmsQueues=[]},v.selectAllSmsQueues=function(){v.selectedSmsQueues=v.smsQueues.rows};var h=!0,b=1;function f(e){v.smsQueues=e||{count:0,rows:[]}}function A(e){l.smsQueue.delete({id:e.id}).$promise.then(function(){_.remove(v.smsQueues.rows,{id:e.id}),v.smsQueues.count-=1,v.smsQueues.rows.length||v.getSmsQueues(),c.success({title:"SmsQueue deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsQueue"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getSmsQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","smsQueues","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.sms").controller("SmsQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.agents=r||{count:0,rows:[]},v.table="agents",v.listOrder="",v.listOrderAsc=null,v.selectedAgents=[],v.query={fields:"createdAt,updatedAt,id,role,fullname,name,alias,email,phone,mobile,userpic,password,showWebBar,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,voicemail,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,passwordResetAt,passwordResetAt",role:"agent",sort:"-updatedAt",limit:10,page:1},v.arrayshowWebBar=_.keyBy([{option:"Phonebar",value:"0"},{option:"External",value:"1"},{option:"WebRTC (rc-1)",value:"2"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'",ngIf:"vm.agent.showWebBar == 1"},{option:"wss",value:"'wss'",ngIf:"vm.agent.showWebBar == 1"},{option:"tls",value:"'tls'",ngIf:"vm.agent.showWebBar == 1"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytype=_.keyBy([{option:"Friend",value:"'friend'"},{option:"User",value:"'user'"},{option:"Peer",value:"'peer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayextensionMonitor=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'WAV'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.staff.agents.edit",{id:e.id,agent:e})},v.teamadddialog=function(e,t){i.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:v.agents?v.agents.rows:[]}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the agent?").htmlContent("<b>"+(e.name||"agent")+"</b> will be deleted.").ariaLabel("delete agent").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getAgents=function(){v.query.offset=(v.query.page-1)*v.query.limit,m.hasRole("admin")?v.promise=l.user.get(v.query,f).$promise:(v.query.id=v.currentUser.id,v.promise=l.user.getAgents(v.query,f).$promise)},v.createOrEditAgent=function(e,t){i.show({controller:"CreateOrEditAgentDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{agent:t,agents:v.agents.rows,license:v.license,setting:v.setting}})},v.deleteAgent=A,v.exportSelectedAgents=function(){var e=angular.copy(v.selectedAgents);return v.selectedAgents=[],e},v.deleteSelectedAgents=function(e){var t=i.confirm().title("Are you sure want to delete the selected agents?").htmlContent("<b>"+v.selectedAgents.length+" selected</b> will be deleted.").ariaLabel("delete Agents").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedAgents.forEach(function(e){A(e)}),v.selectedAgents=[]})},v.deselectAgents=function(){v.selectedAgents=[]},v.selectAllAgents=function(){v.selectedAgents=v.agents.rows};var h=!0,b=1;function f(e){v.agents=e||{count:0,rows:[]}}function A(e){l.user.delete({id:e.id}).$promise.then(function(){_.remove(v.agents.rows,{id:e.id}),v.agents.count-=1,v.agents.rows.length||v.getAgents(),c.success({title:"Agent deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getAgents())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","agents","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("AgentsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="STAFF.EDIT_AGENT",m.agent=angular.copy(s),m.agents=o,m.newAgent=!1,m.agent||(m.agent={role:"agent",showWebBar:"0",autointernal:!0,type:"friend",context:"from-sip",phoneBarRemoteControl:!0,phoneBarRemoteControlPort:9888,allowmessenger:!0},m.title="STAFF.NEW_AGENT",m.newAgent=!0),m.addNewAgent=function(){m.errors=[],r.user.save(m.agent).$promise.then(function(e){m.agents.unshift(e.toJSON()),i.success({title:"Agent properly created",msg:m.agent.name?m.agent.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveAgent=function(){m.errors=[],r.user.update({id:m.agent.id},m.agent).$promise.then(function(e){var t=_.find(m.agents,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Agent properly saved!",msg:m.agent.name?m.agent.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteAgent=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The agent will be deleted.").ariaLabel("Delete Agent").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.user.delete({id:m.agent.id}).$promise.then(function(){_.remove(m.agents,{id:m.agent.id}),i.success({title:"Agent properly deleted!",msg:(m.agent.name||"agent")+" has been deleted!"}),u(m.agent)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","agents","agent","api","Auth","license","setting"],angular.module("app.staff").controller("CreateOrEditAgentDialogController",e)}(),function(){"use strict";function e(e,a){var i=this;i.agent={},i.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size for image files is 8 Mb"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.agent.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.agent.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.agent=angular.copy(e),i.ngFlowOptions.target="api/users/"+i.agent.id+"/avatar",i.agent.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Agentchange_avatarController",e)}(),function(){"use strict";function e(e,t,n,a,i){var o=this;function s(){e.hide()}o.errors=[],o.setting=i,o.passwordPattern=o.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",o.agent=a,o.password="",o.savePassword=function(){o.errors=[],n.user.changePassword({id:o.agent.id,newPassword:o.password}).$promise.then(function(){t.success({title:"Agent password properly updated!"}),s()}).catch(function(e){console.error(e),o.errors=e.data.errors||[{message:e.toString(),type:"api.agent.changePassword"}]})},o.closeDialog=s}e.$inject=["$mdDialog","toasty","api","agent","setting"],angular.module("app.staff").controller("AgentchangepasswordController",e)}(),function(){"use strict";function e(i,e,t,o){var s=this;s.agent={},s.navigation=t.getNavigation(),s.init=function(e){s.agent=e},s.onChange=function(t,n){if((n||t).enabled){if(n)n.enabled=!0,s.agent.permissions.push(n.id);else for(var e=0;e<t.children.length;e++)t.children[e].enabled=!0,s.agent.permissions.push(t.children[e].id);t.enabled=!0,s.agent.permissions.push(t.id)}else if(n)n.enabled=!1,_.remove(s.agent.permissions,function(e){return n.id===e}),_.filter(t.children,{enabled:!1}).length===t.children.length&&(t.enabled=!1,_.remove(s.agent.permissions,function(e){return t.id===e}));else{t.enabled=!1,_.remove(s.agent.permissions,function(e){return t.id===e});for(var a=0;a<t.children.length;a++)t.children[a].enabled=!1,_.remove(s.agent.permissions,function(e){return t.children[a].id===e})}return i.user.update({id:s.agent.id,permissions:_.uniq(s.agent.permissions)}).$promise.then(function(){o.success({title:"agent updated!",msg:s.agent.name?s.agent.name+" has been updated!":""})}).catch(function(e){console.error(e)})}}e.$inject=["api","msNavigationService","msNavigationAgentService","toasty"],angular.module("app.staff").controller("AgentPermissionsController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l){var d=this;function c(){a.user[d.isVoiceRealtime()?"getVoiceQueuesRt":"getQueues"]({id:d.agent.id,fields:d.isVoiceRealtime()?"VoiceQueueId,queue_name,penalty":"id,name,strategy,type",channel:i,nolimit:!0}).$promise.then(function(e){return d.isVoiceRealtime()?d.selectedItems=e.rows?_.map(e.rows,function(e){return{id:e.VoiceQueueId,name:e.queue_name,penalty:e.hasOwnProperty("penalty")?"penalty "+e.penalty:"penalty 0",strategy:""}}):[]:d.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",e}):[],l.hasRole("admin")?a[d.apiname].get({fields:"id,name,strategy,type",nolimit:!0,type:s}).$promise:a.user.getQueues({id:l.getCurrentUser().id,fields:"id,name,strategy,type",nolimit:!0,type:s,channel:i}).$promise}).then(function(e){d.items=e.rows?e.rows:[],d.selectedItems=_.intersectionBy(d.selectedItems,d.items,"id"),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.items,d.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETQUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})})}d.agent=t,d.penalty=0,d.apiname=i+"Queue",d.title=r.instant("STAFF.QUEUEADD_AGENT_"+i.toUpperCase()+"_"+s.toUpperCase()),d.items=[],d.selectedItems=[],d.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"name",line2:"type",line3:"agent"===d.agent.role?"penalty":"",labelAll:r.instant("STAFF.ALL_QUEUES_"+i.toUpperCase()+"_"+s.toUpperCase()),labelSelected:r.instant("STAFF.SELECTED_QUEUES_"+i.toUpperCase()+"_"+s.toUpperCase()),transferCallback:function(e,t){a.user[t?"removeQueues":"addQueues"]({id:d.agent.id,ids:_.map(e,"id"),channel:i,penalty:d.penalty||0,realtime:o}).$promise.then(function(){c(),n.success({title:"Queue properly "+(t?"removed":"added"),msg:"Queue has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USER.ADDQUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d.closeDialog=function(){e.hide()},d.isVoiceRealtime=function(){return o&&"voice"===i},d.isVoiceChannel=function(){return"voice"===i},c()}e.$inject=["$mdDialog","toasty","api","agent","channel","realtime","direction","$translate","Auth"],angular.module("app.staff").controller("AgentqueueaddController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.agent=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("STAFF.ALL_TEAMS"),labelSelected:i.instant("STAFF.SELECTED_TEAMS"),transferCallback:function(e,t){a.user[t?"removeTeams":"addTeams"]({id:o.agent.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:agent.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.user.getTeams({id:o.agent.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","agent","$translate"],angular.module("app.staff").controller("AgentteamaddController",e)}(),function(){"use strict";function e(e,t,i,o,n,a,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=n,c.setting=a,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.agent=d||e.params.agent||{},c.selectedTab=e.params.tab||0,c.queueaddchannel=function(e,t,n,a){i.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(o.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,agents:c.agents?c.agents.rows:[],channel:t,realtime:!1,direction:a||"inbound"}})},c.teamadddialog=function(e,t){i.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:c.agents?c.agents.rows:[]}})},c.changepassworddialog=function(e,t){i.show({controller:"AgentchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,setting:a,agents:c.agents?c.agents.rows:[]}})},c.alert=r.info,c.gotoAgents=function(){e.go("app.staff.agents")},c.saveAgent=function(){c.agent=_.omit(c.agent,"userpic"),s.user.update({id:c.agent.id},c.agent).$promise.then(function(){r.success({title:"Agent updated!",msg:c.agent.name?c.agent.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","agent"],angular.module("app.staff").controller("AgentController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="STAFF.EDIT_TEAM",m.team=angular.copy(s),m.teams=o,m.newTeam=!1,m.team||(m.team={},m.title="STAFF.NEW_TEAM",m.newTeam=!0),m.addNewTeam=function(){m.errors=[],r.team.save(m.team).$promise.then(function(e){m.teams.unshift(e.toJSON()),i.success({title:"Team properly created",msg:m.team.name?m.team.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.team.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveTeam=function(){m.errors=[],r.team.update({id:m.team.id},m.team).$promise.then(function(e){var t=_.find(m.teams,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Team properly saved!",msg:m.team.name?m.team.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.team.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteTeam=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The team will be deleted.").ariaLabel("Delete Team").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.team.delete({id:m.team.id}).$promise.then(function(){_.remove(m.teams,{id:m.team.id}),i.success({title:"Team properly deleted!",msg:(m.team.name||"team")+" has been deleted!"}),u(m.team)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.team.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","teams","team","api","Auth","license","setting"],angular.module("app.staff").controller("CreateOrEditTeamDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.team[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.team.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserTeam?"penalty "+e.UserTeam.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserTeam?"penalty "+e.UserTeam.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.team=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("STAFF.ALL_AGENTS"),labelSelected:s.instant("STAFF.SELECTED_AGENTS"),transferCallback:function(e,t){a.team[t?"removeAgents":"addAgents"]({id:l.team.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:team.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","team","teams","realtime","$translate","Auth"],angular.module("app.staff").controller("TeamagentaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.teams=r||{count:0,rows:[]},v.table="teams",v.listOrder="",v.listOrderAsc=null,v.selectedTeams=[],v.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{team:e,teams:v.teams.rows,license:v.license,setting:null}})},v.agentadddialog=function(e,t){i.show({controller:"TeamagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{team:e,teams:v.teams?v.teams.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the team?").htmlContent("<b>"+(e.name||"team")+"</b> will be deleted.").ariaLabel("delete team").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getTeams=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.team.get(v.query,f).$promise},v.createOrEditTeam=function(e,t){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{team:t,teams:v.teams.rows,license:v.license,setting:v.setting}})},v.deleteTeam=A,v.exportSelectedTeams=function(){var e=angular.copy(v.selectedTeams);return v.selectedTeams=[],e},v.deleteSelectedTeams=function(e){var t=i.confirm().title("Are you sure want to delete the selected teams?").htmlContent("<b>"+v.selectedTeams.length+" selected</b> will be deleted.").ariaLabel("delete Teams").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedTeams.forEach(function(e){A(e)}),v.selectedTeams=[]})},v.deselectTeams=function(){v.selectedTeams=[]},v.selectAllTeams=function(){v.selectedTeams=v.teams.rows};var h=!0,b=1;function f(e){v.teams=e||{count:0,rows:[]}}function A(e){l.team.delete({id:e.id}).$promise.then(function(){_.remove(v.teams.rows,{id:e.id}),v.teams.count-=1,v.teams.rows.length||v.getTeams(),c.success({title:"Team deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEteam"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEteam",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getTeams())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","teams","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("TeamsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="STAFF.EDIT_TELEPHONE",m.telephone=angular.copy(s),m.telephones=o,m.newTelephone=!1,m.telephone||(m.telephone={role:"telephone",autointernal:!0,context:"from-sip"},m.title="STAFF.NEW_TELEPHONE",m.newTelephone=!0),m.addNewTelephone=function(){m.errors=[],r.user.save(m.telephone).$promise.then(function(e){m.telephones.unshift(e.toJSON()),i.success({title:"Telephone properly created",msg:m.telephone.name?m.telephone.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveTelephone=function(){m.errors=[],r.user.update({id:m.telephone.id},m.telephone).$promise.then(function(e){var t=_.find(m.telephones,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Telephone properly saved!",msg:m.telephone.name?m.telephone.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteTelephone=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The telephone will be deleted.").ariaLabel("Delete Telephone").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.user.delete({id:m.telephone.id}).$promise.then(function(){_.remove(m.telephones,{id:m.telephone.id}),i.success({title:"Telephone properly deleted!",msg:(m.telephone.name||"telephone")+" has been deleted!"}),u(m.telephone)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","telephones","telephone","api","Auth","license","setting"],angular.module("app.staff").controller("CreateOrEditTelephoneDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i){var o=this;function s(){e.hide()}o.errors=[],o.setting=i,o.passwordPattern=o.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",o.telephone=a,o.password="",o.savePassword=function(){o.errors=[],n.user.changePassword({id:o.telephone.id,newPassword:o.password}).$promise.then(function(){t.success({title:"Telephone password properly updated!"}),s()}).catch(function(e){console.error(e),o.errors=e.data.errors||[{message:e.toString(),type:"api.telephone.changePassword"}]})},o.closeDialog=s}e.$inject=["$mdDialog","toasty","api","telephone","setting"],angular.module("app.staff").controller("TelephonechangepasswordController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.telephone=d||e.params.telephone||{},c.selectedTab=e.params.tab||0,c.changepassworddialog=function(e,t){n.show({controller:"TelephonechangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{telephone:e,setting:o,telephones:c.telephones?c.telephones.rows:[]}})},c.alert=r.info,c.gotoTelephones=function(){e.go("app.staff.telephones")},c.saveTelephone=function(){s.user.update({id:c.telephone.id},c.telephone).$promise.then(function(){r.success({title:"Telephone updated!",msg:c.telephone.name?c.telephone.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","telephone"],angular.module("app.staff").controller("TelephoneController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.telephones=r||{count:0,rows:[]},v.table="telephones",v.listOrder="",v.listOrderAsc=null,v.selectedTelephones=[],v.query={fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,page:1},v.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.staff.telephones.edit",{id:e.id,telephone:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the telephone?").htmlContent("<b>"+(e.name||"telephone")+"</b> will be deleted.").ariaLabel("delete telephone").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getTelephones=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.user.get(v.query,f).$promise},v.createOrEditTelephone=function(e,t){i.show({controller:"CreateOrEditTelephoneDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{telephone:t,telephones:v.telephones.rows,license:v.license,setting:v.setting}})},v.deleteTelephone=A,v.exportSelectedTelephones=function(){var e=angular.copy(v.selectedTelephones);return v.selectedTelephones=[],e},v.deleteSelectedTelephones=function(e){var t=i.confirm().title("Are you sure want to delete the selected telephones?").htmlContent("<b>"+v.selectedTelephones.length+" selected</b> will be deleted.").ariaLabel("delete Telephones").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedTelephones.forEach(function(e){A(e)}),v.selectedTelephones=[]})},v.deselectTelephones=function(){v.selectedTelephones=[]},v.selectAllTelephones=function(){v.selectedTelephones=v.telephones.rows};var h=!0,b=1;function f(e){v.telephones=e||{count:0,rows:[]}}function A(e){l.user.delete({id:e.id}).$promise.then(function(){_.remove(v.telephones.rows,{id:e.id}),v.telephones.count-=1,v.telephones.rows.length||v.getTelephones(),c.success({title:"Telephone deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getTelephones())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","telephones","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("TelephonesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="STAFF.EDIT_USER",m.user=angular.copy(s),m.users=o,m.newUser=!1,m.user||(m.user={role:"user",autointernal:!0,context:"from-sip",crudPermissions:"0"},m.title="STAFF.NEW_USER",m.newUser=!0),m.addNewUser=function(){m.errors=[],r.user.save(m.user).$promise.then(function(e){m.users.unshift(e.toJSON()),i.success({title:"User properly created",msg:m.user.name?m.user.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveUser=function(){m.errors=[],r.user.update({id:m.user.id},m.user).$promise.then(function(e){var t=_.find(m.users,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"User properly saved!",msg:m.user.name?m.user.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteUser=function(e){if(l.getCurrentUser().id===m.user.id)return i.error({title:"User not deleted!",msg:"You can't remove yourself"});m.errors=[];var t=a.confirm().title("Are you sure?").content("The user will be deleted.").ariaLabel("Delete User").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.user.delete({id:m.user.id}).$promise.then(function(){_.remove(m.users,{id:m.user.id}),i.success({title:"User properly deleted!",msg:(m.user.name||"user")+" has been deleted!"}),u(m.user)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","users","user","api","Auth","license","setting"],angular.module("app.staff").controller("CreateOrEditUserDialogController",e)}(),function(){"use strict";function e(e,a){var i=this;i.user={},i.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size for image files is 8 Mb"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.user.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.user.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.user=angular.copy(e),i.ngFlowOptions.target="api/users/"+i.user.id+"/avatar",i.user.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Userchange_avatarController",e)}(),function(){"use strict";function e(e,t,n,a,i){var o=this;function s(){e.hide()}o.errors=[],o.setting=i,o.passwordPattern=o.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",o.user=a,o.password="",o.savePassword=function(){o.errors=[],n.user.changePassword({id:o.user.id,newPassword:o.password}).$promise.then(function(){t.success({title:"User password properly updated!"}),s()}).catch(function(e){console.error(e),o.errors=e.data.errors||[{message:e.toString(),type:"api.user.changePassword"}]})},o.closeDialog=s}e.$inject=["$mdDialog","toasty","api","user","setting"],angular.module("app.staff").controller("UserchangepasswordController",e)}(),function(){"use strict";function e(i,e,t,o){var s=this;s.user={},s.navigation=e.getNavigation(),s.init=function(e){s.user=e},s.onChange=function(t,n){if((n||t).enabled){if(n)n.enabled=!0,s.user.permissions.push(n.id);else for(var e=0;e<t.children.length;e++)t.children[e].enabled=!0,s.user.permissions.push(t.children[e].id);t.enabled=!0,s.user.permissions.push(t.id)}else if(n)n.enabled=!1,_.remove(s.user.permissions,function(e){return n.id===e}),_.filter(t.children,{enabled:!1}).length===t.children.length&&(t.enabled=!1,_.remove(s.user.permissions,function(e){return t.id===e}));else{t.enabled=!1,_.remove(s.user.permissions,function(e){return t.id===e});for(var a=0;a<t.children.length;a++)t.children[a].enabled=!1,_.remove(s.user.permissions,function(e){return t.children[a].id===e})}return i.user.update({id:s.user.id,permissions:_.uniq(s.user.permissions)}).$promise.then(function(){o.success({title:"user updated!",msg:s.user.name?s.user.name+" has been updated!":""})}).catch(function(e){console.error(e)})}}e.$inject=["api","msNavigationService","msNavigationAgentService","toasty"],angular.module("app.staff").controller("UserPermissionsController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l){var d=this;function c(){a.user[d.isVoiceRealtime()?"getVoiceQueuesRt":"getQueues"]({id:d.user.id,fields:d.isVoiceRealtime()?"VoiceQueueId,queue_name,penalty":"id,name,strategy,type",channel:i,nolimit:!0}).$promise.then(function(e){return d.isVoiceRealtime()?d.selectedItems=e.rows?_.map(e.rows,function(e){return{id:e.VoiceQueueId,name:e.queue_name,penalty:e.hasOwnProperty("penalty")?"penalty "+e.penalty:"penalty 0",strategy:""}}):[]:d.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",e}):[],l.hasRole("admin")?a[d.apiname].get({fields:"id,name,strategy,type",nolimit:!0,type:s}).$promise:a.user.getQueues({id:l.getCurrentUser().id,fields:"id,name,strategy,type",nolimit:!0,type:s,channel:i}).$promise}).then(function(e){d.items=e.rows?e.rows:[],d.selectedItems=_.intersectionBy(d.selectedItems,d.items,"id"),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.items,d.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETQUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})})}d.user=t,d.penalty=0,d.apiname=i+"Queue",d.title=r.instant("STAFF.QUEUEADD_USER_"+i.toUpperCase()+"_"+s.toUpperCase()),d.items=[],d.selectedItems=[],d.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"name",line2:"type",line3:"agent"===d.user.role?"penalty":"",labelAll:r.instant("STAFF.ALL_QUEUES_"+i.toUpperCase()+"_"+s.toUpperCase()),labelSelected:r.instant("STAFF.SELECTED_QUEUES_"+i.toUpperCase()+"_"+s.toUpperCase()),transferCallback:function(e,t){a.user[t?"removeQueues":"addQueues"]({id:d.user.id,ids:_.map(e,"id"),channel:i,penalty:d.penalty||0,realtime:o}).$promise.then(function(){c(),n.success({title:"Queue properly "+(t?"removed":"added"),msg:"Queue has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USER.ADDQUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d.closeDialog=function(){e.hide()},d.isVoiceRealtime=function(){return o&&"voice"===i},d.isVoiceChannel=function(){return"voice"===i},c()}e.$inject=["$mdDialog","toasty","api","user","channel","realtime","direction","$translate","Auth"],angular.module("app.staff").controller("UserqueueaddController",e)}(),function(){"use strict";function e(e,t,i,o,n,a,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=n,c.setting=a,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.user=d||e.params.user||{},c.selectedTab=e.params.tab||0,c.queueaddchannel=function(e,t,n,a){i.show({controller:"UserqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/queueadd/queueadd.html",parent:angular.element(o.body),targetEvent:n,clickOutsideToClose:!0,locals:{user:e,users:c.users?c.users.rows:[],channel:t,realtime:!1,direction:a||"inbound"}})},c.changepassworddialog=function(e,t){i.show({controller:"UserchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/changepassword/changepassword.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{user:e,setting:a,users:c.users?c.users.rows:[]}})},c.alert=r.info,c.gotoUsers=function(){e.go("app.staff.users")},c.saveUser=function(){c.user=_.omit(c.user,"userpic"),s.user.update({id:c.user.id},c.user).$promise.then(function(){r.success({title:"User updated!",msg:c.user.name?c.user.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","user"],angular.module("app.staff").controller("UserController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.users=r||{count:0,rows:[]},v.table="users",v.listOrder="",v.listOrderAsc=null,v.selectedUsers=[],v.query={fields:"createdAt,updatedAt,role,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,permissions,crudPermissions,passwordResetAt,passwordResetAt",role:"admin,user",sort:"-updatedAt",limit:10,page:1},v.arrayrole=_.keyBy([{option:"Admin",value:"'admin'"},{option:"User",value:"'user'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraycrudPermissions=_.keyBy([{option:"readAndEditAndDelete",value:"0"},{option:"readAndEdit",value:"1"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.staff.users.edit",{id:e.id,user:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the user?").htmlContent("<b>"+(e.name||"user")+"</b> will be deleted.").ariaLabel("delete user").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getUsers=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.user.get(v.query,f).$promise},v.createOrEditUser=function(e,t){i.show({controller:"CreateOrEditUserDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{user:t,users:v.users.rows,license:v.license,setting:v.setting}})},v.deleteUser=A,v.exportSelectedUsers=function(){var e=angular.copy(v.selectedUsers);return v.selectedUsers=[],e},v.deleteSelectedUsers=function(e){var t=i.confirm().title("Are you sure want to delete the selected users?").htmlContent("<b>"+v.selectedUsers.length+" selected</b> will be deleted.").ariaLabel("delete Users").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedUsers.forEach(function(e){A(e)}),v.selectedUsers=[]})},v.deselectUsers=function(){v.selectedUsers=[]},v.selectAllUsers=function(){v.selectedUsers=v.users.rows};var h=!0,b=1;function f(e){v.users=e||{count:0,rows:[]}}function A(e){l.user.delete({id:e.id}).$promise.then(function(){_.remove(v.users.rows,{id:e.id}),v.users.count-=1,v.users.rows.length||v.getUsers(),c.success({title:"User deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getUsers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","users","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("UsersController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.cannedAnswers=r||{count:0,rows:[]},v.table="cannedAnswers",v.listOrder="",v.listOrderAsc=null,v.selectedCannedAnswers=[],v.query={fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{cannedAnswer:e,cannedAnswers:v.cannedAnswers.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the cannedAnswer?").htmlContent("<b>"+(e.name||"cannedAnswer")+"</b> will be deleted.").ariaLabel("delete cannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getCannedAnswers=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.cannedAnswer.get(v.query,f).$promise},v.createOrEditCannedAnswer=function(e,t){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{cannedAnswer:t,cannedAnswers:v.cannedAnswers.rows,license:v.license,setting:v.setting}})},v.deleteCannedAnswer=A,v.exportSelectedCannedAnswers=function(){var e=angular.copy(v.selectedCannedAnswers);return v.selectedCannedAnswers=[],e},v.deleteSelectedCannedAnswers=function(e){var t=i.confirm().title("Are you sure want to delete the selected cannedAnswers?").htmlContent("<b>"+v.selectedCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete CannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedCannedAnswers.forEach(function(e){A(e)}),v.selectedCannedAnswers=[]})},v.deselectCannedAnswers=function(){v.selectedCannedAnswers=[]},v.selectAllCannedAnswers=function(){v.selectedCannedAnswers=v.cannedAnswers.rows};var h=!0,b=1;function f(e){v.cannedAnswers=e||{count:0,rows:[]}}function A(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(v.cannedAnswers.rows,{id:e.id}),v.cannedAnswers.count-=1,v.cannedAnswers.rows.length||v.getCannedAnswers(),c.success({title:"CannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcannedAnswer"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcannedAnswer",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getCannedAnswers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","cannedAnswers","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("CannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_CANNEDANSWER",m.cannedAnswer=angular.copy(s),m.cannedAnswers=o,m.newCannedAnswer=!1,m.cannedAnswer||(m.cannedAnswer={},m.title="TOOLS.NEW_CANNEDANSWER",m.newCannedAnswer=!0),m.addNewCannedAnswer=function(){m.errors=[],r.cannedAnswer.save(m.cannedAnswer).$promise.then(function(e){m.cannedAnswers.unshift(e.toJSON()),i.success({title:"CannedAnswer properly created",msg:m.cannedAnswer.name?m.cannedAnswer.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveCannedAnswer=function(){m.errors=[],r.cannedAnswer.update({id:m.cannedAnswer.id},m.cannedAnswer).$promise.then(function(e){var t=_.find(m.cannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"CannedAnswer properly saved!",msg:m.cannedAnswer.name?m.cannedAnswer.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteCannedAnswer=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The cannedAnswer will be deleted.").ariaLabel("Delete CannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cannedAnswer.delete({id:m.cannedAnswer.id}).$promise.then(function(){_.remove(m.cannedAnswers,{id:m.cannedAnswer.id}),i.success({title:"CannedAnswer properly deleted!",msg:(m.cannedAnswer.name||"cannedAnswer")+" has been deleted!"}),u(m.cannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","cannedAnswers","cannedAnswer","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_CUSTOMDASHBOARD",m.customDashboard=angular.copy(s),m.customDashboards=o,m.newCustomDashboard=!1,m.customDashboard||(m.customDashboard={},m.title="TOOLS.NEW_CUSTOMDASHBOARD",m.newCustomDashboard=!0),m.addNewCustomDashboard=function(){m.errors=[],r.dashboard.save(m.customDashboard).$promise.then(function(e){m.customDashboards.unshift(e.toJSON()),i.success({title:"CustomDashboard properly created",msg:m.customDashboard.name?m.customDashboard.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveCustomDashboard=function(){m.errors=[],r.dashboard.update({id:m.customDashboard.id},m.customDashboard).$promise.then(function(e){var t=_.find(m.customDashboards,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"CustomDashboard properly saved!",msg:m.customDashboard.name?m.customDashboard.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteCustomDashboard=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The customDashboard will be deleted.").ariaLabel("Delete CustomDashboard").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.dashboard.delete({id:m.customDashboard.id}).$promise.then(function(){_.remove(m.customDashboards,{id:m.customDashboard.id}),i.success({title:"CustomDashboard properly deleted!",msg:(m.customDashboard.name||"customDashboard")+" has been deleted!"}),u(m.customDashboard)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","customDashboards","customDashboard","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditCustomDashboardDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.customDashboards=r||{count:0,rows:[]},v.table="customDashboards",v.listOrder="",v.listOrderAsc=null,v.selectedCustomDashboards=[],v.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},v.editstate=function(e,t){n.go("app.tools.customDashboards.edit",{id:e.id,customDashboard:e})},v.useradddialog=function(e,t){i.show({controller:"CustomDashboarduseraddController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/useradd/useradd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:v.customDashboards?v.customDashboards.rows:[]}})},v.clonedialog=function(e,t){i.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:v.customDashboards?v.customDashboards.rows:[]}})},v.gotodashboardgoto=function(e,t){n.go("app.dashboards.custom",{id:e.id})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the customDashboard?").htmlContent("<b>"+(e.name||"customDashboard")+"</b> will be deleted.").ariaLabel("delete customDashboard").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getCustomDashboards=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.dashboard.get(v.query,f).$promise},v.createOrEditCustomDashboard=function(e,t){i.show({controller:"CreateOrEditCustomDashboardDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{customDashboard:t,customDashboards:v.customDashboards.rows,license:v.license,setting:v.setting}})},v.deleteCustomDashboard=A,v.exportSelectedCustomDashboards=function(){var e=angular.copy(v.selectedCustomDashboards);return v.selectedCustomDashboards=[],e},v.deleteSelectedCustomDashboards=function(e){var t=i.confirm().title("Are you sure want to delete the selected customDashboards?").htmlContent("<b>"+v.selectedCustomDashboards.length+" selected</b> will be deleted.").ariaLabel("delete CustomDashboards").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedCustomDashboards.forEach(function(e){A(e)}),v.selectedCustomDashboards=[]})},v.deselectCustomDashboards=function(){v.selectedCustomDashboards=[]},v.selectAllCustomDashboards=function(){v.selectedCustomDashboards=v.customDashboards.rows};var h=!0,b=1;function f(e){v.customDashboards=e||{count:0,rows:[]}}function A(e){l.dashboard.delete({id:e.id}).$promise.then(function(){_.remove(v.customDashboards.rows,{id:e.id}),v.customDashboards.count-=1,v.customDashboards.rows.length||v.getCustomDashboards(),c.success({title:"CustomDashboard deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdashboard"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getCustomDashboards())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","customDashboards","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("CustomDashboardsController",e)}(),function(){"use strict";function e(t,n,a,e,i,o,s){var r=this;function l(e){t.hide(e)}r.newCustomDashboard=!0,r.customDashboard=angular.copy(i),r.customDashboards=o,r.title=s.instant("TOOLS.CLONE_CUSTOMDASHBOARD"),i&&i.name&&(r.title+=": "+i.name),r.cloneCustomDashboard=function(){return e.dashboard.clone({id:i.id,includeAll:!0},r.customDashboard).$promise.then(function(e){r.customDashboards.unshift(e.toJSON()),a.success({title:"CustomDashboard properly cloned",msg:r.customDashboard.name?r.customDashboard.name+" has been cloned!":""}),n.go("app.tools.customDashboards.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.clone"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","customDashboard","customDashboards","$translate"],angular.module("app.tools").controller("CustomDashboardcloneController",e)}(),function(){"use strict";function e(n,a,e,i,o){var s=this;function t(e,t,n){return o.dashboardItem.update(n).$promise.catch(function(e){console.error(e)})}s.customDashboard={},s.voiceQueues=o.rpc.getVoiceQueues({fields:"id,name"}),s.init=function(e){return s.customDashboard=e,s.customDashboard.draggable={enabled:!0,handle:".draggable",stop:t},s.customDashboard.resizable={enabled:!0,handle:".resizable",stop:t},s.customDashboard.widgets=[],o.dashboard.getItems({id:e.id}).$promise.then(function(e){if(e&&e.count&&e.rows)for(var t=0;t<e.rows.length;t+=1)e.rows[t].voiceQueues=s.voiceQueues,e.rows[t].voiceQueuesSelected=_.map(s.voiceQueues.rows,"id"),e.rows[t].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[t].type+"/ms-widget-engine."+e.rows[t].type+".html",s.customDashboard.widgets.push(e.rows[t])}).catch(function(e){console.error(e)})},s.createOrEditWidget=function(e){if(e&&e.attrs)for(var t=0;t<e.attrs.length;t+=1)e[e.attrs[t].name]=e.attrs[t].value;n.show({controller:"CreateOrEditDashboardItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",parent:angular.element(a.body),clickOutsideToClose:!0,locals:{dashboarditem:e,dashboard:s.customDashboard.widgets,license:null,setting:null}}).then(function(e){for(var t=0;t<s.customDashboard.widgets.length;t+=1)s.customDashboard.widgets[t].id===e.id&&(s.customDashboard.widgets[t].attrs=e.attrs,s.customDashboard.widgets[t].voiceQueues=s.voiceQueues,s.customDashboard.widgets[t].voiceQueuesSelected=_.map(s.voiceQueues.rows,"id"),s.customDashboard.widgets[t].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+s.customDashboard.widgets[t].type+"/ms-widget-engine."+s.customDashboard.widgets[t].type+".html")})},s.deleteWidget=function(t){var e=n.confirm().title("Would you like to delete "+t.title+"?").textContent("").ariaLabel("Delete Widget").ok("YES").cancel("NO");n.show(e).then(function(){return o.dashboardItem.delete({id:t.id}).$promise.then(function(e){_.remove(s.customDashboard.widgets,{id:t.id}),i.success({title:"Widget deleted!",msg:t.name?t.name+" has been deleted!":"Widget has been deleted!"})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){s.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE.customDashboard"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()});console.error(e)})})}}e.$inject=["$mdDialog","$document","socket","toasty","api"],angular.module("app.tools").controller("CustomDashboardItemsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_DASHBOARDITEM",m.dashboarditem=angular.copy(s),m.dashboard=o,m.newDashboardItem=!1,m.dashboarditem||(m.dashboarditem={type:"counter",attrUrl:"https://",attrHourFormat:"HH:mm:ss",attrTimezone:"0.00",attrMetric:"total",attrSerie1:"total",attrSerie2:"null",attrSerie3:"null",attrRefresh:10,attrFontSize:20,foreground:"#2196f3",background:"#ffffff"},m.title="TOOLS.NEW_DASHBOARDITEM",m.newDashboardItem=!0),m.addNewDashboardItem=function(){m.errors=[],r.dashboard.addItem({id:t.params.id},m.dashboarditem).$promise.then(function(e){m.dashboard.unshift(e.toJSON()),i.success({title:"DashboardItem properly created",msg:m.dashboarditem.name?m.dashboarditem.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveDashboardItem=function(){m.errors=[],r.dashboardItem.update({id:m.dashboarditem.id},m.dashboarditem).$promise.then(function(e){var t=_.find(m.dashboard,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"DashboardItem properly saved!",msg:m.dashboarditem.name?m.dashboarditem.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteDashboardItem=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The dashboarditem will be deleted.").ariaLabel("Delete DashboardItem").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.dashboardItem.delete({id:m.dashboarditem.id}).$promise.then(function(){_.remove(m.dashboard,{id:m.dashboarditem.id}),i.success({title:"DashboardItem properly deleted!",msg:(m.dashboarditem.name||"dashboarditem")+" has been deleted!"}),u(m.dashboarditem)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.analyticCustomReport.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){m.customReports=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcustomReports",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.voiceQueue.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){m.voiceQueues=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","dashboard","dashboarditem","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditDashboardItemDialogController",e)}(),function(){"use strict";function e(e,i,o,s,t,n,a){var r=this;r.closeDialog=function(){e.hide()},r.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:n.instant("TOOLS.ALL_USERS"),labelSelected:n.instant("TOOLS.SELECTED_USERS"),transferCallback:function(e,t){for(var n=0,a=0;n<e.length;n+=1)a=99999+s.id,e[n].permissions=t?_.without(e[n].permissions,a):_.concat(e[n].permissions,a),o.user.update(e[n]).$promise.then(function(){i.success({title:"User properly "+(t?"removed":"added"),msg:"User has been "+(t?"removed":"added")+"!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:dashboard.ADDUSERS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},function(){if(s&&s.id){var t=99999+s.id;o.user.get({fields:"id,fullname,name,internal,permissions",role:"user",nolimit:!0}).$promise.then(function(e){r.dualMultiselectOptions.selectedItems=_.filter(e.rows,function(e){return _.includes(e.permissions,t)}),r.dualMultiselectOptions.items=_.differenceBy(e.rows,r.dualMultiselectOptions.selectedItems,"id")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}}()}e.$inject=["$mdDialog","toasty","api","customDashboard","customDashboards","$translate","Auth"],angular.module("app.tools").controller("CustomDashboarduseraddController",e)}(),function(){"use strict";function e(n,e,a,i,t,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=t,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.customDashboard=d||n.params.customDashboard||{},c.selectedTab=n.params.tab||0,c.useradddialog=function(e,t){a.show({controller:"CustomDashboarduseraddController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/useradd/useradd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:c.customDashboards?c.customDashboards.rows:[]}})},c.clonedialog=function(e,t){a.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:c.customDashboards?c.customDashboards.rows:[]}})},c.gotogoto=function(e,t){n.go("app.dashboards.custom",{id:e.id})},c.alert=r.info,c.gotoCustomDashboards=function(){n.go("app.tools.customDashboards")},c.saveCustomDashboard=function(){s.dashboard.update({id:c.customDashboard.id},c.customDashboard).$promise.then(function(){r.success({title:"CustomDashboard updated!",msg:c.customDashboard.name?c.customDashboard.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdashboard",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","customDashboard"],angular.module("app.tools").controller("CustomDashboardController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_INTERVAL",m.interval=angular.copy(s),m.intervals=o,m.newInterval=!1,m.interval||(m.interval={},m.title="TOOLS.NEW_INTERVAL",m.newInterval=!0),m.addNewInterval=function(){m.errors=[],r.interval.save(m.interval).$promise.then(function(e){m.intervals.unshift(e.toJSON()),i.success({title:"Interval properly created",msg:m.interval.name?m.interval.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveInterval=function(){m.errors=[],r.interval.update({id:m.interval.id},m.interval).$promise.then(function(e){var t=_.find(m.intervals,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Interval properly saved!",msg:m.interval.name?m.interval.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteInterval=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.interval.delete({id:m.interval.id}).$promise.then(function(){_.remove(m.intervals,{id:m.interval.id}),i.success({title:"Interval properly deleted!",msg:(m.interval.name||"interval")+" has been deleted!"}),u(m.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","intervals","interval","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditAppintervalDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.interval={},c.intervalIntervals={count:0,rows:[]},c.selectedIntervalIntervals=[],c.sortableTable={animation:100,onSort:function(e){l.interval.addIntervals({id:c.interval.id},e.models).$promise.then(function(e){c.intervalIntervals.rows=e}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SORTABLETABLE",msg:e.data?JSON.stringify(e.data):e.toString()})})}},c.query={fields:"createdAt,updatedAt,id,name,interval,createdAt",nolimit:"true",limit:10,page:1},c.init=function(e){c.interval=e,c.query.id=c.interval.id,c.getIntervalIntervals()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the interval?").htmlContent("<b>"+(e.name||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIntervalIntervals=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.interval.getIntervals(c.query,p).$promise},c.createOrEditIntervalInterval=function(e,t){o.show({controller:"EditAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:c.interval,interval:t,intervals:c.intervalIntervals.rows,license:null,setting:null}})},c.exportSelectedIntervalIntervals=function(){var e=angular.copy(c.selectedIntervalIntervals);return c.selectedIntervalIntervals=[],e},c.deleteIntervalInterval=g,c.deleteSelectedIntervalIntervals=function(e){var t=o.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+c.selectedIntervalIntervals.length+" selected</b> will be deleted.").ariaLabel("delete intervals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedIntervalIntervals.forEach(function(e){g(e)}),c.selectedIntervalIntervals=[]})};var m=!0,u=1;function p(e){c.intervalIntervals=e||{count:0,rows:[]}}function g(e){l.interval.delete({id:e.id}).$promise.then(function(){_.remove(c.intervalIntervals.rows,{id:e.id}),c.intervalIntervals.count-=1,c.intervalIntervals.rows.length||c.getIntervalIntervals(),r.success({title:"Interval deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETinterval"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIntervalIntervals())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("IntervalIntervalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_INTERVAL",m.interval=angular.copy(s),m.intervals=o,m.newInterval=!1,m.interval||(m.interval={},m.title="TOOLS.NEW_INTERVAL",m.newInterval=!0),m.addNewInterval=function(){m.errors=[],r.interval.save(m.interval).$promise.then(function(e){m.intervals.unshift(e.toJSON()),i.success({title:"Interval properly created",msg:m.interval.name?m.interval.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveInterval=function(){m.errors=[],r.interval.update({id:m.interval.id},m.interval).$promise.then(function(e){var t=_.find(m.intervals,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Interval properly saved!",msg:m.interval.name?m.interval.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteInterval=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.interval.delete({id:m.interval.id}).$promise.then(function(){_.remove(m.intervals,{id:m.interval.id}),i.success({title:"Interval properly deleted!",msg:(m.interval.name||"interval")+" has been deleted!"}),u(m.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","intervals","interval","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.interval=d||e.params.interval||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoIntervals=function(){e.go("app.tools.intervals")},c.saveInterval=function(){s.interval.update({id:c.interval.id},c.interval).$promise.then(function(){r.success({title:"Interval updated!",msg:c.interval.name?c.interval.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","interval"],angular.module("app.tools").controller("IntervalController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.intervals=r||{count:0,rows:[]},v.table="intervals",v.listOrder="",v.listOrderAsc=null,v.selectedIntervals=[],v.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,page:1},v.editstate=function(e,t){n.go("app.tools.intervals.edit",{id:e.id,interval:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the interval?").htmlContent("<b>"+(e.name||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getIntervals=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.interval.get(v.query,f).$promise},v.createOrEditInterval=function(e,t){i.show({controller:"CreateOrEditIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:t,intervals:v.intervals.rows,license:v.license,setting:v.setting}})},v.deleteInterval=A,v.exportSelectedIntervals=function(){var e=angular.copy(v.selectedIntervals);return v.selectedIntervals=[],e},v.deleteSelectedIntervals=function(e){var t=i.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+v.selectedIntervals.length+" selected</b> will be deleted.").ariaLabel("delete Intervals").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedIntervals.forEach(function(e){A(e)}),v.selectedIntervals=[]})},v.deselectIntervals=function(){v.selectedIntervals=[]},v.selectAllIntervals=function(){v.selectedIntervals=v.intervals.rows};var h=!0,b=1;function f(e){v.intervals=e||{count:0,rows:[]}}function A(e){l.interval.delete({id:e.id}).$promise.then(function(){_.remove(v.intervals.rows,{id:e.id}),v.intervals.count-=1,v.intervals.rows.length||v.getIntervals(),c.success({title:"Interval deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEinterval"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getIntervals())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","intervals","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("IntervalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_PAUSE",m.pause=angular.copy(s),m.pauses=o,m.newPause=!1,m.pause||(m.pause={},m.title="TOOLS.NEW_PAUSE",m.newPause=!0),m.addNewPause=function(){m.errors=[],r.pause.save(m.pause).$promise.then(function(e){m.pauses.unshift(e.toJSON()),i.success({title:"Pause properly created",msg:m.pause.name?m.pause.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.pause.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.savePause=function(){m.errors=[],r.pause.update({id:m.pause.id},m.pause).$promise.then(function(e){var t=_.find(m.pauses,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Pause properly saved!",msg:m.pause.name?m.pause.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.pause.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deletePause=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The pause will be deleted.").ariaLabel("Delete Pause").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.pause.delete({id:m.pause.id}).$promise.then(function(){_.remove(m.pauses,{id:m.pause.id}),i.success({title:"Pause properly deleted!",msg:(m.pause.name||"pause")+" has been deleted!"}),u(m.pause)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.pause.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","pauses","pause","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditPauseDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.pauses=r||{count:0,rows:[]},v.table="pauses",v.listOrder="",v.listOrderAsc=null,v.selectedPauses=[],v.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{pause:e,pauses:v.pauses.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the pause?").htmlContent("<b>"+(e.name||"pause")+"</b> will be deleted.").ariaLabel("delete pause").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getPauses=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.pause.get(v.query,f).$promise},v.createOrEditPause=function(e,t){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{pause:t,pauses:v.pauses.rows,license:v.license,setting:v.setting}})},v.deletePause=A,v.exportSelectedPauses=function(){var e=angular.copy(v.selectedPauses);return v.selectedPauses=[],e},v.deleteSelectedPauses=function(e){var t=i.confirm().title("Are you sure want to delete the selected pauses?").htmlContent("<b>"+v.selectedPauses.length+" selected</b> will be deleted.").ariaLabel("delete Pauses").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedPauses.forEach(function(e){A(e)}),v.selectedPauses=[]})},v.deselectPauses=function(){v.selectedPauses=[]},v.selectAllPauses=function(){v.selectedPauses=v.pauses.rows};var h=!0,b=1;function f(e){v.pauses=e||{count:0,rows:[]}}function A(e){l.pause.delete({id:e.id}).$promise.then(function(){_.remove(v.pauses.rows,{id:e.id}),v.pauses.count-=1,v.pauses.rows.length||v.getPauses(),c.success({title:"Pause deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEpause"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEpause",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getPauses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","pauses","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("PausesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_SCHEDULE",m.schedule=angular.copy(s),m.schedules=o,m.newSchedule=!1,m.schedule||(m.schedule={type:"custom",output:"xlsx",active:!0,startAt:new Date,endAt:new Date(Date.now()+2592e6),cron:"0 0 * * *",subtractNumber:1,subtractUnit:"days",sendMail:!1},m.title="TOOLS.NEW_SCHEDULE",m.newSchedule=!0),m.addNewSchedule=function(){m.errors=[],r.schedule.save(m.schedule).$promise.then(function(e){m.schedules.unshift(e.toJSON()),i.success({title:"Schedule properly created",msg:m.schedule.name?m.schedule.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSchedule=function(){m.errors=[],r.schedule.update({id:m.schedule.id},m.schedule).$promise.then(function(e){var t=_.find(m.schedules,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Schedule properly saved!",msg:m.schedule.name?m.schedule.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSchedule=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The schedule will be deleted.").ariaLabel("Delete Schedule").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.schedule.delete({id:m.schedule.id}).$promise.then(function(){_.remove(m.schedules,{id:m.schedule.id}),i.success({title:"Schedule properly deleted!",msg:(m.schedule.name||"schedule")+" has been deleted!"}),u(m.schedule)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.analyticCustomReport.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.customReports=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcustomReports",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.analyticDefaultReport.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.defaultReports=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdefaultReports",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.mailAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","schedules","schedule","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditScheduleDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.schedules=r||{count:0,rows:[]},v.table="schedules",v.listOrder="",v.listOrderAsc=null,v.selectedScheduler=[],v.query={fields:"createdAt,updatedAt,id,name,type,DefaultReportId,CustomReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,description",sort:"-updatedAt",limit:10,page:1},v.arraytype=_.keyBy([{option:"Default",value:"'default'"},{option:"Custom",value:"'custom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayoutput=_.keyBy([{option:"CSV",value:"'csv'"},{option:"PDF",value:"'pdf'"},{option:"Excel",value:"'xlsx'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysubtractUnit=_.keyBy([{option:"Minutes",value:"'minutes'"},{option:"Hours",value:"'hours'"},{option:"Days",value:"'days'"},{option:"Weeks",value:"'weeks'"},{option:"Months",value:"'months'"},{option:"Quarters",value:"'quarters'"},{option:"Years",value:"'years'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editdialog=function(e,t){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{schedule:e,schedules:v.schedules.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the schedule?").htmlContent("<b>"+(e.name||"schedule")+"</b> will be deleted.").ariaLabel("delete schedule").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getScheduler=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.schedule.get(v.query,f).$promise},v.createOrEditSchedule=function(e,t){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{schedule:t,schedules:v.schedules.rows,license:v.license,setting:v.setting}})},v.deleteSchedule=A,v.exportSelectedScheduler=function(){var e=angular.copy(v.selectedScheduler);return v.selectedScheduler=[],e},v.deleteSelectedScheduler=function(e){var t=i.confirm().title("Are you sure want to delete the selected schedules?").htmlContent("<b>"+v.selectedScheduler.length+" selected</b> will be deleted.").ariaLabel("delete Schedules").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedScheduler.forEach(function(e){A(e)}),v.selectedScheduler=[]})},v.deselectScheduler=function(){v.selectedScheduler=[]},v.selectAllScheduler=function(){v.selectedScheduler=v.schedules.rows},l.analyticCustomReport.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.customReports=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcustomReports",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.analyticDefaultReport.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.defaultReports=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdefaultReports",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.mailAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.schedules=e||{count:0,rows:[]}}function A(e){l.schedule.delete({id:e.id}).$promise.then(function(){_.remove(v.schedules.rows,{id:e.id}),v.schedules.count-=1,v.schedules.rows.length||v.getScheduler(),c.success({title:"Schedule deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEschedule"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEschedule",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getScheduler())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","schedules","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("SchedulesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_SOUND",m.sound=angular.copy(s),m.sounds=o,m.newSound=!1,m.sound||(m.sound={},m.title="TOOLS.NEW_SOUND",m.newSound=!0),m.addNewSound=function(){m.errors=[],r.sound.save(m.sound).$promise.then(function(e){m.sounds.unshift(e.toJSON()),i.success({title:"Sound properly created",msg:m.sound.name?m.sound.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.sound.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSound=function(){m.errors=[],r.sound.update({id:m.sound.id},m.sound).$promise.then(function(e){var t=_.find(m.sounds,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Sound properly saved!",msg:m.sound.name?m.sound.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.sound.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSound=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The sound will be deleted.").ariaLabel("Delete Sound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.sound.delete({id:m.sound.id}).$promise.then(function(){_.remove(m.sounds,{id:m.sound.id}),i.success({title:"Sound properly deleted!",msg:(m.sound.name||"sound")+" has been deleted!"}),u(m.sound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.sound.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","sounds","sound","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditSoundDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.sounds=r||{count:0,rows:[]},v.table="sounds",v.listOrder="",v.listOrderAsc=null,v.selectedSounds=[],v.query={fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{sound:e,sounds:v.sounds.rows,license:v.license,setting:null}})},v.downloadfile2=function(o,e){return l.sound.download({id:o.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=o.converted_format?o.save_name+"."+o.converted_format:o.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the sound?").htmlContent("<b>"+(e.name||"sound")+"</b> will be deleted.").ariaLabel("delete sound").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getSounds=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.sound.get(v.query,f).$promise},v.createOrEditSound=function(e,t){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{sound:t,sounds:v.sounds.rows,license:v.license,setting:v.setting}})},v.deleteSound=A,v.exportSelectedSounds=function(){var e=angular.copy(v.selectedSounds);return v.selectedSounds=[],e},v.deleteSelectedSounds=function(e){var t=i.confirm().title("Are you sure want to delete the selected sounds?").htmlContent("<b>"+v.selectedSounds.length+" selected</b> will be deleted.").ariaLabel("delete Sounds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedSounds.forEach(function(e){A(e)}),v.selectedSounds=[]})},v.deselectSounds=function(){v.selectedSounds=[]},v.selectAllSounds=function(){v.selectedSounds=v.sounds.rows},v.uploadSound=function(e){i.show({controller:"UploadSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/uploadsound/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{sounds:v.sounds.rows}})};var h=!0,b=1;function f(e){v.sounds=e||{count:0,rows:[]}}function A(e){l.sound.delete({id:e.id}).$promise.then(function(){_.remove(v.sounds.rows,{id:e.id}),v.sounds.count-=1,v.sounds.rows.length||v.getSounds(),c.success({title:"Sound deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsound"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsound",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getSounds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","sounds","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("SoundsController",e)}(),function(){"use strict";function e(e,t,a,n,i){var o=this;o.errors=[],o.title="TOOLS.UPLOAD_SOUND",o.sounds=n,o.uploadSounds=[],o.sound={},o.ngFlowOptions={maxChunkRetries:1,chunkSize:15728640,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,target:"api/sounds",allowDuplicateUploads:!0},o.ngFlow={flow:{}},o.dropping=!1,o.fileAdded=function(e){var t=["wav","mp3","gsm"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;if(15728640<e.size)return a.error({title:"File too big",msg:"The max allowed size for audio files is 15 Mb"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return o.uploadSounds.unshift(n),!0},o.upload=function(){o.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},o.ngFlow.flow.upload()},o.fileSuccess=function(a,e){o.sounds.unshift(JSON.parse(e)),angular.forEach(o.uploadSounds,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="sound"}})},o.closeDialog=function(){t.hide()}}e.$inject=["$cookies","$mdDialog","toasty","sounds","api"],angular.module("app.tools").controller("UploadSoundDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_TAG",m.tag=angular.copy(s),m.tags=o,m.newTag=!1,m.tag||(m.tag={},m.title="TOOLS.NEW_TAG",m.newTag=!0),m.addNewTag=function(){m.errors=[],r.tag.save(m.tag).$promise.then(function(e){m.tags.unshift(e.toJSON()),i.success({title:"Tag properly created",msg:m.tag.name?m.tag.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.tag.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveTag=function(){m.errors=[],r.tag.update({id:m.tag.id},m.tag).$promise.then(function(e){var t=_.find(m.tags,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Tag properly saved!",msg:m.tag.name?m.tag.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.tag.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteTag=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The tag will be deleted.").ariaLabel("Delete Tag").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.tag.delete({id:m.tag.id}).$promise.then(function(){_.remove(m.tags,{id:m.tag.id}),i.success({title:"Tag properly deleted!",msg:(m.tag.name||"tag")+" has been deleted!"}),u(m.tag)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.tag.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","tags","tag","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditTagDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.tags=r||{count:0,rows:[]},v.table="tags",v.listOrder="",v.listOrderAsc=null,v.selectedTags=[],v.query={fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{tag:e,tags:v.tags.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the tag?").htmlContent("<b>"+(e.name||"tag")+"</b> will be deleted.").ariaLabel("delete tag").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getTags=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.tag.get(v.query,f).$promise},v.createOrEditTag=function(e,t){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{tag:t,tags:v.tags.rows,license:v.license,setting:v.setting}})},v.deleteTag=A,v.exportSelectedTags=function(){var e=angular.copy(v.selectedTags);return v.selectedTags=[],e},v.deleteSelectedTags=function(e){var t=i.confirm().title("Are you sure want to delete the selected tags?").htmlContent("<b>"+v.selectedTags.length+" selected</b> will be deleted.").ariaLabel("delete Tags").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedTags.forEach(function(e){A(e)}),v.selectedTags=[]})},v.deselectTags=function(){v.selectedTags=[]},v.selectAllTags=function(){v.selectedTags=v.tags.rows};var h=!0,b=1;function f(e){v.tags=e||{count:0,rows:[]}}function A(e){l.tag.delete({id:e.id}).$promise.then(function(){_.remove(v.tags.rows,{id:e.id}),v.tags.count-=1,v.tags.rows.length||v.getTags(),c.success({title:"Tag deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtag"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtag",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getTags())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","tags","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TagsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_TEMPLATE",m.template=angular.copy(s),m.templates=o,m.newTemplate=!1,m.template||(m.template={},m.title="TOOLS.NEW_TEMPLATE",m.newTemplate=!0),m.addNewTemplate=function(){m.errors=[],r.template.save(m.template).$promise.then(function(e){m.templates.unshift(e.toJSON()),i.success({title:"Template properly created",msg:m.template.name?m.template.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.template.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveTemplate=function(){m.errors=[],r.template.update({id:m.template.id},m.template).$promise.then(function(e){var t=_.find(m.templates,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Template properly saved!",msg:m.template.name?m.template.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.template.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteTemplate=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The template will be deleted.").ariaLabel("Delete Template").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.template.delete({id:m.template.id}).$promise.then(function(){_.remove(m.templates,{id:m.template.id}),i.success({title:"Template properly deleted!",msg:(m.template.name||"template")+" has been deleted!"}),u(m.template)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.template.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","templates","template","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditTemplateDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.templates=r||{count:0,rows:[]},v.table="templates",v.listOrder="",v.listOrderAsc=null,v.selectedTemplates=[],v.query={fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{template:e,templates:v.templates.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the template?").htmlContent("<b>"+(e.name||"template")+"</b> will be deleted.").ariaLabel("delete template").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getTemplates=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.template.get(v.query,f).$promise},v.createOrEditTemplate=function(e,t){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{template:t,templates:v.templates.rows,license:v.license,setting:v.setting}})},v.deleteTemplate=A,v.exportSelectedTemplates=function(){var e=angular.copy(v.selectedTemplates);return v.selectedTemplates=[],e},v.deleteSelectedTemplates=function(e){var t=i.confirm().title("Are you sure want to delete the selected templates?").htmlContent("<b>"+v.selectedTemplates.length+" selected</b> will be deleted.").ariaLabel("delete Templates").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedTemplates.forEach(function(e){A(e)}),v.selectedTemplates=[]})},v.deselectTemplates=function(){v.selectedTemplates=[]},v.selectAllTemplates=function(){v.selectedTemplates=v.templates.rows};var h=!0,b=1;function f(e){v.templates=e||{count:0,rows:[]}}function A(e){l.template.delete({id:e.id}).$promise.then(function(){_.remove(v.templates.rows,{id:e.id}),v.templates.count-=1,v.templates.rows.length||v.getTemplates(),c.success({title:"Template deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtemplate"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtemplate",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getTemplates())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","templates","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TemplatesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_TRIGGER",m.trigger=angular.copy(s),m.triggers=o,m.newTrigger=!1,m.trigger||(m.trigger={channel:"voice"},m.title="TOOLS.NEW_TRIGGER",m.newTrigger=!0),m.addNewTrigger=function(){m.errors=[],r.trigger.save(m.trigger).$promise.then(function(e){m.triggers.unshift(e.toJSON()),i.success({title:"Trigger properly created",msg:m.trigger.name?m.trigger.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveTrigger=function(){m.errors=[],r.trigger.update({id:m.trigger.id},m.trigger).$promise.then(function(e){var t=_.find(m.triggers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Trigger properly saved!",msg:m.trigger.name?m.trigger.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteTrigger=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The trigger will be deleted.").ariaLabel("Delete Trigger").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.trigger.delete({id:m.trigger.id}).$promise.then(function(){_.remove(m.triggers,{id:m.trigger.id}),i.success({title:"Trigger properly deleted!",msg:(m.trigger.name||"trigger")+" has been deleted!"}),u(m.trigger)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","triggers","trigger","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditTriggerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.trigger={},c.triggerActions={count:0,rows:[]},c.selectedTriggerActions=[],c.query={fields:"createdAt,updatedAt,id,action,data1,data1,data1,data2,data1,data2,data2,data1,data2,data2,data2,data2,data2,data2,data3,data3,data3,data3,data3,data3,data1,data2,data2,data3,data2,data2,data2,data3,data4,data5,data6,createdAt",limit:10,page:1},c.arrayaction=_.keyBy([{option:"CONTACT_MANAGER",value:"'contactManager'",ngIf:"vm.trigger.channel == 'voice'"},{option:"INTEGRATIONS",value:"'integration'",ngIf:"vm.trigger.channel == 'voice'"},{option:"MOTION_BAR",value:"'motionbar'"},{option:"JSCRIPTY",value:"'jscripty'",ngIf:"vm.trigger.channel == 'voice'"},{option:"URL_FORWARD",value:"'urlForward'"},{option:"BROWSER",value:"'browser'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.browserValues=_.keyBy([{option:"Popup",value:"'0'"},{option:"CTI URL",value:"'1'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.autoCreateContact=_.keyBy([{option:"yes",value:"'1'"},{option:"no",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.urlForwardValues=_.keyBy([{option:"GET",value:"'GET'"},{option:"POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.integrationValues=_.keyBy([{option:"Zendesk",value:"'zendesk'"},{option:"Salesforce",value:"'salesforce'"},{option:"SugarCRM",value:"'sugarcrm'"},{option:"Freshdesk",value:"'freshdesk'"},{option:"Desk",value:"'desk'"},{option:"Zoho",value:"'zoho'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.motionbarValues=_.keyBy([{option:"Popup",value:"'0'"},{option:"CTI URL",value:"'1'"},{option:"Windows App",value:"'2'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.eventVariables=_.keyBy([{option:"yes",value:"'1'"},{option:"no",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.location=_.keyBy([{option:"NEW_TAB",value:"'0'"},{option:"NEW_WINDOW",value:"'1'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e){c.trigger=e,c.query.id=c.trigger.id,c.query.ActionId=c.trigger.id,c.getTriggerActions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the action?").htmlContent("<b>"+(e.name||"action")+"</b> will be deleted.").ariaLabel("delete action").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getTriggerActions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.trigger.getActions(c.query,p).$promise},c.createOrEditTriggerAction=function(e,t){o.show({controller:"CreateOrEditActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/actions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:c.trigger,action:t,actions:c.triggerActions.rows,license:null,setting:null}})},c.exportSelectedTriggerActions=function(){var e=angular.copy(c.selectedTriggerActions);return c.selectedTriggerActions=[],e},c.deleteTriggerAction=g,c.deleteSelectedTriggerActions=function(e){var t=o.confirm().title("Are you sure want to delete the selected actions?").htmlContent("<b>"+c.selectedTriggerActions.length+" selected</b> will be deleted.").ariaLabel("delete actions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedTriggerActions.forEach(function(e){g(e)}),c.selectedTriggerActions=[]})},l.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){c.lists=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){c.projects=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZendeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zendeskAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzendeskAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.deskAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdeskAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZohoAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zohoAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzohoAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSalesforceAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.salesforceAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsalesforceAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSugarcrmAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.sugarcrmAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsugarcrmAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intFreshdeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.freshdeskAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfreshdeskAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZendeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zendeskConfigurations=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzendeskConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.deskConfigurations=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdeskConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZohoConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zohoConfigurations=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzohoConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSalesforceConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.salesforceConfigurations=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsalesforceConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSugarcrmConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.sugarcrmConfigurations=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsugarcrmConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intFreshdeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.freshdeskConfigurations=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfreshdeskConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.templates=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtemplates",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.triggerActions=e||{count:0,rows:[]}}function g(e){l.action.delete({id:e.id}).$promise.then(function(){_.remove(c.triggerActions.rows,{id:e.id}),c.triggerActions.count-=1,c.triggerActions.rows.length||c.getTriggerActions(),r.success({title:"Action deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getTriggerActions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerActionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m){var u=this;function p(e){a.hide(e)}u.errors=[],u.setting=m,u.license=c,u.passwordPattern=u.setting&&u.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",u.title="TOOLS.EDIT_ACTION",u.action=angular.copy(s),u.actions=o,u.newAction=!1,u.trigger=angular.copy(r),u.action||(u.action={data3:"0",data4:"0",data5:"800",data6:"600"},u.title="TOOLS.NEW_ACTION",u.newAction=!0),t.params.id&&(u.action.ActionId=t.params.id),u.addNewAction=function(){u.errors=[],l.trigger.addAction({id:t.params.id},u.action).$promise.then(function(e){u.actions.unshift(e.toJSON()),i.success({title:"Action properly created",msg:u.action.name?u.action.name+" has been created!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.saveAction=function(){u.errors=[],l.action.update({id:u.action.id},u.action).$promise.then(function(e){var t=_.find(u.actions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Action properly saved!",msg:u.action.name?u.action.name+" has been saved!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.deleteAction=function(e){u.errors=[];var t=a.confirm().title("Are you sure?").content("The action will be deleted.").ariaLabel("Delete Action").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){l.action.delete({id:u.action.id}).$promise.then(function(){_.remove(u.actions,{id:u.action.id}),i.success({title:"Action properly deleted!",msg:(u.action.name||"action")+" has been deleted!"}),p(u.action)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},u.getDateFromString=function(e){return new Date(e)},u.closeDialog=p,l.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZendeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.zendeskAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzendeskAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.deskAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdeskAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZohoAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.zohoAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzohoAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSalesforceAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.salesforceAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsalesforceAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSugarcrmAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.sugarcrmAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsugarcrmAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intFreshdeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.freshdeskAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfreshdeskAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZendeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.zendeskConfigurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzendeskConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.deskConfigurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdeskConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZohoConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.zohoConfigurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzohoConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSalesforceConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.salesforceConfigurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsalesforceConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSugarcrmConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.sugarcrmConfigurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsugarcrmConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intFreshdeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.freshdeskConfigurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfreshdeskConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.templates=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtemplates",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","actions","action","trigger","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditActionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.trigger={},c.triggerAllConditions={count:0,rows:[]},c.selectedTriggerAllConditions=[],c.query={fields:"createdAt,updatedAt,id,field,operator,value,value,value,value,value,value,value,value,value,value,value,createdAt",limit:10,page:1},c.arrayfield=_.keyBy([{option:"Queue",value:"'queue'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Call_Status",value:"'lastevent'",ngIf:"vm.trigger.channel == 'voice'"},{option:"OutboundRoute",value:"'routeId'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Account",value:"'account'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Interaction",value:"'interaction'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Message",value:"'message'",ngIf:"vm.trigger.channel != 'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.arrayoperator=_.keyBy([{option:"Equals",value:"'equals'"},{option:"Not_Equals",value:"'not_equals'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.callStatusValues=_.keyBy([{option:"Abandon",value:"'abandoned'"},{option:"Hangup",value:"'complete'"},{option:"Reject",value:"'rejected'"},{option:"Ring",value:"'called'"},{option:"Answer",value:"'connect'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.interactionStatusValues=_.keyBy([{option:"Opened",value:"'opened'"},{option:"Closed",value:"'closed'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.messageStatusValues=_.keyBy([{option:"Incoming",value:"'in'"},{option:"Outgoing",value:"'out'"},{option:"Accepted",value:"'accept'"},{option:"Rejected",value:"'reject'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e){c.trigger=e,c.query.id=c.trigger.id,c.query.TriggerAllId=c.trigger.id,c.getTriggerAllConditions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the allCondition?").htmlContent("<b>"+(e.name||"allCondition")+"</b> will be deleted.").ariaLabel("delete allCondition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getTriggerAllConditions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.trigger.getAllConditions(c.query,p).$promise},c.createOrEditTriggerAllCondition=function(e,t){o.show({controller:"CreateOrEditAllConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/allconditions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:c.trigger,allCondition:t,allconditions:c.triggerAllConditions.rows,license:null,setting:null}})},c.exportSelectedTriggerAllConditions=function(){var e=angular.copy(c.selectedTriggerAllConditions);return c.selectedTriggerAllConditions=[],e},c.deleteTriggerAllCondition=g,c.deleteSelectedTriggerAllConditions=function(e){var t=o.confirm().title("Are you sure want to delete the selected allconditions?").htmlContent("<b>"+c.selectedTriggerAllConditions.length+" selected</b> will be deleted.").ariaLabel("delete allconditions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedTriggerAllConditions.forEach(function(e){g(e)}),c.selectedTriggerAllConditions=[]})},l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.chatAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.mailAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.smsAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.faxAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.openchannelAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){c.queues=_.keyBy(e.rows||[],"name")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){c.outboundRoutes=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.triggerAllConditions=e||{count:0,rows:[]}}function g(e){l.condition.delete({id:e.id}).$promise.then(function(){_.remove(c.triggerAllConditions.rows,{id:e.id}),c.triggerAllConditions.count-=1,c.triggerAllConditions.rows.length||c.getTriggerAllConditions(),r.success({title:"AllCondition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getTriggerAllConditions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAllConditionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m){var u=this;function p(e){a.hide(e)}u.errors=[],u.setting=m,u.license=c,u.passwordPattern=u.setting&&u.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",u.title="TOOLS.EDIT_ALLCONDITION",u.allCondition=angular.copy(s),u.allconditions=o,u.newAllCondition=!1,u.trigger=angular.copy(r),u.allCondition||(u.allCondition={field:"queue",operator:"equals",value:"abandoned",value:"opened",value:"in"},u.title="TOOLS.NEW_ALLCONDITION",u.newAllCondition=!0),t.params.id&&(u.allCondition.TriggerAllId=t.params.id),u.addNewAllCondition=function(){u.errors=[],l.trigger.addAllCondition({id:t.params.id},u.allCondition).$promise.then(function(e){u.allconditions.unshift(e.toJSON()),i.success({title:"AllCondition properly created",msg:u.allCondition.name?u.allCondition.name+" has been created!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.saveAllCondition=function(){u.errors=[],l.condition.update({id:u.allCondition.id},u.allCondition).$promise.then(function(e){var t=_.find(u.allconditions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"AllCondition properly saved!",msg:u.allCondition.name?u.allCondition.name+" has been saved!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.deleteAllCondition=function(e){u.errors=[];var t=a.confirm().title("Are you sure?").content("The allCondition will be deleted.").ariaLabel("Delete AllCondition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){l.condition.delete({id:u.allCondition.id}).$promise.then(function(){_.remove(u.allconditions,{id:u.allCondition.id}),i.success({title:"AllCondition properly deleted!",msg:(u.allCondition.name||"allCondition")+" has been deleted!"}),p(u.allCondition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},u.getDateFromString=function(e){return new Date(e)},u.closeDialog=p,l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.chatAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.mailAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.smsAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.faxAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.openchannelAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u.queues=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","allconditions","allCondition","trigger","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditAllConditionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.trigger={},c.triggerAnyConditions={count:0,rows:[]},c.selectedTriggerAnyConditions=[],c.query={fields:"createdAt,updatedAt,id,field,operator,value,value,value,value,value,value,value,value,value,value,value,createdAt",limit:10,page:1},c.arrayfield=_.keyBy([{option:"Queue",value:"'queue'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Call_Status",value:"'lastevent'",ngIf:"vm.trigger.channel == 'voice'"},{option:"OutboundRoute",value:"'routeId'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Account",value:"'account'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Interaction",value:"'interaction'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Message",value:"'message'",ngIf:"vm.trigger.channel != 'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.arrayoperator=_.keyBy([{option:"Equals",value:"'equals'"},{option:"Not_Equals",value:"'not_equals'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.callStatusValues=_.keyBy([{option:"Abandon",value:"'abandoned'"},{option:"Hangup",value:"'complete'"},{option:"Reject",value:"'rejected'"},{option:"Ring",value:"'called'"},{option:"Answer",value:"'connect'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.interactionStatusValues=_.keyBy([{option:"Opened",value:"'opened'"},{option:"Closed",value:"'closed'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.messageStatusValues=_.keyBy([{option:"Incoming",value:"'in'"},{option:"Outgoing",value:"'out'"},{option:"Accepted",value:"'accept'"},{option:"Rejected",value:"'reject'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e){c.trigger=e,c.query.id=c.trigger.id,c.query.TriggerAnyId=c.trigger.id,c.getTriggerAnyConditions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the anyCondition?").htmlContent("<b>"+(e.name||"anyCondition")+"</b> will be deleted.").ariaLabel("delete anyCondition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getTriggerAnyConditions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.trigger.getAnyConditions(c.query,p).$promise},c.createOrEditTriggerAnyCondition=function(e,t){o.show({controller:"CreateOrEditAnyConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/anyconditions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:c.trigger,anyCondition:t,anyconditions:c.triggerAnyConditions.rows,license:null,setting:null}})},c.exportSelectedTriggerAnyConditions=function(){var e=angular.copy(c.selectedTriggerAnyConditions);return c.selectedTriggerAnyConditions=[],e},c.deleteTriggerAnyCondition=g,c.deleteSelectedTriggerAnyConditions=function(e){var t=o.confirm().title("Are you sure want to delete the selected anyconditions?").htmlContent("<b>"+c.selectedTriggerAnyConditions.length+" selected</b> will be deleted.").ariaLabel("delete anyconditions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedTriggerAnyConditions.forEach(function(e){g(e)}),c.selectedTriggerAnyConditions=[]})},l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.chatAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.mailAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.smsAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.faxAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.openchannelAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){c.queues=_.keyBy(e.rows||[],"name")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){c.outboundRoutes=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.triggerAnyConditions=e||{count:0,rows:[]}}function g(e){l.condition.delete({id:e.id}).$promise.then(function(){_.remove(c.triggerAnyConditions.rows,{id:e.id}),c.triggerAnyConditions.count-=1,c.triggerAnyConditions.rows.length||c.getTriggerAnyConditions(),r.success({title:"AnyCondition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getTriggerAnyConditions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAnyConditionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m){var u=this;function p(e){a.hide(e)}u.errors=[],u.setting=m,u.license=c,u.passwordPattern=u.setting&&u.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",u.title="TOOLS.EDIT_ANYCONDITION",u.anyCondition=angular.copy(s),u.anyconditions=o,u.newAnyCondition=!1,u.trigger=angular.copy(r),u.anyCondition||(u.anyCondition={field:"queue",operator:"equals",value:"abandoned",value:"opened",value:"in"},u.title="TOOLS.NEW_ANYCONDITION",u.newAnyCondition=!0),t.params.id&&(u.anyCondition.TriggerAnyId=t.params.id),u.addNewAnyCondition=function(){u.errors=[],l.trigger.addAnyCondition({id:t.params.id},u.anyCondition).$promise.then(function(e){u.anyconditions.unshift(e.toJSON()),i.success({title:"AnyCondition properly created",msg:u.anyCondition.name?u.anyCondition.name+" has been created!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.saveAnyCondition=function(){u.errors=[],l.condition.update({id:u.anyCondition.id},u.anyCondition).$promise.then(function(e){var t=_.find(u.anyconditions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"AnyCondition properly saved!",msg:u.anyCondition.name?u.anyCondition.name+" has been saved!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.deleteAnyCondition=function(e){u.errors=[];var t=a.confirm().title("Are you sure?").content("The anyCondition will be deleted.").ariaLabel("Delete AnyCondition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){l.condition.delete({id:u.anyCondition.id}).$promise.then(function(){_.remove(u.anyconditions,{id:u.anyCondition.id}),i.success({title:"AnyCondition properly deleted!",msg:(u.anyCondition.name||"anyCondition")+" has been deleted!"}),p(u.anyCondition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},u.getDateFromString=function(e){return new Date(e)},u.closeDialog=p,l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.chatAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.mailAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.smsAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.faxAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.openchannelAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u.queues=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","anyconditions","anyCondition","trigger","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditAnyConditionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.trigger=d||e.params.trigger||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoTriggers=function(){e.go("app.tools.triggers")},c.saveTrigger=function(){s.trigger.update({id:c.trigger.id},c.trigger).$promise.then(function(){r.success({title:"Trigger updated!",msg:c.trigger.name?c.trigger.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","trigger"],angular.module("app.tools").controller("TriggerController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.triggers=r||{count:0,rows:[]},v.table="triggers",v.listOrder="",v.listOrderAsc=null,v.selectedTriggers=[],v.query={fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,page:1},v.arraychannel=_.keyBy([{option:"Voice",value:"'voice'"},{option:"Openchannel",value:"'openchannel'",ngIf:"vm.license.openchannel"},{option:"Chat",value:"'chat'",ngIf:"vm.license.chat"},{option:"Mail",value:"'mail'",ngIf:"vm.license.mail"},{option:"Sms",value:"'sms'",ngIf:"vm.license.messaging"},{option:"Fax",value:"'fax'",ngIf:"vm.license.fax"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.tools.triggers.edit",{id:e.id,trigger:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the trigger?").htmlContent("<b>"+(e.name||"trigger")+"</b> will be deleted.").ariaLabel("delete trigger").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getTriggers=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.trigger.get(v.query,f).$promise},v.createOrEditTrigger=function(e,t){i.show({controller:"CreateOrEditTriggerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:t,triggers:v.triggers.rows,license:v.license,setting:v.setting}})},v.deleteTrigger=A,v.exportSelectedTriggers=function(){var e=angular.copy(v.selectedTriggers);return v.selectedTriggers=[],e},v.deleteSelectedTriggers=function(e){var t=i.confirm().title("Are you sure want to delete the selected triggers?").htmlContent("<b>"+v.selectedTriggers.length+" selected</b> will be deleted.").ariaLabel("delete Triggers").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedTriggers.forEach(function(e){A(e)}),v.selectedTriggers=[]})},v.deselectTriggers=function(){v.selectedTriggers=[]},v.selectAllTriggers=function(){v.selectedTriggers=v.triggers.rows};var h=!0,b=1;function f(e){v.triggers=e||{count:0,rows:[]}}function A(e){l.trigger.delete({id:e.id}).$promise.then(function(){_.remove(v.triggers.rows,{id:e.id}),v.triggers.count-=1,v.triggers.rows.length||v.getTriggers(),c.success({title:"Trigger deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrigger"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getTriggers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","triggers","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TriggersController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_TRUNK",m.trunk=angular.copy(s),m.trunks=o,m.newTrunk=!1,m.trunk||(m.trunk={active:!0,type:"friend",dtmfmode:"rfc2833",qualify:"yes",t38pt_udptl:"no"},m.title="TOOLS.NEW_TRUNK",m.newTrunk=!0),m.addNewTrunk=function(){m.errors=[],r.trunk.save(m.trunk).$promise.then(function(e){m.trunks.unshift(e.toJSON()),i.success({title:"Trunk properly created",msg:m.trunk.name?m.trunk.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveTrunk=function(){m.errors=[],r.trunk.update({id:m.trunk.id},m.trunk).$promise.then(function(e){var t=_.find(m.trunks,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Trunk properly saved!",msg:m.trunk.name?m.trunk.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteTrunk=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The trunk will be deleted.").ariaLabel("Delete Trunk").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.trunk.delete({id:m.trunk.id}).$promise.then(function(){_.remove(m.trunks,{id:m.trunk.id}),i.success({title:"Trunk properly deleted!",msg:(m.trunk.name||"trunk")+" has been deleted!"}),u(m.trunk)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","trunks","trunk","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditTrunkDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.trunk=d||n.params.trunk||{},c.selectedTab=n.params.tab||0,c.gotogoto=function(e,t){n.go("app.voice.realtime.trunks",{})},c.alert=r.info,c.gotoTrunks=function(){n.go("app.tools.trunks")},c.saveTrunk=function(){s.trunk.update({id:c.trunk.id},c.trunk).$promise.then(function(){r.success({title:"Trunk updated!",msg:c.trunk.name?c.trunk.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunk",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","trunk"],angular.module("app.tools").controller("TrunkController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.trunks=r||{count:0,rows:[]},v.table="trunks",v.listOrder="",v.listOrderAsc=null,v.selectedTrunks=[],v.query={fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,otherFields",sort:"-updatedAt",limit:10,page:1},v.arraytype=_.keyBy([{option:"Friend",value:"'friend'"},{option:"User",value:"'user'"},{option:"Peer",value:"'peer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraydtmfmode=_.keyBy([{option:"rfc2833",value:"'rfc2833'"},{option:"info",value:"'info'"},{option:"shortinfo",value:"'shortinfo'"},{option:"inband",value:"'inband'"},{option:"auto",value:"'auto'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayqualify=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g723",value:"'g723'"},{option:"g726",value:"'g726'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"ilbc",value:"'ilbc'"},{option:"opus",value:"'opus'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayinsecure=_.keyBy([{option:"port",value:"'port'"},{option:"invite",value:"'invite'"},{option:"very",value:"'very'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraydirectmedia=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"nonat",value:"'nonat'"},{option:"update",value:"'update'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraycallcounter=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayusereqphone=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytrustrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysendrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"pai",value:"'pai'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.tools.trunks.edit",{id:e.id,trunk:e})},v.gotorealtimegoto=function(e,t){n.go("app.voice.realtime.trunks",{})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the trunk?").htmlContent("<b>"+(e.name||"trunk")+"</b> will be deleted.").ariaLabel("delete trunk").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getTrunks=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.trunk.get(v.query,f).$promise},v.createOrEditTrunk=function(e,t){i.show({controller:"CreateOrEditTrunkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{trunk:t,trunks:v.trunks.rows,license:v.license,setting:v.setting}})},v.deleteTrunk=A,v.exportSelectedTrunks=function(){var e=angular.copy(v.selectedTrunks);return v.selectedTrunks=[],e},v.deleteSelectedTrunks=function(e){var t=i.confirm().title("Are you sure want to delete the selected trunks?").htmlContent("<b>"+v.selectedTrunks.length+" selected</b> will be deleted.").ariaLabel("delete Trunks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedTrunks.forEach(function(e){A(e)}),v.selectedTrunks=[]})},v.deselectTrunks=function(){v.selectedTrunks=[]},v.selectAllTrunks=function(){v.selectedTrunks=v.trunks.rows};var h=!0,b=1;function f(e){v.trunks=e||{count:0,rows:[]}}function A(e){l.trunk.delete({id:e.id}).$promise.then(function(){_.remove(v.trunks.rows,{id:e.id}),v.trunks.count-=1,v.trunks.rows.length||v.getTrunks(),c.success({title:"Trunk deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrunk"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrunk",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getTrunks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","trunks","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TrunksController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_VARIABLE",m.variable=angular.copy(s),m.variables=o,m.newVariable=!1,m.variable||(m.variable={},m.title="TOOLS.NEW_VARIABLE",m.newVariable=!0),m.addNewVariable=function(){m.errors=[],r.variable.save(m.variable).$promise.then(function(e){m.variables.unshift(e.toJSON()),i.success({title:"Variable properly created",msg:m.variable.name?m.variable.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.variable.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveVariable=function(){m.errors=[],r.variable.update({id:m.variable.id},m.variable).$promise.then(function(e){var t=_.find(m.variables,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Variable properly saved!",msg:m.variable.name?m.variable.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteVariable=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The variable will be deleted.").ariaLabel("Delete Variable").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.variable.delete({id:m.variable.id}).$promise.then(function(){_.remove(m.variables,{id:m.variable.id}),i.success({title:"Variable properly deleted!",msg:(m.variable.name||"variable")+" has been deleted!"}),u(m.variable)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.variable.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","variables","variable","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditVariableDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.variables=r||{count:0,rows:[]},v.table="variables",v.listOrder="",v.listOrderAsc=null,v.selectedVariables=[],v.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{variable:e,variables:v.variables.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the variable?").htmlContent("<b>"+(e.name||"variable")+"</b> will be deleted.").ariaLabel("delete variable").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getVariables=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.variable.get(v.query,f).$promise},v.createOrEditVariable=function(e,t){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{variable:t,variables:v.variables.rows,license:v.license,setting:v.setting}})},v.deleteVariable=A,v.exportSelectedVariables=function(){var e=angular.copy(v.selectedVariables);return v.selectedVariables=[],e},v.deleteSelectedVariables=function(e){var t=i.confirm().title("Are you sure want to delete the selected variables?").htmlContent("<b>"+v.selectedVariables.length+" selected</b> will be deleted.").ariaLabel("delete Variables").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedVariables.forEach(function(e){A(e)}),v.selectedVariables=[]})},v.deselectVariables=function(){v.selectedVariables=[]},v.selectAllVariables=function(){v.selectedVariables=v.variables.rows};var h=!0,b=1;function f(e){v.variables=e||{count:0,rows:[]}}function A(e){l.variable.delete({id:e.id}).$promise.then(function(){_.remove(v.variables.rows,{id:e.id}),v.variables.count-=1,v.variables.rows.length||v.getVariables(),c.success({title:"Variable deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvariable"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvariable",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getVariables())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","variables","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("VariablesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.chanSpies=r||{count:0,rows:[]},v.table="chanSpies",v.listOrder="",v.listOrderAsc=null,v.selectedChanSpies=[],v.query={fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,page:1},v.arrayoptions=_.keyBy([{option:"b: Only spy on channels involved in a bridged call.",value:"'b'"},{option:"B: Instead of whispering on a single channel barge in on both channels involved in the call.",value:"'B'"},{option:"E: Exit when the spied-on channel hangs up.",value:"'E'"},{option:"o: Only listen to audio coming from this channel.",value:"'o'"},{option:"q: Don't play a beep when beginning to spy on a channel, or speak the selected channel name.",value:"'q'"},{option:"s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.",value:"'s'"},{option:"S: Stop when no more channels are left to spy on.",value:"'S'"},{option:"w: Enable whisper mode, so the spying channel can talk to the spied-on channel.",value:"'w'"},{option:"W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.",value:"'W'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayrecordingFormat=_.keyBy([{option:"wav",value:"'wav'"},{option:"gsm",value:"'gsm'"},{option:"wav49",value:"'WAV'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editdialog=function(e,t){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{chanSpy:e,chanSpies:v.chanSpies.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the chanSpy?").htmlContent("<b>"+(e.name||"chanSpy")+"</b> will be deleted.").ariaLabel("delete chanSpy").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getChanSpies=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceChanSpy.get(v.query,f).$promise},v.createOrEditchanSpy=function(e,t){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chanSpy:t,chanSpies:v.chanSpies.rows,license:v.license,setting:v.setting}})},v.deletechanSpy=A,v.exportSelectedChanSpies=function(){var e=angular.copy(v.selectedChanSpies);return v.selectedChanSpies=[],e},v.deleteSelectedChanSpies=function(e){var t=i.confirm().title("Are you sure want to delete the selected chanSpies?").htmlContent("<b>"+v.selectedChanSpies.length+" selected</b> will be deleted.").ariaLabel("delete chanSpys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedChanSpies.forEach(function(e){A(e)}),v.selectedChanSpies=[]})},v.deselectChanSpies=function(){v.selectedChanSpies=[]},v.selectAllChanSpies=function(){v.selectedChanSpies=v.chanSpies.rows};var h=!0,b=1;function f(e){v.chanSpies=e||{count:0,rows:[]}}function A(e){l.voiceChanSpy.delete({id:e.id}).$promise.then(function(){_.remove(v.chanSpies.rows,{id:e.id}),v.chanSpies.count-=1,v.chanSpies.rows.length||v.getChanSpies(),c.success({title:"chanSpy deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceChanSpy"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceChanSpy",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getChanSpies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","chanSpies","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("ChanSpiesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_CHANSPY",m.chanSpy=angular.copy(s),m.chanSpies=o,m.newchanSpy=!1,m.chanSpy||(m.chanSpy={recordingFormat:"wav"},m.title="VOICE.NEW_CHANSPY",m.newchanSpy=!0),m.addNewchanSpy=function(){m.errors=[],r.voiceChanSpy.save(m.chanSpy).$promise.then(function(e){m.chanSpies.unshift(e.toJSON()),i.success({title:"chanSpy properly created",msg:m.chanSpy.name?m.chanSpy.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.savechanSpy=function(){m.errors=[],r.voiceChanSpy.update({id:m.chanSpy.id},m.chanSpy).$promise.then(function(e){var t=_.find(m.chanSpies,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"chanSpy properly saved!",msg:m.chanSpy.name?m.chanSpy.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deletechanSpy=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The chanSpy will be deleted.").ariaLabel("Delete chanSpy").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceChanSpy.delete({id:m.chanSpy.id}).$promise.then(function(){_.remove(m.chanSpies,{id:m.chanSpy.id}),i.success({title:"chanSpy properly deleted!",msg:(m.chanSpy.name||"chanSpy")+" has been deleted!"}),u(m.chanSpy)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","chanSpies","chanSpy","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditchanSpyDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.contexts=r||{count:0,rows:[]},v.table="contexts",v.listOrder="",v.listOrderAsc=null,v.selectedContexts=[],v.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{context:e,contexts:v.contexts.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the context?").htmlContent("<b>"+(e.name||"context")+"</b> will be deleted.").ariaLabel("delete context").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getContexts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceContext.get(v.query,f).$promise},v.createOrEditContext=function(e,t){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{context:t,contexts:v.contexts.rows,license:v.license,setting:v.setting}})},v.deleteContext=A,v.exportSelectedContexts=function(){var e=angular.copy(v.selectedContexts);return v.selectedContexts=[],e},v.deleteSelectedContexts=function(e){var t=i.confirm().title("Are you sure want to delete the selected contexts?").htmlContent("<b>"+v.selectedContexts.length+" selected</b> will be deleted.").ariaLabel("delete Contexts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedContexts.forEach(function(e){A(e)}),v.selectedContexts=[]})},v.deselectContexts=function(){v.selectedContexts=[]},v.selectAllContexts=function(){v.selectedContexts=v.contexts.rows};var h=!0,b=1;function f(e){v.contexts=e||{count:0,rows:[]}}function A(e){l.voiceContext.delete({id:e.id}).$promise.then(function(){_.remove(v.contexts.rows,{id:e.id}),v.contexts.count-=1,v.contexts.rows.length||v.getContexts(),c.success({title:"Context deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceContext"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceContext",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getContexts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","contexts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("ContextsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_CONTEXT",m.context=angular.copy(s),m.contexts=o,m.newContext=!1,m.context||(m.context={},m.title="VOICE.NEW_CONTEXT",m.newContext=!0),m.addNewContext=function(){m.errors=[],r.voiceContext.save(m.context).$promise.then(function(e){m.contexts.unshift(e.toJSON()),i.success({title:"Context properly created",msg:m.context.name?m.context.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveContext=function(){m.errors=[],r.voiceContext.update({id:m.context.id},m.context).$promise.then(function(e){var t=_.find(m.contexts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Context properly saved!",msg:m.context.name?m.context.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteContext=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The context will be deleted.").ariaLabel("Delete Context").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceContext.delete({id:m.context.id}).$promise.then(function(){_.remove(m.contexts,{id:m.context.id}),i.success({title:"Context properly deleted!",msg:(m.context.name||"context")+" has been deleted!"}),u(m.context)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","contexts","context","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditContextDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_INBOUNDROUTE",m.inboundroute=angular.copy(s),m.inboundroutes=o,m.newInboundRoute=!1,m.inboundroute||(m.inboundroute={appdata:"Inbound Call",type:"inbound",context:"from-voip-provider"},m.title="VOICE.NEW_INBOUNDROUTE",m.newInboundRoute=!0),m.addNewInboundRoute=function(){m.errors=[],r.voiceExtension.save(m.inboundroute).$promise.then(function(e){m.inboundroutes.unshift(e.toJSON()),i.success({title:"InboundRoute properly created",msg:m.inboundroute.name?m.inboundroute.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveInboundRoute=function(){m.errors=[],r.voiceExtension.update({id:m.inboundroute.id},m.inboundroute).$promise.then(function(e){var t=_.find(m.inboundroutes,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"InboundRoute properly saved!",msg:m.inboundroute.name?m.inboundroute.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteInboundRoute=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The inboundroute will be deleted.").ariaLabel("Delete InboundRoute").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceExtension.delete({id:m.inboundroute.id}).$promise.then(function(){_.remove(m.inboundroutes,{id:m.inboundroute.id}),i.success({title:"InboundRoute properly deleted!",msg:(m.inboundroute.name||"inboundroute")+" has been deleted!"}),u(m.inboundroute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","inboundroutes","inboundroute","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditInboundRouteDialogController",e)}(),function(){"use strict";function e(m,i,a,o,e){var u=this;function t(e,t){if(u.inboundrouteApps.rows.length){var n=u.inboundrouteApps.rows[t]?u.inboundrouteApps.rows[t]:u.inboundrouteApps.rows[0];i.show({controller:"EditInboundApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundroutes/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{inboundrouteApp:n,inboundroute:u.inboundroute}}).then(function(e){e&&(e.id?u.inboundrouteApps.rows[t]=e:u.inboundrouteApps.rows.splice(t,0,e),s())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function s(){var e=["queue","playback"],t=2,n=[];n.push({type:"inbound",app:"Set",appdata:"CDR(type)=inbound",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id}),n.push({type:"inbound",app:"Set",appdata:"XCALLY-MOTION-ANSWER=0",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id}),n.push({type:"inbound",app:"Set",appdata:"XCALLY-MOTION-PROGRESS=0",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id}),n.push({type:"inbound",app:"Set",appdata:"MONITOR_OPTIONS=ab",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id});for(var a=0,i=0;a<u.inboundrouteApps.rows.length;a++,i=0){var o=u.inboundrouteApps.rows[a],s=[],r=[];o.intervals="*,*,*,*"!==o.interval?[o.interval]:o.IntervalId?_.map(_.filter(u.intervals.rows,{IntervalId:o.IntervalId}),"interval"):[],o.context=u.inboundroute.context,o.exten=u.inboundroute.exten,o.type&&(o.type=o.type.toLowerCase()),o.hasOwnProperty("answer")&&e.includes(o.app.toLowerCase())&&"custom"!==o.appType&&(o.answer?(s.push({type:o.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-ANSWER}=0]?Answer",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id}),s.push({type:o.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-ANSWER=1",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id})):(s.push({type:o.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-PROGRESS}=0]?Progress",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id}),s.push({type:o.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-PROGRESS=1",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id})));for(var l=0;l<o.intervals.length;l++){var d=t+o.intervals.length,c=l===o.intervals.length-1?t+s.length+r.length+2:t+l+1;s.splice(l,0,{type:"inbound",app:"GotoIfTime",appdata:o.intervals[l]+"?"+u.inboundroute.context+",${EXTEN},"+d+":"+u.inboundroute.context+",${EXTEN},"+c,exten:u.inboundroute.exten,context:u.inboundroute.context,priority:t+l,VoiceExtensionId:u.inboundroute.id})}o.priority=s.length?_.last(s).priority+1:t,t=(r.length?_.last(r).priority:o.priority)+1,n=_.concat(n,s,[o],r)}n.push({type:"inbound",app:"Hangup",exten:u.inboundroute.exten,context:u.inboundroute.context,priority:t,VoiceExtensionId:u.inboundroute.id}),m.voiceExtension.addApplications({id:u.inboundroute.id},_.sortBy(n,"priority")).$promise.then(function(e){u.inboundrouteApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){u.inboundrouteApps=e||{count:0,rows:[]}}u.currentUser=e.getCurrentUser(),u.inboundroute={},u.inboundrouteApps={count:0,rows:[]},u.selectedInboundRouteApps=[],u.query={sort:"priority"},u.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"Queue",appType:"queue",context:"from-voip-provider",type:"Inbound",appdata:",xX,,,300,,,,,",icon:"icon-apps",options:"xX",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",route:"sound",filters:{fields:"name,save_name",sort:"name"}},{name:"queues",route:"voiceQueue",filters:{type:"inbound",fields:"id,name,type",sort:"name",nolimit:!0}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Url",name:"URL",type:"text",param:2},{title:"Announce_Overrides",name:"sound",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}'",option:"sound.name",defaultValues:[{value:"''",option:"None"}],param:3},{title:"Timeout",name:"timeout",type:"number",min:0,param:4},{title:"Agi",name:"agi",type:"text",param:5},{title:"Macro",name:"macro",type:"text",param:6},{title:"GoSub",name:"gosub",type:"text",param:7},{title:"Rule",name:"rule",type:"text",param:8},{title:"Position",name:"position",type:"number",min:0,param:9},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Playback",appType:"playback",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",route:"sound",filters:{fields:"name,save_name",sort:"name"}}],fields:[{title:"Audio_Files",name:"appdata",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}'",option:"appdata.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Dial",appType:"dial",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,fields:[{title:"Technology/Resource",name:"tech",type:"text",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"internalDial",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"users",route:"user",filters:{fields:"name",sort:"name"}}],fields:[{title:"User",name:"user",type:"apiselect",values:"users",value:"'SIP/{{user.name}}'",option:"user.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"externalDial",context:"from-voip-provider",type:"inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"trunks",route:"trunk",filters:{fields:"name",sort:"name"}}],fields:[{title:"Trunk",name:"trunk",type:"apiselect",values:"trunks",value:"trunk.name",option:"trunk.name",required:!0,param:0},{title:"Phone",name:"phone",required:!0,type:"text"},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"ringGroup",context:"from-voip-provider",type:"inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"users",route:"user",filters:{fields:"name",sort:"name"}}],fields:[{title:"User",name:"multipleUsers",type:"apiselect",multiple:!0,values:"users",value:"'SIP/{{multipleUsers.name}}'",option:"multipleUsers.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"AGI",alias:"CallySquare",appType:"agi",context:"from-voip-provider",type:"inbound",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"projects",route:"squareProject",filters:{fields:"name",sort:"name"}}],fields:[{title:"Project",name:"project",type:"apiselect",values:"projects",value:"'agi://127.0.0.1/square,{{project.name}}'",option:"project.name",required:!0,param:0}]},{app:"goto",appType:"goTo",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"contexts",route:"voiceContext",filters:{fields:"name",sort:"name"}}],fields:[{title:"Context",name:"context",type:"apiselect",values:"contexts",value:"context.name",option:"context.name",required:!0,param:0},{title:"Extension",name:"extension",type:"text",required:!0,param:1},{title:"Priority",name:"priority",type:"text",required:!0,param:2}]},{app:"hangup",appType:"hangup",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Hangup_Cause",name:"appdata",type:"select",param:0,values:[{option:"HANGUPCAUSE_1",value:"'1'"},{option:"HANGUPCAUSE_16",value:"'16'"},{option:"HANGUPCAUSE_17",value:"'17'"},{option:"HANGUPCAUSE_18",value:"'18'"},{option:"HANGUPCAUSE_21",value:"'21'"},{option:"HANGUPCAUSE_22",value:"'22'"},{option:"HANGUPCAUSE_27",value:"'27'"},{option:"HANGUPCAUSE_38",value:"'38'"},{option:"HANGUPCAUSE_41",value:"'41'"}],translate:!0,required:!0,general:!0}]},{app:"Set",appType:"set",context:"from-voip-provider",type:"Inbound",separator:"=",icon:"icon-apps",interval:"*,*,*,*",extraApi:[{name:"variables",route:"variable",filters:{fields:"name",sort:"name"}}],isApp:!0,fields:[{title:"Variable",name:"name",type:"apiselect",values:"variables",value:"name.name",option:"name.name",required:!0,param:0},{title:"Value",name:"value",type:"text",required:!0,param:1}]},{app:null,appType:"custom",icon:"icon-apps",type:"Inbound",interval:"*,*,*,*",isApp:!0,fields:[{title:"Application_Name",name:"app",type:"text",required:!0,param:0},{title:"Arguments",name:"appdata",type:"text",param:1}]},{app:"Voicemail",appType:"voicemail",context:"from-voip-provider",icon:"icon-apps",type:"Inbound",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"voiceMails",route:"voiceMail",filters:{fields:"mailbox",sort:"mailbox"}}],fields:[{title:"Mailbox@Context",name:"voiceMail",type:"apiselect",values:"voiceMails",value:"'{{voiceMail.mailbox}}@from-voicemail'",option:"voiceMail.mailbox",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1}]}],["app"]),{isApp:!1}),u.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},u.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){s()}},u.init=function(e){u.inboundroute=e,u.query.VoiceExtensionId=e.id,u.query.isApp=!0,u.query.nolimit=!0,u.getInboundRouteApps(),u.getIntervals()},u.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){u.inboundrouteApps.rows.splice(t,1),s()},function(){console.log("CANCEL")})},u.getInboundRouteApps=function(){u.promise=m.voiceExtension.get(u.query,n).$promise},u.editInboundRouteApp=t,u.editInterval=function(e,t){if(u.inboundrouteApps.rows.length){var n=u.inboundrouteApps.rows[t]?u.inboundrouteApps.rows[t]:u.inboundrouteApps.rows[0];i.show({controller:"EditInboundAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundroutes/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,s())})}},u.deleteInboundRouteApp=function(e){_.remove(u.inboundrouteApps.rows,{id:e.id}),s(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},u.deleteSelectedInboundRouteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+u.selectedInboundRouteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){u.selectedInboundRouteApps.forEach(function(e){_.remove(u.inboundrouteApps.rows,{id:e.id})}),u.selectedInboundRouteApps=[],s()})},u.rewriteRouting=s,u.getIntervals=function(){return m.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){u.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.voice").controller("InboundRouteActionsController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.agi=angular.copy(e),o.agi.appdata)switch(o.agi.appType?o.agi.appType.toLowerCase():o.agi.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.agi.appdata.split(",");o.agi.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.agi.text=s.slice(1,s.length).join(",");break;case"message":o.agi.text=o.agi.appdata;break;case"set":o.agi.name=o.agi.appdata.split("=")[0],o.agi.value=o.agi.appdata.split("=")[1];break;case"agi":o.agi.project=o.agi.appdata;break;default:var r=o.agi.appdata.split(",");o.agi.project=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.agi.type&&"outbound"===o.agi.type.toLowerCase()&&"outbounddial"===o.agi.appType.toLowerCase()&&(o.agi.prefix=o.agi.phone?o.agi.phone.split("$")[0]:void 0,o.agi.callerId=o.agi.callerID?"CALLERID(all)="+o.agi.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.agi.type&&"outbound"===o.agi.type.toLowerCase()&&"outboundDial"===o.agi.appType&&(o.agi.phone=a.cutdigits?(o.agi.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.agi.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.agi.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.agi.options+="U(xcally-mixmonitor-context)"):o.agi.options=o.agi.options.replace("U(xcally-mixmonitor-context)",""));if(o.agi.appType&&"custom"===o.agi.appType);else switch((o.agi.app||o.agi.appType).toLowerCase()){case"set":o.agi.appdata=o.agi.name+"="+o.agi.value;break;case"custom":break;default:e[0]=o.agi.project,o.agi.appdata=e.join(",")}l(o.agi)},o.closeDialog=l,i.squareProject.get({fields:"name",sort:"name"}).$promise.then(function(e){o.projects=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppagiDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(n.appType||n.app).toUpperCase(),o.custom=angular.copy(n),o.custom.appdata)switch(o.custom.appType?o.custom.appType.toLowerCase():o.custom.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.custom.appdata.split(",");o.custom.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.custom.text=s.slice(1,s.length).join(",");break;case"message":o.custom.text=o.custom.appdata;break;case"set":o.custom.name=o.custom.appdata.split("=")[0],o.custom.value=o.custom.appdata.split("=")[1];break;case"agi":o.custom.project=o.custom.appdata;break;default:var r=o.custom.appdata.split(",");o.custom.app=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.custom.appdata=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.custom.type&&"outbound"===o.custom.type.toLowerCase()&&"outbounddial"===o.custom.appType.toLowerCase()&&(o.custom.prefix=o.custom.phone?o.custom.phone.split("$")[0]:void 0,o.custom.callerId=o.custom.callerID?"CALLERID(all)="+o.custom.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.custom.type&&"outbound"===o.custom.type.toLowerCase()&&"outboundDial"===o.custom.appType&&(o.custom.phone=a.cutdigits?(o.custom.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.custom.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.custom.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.custom.options+="U(xcally-mixmonitor-context)"):o.custom.options=o.custom.options.replace("U(xcally-mixmonitor-context)",""));if(o.custom.appType&&"custom"===o.custom.appType);else switch((o.custom.app||o.custom.appType).toLowerCase()){case"set":o.custom.appdata=o.custom.name+"="+o.custom.value;break;case"custom":break;default:e[0]=o.custom.app,e[1]=o.custom.appdata,o.custom.appdata=e.join(",")}l(o.custom)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppcustomDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(n.appType||n.app).toUpperCase(),o.dial=angular.copy(n),o.dial.appdata)switch(o.dial.appType?o.dial.appType.toLowerCase():o.dial.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.dial.appdata.split(",");o.dial.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.dial.text=s.slice(1,s.length).join(",");break;case"message":o.dial.text=o.dial.appdata;break;case"set":o.dial.name=o.dial.appdata.split("=")[0],o.dial.value=o.dial.appdata.split("=")[1];break;case"agi":o.dial.project=o.dial.appdata;break;default:var r=o.dial.appdata.split(",");o.dial.tech=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.dial.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.dial.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.dial.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.dial.type&&"outbound"===o.dial.type.toLowerCase()&&"outbounddial"===o.dial.appType.toLowerCase()&&(o.dial.prefix=o.dial.phone?o.dial.phone.split("$")[0]:void 0,o.dial.callerId=o.dial.callerID?"CALLERID(all)="+o.dial.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.dial.type&&"outbound"===o.dial.type.toLowerCase()&&"outboundDial"===o.dial.appType&&(o.dial.phone=a.cutdigits?(o.dial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.dial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.dial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.dial.options+="U(xcally-mixmonitor-context)"):o.dial.options=o.dial.options.replace("U(xcally-mixmonitor-context)",""));if(o.dial.appType&&"custom"===o.dial.appType);else switch((o.dial.app||o.dial.appType).toLowerCase()){case"set":o.dial.appdata=o.dial.name+"="+o.dial.value;break;case"custom":break;default:e[0]=o.dial.tech,e[1]=o.dial.timeout,e[2]=o.dial.options,e[3]=o.dial.url,o.dial.appdata=e.join(",")}l(o.dial)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppdialDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.externaldial=angular.copy(e),o.externaldial.appdata)switch(o.externaldial.appType?o.externaldial.appType.toLowerCase():o.externaldial.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.externaldial.appdata.split(",");o.externaldial.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.externaldial.text=s.slice(1,s.length).join(",");break;case"message":o.externaldial.text=o.externaldial.appdata;break;case"set":o.externaldial.name=o.externaldial.appdata.split("=")[0],o.externaldial.value=o.externaldial.appdata.split("=")[1];break;case"agi":o.externaldial.project=o.externaldial.appdata;break;default:var r=o.externaldial.appdata.split(",");o.externaldial.trunk=r[0].split("/")[1],o.externaldial.phone=r[0].split("/")[2],o.externaldial.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.externaldial.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.externaldial.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.externaldial.type&&"outbound"===o.externaldial.type.toLowerCase()&&"outbounddial"===o.externaldial.appType.toLowerCase()&&(o.externaldial.prefix=o.externaldial.phone?o.externaldial.phone.split("$")[0]:void 0,o.externaldial.callerId=o.externaldial.callerID?"CALLERID(all)="+o.externaldial.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.externaldial.type&&"outbound"===o.externaldial.type.toLowerCase()&&"outboundDial"===o.externaldial.appType&&(o.externaldial.phone=a.cutdigits?(o.externaldial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.externaldial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.externaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.externaldial.options+="U(xcally-mixmonitor-context)"):o.externaldial.options=o.externaldial.options.replace("U(xcally-mixmonitor-context)",""));if(o.externaldial.appType&&"custom"===o.externaldial.appType);else switch((o.externaldial.app||o.externaldial.appType).toLowerCase()){case"set":o.externaldial.appdata=o.externaldial.name+"="+o.externaldial.value;break;case"custom":break;default:e[0]=["SIP",o.externaldial.trunk,o.externaldial.phone].join("/"),e[1]=o.externaldial.timeout,e[2]=o.externaldial.options,e[3]=o.externaldial.url,o.externaldial.appdata=e.join(",")}l(o.externaldial)},o.closeDialog=l,i.trunk.get({fields:"name",sort:"name"}).$promise.then(function(e){o.trunks=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppexternaldialDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.goto=angular.copy(e),o.goto.appdata)switch(o.goto.appType?o.goto.appType.toLowerCase():o.goto.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.goto.appdata.split(",");o.goto.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.goto.text=s.slice(1,s.length).join(",");break;case"message":o.goto.text=o.goto.appdata;break;case"set":o.goto.name=o.goto.appdata.split("=")[0],o.goto.value=o.goto.appdata.split("=")[1];break;case"agi":o.goto.project=o.goto.appdata;break;default:var r=o.goto.appdata.split(",");o.goto.context=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.goto.extension=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.goto.priority=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10)}function l(e){t.hide(e)}o.goto.type&&"outbound"===o.goto.type.toLowerCase()&&"outbounddial"===o.goto.appType.toLowerCase()&&(o.goto.prefix=o.goto.phone?o.goto.phone.split("$")[0]:void 0,o.goto.callerId=o.goto.callerID?"CALLERID(all)="+o.goto.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.goto.type&&"outbound"===o.goto.type.toLowerCase()&&"outboundDial"===o.goto.appType&&(o.goto.phone=a.cutdigits?(o.goto.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.goto.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.goto.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.goto.options+="U(xcally-mixmonitor-context)"):o.goto.options=o.goto.options.replace("U(xcally-mixmonitor-context)",""));if(o.goto.appType&&"custom"===o.goto.appType);else switch((o.goto.app||o.goto.appType).toLowerCase()){case"set":o.goto.appdata=o.goto.name+"="+o.goto.value;break;case"custom":break;default:e[0]=o.goto.context,e[1]=o.goto.extension,e[2]=o.goto.priority,o.goto.appdata=e.join(",")}l(o.goto)},o.closeDialog=l,i.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){o.contexts=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppgotoDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(n.appType||n.app).toUpperCase(),o.hangup=angular.copy(n),o.hangup.appdata)switch(o.hangup.appType?o.hangup.appType.toLowerCase():o.hangup.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.hangup.appdata.split(",");o.hangup.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.hangup.text=s.slice(1,s.length).join(",");break;case"message":o.hangup.text=o.hangup.appdata;break;case"set":o.hangup.name=o.hangup.appdata.split("=")[0],o.hangup.value=o.hangup.appdata.split("=")[1];break;case"agi":o.hangup.project=o.hangup.appdata;break;default:var r=o.hangup.appdata.split(",");o.hangup.appdata=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.hangup.type&&"outbound"===o.hangup.type.toLowerCase()&&"outbounddial"===o.hangup.appType.toLowerCase()&&(o.hangup.prefix=o.hangup.phone?o.hangup.phone.split("$")[0]:void 0,o.hangup.callerId=o.hangup.callerID?"CALLERID(all)="+o.hangup.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.hangup.type&&"outbound"===o.hangup.type.toLowerCase()&&"outboundDial"===o.hangup.appType&&(o.hangup.phone=a.cutdigits?(o.hangup.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.hangup.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.hangup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.hangup.options+="U(xcally-mixmonitor-context)"):o.hangup.options=o.hangup.options.replace("U(xcally-mixmonitor-context)",""));if(o.hangup.appType&&"custom"===o.hangup.appType);else switch((o.hangup.app||o.hangup.appType).toLowerCase()){case"set":o.hangup.appdata=o.hangup.name+"="+o.hangup.value;break;case"custom":break;default:e[0]=o.hangup.appdata,o.hangup.appdata=e.join(",")}l(o.hangup)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundApphangupDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.internaldial=angular.copy(e),o.internaldial.appdata)switch(o.internaldial.appType?o.internaldial.appType.toLowerCase():o.internaldial.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.internaldial.appdata.split(",");o.internaldial.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.internaldial.text=s.slice(1,s.length).join(",");break;case"message":o.internaldial.text=o.internaldial.appdata;break;case"set":o.internaldial.name=o.internaldial.appdata.split("=")[0],o.internaldial.value=o.internaldial.appdata.split("=")[1];break;case"agi":o.internaldial.project=o.internaldial.appdata;break;default:var r=o.internaldial.appdata.split(",");o.internaldial.user=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.internaldial.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.internaldial.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.internaldial.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.internaldial.type&&"outbound"===o.internaldial.type.toLowerCase()&&"outbounddial"===o.internaldial.appType.toLowerCase()&&(o.internaldial.prefix=o.internaldial.phone?o.internaldial.phone.split("$")[0]:void 0,o.internaldial.callerId=o.internaldial.callerID?"CALLERID(all)="+o.internaldial.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.internaldial.type&&"outbound"===o.internaldial.type.toLowerCase()&&"outboundDial"===o.internaldial.appType&&(o.internaldial.phone=a.cutdigits?(o.internaldial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.internaldial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.internaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.internaldial.options+="U(xcally-mixmonitor-context)"):o.internaldial.options=o.internaldial.options.replace("U(xcally-mixmonitor-context)",""));if(o.internaldial.appType&&"custom"===o.internaldial.appType);else switch((o.internaldial.app||o.internaldial.appType).toLowerCase()){case"set":o.internaldial.appdata=o.internaldial.name+"="+o.internaldial.value;break;case"custom":break;default:e[0]=o.internaldial.user,e[1]=o.internaldial.timeout,e[2]=o.internaldial.options,e[3]=o.internaldial.url,o.internaldial.appdata=e.join(",")}l(o.internaldial)},o.closeDialog=l,i.user.get({fields:"name",sort:"name"}).$promise.then(function(e){o.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppinternaldialDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditInboundAppintervalDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.playback=angular.copy(e),o.playback.appdata)switch(o.playback.appType?o.playback.appType.toLowerCase():o.playback.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.playback.appdata.split(",");o.playback.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.playback.text=s.slice(1,s.length).join(",");break;case"message":o.playback.text=o.playback.appdata;break;case"set":o.playback.name=o.playback.appdata.split("=")[0],o.playback.value=o.playback.appdata.split("=")[1];break;case"agi":o.playback.project=o.playback.appdata;break;default:var r=o.playback.appdata.split(",");o.playback.appdata=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.playback.options=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.playback.type&&"outbound"===o.playback.type.toLowerCase()&&"outbounddial"===o.playback.appType.toLowerCase()&&(o.playback.prefix=o.playback.phone?o.playback.phone.split("$")[0]:void 0,o.playback.callerId=o.playback.callerID?"CALLERID(all)="+o.playback.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.playback.type&&"outbound"===o.playback.type.toLowerCase()&&"outboundDial"===o.playback.appType&&(o.playback.phone=a.cutdigits?(o.playback.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.playback.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.playback.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.playback.options+="U(xcally-mixmonitor-context)"):o.playback.options=o.playback.options.replace("U(xcally-mixmonitor-context)",""));if(o.playback.appType&&"custom"===o.playback.appType);else switch((o.playback.app||o.playback.appType).toLowerCase()){case"set":o.playback.appdata=o.playback.name+"="+o.playback.value;break;case"custom":break;default:e[0]=o.playback.appdata,e[1]=o.playback.options,o.playback.appdata=e.join(",")}l(o.playback)},o.closeDialog=l,i.sound.get({fields:"name,save_name",sort:"name"}).$promise.then(function(e){o.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppplaybackDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.queue=angular.copy(e),o.queue.appdata)switch(o.queue.appType?o.queue.appType.toLowerCase():o.queue.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.queue.appdata.split(",");o.queue.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.queue.text=s.slice(1,s.length).join(",");break;case"message":o.queue.text=o.queue.appdata;break;case"set":o.queue.name=o.queue.appdata.split("=")[0],o.queue.value=o.queue.appdata.split("=")[1];break;case"agi":o.queue.project=o.queue.appdata;break;default:var r=o.queue.appdata.split(",");o.queue.queue=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.queue.options=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.queue.URL=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.queue.sound=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10),o.queue.timeout=_.isEmpty(r[4])?r[4]:isNaN(r[4])?r[4]:parseInt(r[4],10),o.queue.agi=_.isEmpty(r[5])?r[5]:isNaN(r[5])?r[5]:parseInt(r[5],10),o.queue.macro=_.isEmpty(r[6])?r[6]:isNaN(r[6])?r[6]:parseInt(r[6],10),o.queue.gosub=_.isEmpty(r[7])?r[7]:isNaN(r[7])?r[7]:parseInt(r[7],10),o.queue.rule=_.isEmpty(r[8])?r[8]:isNaN(r[8])?r[8]:parseInt(r[8],10),o.queue.position=_.isEmpty(r[9])?r[9]:isNaN(r[9])?r[9]:parseInt(r[9],10)}function l(e){t.hide(e)}o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outbounddial"===o.queue.appType.toLowerCase()&&(o.queue.prefix=o.queue.phone?o.queue.phone.split("$")[0]:void 0,o.queue.callerId=o.queue.callerID?"CALLERID(all)="+o.queue.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outboundDial"===o.queue.appType&&(o.queue.phone=a.cutdigits?(o.queue.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.queue.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.queue.options+="U(xcally-mixmonitor-context)"):o.queue.options=o.queue.options.replace("U(xcally-mixmonitor-context)",""));if(o.queue.appType&&"custom"===o.queue.appType);else switch((o.queue.app||o.queue.appType).toLowerCase()){case"set":o.queue.appdata=o.queue.name+"="+o.queue.value;break;case"custom":break;default:e[0]=o.queue.queue,e[1]=o.queue.options,e[2]=o.queue.URL,e[3]=o.queue.sound,e[4]=o.queue.timeout,e[5]=o.queue.agi,e[6]=o.queue.macro,e[7]=o.queue.gosub,e[8]=o.queue.rule,e[9]=o.queue.position,o.queue.appdata=e.join(",")}l(o.queue)},o.closeDialog=l,i.sound.get({fields:"name,save_name",sort:"name"}).$promise.then(function(e){o.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.voiceQueue.get({type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){o.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppqueueDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.ringgroup=angular.copy(e),o.ringgroup.appdata)switch(o.ringgroup.appType?o.ringgroup.appType.toLowerCase():o.ringgroup.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.ringgroup.appdata.split(",");o.ringgroup.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.ringgroup.text=s.slice(1,s.length).join(",");break;case"message":o.ringgroup.text=o.ringgroup.appdata;break;case"set":o.ringgroup.name=o.ringgroup.appdata.split("=")[0],o.ringgroup.value=o.ringgroup.appdata.split("=")[1];break;case"agi":o.ringgroup.project=o.ringgroup.appdata;break;default:var r=o.ringgroup.appdata.split(",");o.ringgroup.multipleUsers=r[0].split("&"),o.ringgroup.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.ringgroup.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.ringgroup.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.ringgroup.type&&"outbound"===o.ringgroup.type.toLowerCase()&&"outbounddial"===o.ringgroup.appType.toLowerCase()&&(o.ringgroup.prefix=o.ringgroup.phone?o.ringgroup.phone.split("$")[0]:void 0,o.ringgroup.callerId=o.ringgroup.callerID?"CALLERID(all)="+o.ringgroup.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.ringgroup.type&&"outbound"===o.ringgroup.type.toLowerCase()&&"outboundDial"===o.ringgroup.appType&&(o.ringgroup.phone=a.cutdigits?(o.ringgroup.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.ringgroup.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.ringgroup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.ringgroup.options+="U(xcally-mixmonitor-context)"):o.ringgroup.options=o.ringgroup.options.replace("U(xcally-mixmonitor-context)",""));if(o.ringgroup.appType&&"custom"===o.ringgroup.appType);else switch((o.ringgroup.app||o.ringgroup.appType).toLowerCase()){case"set":o.ringgroup.appdata=o.ringgroup.name+"="+o.ringgroup.value;break;case"custom":break;default:e[0]=o.ringgroup.multipleUsers.join("&"),e[1]=o.ringgroup.timeout,e[2]=o.ringgroup.options,e[3]=o.ringgroup.url,o.ringgroup.appdata=e.join(",")}l(o.ringgroup)},o.closeDialog=l,i.user.get({fields:"name",sort:"name"}).$promise.then(function(e){o.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppringgroupDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.set=angular.copy(e),o.set.appdata)switch(o.set.appType?o.set.appType.toLowerCase():o.set.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.set.appdata.split(",");o.set.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.set.text=s.slice(1,s.length).join(",");break;case"message":o.set.text=o.set.appdata;break;case"set":o.set.name=o.set.appdata.split("=")[0],o.set.value=o.set.appdata.split("=")[1];break;case"agi":o.set.project=o.set.appdata;break;default:var r=o.set.appdata.split("=");o.set.name=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.set.value=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.set.type&&"outbound"===o.set.type.toLowerCase()&&"outbounddial"===o.set.appType.toLowerCase()&&(o.set.prefix=o.set.phone?o.set.phone.split("$")[0]:void 0,o.set.callerId=o.set.callerID?"CALLERID(all)="+o.set.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.set.type&&"outbound"===o.set.type.toLowerCase()&&"outboundDial"===o.set.appType&&(o.set.phone=a.cutdigits?(o.set.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.set.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.set.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.set.options+="U(xcally-mixmonitor-context)"):o.set.options=o.set.options.replace("U(xcally-mixmonitor-context)",""));if(o.set.appType&&"custom"===o.set.appType);else switch((o.set.app||o.set.appType).toLowerCase()){case"set":o.set.appdata=o.set.name+"="+o.set.value;break;case"custom":break;default:e[0]=o.set.name,e[1]=o.set.value,o.set.appdata=e.join("=")}l(o.set)},o.closeDialog=l,i.variable.get({fields:"name",sort:"name"}).$promise.then(function(e){o.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppsetDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.voicemail=angular.copy(e),o.voicemail.appdata)switch(o.voicemail.appType?o.voicemail.appType.toLowerCase():o.voicemail.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.voicemail.appdata.split(",");o.voicemail.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.voicemail.text=s.slice(1,s.length).join(",");break;case"message":o.voicemail.text=o.voicemail.appdata;break;case"set":o.voicemail.name=o.voicemail.appdata.split("=")[0],o.voicemail.value=o.voicemail.appdata.split("=")[1];break;case"agi":o.voicemail.project=o.voicemail.appdata;break;default:var r=o.voicemail.appdata.split(",");o.voicemail.voiceMail=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.voicemail.options=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.voicemail.type&&"outbound"===o.voicemail.type.toLowerCase()&&"outbounddial"===o.voicemail.appType.toLowerCase()&&(o.voicemail.prefix=o.voicemail.phone?o.voicemail.phone.split("$")[0]:void 0,o.voicemail.callerId=o.voicemail.callerID?"CALLERID(all)="+o.voicemail.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.voicemail.type&&"outbound"===o.voicemail.type.toLowerCase()&&"outboundDial"===o.voicemail.appType&&(o.voicemail.phone=a.cutdigits?(o.voicemail.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.voicemail.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.voicemail.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.voicemail.options+="U(xcally-mixmonitor-context)"):o.voicemail.options=o.voicemail.options.replace("U(xcally-mixmonitor-context)",""));if(o.voicemail.appType&&"custom"===o.voicemail.appType);else switch((o.voicemail.app||o.voicemail.appType).toLowerCase()){case"set":o.voicemail.appdata=o.voicemail.name+"="+o.voicemail.value;break;case"custom":break;default:e[0]=o.voicemail.voiceMail,e[1]=o.voicemail.options,o.voicemail.appdata=e.join(",")}l(o.voicemail)},o.closeDialog=l,i.voiceMail.get({fields:"mailbox",sort:"mailbox"}).$promise.then(function(e){o.voiceMails=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMails",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppvoicemailDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.inboundroute=d||e.params.inboundroute||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoInboundRoutes=function(){e.go("app.voice.inboundroutes")},c.saveInboundRoute=function(){s.voiceExtension.update({id:c.inboundroute.id},c.inboundroute).$promise.then(function(){r.success({title:"InboundRoute updated!",msg:c.inboundroute.name?c.inboundroute.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","inboundroute"],angular.module("app.voice").controller("InboundRouteController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.inboundroutes=r||{count:0,rows:[]},v.table="inboundroutes",v.listOrder="",v.listOrderAsc=null,v.selectedInboundRoutes=[],v.query={fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},v.editstate=function(e,t){n.go("app.voice.inboundroutes.edit",{id:e.id,inboundroute:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the inboundroute?").htmlContent("<b>"+(e.name||"inboundroute")+"</b> will be deleted.").ariaLabel("delete inboundroute").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getInboundRoutes=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceExtension.get(v.query,f).$promise},v.createOrEditInboundRoute=function(e,t){i.show({controller:"CreateOrEditInboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundroutes/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{inboundroute:t,inboundroutes:v.inboundroutes.rows,license:v.license,setting:v.setting}})},v.deleteInboundRoute=A,v.exportSelectedInboundRoutes=function(){var e=angular.copy(v.selectedInboundRoutes);return v.selectedInboundRoutes=[],e},v.deleteSelectedInboundRoutes=function(e){var t=i.confirm().title("Are you sure want to delete the selected inboundroutes?").htmlContent("<b>"+v.selectedInboundRoutes.length+" selected</b> will be deleted.").ariaLabel("delete InboundRoutes").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedInboundRoutes.forEach(function(e){A(e)}),v.selectedInboundRoutes=[]})},v.deselectInboundRoutes=function(){v.selectedInboundRoutes=[]},v.selectAllInboundRoutes=function(){v.selectedInboundRoutes=v.inboundroutes.rows},l.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){v.contexts=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.inboundroutes=e||{count:0,rows:[]}}function A(e){l.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(v.inboundroutes.rows,{id:e.id}),v.inboundroutes.count-=1,v.inboundroutes.rows.length||v.getInboundRoutes(),c.success({title:"InboundRoute deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getInboundRoutes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","inboundroutes","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("InboundRoutesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_INTERNALROUTE",m.internalroute=angular.copy(s),m.internalroutes=o,m.newInternalRoute=!1,m.internalroute||(m.internalroute={appdata:"Internal Call",type:"internal",context:"from-sip"},m.title="VOICE.NEW_INTERNALROUTE",m.newInternalRoute=!0),m.addNewInternalRoute=function(){m.errors=[],r.voiceExtension.save(m.internalroute).$promise.then(function(e){m.internalroutes.unshift(e.toJSON()),i.success({title:"InternalRoute properly created",msg:m.internalroute.name?m.internalroute.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveInternalRoute=function(){m.errors=[],r.voiceExtension.update({id:m.internalroute.id},m.internalroute).$promise.then(function(e){var t=_.find(m.internalroutes,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"InternalRoute properly saved!",msg:m.internalroute.name?m.internalroute.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteInternalRoute=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The internalroute will be deleted.").ariaLabel("Delete InternalRoute").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceExtension.delete({id:m.internalroute.id}).$promise.then(function(){_.remove(m.internalroutes,{id:m.internalroute.id}),i.success({title:"InternalRoute properly deleted!",msg:(m.internalroute.name||"internalroute")+" has been deleted!"}),u(m.internalroute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","internalroutes","internalroute","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditInternalRouteDialogController",e)}(),function(){"use strict";function e(m,i,a,o,e){var u=this;function t(e,t){if(u.internalrouteApps.rows.length){var n=u.internalrouteApps.rows[t]?u.internalrouteApps.rows[t]:u.internalrouteApps.rows[0];i.show({controller:"EditInternalApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalroutes/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{internalrouteApp:n,internalroute:u.internalroute}}).then(function(e){e&&(e.id?u.internalrouteApps.rows[t]=e:u.internalrouteApps.rows.splice(t,0,e),s())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function s(){var e=["queue","playback"],t=2,n=[];n.push({type:"internal",app:"Set",appdata:"CDR(type)=internal",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id}),n.push({type:"internal",app:"Set",appdata:"XCALLY-MOTION-ANSWER=0",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id}),n.push({type:"internal",app:"Set",appdata:"XCALLY-MOTION-PROGRESS=0",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id}),n.push({type:"internal",app:"Set",appdata:"MONITOR_OPTIONS=ab",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id});for(var a=0,i=0;a<u.internalrouteApps.rows.length;a++,i=0){var o=u.internalrouteApps.rows[a],s=[],r=[];o.intervals="*,*,*,*"!==o.interval?[o.interval]:o.IntervalId?_.map(_.filter(u.intervals.rows,{IntervalId:o.IntervalId}),"interval"):[],o.context=u.internalroute.context,o.exten=u.internalroute.exten,o.type&&(o.type=o.type.toLowerCase()),o.hasOwnProperty("answer")&&e.includes(o.app.toLowerCase())&&"custom"!==o.appType&&(o.answer?(s.push({type:o.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-ANSWER}=0]?Answer",context:u.internalroute.context,exten:u.internalroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id}),s.push({type:o.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-ANSWER=1",context:u.internalroute.context,exten:u.internalroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id})):(s.push({type:o.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-PROGRESS}=0]?Progress",context:u.internalroute.context,exten:u.internalroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id}),s.push({type:o.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-PROGRESS=1",context:u.internalroute.context,exten:u.internalroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id})));for(var l=0;l<o.intervals.length;l++){var d=t+o.intervals.length,c=l===o.intervals.length-1?t+s.length+r.length+2:t+l+1;s.splice(l,0,{type:"internal",app:"GotoIfTime",appdata:o.intervals[l]+"?"+u.internalroute.context+",${EXTEN},"+d+":"+u.internalroute.context+",${EXTEN},"+c,exten:u.internalroute.exten,context:u.internalroute.context,priority:t+l,VoiceExtensionId:u.internalroute.id})}o.priority=s.length?_.last(s).priority+1:t,t=(r.length?_.last(r).priority:o.priority)+1,n=_.concat(n,s,[o],r)}n.push({type:"internal",app:"Hangup",exten:u.internalroute.exten,context:u.internalroute.context,priority:t,VoiceExtensionId:u.internalroute.id}),m.voiceExtension.addApplications({id:u.internalroute.id},_.sortBy(n,"priority")).$promise.then(function(e){u.internalrouteApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){u.internalrouteApps=e||{count:0,rows:[]}}u.currentUser=e.getCurrentUser(),u.internalroute={},u.internalrouteApps={count:0,rows:[]},u.selectedInternalRouteApps=[],u.query={sort:"priority"},u.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",type:"Internal",types:["always","custom","list"],fields:[],isApp:!1},{app:"Queue",appType:"queue",context:"from-sip",type:"Internal",options:"xX",appdata:",xX,,,300,,,,,",icon:"icon-apps",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",route:"sound",filters:{fields:"name,save_name",sort:"name"}},{name:"queues",route:"voiceQueue",filters:{type:"inbound",fields:"id,name,type",sort:"name",nolimit:!0}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Url",name:"URL",type:"text",param:2},{title:"Announce_Overrides",name:"sound",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}'",option:"sound.name",defaultValues:[{value:"''",option:"None"}],param:3},{title:"Timeout",name:"timeout",type:"number",min:0,param:4},{title:"Agi",name:"agi",type:"text",param:5},{title:"Macro",name:"macro",type:"text",param:6},{title:"GoSub",name:"gosub",type:"text",param:7},{title:"Rule",name:"rule",type:"text",param:8},{title:"Position",name:"position",type:"number",min:0,param:9},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Playback",appType:"playback",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",route:"sound",filters:{fields:"name,save_name",sort:"name"}}],fields:[{title:"Audio_Files",name:"appdata",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}'",option:"appdata.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Dial",appType:"dial",context:"from-sip",type:"Internal",icon:"icon-apps",options:"xX",interval:"*,*,*,*",isApp:!0,fields:[{title:"Technology/Resource",name:"tech",type:"text",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"internalDial",context:"from-sip",type:"Internal",icon:"icon-apps",options:"xX",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"users",route:"user",filters:{fields:"name",sort:"name"}}],fields:[{title:"User",name:"user",type:"apiselect",values:"users",value:"'SIP/{{user.name}}'",option:"user.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"externalDial",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"trunks",route:"trunk",filters:{fields:"name",sort:"name"}}],fields:[{title:"Trunk",name:"trunk",type:"apiselect",values:"trunks",value:"trunk.name",option:"trunk.name",required:!0,param:0},{title:"Phone",name:"phone",type:"text"},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"ringGroup",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"users",route:"user",filters:{fields:"name",sort:"name"}}],fields:[{title:"User",name:"multipleUsers",type:"apiselect",multiple:!0,values:"users",value:"'SIP/{{multipleUsers.name}}'",option:"multipleUsers.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"AGI",alias:"CallySquare",appType:"agi",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"projects",route:"squareProject",filters:{fields:"name",sort:"name"}}],fields:[{title:"Project",name:"project",type:"apiselect",values:"projects",value:"'agi://127.0.0.1/square,{{project.name}}'",option:"project.name",required:!0,param:0}]},{app:"goto",appType:"goTo",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"contexts",route:"voiceContext",filters:{fields:"name",sort:"name"}}],fields:[{title:"Context",name:"context",type:"apiselect",values:"contexts",value:"context.name",option:"context.name",required:!0,param:0},{title:"Extension",name:"extension",type:"text",required:!0,param:1},{title:"Priority",name:"priority",type:"text",required:!0,param:2}]},{app:"hangup",appType:"hangup",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Hangup_Cause",name:"appdata",type:"select",param:0,values:[{option:"HANGUPCAUSE_1",value:"'1'"},{option:"HANGUPCAUSE_16",value:"'16'"},{option:"HANGUPCAUSE_17",value:"'17'"},{option:"HANGUPCAUSE_18",value:"'18'"},{option:"HANGUPCAUSE_21",value:"'21'"},{option:"HANGUPCAUSE_22",value:"'22'"},{option:"HANGUPCAUSE_27",value:"'27'"},{option:"HANGUPCAUSE_38",value:"'38'"},{option:"HANGUPCAUSE_41",value:"'41'"}],translate:!0,required:!0,general:!0}]},{app:"Set",appType:"set",context:"from-sip",type:"Internal",separator:"=",icon:"icon-apps",interval:"*,*,*,*",extraApi:[{name:"variables",route:"variable",filters:{fields:"name",sort:"name"}}],isApp:!0,fields:[{title:"Variable",name:"name",type:"apiselect",values:"variables",value:"name.name",option:"name.name",required:!0,param:0},{title:"Value",name:"value",type:"text",required:!0,param:1}]},{app:null,appType:"custom",icon:"icon-apps",type:"Internal",interval:"*,*,*,*",isApp:!0,fields:[{title:"Application_Name",name:"app",type:"text",required:!0,param:0},{title:"Arguments",name:"appdata",type:"text",param:1}]},{app:"Voicemail",appType:"voicemail",context:"from-sip",icon:"icon-apps",type:"Internal",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"voiceMails",route:"voiceMail",filters:{fields:"mailbox",sort:"mailbox"}}],fields:[{title:"Mailbox@Context",name:"voiceMail",type:"apiselect",values:"voiceMails",value:"'{{voiceMail.mailbox}}@from-voicemail'",option:"voiceMail.mailbox",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1}]}],["app"]),{isApp:!1}),u.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},u.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){s()}},u.init=function(e){u.internalroute=e,u.query.VoiceExtensionId=e.id,u.query.isApp=!0,u.query.nolimit=!0,u.getInternalRouteApps(),u.getIntervals()},u.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){u.internalrouteApps.rows.splice(t,1),s()},function(){console.log("CANCEL")})},u.getInternalRouteApps=function(){u.promise=m.voiceExtension.get(u.query,n).$promise},u.editInternalRouteApp=t,u.editInterval=function(e,t){if(u.internalrouteApps.rows.length){var n=u.internalrouteApps.rows[t]?u.internalrouteApps.rows[t]:u.internalrouteApps.rows[0];i.show({controller:"EditInternalAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalroutes/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,s())})}},u.deleteInternalRouteApp=function(e){_.remove(u.internalrouteApps.rows,{id:e.id}),s(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},u.deleteSelectedInternalRouteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+u.selectedInternalRouteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){u.selectedInternalRouteApps.forEach(function(e){_.remove(u.internalrouteApps.rows,{id:e.id})}),u.selectedInternalRouteApps=[],s()})},u.rewriteRouting=s,u.getIntervals=function(){return m.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){u.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.voice").controller("InternalRouteActionsController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.agi=angular.copy(e),o.agi.appdata)switch(o.agi.appType?o.agi.appType.toLowerCase():o.agi.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.agi.appdata.split(",");o.agi.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.agi.text=s.slice(1,s.length).join(",");break;case"message":o.agi.text=o.agi.appdata;break;case"set":o.agi.name=o.agi.appdata.split("=")[0],o.agi.value=o.agi.appdata.split("=")[1];break;case"agi":o.agi.project=o.agi.appdata;break;default:var r=o.agi.appdata.split(",");o.agi.project=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.agi.type&&"outbound"===o.agi.type.toLowerCase()&&"outbounddial"===o.agi.appType.toLowerCase()&&(o.agi.prefix=o.agi.phone?o.agi.phone.split("$")[0]:void 0,o.agi.callerId=o.agi.callerID?"CALLERID(all)="+o.agi.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.agi.type&&"outbound"===o.agi.type.toLowerCase()&&"outboundDial"===o.agi.appType&&(o.agi.phone=a.cutdigits?(o.agi.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.agi.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.agi.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.agi.options+="U(xcally-mixmonitor-context)"):o.agi.options=o.agi.options.replace("U(xcally-mixmonitor-context)",""));if(o.agi.appType&&"custom"===o.agi.appType);else switch((o.agi.app||o.agi.appType).toLowerCase()){case"set":o.agi.appdata=o.agi.name+"="+o.agi.value;break;case"custom":break;default:e[0]=o.agi.project,o.agi.appdata=e.join(",")}l(o.agi)},o.closeDialog=l,i.squareProject.get({fields:"name",sort:"name"}).$promise.then(function(e){o.projects=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppagiDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(n.appType||n.app).toUpperCase(),o.custom=angular.copy(n),o.custom.appdata)switch(o.custom.appType?o.custom.appType.toLowerCase():o.custom.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.custom.appdata.split(",");o.custom.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.custom.text=s.slice(1,s.length).join(",");break;case"message":o.custom.text=o.custom.appdata;break;case"set":o.custom.name=o.custom.appdata.split("=")[0],o.custom.value=o.custom.appdata.split("=")[1];break;case"agi":o.custom.project=o.custom.appdata;break;default:var r=o.custom.appdata.split(",");o.custom.app=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.custom.appdata=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.custom.type&&"outbound"===o.custom.type.toLowerCase()&&"outbounddial"===o.custom.appType.toLowerCase()&&(o.custom.prefix=o.custom.phone?o.custom.phone.split("$")[0]:void 0,o.custom.callerId=o.custom.callerID?"CALLERID(all)="+o.custom.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.custom.type&&"outbound"===o.custom.type.toLowerCase()&&"outboundDial"===o.custom.appType&&(o.custom.phone=a.cutdigits?(o.custom.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.custom.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.custom.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.custom.options+="U(xcally-mixmonitor-context)"):o.custom.options=o.custom.options.replace("U(xcally-mixmonitor-context)",""));if(o.custom.appType&&"custom"===o.custom.appType);else switch((o.custom.app||o.custom.appType).toLowerCase()){case"set":o.custom.appdata=o.custom.name+"="+o.custom.value;break;case"custom":break;default:e[0]=o.custom.app,e[1]=o.custom.appdata,o.custom.appdata=e.join(",")}l(o.custom)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppcustomDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(n.appType||n.app).toUpperCase(),o.dial=angular.copy(n),o.dial.appdata)switch(o.dial.appType?o.dial.appType.toLowerCase():o.dial.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.dial.appdata.split(",");o.dial.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.dial.text=s.slice(1,s.length).join(",");break;case"message":o.dial.text=o.dial.appdata;break;case"set":o.dial.name=o.dial.appdata.split("=")[0],o.dial.value=o.dial.appdata.split("=")[1];break;case"agi":o.dial.project=o.dial.appdata;break;default:var r=o.dial.appdata.split(",");o.dial.tech=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.dial.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.dial.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.dial.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.dial.type&&"outbound"===o.dial.type.toLowerCase()&&"outbounddial"===o.dial.appType.toLowerCase()&&(o.dial.prefix=o.dial.phone?o.dial.phone.split("$")[0]:void 0,o.dial.callerId=o.dial.callerID?"CALLERID(all)="+o.dial.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.dial.type&&"outbound"===o.dial.type.toLowerCase()&&"outboundDial"===o.dial.appType&&(o.dial.phone=a.cutdigits?(o.dial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.dial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.dial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.dial.options+="U(xcally-mixmonitor-context)"):o.dial.options=o.dial.options.replace("U(xcally-mixmonitor-context)",""));if(o.dial.appType&&"custom"===o.dial.appType);else switch((o.dial.app||o.dial.appType).toLowerCase()){case"set":o.dial.appdata=o.dial.name+"="+o.dial.value;break;case"custom":break;default:e[0]=o.dial.tech,e[1]=o.dial.timeout,e[2]=o.dial.options,e[3]=o.dial.url,o.dial.appdata=e.join(",")}l(o.dial)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppdialDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.externaldial=angular.copy(e),o.externaldial.appdata)switch(o.externaldial.appType?o.externaldial.appType.toLowerCase():o.externaldial.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.externaldial.appdata.split(",");o.externaldial.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.externaldial.text=s.slice(1,s.length).join(",");break;case"message":o.externaldial.text=o.externaldial.appdata;break;case"set":o.externaldial.name=o.externaldial.appdata.split("=")[0],o.externaldial.value=o.externaldial.appdata.split("=")[1];break;case"agi":o.externaldial.project=o.externaldial.appdata;break;default:var r=o.externaldial.appdata.split(",");o.externaldial.trunk=r[0].split("/")[1],o.externaldial.phone=r[0].split("/")[2],o.externaldial.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.externaldial.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.externaldial.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.externaldial.type&&"outbound"===o.externaldial.type.toLowerCase()&&"outbounddial"===o.externaldial.appType.toLowerCase()&&(o.externaldial.prefix=o.externaldial.phone?o.externaldial.phone.split("$")[0]:void 0,o.externaldial.callerId=o.externaldial.callerID?"CALLERID(all)="+o.externaldial.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.externaldial.type&&"outbound"===o.externaldial.type.toLowerCase()&&"outboundDial"===o.externaldial.appType&&(o.externaldial.phone=a.cutdigits?(o.externaldial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.externaldial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.externaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.externaldial.options+="U(xcally-mixmonitor-context)"):o.externaldial.options=o.externaldial.options.replace("U(xcally-mixmonitor-context)",""));if(o.externaldial.appType&&"custom"===o.externaldial.appType);else switch((o.externaldial.app||o.externaldial.appType).toLowerCase()){case"set":o.externaldial.appdata=o.externaldial.name+"="+o.externaldial.value;break;case"custom":break;default:e[0]=["SIP",o.externaldial.trunk,o.externaldial.phone].join("/"),e[1]=o.externaldial.timeout,e[2]=o.externaldial.options,e[3]=o.externaldial.url,o.externaldial.appdata=e.join(",")}l(o.externaldial)},o.closeDialog=l,i.trunk.get({fields:"name",sort:"name"}).$promise.then(function(e){o.trunks=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppexternaldialDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.goto=angular.copy(e),o.goto.appdata)switch(o.goto.appType?o.goto.appType.toLowerCase():o.goto.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.goto.appdata.split(",");o.goto.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.goto.text=s.slice(1,s.length).join(",");break;case"message":o.goto.text=o.goto.appdata;break;case"set":o.goto.name=o.goto.appdata.split("=")[0],o.goto.value=o.goto.appdata.split("=")[1];break;case"agi":o.goto.project=o.goto.appdata;break;default:var r=o.goto.appdata.split(",");o.goto.context=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.goto.extension=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.goto.priority=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10)}function l(e){t.hide(e)}o.goto.type&&"outbound"===o.goto.type.toLowerCase()&&"outbounddial"===o.goto.appType.toLowerCase()&&(o.goto.prefix=o.goto.phone?o.goto.phone.split("$")[0]:void 0,o.goto.callerId=o.goto.callerID?"CALLERID(all)="+o.goto.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.goto.type&&"outbound"===o.goto.type.toLowerCase()&&"outboundDial"===o.goto.appType&&(o.goto.phone=a.cutdigits?(o.goto.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.goto.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.goto.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.goto.options+="U(xcally-mixmonitor-context)"):o.goto.options=o.goto.options.replace("U(xcally-mixmonitor-context)",""));if(o.goto.appType&&"custom"===o.goto.appType);else switch((o.goto.app||o.goto.appType).toLowerCase()){case"set":o.goto.appdata=o.goto.name+"="+o.goto.value;break;case"custom":break;default:e[0]=o.goto.context,e[1]=o.goto.extension,e[2]=o.goto.priority,o.goto.appdata=e.join(",")}l(o.goto)},o.closeDialog=l,i.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){o.contexts=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppgotoDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(n.appType||n.app).toUpperCase(),o.hangup=angular.copy(n),o.hangup.appdata)switch(o.hangup.appType?o.hangup.appType.toLowerCase():o.hangup.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.hangup.appdata.split(",");o.hangup.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.hangup.text=s.slice(1,s.length).join(",");break;case"message":o.hangup.text=o.hangup.appdata;break;case"set":o.hangup.name=o.hangup.appdata.split("=")[0],o.hangup.value=o.hangup.appdata.split("=")[1];break;case"agi":o.hangup.project=o.hangup.appdata;break;default:var r=o.hangup.appdata.split(",");o.hangup.appdata=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.hangup.type&&"outbound"===o.hangup.type.toLowerCase()&&"outbounddial"===o.hangup.appType.toLowerCase()&&(o.hangup.prefix=o.hangup.phone?o.hangup.phone.split("$")[0]:void 0,o.hangup.callerId=o.hangup.callerID?"CALLERID(all)="+o.hangup.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.hangup.type&&"outbound"===o.hangup.type.toLowerCase()&&"outboundDial"===o.hangup.appType&&(o.hangup.phone=a.cutdigits?(o.hangup.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.hangup.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.hangup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.hangup.options+="U(xcally-mixmonitor-context)"):o.hangup.options=o.hangup.options.replace("U(xcally-mixmonitor-context)",""));if(o.hangup.appType&&"custom"===o.hangup.appType);else switch((o.hangup.app||o.hangup.appType).toLowerCase()){case"set":o.hangup.appdata=o.hangup.name+"="+o.hangup.value;break;case"custom":break;default:e[0]=o.hangup.appdata,o.hangup.appdata=e.join(",")}l(o.hangup)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalApphangupDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.internaldial=angular.copy(e),o.internaldial.appdata)switch(o.internaldial.appType?o.internaldial.appType.toLowerCase():o.internaldial.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.internaldial.appdata.split(",");o.internaldial.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.internaldial.text=s.slice(1,s.length).join(",");break;case"message":o.internaldial.text=o.internaldial.appdata;break;case"set":o.internaldial.name=o.internaldial.appdata.split("=")[0],o.internaldial.value=o.internaldial.appdata.split("=")[1];break;case"agi":o.internaldial.project=o.internaldial.appdata;break;default:var r=o.internaldial.appdata.split(",");o.internaldial.user=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.internaldial.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.internaldial.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.internaldial.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.internaldial.type&&"outbound"===o.internaldial.type.toLowerCase()&&"outbounddial"===o.internaldial.appType.toLowerCase()&&(o.internaldial.prefix=o.internaldial.phone?o.internaldial.phone.split("$")[0]:void 0,o.internaldial.callerId=o.internaldial.callerID?"CALLERID(all)="+o.internaldial.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.internaldial.type&&"outbound"===o.internaldial.type.toLowerCase()&&"outboundDial"===o.internaldial.appType&&(o.internaldial.phone=a.cutdigits?(o.internaldial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.internaldial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.internaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.internaldial.options+="U(xcally-mixmonitor-context)"):o.internaldial.options=o.internaldial.options.replace("U(xcally-mixmonitor-context)",""));if(o.internaldial.appType&&"custom"===o.internaldial.appType);else switch((o.internaldial.app||o.internaldial.appType).toLowerCase()){case"set":o.internaldial.appdata=o.internaldial.name+"="+o.internaldial.value;break;case"custom":break;default:e[0]=o.internaldial.user,e[1]=o.internaldial.timeout,e[2]=o.internaldial.options,e[3]=o.internaldial.url,o.internaldial.appdata=e.join(",")}l(o.internaldial)},o.closeDialog=l,i.user.get({fields:"name",sort:"name"}).$promise.then(function(e){o.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppinternaldialDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditInternalAppintervalDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.playback=angular.copy(e),o.playback.appdata)switch(o.playback.appType?o.playback.appType.toLowerCase():o.playback.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.playback.appdata.split(",");o.playback.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.playback.text=s.slice(1,s.length).join(",");break;case"message":o.playback.text=o.playback.appdata;break;case"set":o.playback.name=o.playback.appdata.split("=")[0],o.playback.value=o.playback.appdata.split("=")[1];break;case"agi":o.playback.project=o.playback.appdata;break;default:var r=o.playback.appdata.split(",");o.playback.appdata=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.playback.options=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.playback.type&&"outbound"===o.playback.type.toLowerCase()&&"outbounddial"===o.playback.appType.toLowerCase()&&(o.playback.prefix=o.playback.phone?o.playback.phone.split("$")[0]:void 0,o.playback.callerId=o.playback.callerID?"CALLERID(all)="+o.playback.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.playback.type&&"outbound"===o.playback.type.toLowerCase()&&"outboundDial"===o.playback.appType&&(o.playback.phone=a.cutdigits?(o.playback.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.playback.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.playback.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.playback.options+="U(xcally-mixmonitor-context)"):o.playback.options=o.playback.options.replace("U(xcally-mixmonitor-context)",""));if(o.playback.appType&&"custom"===o.playback.appType);else switch((o.playback.app||o.playback.appType).toLowerCase()){case"set":o.playback.appdata=o.playback.name+"="+o.playback.value;break;case"custom":break;default:e[0]=o.playback.appdata,e[1]=o.playback.options,o.playback.appdata=e.join(",")}l(o.playback)},o.closeDialog=l,i.sound.get({fields:"name,save_name",sort:"name"}).$promise.then(function(e){o.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppplaybackDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.queue=angular.copy(e),o.queue.appdata)switch(o.queue.appType?o.queue.appType.toLowerCase():o.queue.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.queue.appdata.split(",");o.queue.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.queue.text=s.slice(1,s.length).join(",");break;case"message":o.queue.text=o.queue.appdata;break;case"set":o.queue.name=o.queue.appdata.split("=")[0],o.queue.value=o.queue.appdata.split("=")[1];break;case"agi":o.queue.project=o.queue.appdata;break;default:var r=o.queue.appdata.split(",");o.queue.queue=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.queue.options=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.queue.URL=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.queue.sound=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10),o.queue.timeout=_.isEmpty(r[4])?r[4]:isNaN(r[4])?r[4]:parseInt(r[4],10),o.queue.agi=_.isEmpty(r[5])?r[5]:isNaN(r[5])?r[5]:parseInt(r[5],10),o.queue.macro=_.isEmpty(r[6])?r[6]:isNaN(r[6])?r[6]:parseInt(r[6],10),o.queue.gosub=_.isEmpty(r[7])?r[7]:isNaN(r[7])?r[7]:parseInt(r[7],10),o.queue.rule=_.isEmpty(r[8])?r[8]:isNaN(r[8])?r[8]:parseInt(r[8],10),o.queue.position=_.isEmpty(r[9])?r[9]:isNaN(r[9])?r[9]:parseInt(r[9],10)}function l(e){t.hide(e)}o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outbounddial"===o.queue.appType.toLowerCase()&&(o.queue.prefix=o.queue.phone?o.queue.phone.split("$")[0]:void 0,o.queue.callerId=o.queue.callerID?"CALLERID(all)="+o.queue.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outboundDial"===o.queue.appType&&(o.queue.phone=a.cutdigits?(o.queue.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.queue.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.queue.options+="U(xcally-mixmonitor-context)"):o.queue.options=o.queue.options.replace("U(xcally-mixmonitor-context)",""));if(o.queue.appType&&"custom"===o.queue.appType);else switch((o.queue.app||o.queue.appType).toLowerCase()){case"set":o.queue.appdata=o.queue.name+"="+o.queue.value;break;case"custom":break;default:e[0]=o.queue.queue,e[1]=o.queue.options,e[2]=o.queue.URL,e[3]=o.queue.sound,e[4]=o.queue.timeout,e[5]=o.queue.agi,e[6]=o.queue.macro,e[7]=o.queue.gosub,e[8]=o.queue.rule,e[9]=o.queue.position,o.queue.appdata=e.join(",")}l(o.queue)},o.closeDialog=l,i.sound.get({fields:"name,save_name",sort:"name"}).$promise.then(function(e){o.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.voiceQueue.get({type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){o.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppqueueDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.ringgroup=angular.copy(e),o.ringgroup.appdata)switch(o.ringgroup.appType?o.ringgroup.appType.toLowerCase():o.ringgroup.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.ringgroup.appdata.split(",");o.ringgroup.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.ringgroup.text=s.slice(1,s.length).join(",");break;case"message":o.ringgroup.text=o.ringgroup.appdata;break;case"set":o.ringgroup.name=o.ringgroup.appdata.split("=")[0],o.ringgroup.value=o.ringgroup.appdata.split("=")[1];break;case"agi":o.ringgroup.project=o.ringgroup.appdata;break;default:var r=o.ringgroup.appdata.split(",");o.ringgroup.multipleUsers=r[0].split("&"),o.ringgroup.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.ringgroup.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.ringgroup.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.ringgroup.type&&"outbound"===o.ringgroup.type.toLowerCase()&&"outbounddial"===o.ringgroup.appType.toLowerCase()&&(o.ringgroup.prefix=o.ringgroup.phone?o.ringgroup.phone.split("$")[0]:void 0,o.ringgroup.callerId=o.ringgroup.callerID?"CALLERID(all)="+o.ringgroup.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.ringgroup.type&&"outbound"===o.ringgroup.type.toLowerCase()&&"outboundDial"===o.ringgroup.appType&&(o.ringgroup.phone=a.cutdigits?(o.ringgroup.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.ringgroup.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.ringgroup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.ringgroup.options+="U(xcally-mixmonitor-context)"):o.ringgroup.options=o.ringgroup.options.replace("U(xcally-mixmonitor-context)",""));if(o.ringgroup.appType&&"custom"===o.ringgroup.appType);else switch((o.ringgroup.app||o.ringgroup.appType).toLowerCase()){case"set":o.ringgroup.appdata=o.ringgroup.name+"="+o.ringgroup.value;break;case"custom":break;default:e[0]=o.ringgroup.multipleUsers.join("&"),e[1]=o.ringgroup.timeout,e[2]=o.ringgroup.options,e[3]=o.ringgroup.url,o.ringgroup.appdata=e.join(",")}l(o.ringgroup)},o.closeDialog=l,i.user.get({fields:"name",sort:"name"}).$promise.then(function(e){o.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppringgroupDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.set=angular.copy(e),o.set.appdata)switch(o.set.appType?o.set.appType.toLowerCase():o.set.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.set.appdata.split(",");o.set.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.set.text=s.slice(1,s.length).join(",");break;case"message":o.set.text=o.set.appdata;break;case"set":o.set.name=o.set.appdata.split("=")[0],o.set.value=o.set.appdata.split("=")[1];break;case"agi":o.set.project=o.set.appdata;break;default:var r=o.set.appdata.split("=");o.set.name=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.set.value=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.set.type&&"outbound"===o.set.type.toLowerCase()&&"outbounddial"===o.set.appType.toLowerCase()&&(o.set.prefix=o.set.phone?o.set.phone.split("$")[0]:void 0,o.set.callerId=o.set.callerID?"CALLERID(all)="+o.set.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.set.type&&"outbound"===o.set.type.toLowerCase()&&"outboundDial"===o.set.appType&&(o.set.phone=a.cutdigits?(o.set.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.set.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.set.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.set.options+="U(xcally-mixmonitor-context)"):o.set.options=o.set.options.replace("U(xcally-mixmonitor-context)",""));if(o.set.appType&&"custom"===o.set.appType);else switch((o.set.app||o.set.appType).toLowerCase()){case"set":o.set.appdata=o.set.name+"="+o.set.value;break;case"custom":break;default:e[0]=o.set.name,e[1]=o.set.value,o.set.appdata=e.join("=")}l(o.set)},o.closeDialog=l,i.variable.get({fields:"name",sort:"name"}).$promise.then(function(e){o.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppsetDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.voicemail=angular.copy(e),o.voicemail.appdata)switch(o.voicemail.appType?o.voicemail.appType.toLowerCase():o.voicemail.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.voicemail.appdata.split(",");o.voicemail.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.voicemail.text=s.slice(1,s.length).join(",");break;case"message":o.voicemail.text=o.voicemail.appdata;break;case"set":o.voicemail.name=o.voicemail.appdata.split("=")[0],o.voicemail.value=o.voicemail.appdata.split("=")[1];break;case"agi":o.voicemail.project=o.voicemail.appdata;break;default:var r=o.voicemail.appdata.split(",");o.voicemail.voiceMail=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.voicemail.options=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.voicemail.type&&"outbound"===o.voicemail.type.toLowerCase()&&"outbounddial"===o.voicemail.appType.toLowerCase()&&(o.voicemail.prefix=o.voicemail.phone?o.voicemail.phone.split("$")[0]:void 0,o.voicemail.callerId=o.voicemail.callerID?"CALLERID(all)="+o.voicemail.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.voicemail.type&&"outbound"===o.voicemail.type.toLowerCase()&&"outboundDial"===o.voicemail.appType&&(o.voicemail.phone=a.cutdigits?(o.voicemail.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.voicemail.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.voicemail.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.voicemail.options+="U(xcally-mixmonitor-context)"):o.voicemail.options=o.voicemail.options.replace("U(xcally-mixmonitor-context)",""));if(o.voicemail.appType&&"custom"===o.voicemail.appType);else switch((o.voicemail.app||o.voicemail.appType).toLowerCase()){case"set":o.voicemail.appdata=o.voicemail.name+"="+o.voicemail.value;break;case"custom":break;default:e[0]=o.voicemail.voiceMail,e[1]=o.voicemail.options,o.voicemail.appdata=e.join(",")}l(o.voicemail)},o.closeDialog=l,i.voiceMail.get({fields:"mailbox",sort:"mailbox"}).$promise.then(function(e){o.voiceMails=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMails",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppvoicemailDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.internalroute=d||e.params.internalroute||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoInternalRoutes=function(){e.go("app.voice.internalroutes")},c.saveInternalRoute=function(){s.voiceExtension.update({id:c.internalroute.id},c.internalroute).$promise.then(function(){r.success({title:"InternalRoute updated!",msg:c.internalroute.name?c.internalroute.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","internalroute"],angular.module("app.voice").controller("InternalRouteController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.internalroutes=r||{count:0,rows:[]},v.table="internalroutes",v.listOrder="",v.listOrderAsc=null,v.selectedInternalRoutes=[],v.query={fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},v.editstate=function(e,t){n.go("app.voice.internalroutes.edit",{id:e.id,internalroute:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the internalroute?").htmlContent("<b>"+(e.name||"internalroute")+"</b> will be deleted.").ariaLabel("delete internalroute").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getInternalRoutes=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceExtension.get(v.query,f).$promise},v.createOrEditInternalRoute=function(e,t){i.show({controller:"CreateOrEditInternalRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalroutes/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{internalroute:t,internalroutes:v.internalroutes.rows,license:v.license,setting:v.setting}})},v.deleteInternalRoute=A,v.exportSelectedInternalRoutes=function(){var e=angular.copy(v.selectedInternalRoutes);return v.selectedInternalRoutes=[],e},v.deleteSelectedInternalRoutes=function(e){var t=i.confirm().title("Are you sure want to delete the selected internalroutes?").htmlContent("<b>"+v.selectedInternalRoutes.length+" selected</b> will be deleted.").ariaLabel("delete InternalRoutes").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedInternalRoutes.forEach(function(e){A(e)}),v.selectedInternalRoutes=[]})},v.deselectInternalRoutes=function(){v.selectedInternalRoutes=[]},v.selectAllInternalRoutes=function(){v.selectedInternalRoutes=v.internalroutes.rows},l.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){v.contexts=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.internalroutes=e||{count:0,rows:[]}}function A(e){l.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(v.internalroutes.rows,{id:e.id}),v.internalroutes.count-=1,v.internalroutes.rows.length||v.getInternalRoutes(),c.success({title:"InternalRoute deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getInternalRoutes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","internalroutes","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("InternalRoutesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_MUSICONHOLD",m.musiconhold=angular.copy(s),m.musiconholds=o,m.newMusicOnHold=!1,m.musiconhold||(m.musiconhold={mode:"files"},m.title="VOICE.NEW_MUSICONHOLD",m.newMusicOnHold=!0),m.addNewMusicOnHold=function(){m.errors=[],r.voiceMusicOnHold.save(m.musiconhold).$promise.then(function(e){m.musiconholds.unshift(e.toJSON()),i.success({title:"MusicOnHold properly created",msg:m.musiconhold.name?m.musiconhold.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMusicOnHold=function(){m.errors=[],r.voiceMusicOnHold.update({id:m.musiconhold.id},m.musiconhold).$promise.then(function(e){var t=_.find(m.musiconholds,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"MusicOnHold properly saved!",msg:m.musiconhold.name?m.musiconhold.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMusicOnHold=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The musiconhold will be deleted.").ariaLabel("Delete MusicOnHold").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceMusicOnHold.delete({id:m.musiconhold.id}).$promise.then(function(){_.remove(m.musiconholds,{id:m.musiconhold.id}),i.success({title:"MusicOnHold properly deleted!",msg:(m.musiconhold.name||"musiconhold")+" has been deleted!"}),u(m.musiconhold)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","musiconholds","musiconhold","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditMusicOnHoldDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.musiconhold={},c.musiconholdMohSounds={count:0,rows:[]},c.selectedMusicOnHoldMohSounds=[],c.query={fields:"createdAt,updatedAt,id,save_name,converted_format,audio,id,createdAt",limit:10,page:1},c.init=function(e){c.musiconhold=e,c.query.id=c.musiconhold.id,c.query.VoiceMusicOnHoldId=c.musiconhold.id,c.getMusicOnHoldMohSounds()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the mohSound?").htmlContent("<b>"+(e.name||"mohSound")+"</b> will be deleted.").ariaLabel("delete mohSound").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.voiceMusicOnHoldDownload=function(o,e){return l.sound.download({id:o.id,exists:!0}).$promise.then(function(e){var t=[e.buffer],n="mohSound"+o.id,a=new Blob(t,{type:e.type});n=o.converted_format?o.save_name+"."+o.converted_format:o.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getMusicOnHoldMohSounds=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceMusicOnHold.getSounds(c.query,p).$promise},c.createOrEditMusicOnHoldMohSound=function(e,t){o.show({controller:"CreateOrEditMohSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:c.musiconhold,mohSound:t,mohSounds:c.musiconholdMohSounds.rows,license:null,setting:null}})},c.exportSelectedMusicOnHoldMohSounds=function(){var e=angular.copy(c.selectedMusicOnHoldMohSounds);return c.selectedMusicOnHoldMohSounds=[],e},c.deleteMusicOnHoldMohSound=g,c.deleteSelectedMusicOnHoldMohSounds=function(e){var t=o.confirm().title("Are you sure want to delete the selected mohSounds?").htmlContent("<b>"+c.selectedMusicOnHoldMohSounds.length+" selected</b> will be deleted.").ariaLabel("delete mohSounds").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedMusicOnHoldMohSounds.forEach(function(e){g(e)}),c.selectedMusicOnHoldMohSounds=[]})},l.sound.get({fields:"name,id",sort:"name"}).$promise.then(function(e){c.sounds=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.musiconholdMohSounds=e||{count:0,rows:[]}}function g(e){l.voiceMusicOnHold.removeSound({id:n.params.id,id2:e.id}).$promise.then(function(){_.remove(c.musiconholdMohSounds.rows,{id:e.id}),c.musiconholdMohSounds.count-=1,c.musiconholdMohSounds.rows.length||c.getMusicOnHoldMohSounds(),r.success({title:"MohSound deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMusicOnHold"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMusicOnHoldMohSounds())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("MusicOnHoldMohSoundsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_MOHSOUND",m.mohSound=angular.copy(s),m.mohSounds=o,m.newMohSound=!1,m.mohSound||(m.mohSound={},m.title="VOICE.NEW_MOHSOUND",m.newMohSound=!0),t.params.id&&(m.mohSound.VoiceMusicOnHoldId=t.params.id),m.addNewMohSound=function(){m.errors=[],r.voiceMusicOnHold.addSound({id:t.params.id},m.mohSound).$promise.then(function(e){m.mohSounds.unshift(e.toJSON()),i.success({title:"MohSound properly created",msg:m.mohSound.name?m.mohSound.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMohSound=function(){m.errors=[],r.voiceMusicOnHold.update({id:m.mohSound.id},m.mohSound).$promise.then(function(e){var t=_.find(m.mohSounds,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"MohSound properly saved!",msg:m.mohSound.name?m.mohSound.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMohSound=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The mohSound will be deleted.").ariaLabel("Delete MohSound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceMusicOnHold.delete({id:m.mohSound.id}).$promise.then(function(){_.remove(m.mohSounds,{id:m.mohSound.id}),i.success({title:"MohSound properly deleted!",msg:(m.mohSound.name||"mohSound")+" has been deleted!"}),u(m.mohSound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.sound.get({fields:"name,id",sort:"name"}).$promise.then(function(e){m.sounds=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","mohSounds","mohSound","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditMohSoundDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.musiconhold=d||e.params.musiconhold||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoMusicOnHolds=function(){e.go("app.voice.musiconholds")},c.saveMusicOnHold=function(){s.voiceMusicOnHold.update({id:c.musiconhold.id},c.musiconhold).$promise.then(function(){r.success({title:"MusicOnHold updated!",msg:c.musiconhold.name?c.musiconhold.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","musiconhold"],angular.module("app.voice").controller("MusicOnHoldController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.musiconholds=r||{count:0,rows:[]},v.table="musiconholds",v.listOrder="",v.listOrderAsc=null,v.selectedMusicOnHolds=[],v.query={fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,page:1},v.arraymode=_.keyBy([{option:"Files",value:"'files'"},{option:"Custom",value:"'custom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysort=_.keyBy([{option:"Random",value:"'random'"},{option:"Alphabetical",value:"'alpha'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.voice.musiconholds.edit",{id:e.id,musiconhold:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the musiconhold?").htmlContent("<b>"+(e.name||"musiconhold")+"</b> will be deleted.").ariaLabel("delete musiconhold").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getMusicOnHolds=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceMusicOnHold.get(v.query,f).$promise},v.createOrEditMusicOnHold=function(e,t){i.show({controller:"CreateOrEditMusicOnHoldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:t,musiconholds:v.musiconholds.rows,license:v.license,setting:v.setting}})},v.deleteMusicOnHold=A,v.exportSelectedMusicOnHolds=function(){var e=angular.copy(v.selectedMusicOnHolds);return v.selectedMusicOnHolds=[],e},v.deleteSelectedMusicOnHolds=function(e){var t=i.confirm().title("Are you sure want to delete the selected musiconholds?").htmlContent("<b>"+v.selectedMusicOnHolds.length+" selected</b> will be deleted.").ariaLabel("delete MusicOnHolds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedMusicOnHolds.forEach(function(e){A(e)}),v.selectedMusicOnHolds=[]})},v.deselectMusicOnHolds=function(){v.selectedMusicOnHolds=[]},v.selectAllMusicOnHolds=function(){v.selectedMusicOnHolds=v.musiconholds.rows};var h=!0,b=1;function f(e){v.musiconholds=e||{count:0,rows:[]}}function A(e){l.voiceMusicOnHold.delete({id:e.id}).$promise.then(function(){_.remove(v.musiconholds.rows,{id:e.id}),v.musiconholds.count-=1,v.musiconholds.rows.length||v.getMusicOnHolds(),c.success({title:"MusicOnHold deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMusicOnHold"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getMusicOnHolds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","musiconholds","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("MusicOnHoldsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_OUTBOUNDROUTE",m.outboundroute=angular.copy(s),m.outboundroutes=o,m.newOutboundRoute=!1,m.outboundroute||(m.outboundroute={appdata:"Outbound Call",type:"outbound",context:"from-sip",recordingFormat:"none"},m.title="VOICE.NEW_OUTBOUNDROUTE",m.newOutboundRoute=!0),m.addNewOutboundRoute=function(){m.errors=[],r.voiceExtension.save(m.outboundroute).$promise.then(function(e){m.outboundroutes.unshift(e.toJSON()),i.success({title:"OutboundRoute properly created",msg:m.outboundroute.name?m.outboundroute.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveOutboundRoute=function(){m.errors=[],r.voiceExtension.update({id:m.outboundroute.id},m.outboundroute).$promise.then(function(e){var t=_.find(m.outboundroutes,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"OutboundRoute properly saved!",msg:m.outboundroute.name?m.outboundroute.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteOutboundRoute=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The outboundroute will be deleted.").ariaLabel("Delete OutboundRoute").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceExtension.delete({id:m.outboundroute.id}).$promise.then(function(){_.remove(m.outboundroutes,{id:m.outboundroute.id}),i.success({title:"OutboundRoute properly deleted!",msg:(m.outboundroute.name||"outboundroute")+" has been deleted!"}),u(m.outboundroute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","outboundroutes","outboundroute","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditOutboundRouteDialogController",e)}(),function(){"use strict";function e(b,i,a,o,t,e,n){var f=this;function s(e,t){if(f.outboundrouteApps.rows.length){var n=f.outboundrouteApps.rows[t]?f.outboundrouteApps.rows[t]:f.outboundrouteApps.rows[0];i.show({controller:"EditoutboundApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundroutes/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{outboundrouteApp:n,outboundroute:f.outboundroute}}).then(function(e){e&&(e.id?f.outboundrouteApps.rows[t]=e:f.outboundrouteApps.rows.splice(t,0,e),r())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function r(e){var t=2,n=[];n.push({type:"outbound",app:"Set",appdata:"CDR(type)=outbound",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:t++,VoiceExtensionId:f.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"XCALLY-MOTION-ANSWER=0",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:t++,VoiceExtensionId:f.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"XCALLY-MOTION-PROGRESS=0",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:t++,VoiceExtensionId:f.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"MONITOR_OPTIONS=ab",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:t++,VoiceExtensionId:f.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"outboundrouteid="+f.outboundroute.id,context:f.outboundroute.context,exten:f.outboundroute.exten,priority:t++,VoiceExtensionId:f.outboundroute.id}),f.outboundroute.hasOwnProperty("recordingFormat")&&"none"!==f.outboundroute.recordingFormat&&(n.push({type:"outbound",app:"Set",appdata:"_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:t++,VoiceExtensionId:f.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"_XCALLY_MIXMONITOR_FORMAT="+f.outboundroute.recordingFormat||"wav",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:t++,VoiceExtensionId:f.outboundroute.id}));for(var a=0,i=0;a<f.outboundrouteApps.rows.length;a++,i=0){var o=f.outboundrouteApps.rows[a],s=[],r=[];o.intervals="*,*,*,*"!==o.interval?[o.interval]:o.IntervalId?_.map(_.filter(f.intervals.rows,{IntervalId:o.IntervalId}),"interval"):[],o.context=f.outboundroute.context,o.exten=f.outboundroute.exten,o.type&&(o.type=o.type.toLowerCase()),o.hasOwnProperty("tag")&&o.tag&&"--"!==o.tag&&s.push({type:o.type.toLowerCase(),app:"Set",appdata:"CDR(tag)="+o.tag,context:f.outboundroute.context,exten:f.outboundroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:f.outboundroute.id}),o.hasOwnProperty("callerID")&&o.callerID&&s.push({type:o.type.toLowerCase(),app:"Set",appdata:"CALLERID(all)="+o.callerID,context:f.outboundroute.context,exten:f.outboundroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:f.outboundroute.id});for(var l=0;l<o.intervals.length;l++){var d=t+o.intervals.length,c=l===o.intervals.length-1?t+s.length+r.length+2:t+l+1;s.splice(l,0,{type:"outbound",app:"GotoIfTime",appdata:o.intervals[l]+"?"+f.outboundroute.context+",${EXTEN},"+d+":"+f.outboundroute.context+",${EXTEN},"+c,exten:f.outboundroute.exten,context:f.outboundroute.context,priority:t+l,VoiceExtensionId:f.outboundroute.id})}if(e&&"outboundDial"===o.appType){var m=_.find(f.apps,{appType:"outboundDial"});if(m&&m.fields){for(var u={},p=o.appdata.split(","),g=[],v=0,h=m.fields.length;v<h;v++)if(m.fields[v].hasOwnProperty("param"))switch(m.fields[v].name){case"trunk":u.trunk=p[m.fields[v].param].split("/")[1],u.phone=p[m.fields[v].param].split("/")[2],u.prefix=u.phone?u.phone.split("$")[0]:void 0,u.phone=f.outboundroute.cutdigits?(u.prefix||"")+"${EXTEN:"+f.outboundroute.cutdigits+"}":(u.prefix||"")+"${EXTEN}",g[m.fields[v].param]=["SIP",u.trunk,u.phone].join("/");break;case"options":u.options=p[m.fields[v].param],"none"!==f.outboundroute.recordingFormat?u.options.indexOf("U(xcally-mixmonitor-context)")<0&&(u.options+="U(xcally-mixmonitor-context)"):u.options=u.options.replace("U(xcally-mixmonitor-context)",""),g[m.fields[v].param]=u.options;break;default:g[m.fields[v].param]=p[m.fields[v].param]}o.appdata=g.join(",")}}o.priority=s.length?_.last(s).priority+1:t,t=(r.length?_.last(r).priority:o.priority)+1,n=_.concat(n,s,[o],r)}n.push({type:"outbound",app:"Hangup",exten:f.outboundroute.exten,context:f.outboundroute.context,priority:t,VoiceExtensionId:f.outboundroute.id}),b.voiceExtension.addApplications({id:f.outboundroute.id},_.sortBy(n,"priority")).$promise.then(function(e){f.outboundrouteApps.rows=e.rows}).catch(function(e){console.error(e)})}function l(e){f.outboundrouteApps=e||{count:0,rows:[]}}f.currentUser=n.getCurrentUser(),f.outboundroute={},f.outboundrouteApps={count:0,rows:[]},f.selectedOutboundRouteApps=[],f.query={sort:"priority"},f.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",type:"Outbound",types:["always","custom","list"],fields:[],isApp:!1},{app:"Dial",appType:"outboundDial",context:"from-sip",type:"Outbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"trunks",route:"trunk",filters:{fields:"name",sort:"name"}},{name:"tags",route:"tag",filters:{fields:"name",sort:"name"}}],fields:[{title:"Trunk",name:"trunk",type:"apiselect",values:"trunks",value:"trunk.name",option:"trunk.name",required:!0,param:0},{title:"Caller_ID",name:"callerID",type:"text"},{title:"Prefix",name:"prefix",type:"text"},{title:"Tags",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",defaultValues:[{value:"'--'",option:"None"}]},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:null,type:"Outbound",appType:"custom",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Application_Name",name:"app",type:"text",required:!0,param:0},{title:"Arguments",name:"appdata",type:"text",param:1}]}],["app"]),{isApp:!1}),f.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},f.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){s(e,e.newIndex)},onSort:function(e){r()}},f.init=function(e){f.outboundroute=e,t.on("voiceExtension:update",f.onVoiceExtensionUpdate),f.query.VoiceExtensionId=e.id,f.query.isApp=!0,f.query.nolimit=!0,f.getOutboundRouteApps(),f.getIntervals()},f.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){f.outboundrouteApps.rows.splice(t,1),r()},function(){console.log("CANCEL")})},f.getOutboundRouteApps=function(){f.promise=b.voiceExtension.get(f.query,l).$promise},f.editOutboundRouteApp=s,f.editInterval=function(e,t){if(f.outboundrouteApps.rows.length){var n=f.outboundrouteApps.rows[t]?f.outboundrouteApps.rows[t]:f.outboundrouteApps.rows[0];i.show({controller:"EditoutboundAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundroutes/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,r())})}},f.deleteOutboundRouteApp=function(e){_.remove(f.outboundrouteApps.rows,{id:e.id}),r(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},f.deleteSelectedOutboundRouteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+f.selectedOutboundRouteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){f.selectedOutboundRouteApps.forEach(function(e){_.remove(f.outboundrouteApps.rows,{id:e.id})}),f.selectedOutboundRouteApps=[],r()})},f.rewriteRouting=r,f.getIntervals=function(){return b.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){f.intervals=e}).catch(function(e){console.error(e)})},f.onVoiceExtensionUpdate=function(e){e.VoiceExtensionId===f.outboundroute.id&&r(!0)},e.$on("$destroy",function(){t.removeAllListeners("voiceExtension:update")})}e.$inject=["api","$mdDialog","$document","toasty","socket","$scope","Auth"],angular.module("app.voice").controller("OutboundRouteActionsController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(n.appType||n.app).toUpperCase(),o.custom=angular.copy(n),o.custom.appdata)switch(o.custom.appType?o.custom.appType.toLowerCase():o.custom.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.custom.appdata.split(",");o.custom.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.custom.text=s.slice(1,s.length).join(",");break;case"message":o.custom.text=o.custom.appdata;break;case"set":o.custom.name=o.custom.appdata.split("=")[0],o.custom.value=o.custom.appdata.split("=")[1];break;case"agi":o.custom.project=o.custom.appdata;break;default:var r=o.custom.appdata.split(",");o.custom.app=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.custom.appdata=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.custom.type&&"outbound"===o.custom.type.toLowerCase()&&"outbounddial"===o.custom.appType.toLowerCase()&&(o.custom.prefix=o.custom.phone?o.custom.phone.split("$")[0]:void 0,o.custom.callerId=o.custom.callerID?"CALLERID(all)="+o.custom.callerID:void 0),o.saveOutboundRouteApp=function(){o.errors=[];var e=[];o.custom.type&&"outbound"===o.custom.type.toLowerCase()&&"outboundDial"===o.custom.appType&&(o.custom.phone=a.cutdigits?(o.custom.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.custom.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.custom.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.custom.options+="U(xcally-mixmonitor-context)"):o.custom.options=o.custom.options.replace("U(xcally-mixmonitor-context)",""));if(o.custom.appType&&"custom"===o.custom.appType);else switch((o.custom.app||o.custom.appType).toLowerCase()){case"set":o.custom.appdata=o.custom.name+"="+o.custom.value;break;case"custom":break;default:e[0]=o.custom.app,e[1]=o.custom.appdata,o.custom.appdata=e.join(",")}l(o.custom)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","outboundrouteApp","outboundroute","api"],angular.module("app.voice").controller("EditoutboundAppcustomDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditoutboundAppintervalDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.outbounddial=angular.copy(e),o.outbounddial.appdata)switch(o.outbounddial.appType?o.outbounddial.appType.toLowerCase():o.outbounddial.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.outbounddial.appdata.split(",");o.outbounddial.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.outbounddial.text=s.slice(1,s.length).join(",");break;case"message":o.outbounddial.text=o.outbounddial.appdata;break;case"set":o.outbounddial.name=o.outbounddial.appdata.split("=")[0],o.outbounddial.value=o.outbounddial.appdata.split("=")[1];break;case"agi":o.outbounddial.project=o.outbounddial.appdata;break;default:var r=o.outbounddial.appdata.split(",");o.outbounddial.trunk=r[0].split("/")[1],o.outbounddial.phone=r[0].split("/")[2],o.outbounddial.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.outbounddial.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.outbounddial.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.outbounddial.type&&"outbound"===o.outbounddial.type.toLowerCase()&&"outbounddial"===o.outbounddial.appType.toLowerCase()&&(o.outbounddial.prefix=o.outbounddial.phone?o.outbounddial.phone.split("$")[0]:void 0,o.outbounddial.callerId=o.outbounddial.callerID?"CALLERID(all)="+o.outbounddial.callerID:void 0),o.saveOutboundRouteApp=function(){o.errors=[];var e=[];o.outbounddial.type&&"outbound"===o.outbounddial.type.toLowerCase()&&"outboundDial"===o.outbounddial.appType&&(o.outbounddial.phone=a.cutdigits?(o.outbounddial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.outbounddial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.outbounddial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.outbounddial.options+="U(xcally-mixmonitor-context)"):o.outbounddial.options=o.outbounddial.options.replace("U(xcally-mixmonitor-context)",""));if(o.outbounddial.appType&&"custom"===o.outbounddial.appType);else switch((o.outbounddial.app||o.outbounddial.appType).toLowerCase()){case"set":o.outbounddial.appdata=o.outbounddial.name+"="+o.outbounddial.value;break;case"custom":break;default:e[0]=["SIP",o.outbounddial.trunk,o.outbounddial.phone].join("/"),e[1]=o.outbounddial.timeout,e[2]=o.outbounddial.options,e[3]=o.outbounddial.url,o.outbounddial.appdata=e.join(",")}l(o.outbounddial)},o.closeDialog=l,i.trunk.get({fields:"name",sort:"name"}).$promise.then(function(e){o.trunks=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.tag.get({fields:"name",sort:"name"}).$promise.then(function(e){o.tags=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","outboundrouteApp","outboundroute","api"],angular.module("app.voice").controller("EditoutboundAppoutbounddialDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.outboundroute=d||e.params.outboundroute||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoOutboundRoutes=function(){e.go("app.voice.outboundroutes")},c.saveOutboundRoute=function(){s.voiceExtension.update({id:c.outboundroute.id},c.outboundroute).$promise.then(function(){r.success({title:"OutboundRoute updated!",msg:c.outboundroute.name?c.outboundroute.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","outboundroute"],angular.module("app.voice").controller("OutboundRouteController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.outboundroutes=r||{count:0,rows:[]},v.table="outboundroutes",v.listOrder="",v.listOrderAsc=null,v.selectedOutboundRoutes=[],v.query={fields:"createdAt,updatedAt,id,appdata,type,exten,context,recordingFormat,cutdigits,description",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},v.arrayrecordingFormat=_.keyBy([{option:"none",value:"'none'"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'WAV'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.voice.outboundroutes.edit",{id:e.id,outboundroute:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the outboundroute?").htmlContent("<b>"+(e.name||"outboundroute")+"</b> will be deleted.").ariaLabel("delete outboundroute").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getOutboundRoutes=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceExtension.get(v.query,f).$promise},v.createOrEditOutboundRoute=function(e,t){i.show({controller:"CreateOrEditOutboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundroutes/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{outboundroute:t,outboundroutes:v.outboundroutes.rows,license:v.license,setting:v.setting}})},v.deleteOutboundRoute=A,v.exportSelectedOutboundRoutes=function(){var e=angular.copy(v.selectedOutboundRoutes);return v.selectedOutboundRoutes=[],e},v.deleteSelectedOutboundRoutes=function(e){var t=i.confirm().title("Are you sure want to delete the selected outboundroutes?").htmlContent("<b>"+v.selectedOutboundRoutes.length+" selected</b> will be deleted.").ariaLabel("delete OutboundRoutes").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedOutboundRoutes.forEach(function(e){A(e)}),v.selectedOutboundRoutes=[]})},v.deselectOutboundRoutes=function(){v.selectedOutboundRoutes=[]},v.selectAllOutboundRoutes=function(){v.selectedOutboundRoutes=v.outboundroutes.rows},l.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){v.contexts=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.outboundroutes=e||{count:0,rows:[]}}function A(e){l.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(v.outboundroutes.rows,{id:e.id}),v.outboundroutes.count-=1,v.outboundroutes.rows.length||v.getOutboundRoutes(),c.success({title:"OutboundRoute deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getOutboundRoutes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","outboundroutes","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("OutboundRoutesController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d,c,m){var u=this,p=!0;function g(){var e=i.localStorage.getItem("motion2.realtime.abandoned.voice.contacts:"+u.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(u.query=_.merge(e.query,_.omit(u.query,["sort","limit","page"])),u.query=_.omit(u.query,"filter")),s.voiceDisposition.get().$promise.then(function(e){u.disposition=e?e.rows:[]}).catch(function(e){console.log(e)}),s.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise.then(function(e){u.queues=e||{count:0,rows:[]},u.queuesMap=_.mapValues(_.keyBy(u.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){u.getContacts()})}function v(e){u.contacts=e||{count:0,rows:[]},p=!1,u.refresh=!0}u.showTooltip=!1,u.refresh=!0,u.disable=[],u.agents=m||[],u.currentUser=r.getCurrentUser(),u.localizationMap=c,u.pickerModel={dateStart:null,dateEnd:null},u.queues={},u.contacts={count:0,rows:[]},u.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},u.clearAll=function(){u.query.dateStart=void 0,u.query.dateEnd=void 0,u.pickerModel={dateStart:null,dateEnd:null},u.getContacts()},u.getContacts=function(){u.refresh=!1,u.query.dateStart=void 0,u.query.dateEnd=void 0,u.pickerModel.dateStart&&!p&&(u.query.dateStart=u.pickerModel.dateStart,u.query.dateEnd=u.pickerModel.dateEnd);u.query.queue=u.query.queue,u.query.offset=(u.query.page-1)*u.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.voice.contacts:"+u.currentUser.id,JSON.stringify({query:_.omit(u.query,"queue")})),u.promise=s.voiceQueueReport.getVoiceQueuesReport(u.query,v).$promise},u.refreshContacts=function(){u.showTooltip=!1,u.getContacts()},u.onInit=g,u.assignedA=function(e,t){e&&(u.disable[e.id]=!0,s.voiceQueueReport.update({id:e.id,lastAssignedTo:t?t.name:null,assigned:!!t}).$promise.catch(function(e){console.log(e)}).finally(function(){u.disable[e.id]=!1}))},u.disposed=function(e,t){e&&s.voiceQueueReport.update({id:e.id,disposition:t||null}).$promise.catch(function(e){console.log(e)})},u.onSavevoiceQueueReport=function(e){e&&u.queuesMap&&"inbound"===e.type&&u.queuesMap[e.queue]&&(u.showTooltip=!0)},u.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(u.contacts.rows,["id",e.id]);0<=t&&_.merge(u.contacts.rows[t],e)}},l.onWithoutApply("voiceQueueReport:save",u.onSavevoiceQueueReport),l.on("voiceQueueReport:update",u.onUpdatevoiceQueueReport),g();var h=!0,b=1;e.$watch("vm.query.filter",function(e,t){h?n(function(){h=!1}):(t||(b=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=b),u.getContacts())}),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory","agents"],angular.module("app.voice").controller("AbandonedCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,s,t,n,a,i,o,r,l,d,c,m,u,p,g,v){var h=this,b=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum"],f=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var A in h.availableStates=["ringing","inuse","busy","onhold","not_inuse"],h.pauses=o||{count:0,rows:[]},h.license=g,h.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},h.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},h.paginatedAgents={},h.load=!1,h.order=[],h.agentInternal={},h.agents)h.agents.hasOwnProperty(A)&&(h.agents[A].init=!0);h.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},h.logout=function(e,t){return d.user.logout({id:e.id}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),h.agents[e.id]&&(h.agents[e.id].online=!1),h.rpcAgents[e.id]&&(h.rpcAgents[e.id].online=!1),y()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"voice",realtime:!0,direction:"inbound"}})},h.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},h.getAgentStatus=C,h.getAgentGlobalStatus=x,h.isPause=S,h.checkPause=function(e){return"pause"===e},h.isPartialPause=function(e){return"*pause"===e},h.onSave=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(_.omit(e,f),b)),_.merge(h.rpcAgents[e.id],_.pick(_.omit(e,f),b)),x(h.agents[e.id]))},h.onUpdate=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(e,b)),_.merge(h.rpcAgents[e.id],_.pick(e,b)),x(h.agents[e.id]))},h.onInit=y,h.onConnect=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(_.merge(h.agents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(h.rpcAgents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},h.onComplete=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(h.agents[h.agentInternal[e.destaccountcode]]=_.omit(h.agents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),h.rpcAgents[h.agentInternal[e.destaccountcode]]=_.omit(h.rpcAgents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",h.onSave),c.on("user:update",h.onUpdate),c.on("user:agentconnect",h.onConnect),c.on("user:agentcomplete",h.onComplete),y();var E=v(function(){h.load&&(h.load=!1,y())},999);function y(e){h.load=!1;var t,n,a=s.defer();h.promise=a.promise,h.filteredAgents=[],h.order=[],_.forIn(h.agents,function(e,t){h.rpcAgents[t]&&_.merge(e,_.pick(_.omit(h.rpcAgents[t],f),b)),x(e),e.online?(h.filteredAgents.push(e),h.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),h.query.globalStatusFilter&&_.remove(h.filteredAgents,function(e){return e.globalStatus!==h.query.globalStatusFilter}),h.query.pauseTypeFilter&&_.remove(h.filteredAgents,function(e){return e.pauseType!==h.query.pauseTypeFilter}),h.query.filter&&_.remove(h.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(h.query.filter.toLowerCase())<0}),h.filteredAgents=(t=h.filteredAgents,n=_.startsWith(h.query.order,"-")?"desc":"asc",_.orderBy(t,[h.query.order.replace("-","")],[n]));var i=(h.query.page-1)*h.query.limit;h.paginatedAgents=_.drop(h.filteredAgents,i).slice(0,h.query.limit);for(var o=0;o<h.paginatedAgents.length;o+=1)h.order.push(h.paginatedAgents[o].id);a.resolve(),h.load=!0}function S(e){return"pause"===e||"*pause"===e}function T(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function C(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function x(e){var t="unknown";t=_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"pause":_.some([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"*pause":_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],T)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=S(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),E&&(v.cancel(E),E=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","Auth","license","$interval"],angular.module("app.voice").controller("AgentsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,o){var s=this;s.calls=i||{rows:[],count:0},s.query={limit:10,page:1},s.channelStatus=o.channelStatusOut,s.onSave=function(e){var t=_.find(s.calls.rows,{channel:e.channel});e.channelstatedesc=e.dialstatus?"up":"ring",t?_.merge(t,e):e.channel&&s.calls.rows.push(e)},s.onRemove=function(e){var t=_.findIndex(s.calls.rows,{channel:e.channel});0<=t&&(s.calls.rows[t].status="hangup");n(function(){s.calls.rows.splice(t,1)},5e3)},a.on("voice_outbound_channel:save",s.onSave),a.on("voice_outbound_channel:remove",s.onRemove),e.$on("$destroy",function(){a.removeAllListeners("voice_outbound_channel:save"),a.removeAllListeners("voice_outbound_channel:remove")})}e.$inject=["$scope","$timeout","api","socket","rpcCalls","helperClasses"],angular.module("app.voice").controller("OutboundCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,o,s,r,l){var d=this;d.agents=n||{count:0,rows:[]},d.rpcVoiceQueuesChannels=i?_.keyBy(i.rows?_.filter(i.rows,{type:"inbound"}):[],"uniqueid"):{},d.queryChannels={limit:10,page:1},d.getSize=function(e){return _.size(e)},d.onSave=function(e){"inbound"===e.type&&(d.rpcVoiceQueuesChannels[e.uniqueid]=e)},d.onRemove=function(e){d.rpcVoiceQueuesChannels[e.uniqueid]&&delete d.rpcVoiceQueuesChannels[e.uniqueid]},d.hangup=function(t){return o.rpc.getVoiceQueuesChannelHangup({uniqueid:t}).$promise.then(function(e){l.success({title:"Channel "+t+" properly hangup!",msg:e.message||""})}).catch(function(e){l.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},d.redirectToAgent=function(t,e){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e}).$promise.then(function(e){l.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){l.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},d.redirectToNumber=function(e,t){var n=a.prompt().title("Which number do you want transfer the call to?").placeholder("Number").targetEvent(e).ok("Ok").cancel("Cancel");return a.show(n).then(function(e){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e}).$promise}).then(function(e){l.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){l.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},s.on("voice_queue_channel:save",d.onSave),s.on("voice_queue_channel:remove",d.onRemove),e.$on("$destroy",function(){s.removeAllListeners("voice_queue_channel:save"),s.removeAllListeners("voice_queue_channel:remove")})}e.$inject=["$scope","$timeout","$mdDialog","agents","rpcVoiceQueuesChannels","api","socket","helperClasses","toasty"],angular.module("app.voice").controller("QueueCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r){var l=this,d=["total","answered","unmanaged","sumHoldTime","sumDuration","sumBillable"];function c(){_.forIn(l.queues,function(e,t){l.rpcQueues[t]&&_.merge(e,_.pick(l.rpcQueues[t],d))})}l.count=a.count,l.queues=a?_.keyBy(a.rows?a.rows:[],"id"):{},l.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},r.hasRole("admin")?l.query={type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1}:l.query={id:r.getCurrentUser().id,channel:"voice",type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1},l.success=p,l.getQueues=function(){l.query.offset=(l.query.page-1)*l.query.limit,r.hasRole("admin")?l.promise=o.voiceQueue.get(l.query,p).$promise:l.promise=o.user.getQueues(l.query,p).$promise},l.onSave=function(e){l.queues[e.id]&&_.merge(l.queues[e.id],_.pick(e,d))},l.$onInit=c,s.onWithoutApply("voice_queue:save",l.onSave),l.interval=t(function(){},999);var m=!0,u=1;function p(e){l.count=e.count,l.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},c()}e.$watch("vm.query.filter",function(e,t){m?n(function(){m=!1}):(t||(u=l.query.page),e!==t&&(l.query.page=1),e||(l.query.page=u),l.getQueues())}),e.$on("$destroy",function(){s.removeAllListeners("voice_queue:save"),l.interval&&t.cancel(l.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","Auth"],angular.module("app.voice").controller("QueueParamsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function g(){var n=[];return _.forIn(u.queues,function(e,t){e.paused=0,e.loggedInDb=0,u.queues[t].agents={},n.push(l.voiceQueue.getMembers({id:t}).$promise),u.rpcQueues[t]&&_.merge(e,_.pick(u.rpcQueues[t],p))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&u.queues[e[t].rows[n].VoiceQueueId].paused++,u.queues[e[t].rows[n].VoiceQueueId].loggedInDb++,u.queues[e[t].rows[n].VoiceQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].VoiceQueueId}).catch(function(e){console.error(e)})}u.count=s.count?s.count:0,u.queues=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.hasRole("admin")?u.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:u.query={id:m.getCurrentUser().id,channel:"voice",type:"inbound",sort:"-updatedAt",limit:10,page:1},u.success=b,u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=l.voiceQueue.get(u.query,b).$promise:u.promise=l.user.getQueues(u.query,b).$promise},u.createOrEditVoiceQueue=function(e,t){a.show({controller:"CreateOrEditVoiceQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:t,voiceQueues:_.values(u.queues),license:null,setting:null}})},u.agentAdd=function(e,t){a.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:t,voiceQueues:u.queues?u.queues.rows:[],realtime:!0}})},u.updateQueue=function(e){return l.voiceQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},u.onSave=function(e){u.queues[e.id]&&_.merge(u.queues[e.id],_.pick(e,p))},u.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(u.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(u.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},u.onLogin=function(e){console.log("onLogged",e),u.queues[e.VoiceQueueId]&&(u.queues[e.VoiceQueueId].loggedInDb+=1,u.queues[e.VoiceQueueId].agents[e.UserId]=e.VoiceQueueId)},u.onLogout=function(e){console.log("onLogout",e),u.queues[e.VoiceQueueId]&&0<u.queues[e.VoiceQueueId].loggedInDb&&(u.queues[e.VoiceQueueId].loggedInDb-=1,delete u.queues[e.VoiceQueueId].agents[e.UserId])},u.$onInit=g,u.order=[],_.forIn(u.queues,function(e,t){u.order.push(e.id)}),d.onWithoutApply("voice_queue:save",u.onSave),u.interval=o(function(){},999),d.on("user:update",u.onPause),d.on("userVoiceQueue:remove",u.onLogout),d.on("userVoiceQueue:save",u.onLogin);var v=!0,h=1;function b(e){if(u.count=e.count,u.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){u.order=[];for(var t=0;t<e.rows.length;t++)u.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("voice_queue:save"),u.interval&&o.cancel(u.interval),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","Auth"],angular.module("app.voice").controller("QueuesVoiceRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){var a=this;switch(t.disconnect(),t.connect(),a.selectedTab=0,n.current.name){case"app.voice.realtime.agents":a.selectedTab=0;break;case"app.voice.realtime.telephones":a.selectedTab=1;break;case"app.voice.realtime.trunks":a.selectedTab=2;break;case"app.voice.realtime.queues":a.selectedTab=3;break;case"app.voice.realtime.queue_calls":a.selectedTab=4;break;case"app.voice.realtime.abandonedcalls":a.selectedTab=5;break;case"app.voice.realtime.queue_params":a.selectedTab=6;break;case"app.voice.realtime.outbound_calls":a.selectedTab=7;break;default:a.selectedTab=0,n.go("app.voice.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.voice.realtime.agents");break;case 1:n.go("app.voice.realtime.telephones");break;case 2:n.go("app.voice.realtime.trunks");break;case 3:n.go("app.voice.realtime.queues");break;case 4:n.go("app.voice.realtime.queue_calls");break;case 5:n.go("app.voice.realtime.abandonedcalls");break;case 6:n.go("app.voice.realtime.queue_params");break;case 7:n.go("app.voice.realtime.outbound_calls");break;default:n.go("app.voice.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.voice").controller("VoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r){var l=this,d=["fullname","internal","state","status"];function c(){_.forIn(l.telephones,function(e,t){l.rpcTelephones[t]&&_.merge(e,_.pick(l.rpcTelephones[t],d))})}l.count=a.count,l.attributes=["fullname","internal","state","status","address"],l.telephones=a?_.keyBy(a.rows?a.rows:[],"id"):{},l.rpcTelephones=i?_.keyBy(i.rows?i.rows:[],"id"):{},l.query={fields:"id,fullname,internal",role:"telephone",sort:"-updatedAt",limit:10,page:1},l.statusClass=r.status,l.stateClass=r.state,l.success=p,l.$onInit=c,l.showInfo=function(e){t.show(t.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},l.getTelephones=function(){l.query.offset=(l.query.page-1)*l.query.limit,l.promise=o.user.get(l.query,p).$promise},l.onSave=function(e){l.telephones[e.id]&&_.merge(l.telephones[e.id],_.pick(e,d))},s.on("telephone:save",l.onSave);var m=!0,u=1;function p(e){l.telephones=e?_.keyBy(e.rows?e.rows:[],"id"):{},c()}e.$watch("vm.query.filter",function(e,t){m?n(function(){m=!1}):(t||(u=l.query.page),e!==t&&(l.query.page=1),e||(l.query.page=u),l.getTelephones())}),e.$on("$destroy",function(){s.removeAllListeners("telephone:save")})}e.$inject=["$scope","$timeout","$mdDialog","telephones","rpcTelephones","api","socket","helperClasses"],angular.module("app.voice").controller("TelephonesVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l){var d=this,c=["status","stateRegistry","registry","host","port","internal","state","status"];function m(){for(var e,t=0;t<d.trunks.length;t+=1)0<=(e=_.findIndex(d.rpcTrunks,["id",d.trunks[t].id]))&&_.merge(d.trunks[t],_.pick(d.rpcTrunks[e],c))}function u(e,t,n){0<=t&&_.merge(e[t],_.pick(n,c))}d.count=a.count,d.trunks=a?a.rows:[],d.rpcTrunks=i&&i.rows?i.rows:[],d.query={fields:"id,name",active:!0,sort:"-updatedAt",limit:10,page:1},d.statusClass=r.status,d.stateClass=r.state,d.success=v,d.$onInit=m,d.showInfo=function(e){t.show(t.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},d.getTrunks=function(){d.query.offset=(d.query.page-1)*d.query.limit,d.promise=o.trunk.get(d.query,v).$promise},d.goToTrunk=function(e,t){l.go("app.tools.trunks.edit",{id:t.id})},d.onSave=function(e){var t=_.findIndex(d.trunks,["id",e.id]),n=_.findIndex(d.rpcTrunks,["id",e.id]);u(d.trunks,t,e),u(d.rpcTrunks,n,e)},s.on("trunk:save",d.onSave);var p=!0,g=1;function v(e){d.count=e.count,d.trunks=e&&e.rows?e.rows:[],m()}e.$watch("vm.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=d.query.page),e!==t&&(d.query.page=1),e||(d.query.page=g),d.getTrunks())}),e.$on("$destroy",function(){s.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","helperClasses","$state"],angular.module("app.voice").controller("TrunksVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_VOICEMAIL",m.voicemail=angular.copy(s),m.voicemails=o,m.newVoicemail=!1,m.voicemail||(m.voicemail={attach:"no"},m.title="VOICE.NEW_VOICEMAIL",m.newVoicemail=!0),m.addNewVoicemail=function(){m.errors=[],r.voiceMail.save(m.voicemail).$promise.then(function(e){m.voicemails.unshift(e.toJSON()),i.success({title:"Voicemail properly created",msg:m.voicemail.name?m.voicemail.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveVoicemail=function(){m.errors=[],r.voiceMail.update({id:m.voicemail.id},m.voicemail).$promise.then(function(e){var t=_.find(m.voicemails,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Voicemail properly saved!",msg:m.voicemail.name?m.voicemail.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteVoicemail=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The voicemail will be deleted.").ariaLabel("Delete Voicemail").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceMail.delete({id:m.voicemail.id}).$promise.then(function(){_.remove(m.voicemails,{id:m.voicemail.id}),i.success({title:"Voicemail properly deleted!",msg:(m.voicemail.name||"voicemail")+" has been deleted!"}),u(m.voicemail)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","voicemails","voicemail","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditVoicemailDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.voicemail={},c.voicemailMessages={count:0,rows:[]},c.selectedVoicemailMessages=[],c.query={fields:"createdAt,updatedAt,id,callerid,duration,audio,stamp,msg_id",sort:"-stamp",limit:10,page:1},c.init=function(e){c.voicemail=e,c.query.id=c.voicemail.id,c.getVoicemailMessages()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the message?").htmlContent("<b>"+(e.name||"message")+"</b> will be deleted.").ariaLabel("delete message").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.voiceMailMessageDownload=function(o,e){return l.voiceMailMessage.download({id:o.id,exists:!0}).$promise.then(function(e){var t=[e.buffer],n="message"+o.id,a=new Blob(t,{type:e.type});n=o.msg_id+".wav";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getVoicemailMessages=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceMail.getMessages(c.query,p).$promise},c.createOrEditVoicemailMessage=function(e,t){o.show({controller:"CreateOrEditMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/edit/messages/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:c.voicemail,message:t,messages:c.voicemailMessages.rows,license:null,setting:null}})},c.exportSelectedVoicemailMessages=function(){var e=angular.copy(c.selectedVoicemailMessages);return c.selectedVoicemailMessages=[],e},c.deleteVoicemailMessage=g,c.deleteSelectedVoicemailMessages=function(e){var t=o.confirm().title("Are you sure want to delete the selected messages?").htmlContent("<b>"+c.selectedVoicemailMessages.length+" selected</b> will be deleted.").ariaLabel("delete messages").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedVoicemailMessages.forEach(function(e){g(e)}),c.selectedVoicemailMessages=[]})};var m=!0,u=1;function p(e){c.voicemailMessages=e||{count:0,rows:[]}}function g(e){l.voiceMailMessage.delete({id:e.id}).$promise.then(function(){_.remove(c.voicemailMessages.rows,{id:e.id}),c.voicemailMessages.count-=1,c.voicemailMessages.rows.length||c.getVoicemailMessages(),r.success({title:"Message deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMail"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getVoicemailMessages())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("VoicemailMessagesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.voicemail=d||e.params.voicemail||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoVoicemails=function(){e.go("app.voice.voicemails")},c.saveVoicemail=function(){s.voiceMail.update({id:c.voicemail.id},c.voicemail).$promise.then(function(){r.success({title:"Voicemail updated!",msg:c.voicemail.name?c.voicemail.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","voicemail"],angular.module("app.voice").controller("VoicemailController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.voicemails=r||{count:0,rows:[]},v.table="voicemails",v.listOrder="",v.listOrderAsc=null,v.selectedVoicemails=[],v.query={fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,page:1},v.arrayattach=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayenvelope=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraydelete=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.voice.voicemails.edit",{id:e.id,voicemail:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the voicemail?").htmlContent("<b>"+(e.name||"voicemail")+"</b> will be deleted.").ariaLabel("delete voicemail").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getVoicemails=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceMail.get(v.query,f).$promise},v.createOrEditVoicemail=function(e,t){i.show({controller:"CreateOrEditVoicemailDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:t,voicemails:v.voicemails.rows,license:v.license,setting:v.setting}})},v.deleteVoicemail=A,v.exportSelectedVoicemails=function(){var e=angular.copy(v.selectedVoicemails);return v.selectedVoicemails=[],e},v.deleteSelectedVoicemails=function(e){var t=i.confirm().title("Are you sure want to delete the selected voicemails?").htmlContent("<b>"+v.selectedVoicemails.length+" selected</b> will be deleted.").ariaLabel("delete Voicemails").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedVoicemails.forEach(function(e){A(e)}),v.selectedVoicemails=[]})},v.deselectVoicemails=function(){v.selectedVoicemails=[]},v.selectAllVoicemails=function(){v.selectedVoicemails=v.voicemails.rows};var h=!0,b=1;function f(e){v.voicemails=e||{count:0,rows:[]}}function A(e){l.voiceMail.delete({id:e.id}).$promise.then(function(){_.remove(v.voicemails.rows,{id:e.id}),v.voicemails.count-=1,v.voicemails.rows.length||v.getVoicemails(),c.success({title:"Voicemail deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMail"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getVoicemails())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","voicemails","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("VoicemailsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_VOICEQUEUE",m.voiceQueue=angular.copy(s),m.voiceQueues=o,m.newVoiceQueue=!1,m.voiceQueue||(m.voiceQueue={type:"inbound",strategy:"ringall",timeout:15,retry:2,random_periodic_announce:"no",announce_holdtime:"no",announce_position:"no",reportholdtime:"no",autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no"},m.title="VOICE.NEW_VOICEQUEUE",m.newVoiceQueue=!0),m.addNewVoiceQueue=function(){m.errors=[],r.voiceQueue.save(m.voiceQueue).$promise.then(function(e){m.voiceQueues.unshift(e.toJSON()),i.success({title:"VoiceQueue properly created",msg:m.voiceQueue.name?m.voiceQueue.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveVoiceQueue=function(){m.errors=[],r.voiceQueue.update({id:m.voiceQueue.id},m.voiceQueue).$promise.then(function(e){var t=_.find(m.voiceQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"VoiceQueue properly saved!",msg:m.voiceQueue.name?m.voiceQueue.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteVoiceQueue=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The voiceQueue will be deleted.").ariaLabel("Delete VoiceQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceQueue.delete({id:m.voiceQueue.id}).$promise.then(function(){_.remove(m.voiceQueues,{id:m.voiceQueue.id}),i.success({title:"VoiceQueue properly deleted!",msg:(m.voiceQueue.name||"voiceQueue")+" has been deleted!"}),u(m.voiceQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","voiceQueues","voiceQueue","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditVoiceQueueDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.voiceQueue[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.voiceQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.voiceQueue=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("VOICE.ALL_AGENTS"),labelSelected:s.instant("VOICE.SELECTED_AGENTS"),transferCallback:function(e,t){a.voiceQueue[t?"removeAgents":"addAgents"]({id:l.voiceQueue.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"VoiceQueue properly "+(t?"removed":"added"),msg:"VoiceQueue has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:voiceQueue.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","voiceQueue","voiceQueues","realtime","$translate","Auth"],angular.module("app.voice").controller("VoiceQueueagentaddController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.voiceQueue=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("VOICE.ALL_TEAMS"),labelSelected:i.instant("VOICE.SELECTED_TEAMS"),transferCallback:function(e,t){a.voiceQueue[t?"removeTeams":"addTeams"]({id:o.voiceQueue.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:voiceQueue.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.voiceQueue.getTeams({id:o.voiceQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","voiceQueue","$translate"],angular.module("app.voice").controller("VoiceQueueteamaddController",e)}(),function(){"use strict";function e(n,e,a,i,t,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=t,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.voiceQueue=d||n.params.voiceQueue||{},c.selectedTab=n.params.tab||0,c.teamadddialog=function(e,t){a.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:c.voiceQueues?c.voiceQueues.rows:[]}})},c.agentadddialog=function(e,t){a.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:c.voiceQueues?c.voiceQueues.rows:[],realtime:!1}})},c.gotogoto=function(e,t){n.go("app.voice.realtime.queues",{})},c.alert=r.info,c.gotoVoiceQueues=function(){n.go("app.voice.voiceQueues")},c.saveVoiceQueue=function(){s.voiceQueue.update({id:c.voiceQueue.id},c.voiceQueue).$promise.then(function(){r.success({title:"VoiceQueue updated!",msg:c.voiceQueue.name?c.voiceQueue.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceMusicOnHold.get({fields:"name",nolimit:"true"}).$promise.then(function(e){c.musiconholds=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.sound.get({fields:"name,save_name",sort:"name",nolimit:"true"}).$promise.then(function(e){c.sounds=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","voiceQueue"],angular.module("app.voice").controller("VoiceQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.voiceQueues=r||{count:0,rows:[]},v.table="voiceQueues",v.listOrder="",v.listOrderAsc=null,v.selectedVoiceQueues=[],v.query={fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},v.arraystrategy=_.keyBy([{option:"Ringall",value:"'ringall'"},{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Least Recent",value:"'leastrecent'"},{option:"Fewest Calls",value:"'fewestcalls'"},{option:"Random",value:"'random'"},{option:"Linear",value:"'linear'"},{option:"Weight Random",value:"'wrandom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayjoinempty=_.keyBy([{option:"no",value:"'no'"},{option:"yes",value:"'yes'"},{option:"strict",value:"'strict'"},{option:"loose",value:"'loose'"},{option:"paused",value:"'paused'"},{option:"penalty",value:"'penalty'"},{option:"inuse",value:"'inuse'"},{option:"ringing",value:"'ringing'"},{option:"unavailable",value:"'unavailable'"},{option:"invalid",value:"'invalid'"},{option:"unknoww",value:"'unknown'"},{option:"wrapup",value:"'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayleavewhenempty=_.keyBy([{option:"no",value:"'no'"},{option:"yes",value:"'yes'"},{option:"strict",value:"'strict'"},{option:"loose",value:"'loose'"},{option:"paused",value:"'paused'"},{option:"penalty",value:"'penalty'"},{option:"inuse",value:"'inuse'"},{option:"ringing",value:"'ringing'"},{option:"unavailable",value:"'unavailable'"},{option:"invalid",value:"'invalid'"},{option:"unknoww",value:"'unknown'"},{option:"wrapup",value:"'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayrandom_periodic_announce=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayannounce_holdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Once",value:"'once'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayannounce_position=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Limit",value:"'limit'"},{option:"More",value:"'more'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayreportholdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.voice.voiceQueues.edit",{id:e.id,voiceQueue:e})},v.teamadddialog=function(e,t){i.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:v.voiceQueues?v.voiceQueues.rows:[]}})},v.agentadddialog=function(e,t){i.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:v.voiceQueues?v.voiceQueues.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the voiceQueue?").htmlContent("<b>"+(e.name||"voiceQueue")+"</b> will be deleted.").ariaLabel("delete voiceQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.voice.realtime.queues",{})},v.success=f,v.getVoiceQueues=function(){v.query.offset=(v.query.page-1)*v.query.limit,m.hasRole("admin")?v.promise=l.voiceQueue.get(v.query,f).$promise:(v.query.id=v.currentUser.id,v.promise=l.user.getQueues(v.query,f).$promise)},v.createOrEditVoiceQueue=function(e,t){i.show({controller:"CreateOrEditVoiceQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:t,voiceQueues:v.voiceQueues.rows,license:v.license,setting:v.setting}})},v.deleteVoiceQueue=A,v.exportSelectedVoiceQueues=function(){var e=angular.copy(v.selectedVoiceQueues);return v.selectedVoiceQueues=[],e},v.deleteSelectedVoiceQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected voiceQueues?").htmlContent("<b>"+v.selectedVoiceQueues.length+" selected</b> will be deleted.").ariaLabel("delete VoiceQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedVoiceQueues.forEach(function(e){A(e)}),v.selectedVoiceQueues=[]})},v.deselectVoiceQueues=function(){v.selectedVoiceQueues=[]},v.selectAllVoiceQueues=function(){v.selectedVoiceQueues=v.voiceQueues.rows};var h=!0,b=1;function f(e){v.voiceQueues=e||{count:0,rows:[]}}function A(e){l.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(v.voiceQueues.rows,{id:e.id}),v.voiceQueues.count-=1,v.voiceQueues.rows.length||v.getVoiceQueues(),c.success({title:"VoiceQueue deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getVoiceQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","voiceQueues","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("VoiceQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_VOICERECORDING",m.voiceRecording=angular.copy(s),m.voiceRecordings=o,m.newVoiceRecording=!1,m.voiceRecording||(m.voiceRecording={},m.title="VOICE.NEW_VOICERECORDING",m.newVoiceRecording=!0),m.addNewVoiceRecording=function(){m.errors=[],r.voiceRecording.save(m.voiceRecording).$promise.then(function(e){m.voiceRecordings.unshift(e.toJSON()),i.success({title:"VoiceRecording properly created",msg:m.voiceRecording.name?m.voiceRecording.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveVoiceRecording=function(){m.errors=[],r.voiceRecording.update({id:m.voiceRecording.id},m.voiceRecording).$promise.then(function(e){var t=_.find(m.voiceRecordings,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"VoiceRecording properly saved!",msg:m.voiceRecording.name?m.voiceRecording.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteVoiceRecording=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The voiceRecording will be deleted.").ariaLabel("Delete VoiceRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceRecording.delete({id:m.voiceRecording.id}).$promise.then(function(){_.remove(m.voiceRecordings,{id:m.voiceRecording.id}),i.success({title:"VoiceRecording properly deleted!",msg:(m.voiceRecording.name||"voiceRecording")+" has been deleted!"}),u(m.voiceRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","voiceRecordings","voiceRecording","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditVoiceRecordingDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.voiceRecordings=r||{count:0,rows:[]},v.table="voiceRecordings",v.listOrder="",v.listOrderAsc=null,v.selectedVoiceRecordings=[],v.query={fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,createdAt,userDisposition",sort:"-updatedAt",limit:10,page:1},v.localizationMap=g,v.pickerModel={dateStart:null},v.downloadfile2=function(o,e){return l.voiceRecording.download({id:o.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=o.uniqueid+o.format;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the voiceRecording?").htmlContent("<b>"+(e.name||"voiceRecording")+"</b> will be deleted.").ariaLabel("delete voiceRecording").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getVoiceRecordings=function(){v.query.dateStart=void 0,v.query.dateEnd=void 0,v.pickerModel.dateStart&&(v.query.dateStart=v.pickerModel.dateStart,v.query.dateEnd=v.pickerModel.dateEnd);v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceRecording.get(v.query,f).$promise},v.createOrEditVoiceRecording=function(e,t){i.show({controller:"CreateOrEditVoiceRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceRecordings/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceRecording:t,voiceRecordings:v.voiceRecordings.rows,license:v.license,setting:v.setting}})},v.deleteVoiceRecording=A,v.exportSelectedVoiceRecordings=function(){var e=angular.copy(v.selectedVoiceRecordings);return v.selectedVoiceRecordings=[],e},v.deleteSelectedVoiceRecordings=function(e){var t=i.confirm().title("Are you sure want to delete the selected voiceRecordings?").htmlContent("<b>"+v.selectedVoiceRecordings.length+" selected</b> will be deleted.").ariaLabel("delete VoiceRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedVoiceRecordings.forEach(function(e){A(e)}),v.selectedVoiceRecordings=[]})},v.deselectVoiceRecordings=function(){v.selectedVoiceRecordings=[]},v.selectAllVoiceRecordings=function(){v.selectedVoiceRecordings=v.voiceRecordings.rows},v.clearDateFilter=function(){v.pickerModel={dateStart:null},v.getVoiceRecordings()};var h=!0,b=1;function f(e){v.voiceRecordings=e||{count:0,rows:[]}}function A(e){l.voiceRecording.delete({id:e.id}).$promise.then(function(){_.remove(v.voiceRecordings.rows,{id:e.id}),v.voiceRecordings.count-=1,v.voiceRecordings.rows.length||v.getVoiceRecordings(),c.success({title:"VoiceRecording deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceRecording"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getVoiceRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","voiceRecordings","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("VoiceRecordingsController",e)}(),function(){"use strict";function e(t,n,a,e,i,o,s,r){var l=this;function d(e,t){return{id:e,title:t.name||"NONAME",state:"app.dashboards.custom",stateParams:t,weight:2,hidden:function(){return i.hasRole("agent")||!i.hasPermission(e)&&!i.hasRole("admin")}}}l.isAgent=function(){return i.getCurrentUser()&&i.hasRole("agent")},a.saveItem("apps",{title:"APPS",group:!0,weight:1,hidden:function(){return i.hasRole("agent")}}),s.version.get().$promise.then(function(e){l.version=e&&e.current?e.current:"UNKNOWN"}).catch(function(e){l.version="UNKNOWN"}).finally(function(){a.saveItem("version",{title:"VERSION "+l.version,group:!0,weight:2,hidden:function(){return i.hasRole("agent")}})}),i.isLoggedIn()&&s.dashboard.get().$promise.then(function(e){for(var t=0,n=0;n<e.rows.length;n+=1)t=99999+e.rows[n].id,a.saveItem("apps.dashboards.custom_"+t,d(t,e.rows[n]))}),o.custom&&!r.defaultPageTitle&&r.pageTitle&&angular.element("#pageTitle").html(r.pageTitle),a.saveItem("apps.dashboards",{id:100,title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",icon:"icon-tile-four",weight:2,hidden:function(){return i.hasRole("agent")||!i.hasPermission(100)&&!i.hasRole("admin")}}),a.saveItem("apps.dashboards.general",{id:101,title:"General",translate:"DASHBOARDS.GENERAL",state:"app.dashboards.general",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(101)&&!i.hasRole("admin")}}),a.saveItem("apps.staff",{id:200,title:"Staff",translate:"STAFF.STAFF",icon:"icon-account-multiple",weight:3,hidden:function(){return i.hasRole("agent")||!i.hasPermission(200)&&!i.hasRole("admin")}}),a.saveItem("apps.staff.users",{id:201,title:"Users",translate:"STAFF.USERS",state:"app.staff.users",weight:1,hidden:function(){return i.hasRole("agent")||i.hasRole("user")||!i.hasPermission(201)&&!i.hasRole("admin")}}),a.saveItem("apps.staff.agents",{id:202,title:"Agents",translate:"STAFF.AGENTS",state:"app.staff.agents",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(202)&&!i.hasRole("admin")}}),a.saveItem("apps.staff.telephones",{id:203,title:"Telephones",translate:"STAFF.TELEPHONES",state:"app.staff.telephones",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(203)&&!i.hasRole("admin")}}),a.saveItem("apps.staff.teams",{id:204,title:"Teams",translate:"STAFF.TEAMS",state:"app.staff.teams",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(204)&&!i.hasRole("admin")}}),a.saveItem("apps.contactmanager",{id:300,title:"ContactManager",translate:"CONTACTMANAGER.CONTACTMANAGER",icon:"icon-account-circle",weight:4,hidden:function(){return!o.cm||i.hasRole("agent")||!i.hasPermission(300)&&!i.hasRole("admin")}}),a.saveItem("apps.contactmanager.lists",{id:301,title:"Lists",translate:"CONTACTMANAGER.LISTS",state:"app.contactmanager.lists",weight:2,hidden:function(){return i.hasRole("agent")||!i.hasPermission(301)&&!i.hasRole("admin")}}),a.saveItem("apps.contactmanager.companies",{id:302,title:"Companies",translate:"CONTACTMANAGER.COMPANIES",state:"app.contactmanager.companies",weight:3,hidden:function(){return i.hasRole("agent")||!i.hasPermission(302)&&!i.hasRole("admin")}}),a.saveItem("apps.contactmanager.globalCustomFields",{id:304,title:"GlobalCustomFields",translate:"CONTACTMANAGER.GLOBALCUSTOMFIELDS",state:"app.contactmanager.globalCustomFields",weight:4,hidden:function(){return i.hasRole("agent")||!i.hasPermission(304)&&!i.hasRole("admin")}}),a.saveItem("apps.contactmanager.contacts",{id:303,title:"Contacts",translate:"CONTACTMANAGER.CONTACTS",state:"app.contactmanager.contacts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(303)&&!i.hasRole("admin")}}),a.saveItem("apps.voice",{id:400,title:"Voice",translate:"VOICE.VOICE",icon:"icon-phone",weight:5,hidden:function(){return i.hasRole("agent")||!i.hasPermission(400)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.voiceQueues",{id:401,title:"VoiceQueues",translate:"VOICE.VOICEQUEUES",state:"app.voice.voiceQueues",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(401)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.inboundroutes",{id:402,title:"InboundRoutes",translate:"VOICE.INBOUNDROUTES",state:"app.voice.inboundroutes",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(402)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.outboundroutes",{id:403,title:"OutboundRoutes",translate:"VOICE.OUTBOUNDROUTES",state:"app.voice.outboundroutes",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(403)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.internalroutes",{id:404,title:"InternalRoutes",translate:"VOICE.INTERNALROUTES",state:"app.voice.internalroutes",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(404)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.contexts",{id:405,title:"Contexts",translate:"VOICE.CONTEXTS",state:"app.voice.contexts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(405)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.voicemails",{id:406,title:"Voicemails",translate:"VOICE.VOICEMAILS",state:"app.voice.voicemails",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(406)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.musiconholds",{id:407,title:"MusicOnHolds",translate:"VOICE.MUSICONHOLDS",state:"app.voice.musiconholds",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(407)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.voiceRecordings",{id:408,title:"VoiceRecordings",translate:"VOICE.VOICERECORDINGS",state:"app.voice.voiceRecordings",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(408)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.chanSpies",{id:409,title:"ChanSpies",translate:"VOICE.CHANSPIES",state:"app.voice.chanSpies",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(409)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.realtime",{id:410,title:"Realtime",translate:"VOICE.REALTIME",state:"app.voice.realtime",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(410)&&!i.hasRole("admin")}}),a.saveItem("apps.chat",{id:500,title:"Chat",translate:"CHAT.CHAT",icon:"icon-hangouts",weight:6,hidden:function(){return!o.chat||i.hasRole("agent")||!i.hasPermission(500)&&!i.hasRole("admin")}}),a.saveItem("apps.chat.chatQueues",{id:501,title:"ChatQueues",translate:"CHAT.CHATQUEUES",state:"app.chat.chatQueues",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(501)&&!i.hasRole("admin")}}),a.saveItem("apps.chat.chatWebsites",{id:502,title:"ChatWebsites",translate:"CHAT.CHATWEBSITES",state:"app.chat.chatWebsites",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(502)&&!i.hasRole("admin")}}),a.saveItem("apps.chat.realtime",{id:510,title:"Realtime",translate:"CHAT.REALTIME",state:"app.chat.realtime",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(510)&&!i.hasRole("admin")}}),a.saveItem("apps.mail",{id:600,title:"Mail",translate:"MAIL.MAIL",icon:"icon-email",weight:7,hidden:function(){return!o.mail||i.hasRole("agent")||!i.hasPermission(600)&&!i.hasRole("admin")}}),a.saveItem("apps.mail.mailQueues",{id:601,title:"MailQueues",translate:"MAIL.MAILQUEUES",state:"app.mail.mailQueues",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(601)&&!i.hasRole("admin")}}),a.saveItem("apps.mail.mailAccounts",{id:602,title:"MailAccounts",translate:"MAIL.MAILACCOUNTS",state:"app.mail.mailAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(602)&&!i.hasRole("admin")}}),a.saveItem("apps.mail.mailSubtatuses",{id:603,title:"MailSubstatuses",translate:"MAIL.MAILSUBSTATUSES",state:"app.mail.mailSubtatuses",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(603)&&!i.hasRole("admin")}}),a.saveItem("apps.mail.realtime",{id:610,title:"Realtime",translate:"MAIL.REALTIME",state:"app.mail.realtime",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(610)&&!i.hasRole("admin")}}),a.saveItem("apps.sms",{id:700,title:"Sms",translate:"SMS.SMS",icon:"icon-message-text",weight:8,hidden:function(){return!o.messaging||i.hasRole("agent")||!i.hasPermission(700)&&!i.hasRole("admin")}}),a.saveItem("apps.sms.smsQueues",{id:701,title:"SmsQueues",translate:"SMS.SMSQUEUES",state:"app.sms.smsQueues",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(701)&&!i.hasRole("admin")}}),a.saveItem("apps.sms.smsAccounts",{id:702,title:"SmsAccounts",translate:"SMS.SMSACCOUNTS",state:"app.sms.smsAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(702)&&!i.hasRole("admin")}}),a.saveItem("apps.sms.realtime",{id:710,title:"Realtime",translate:"SMS.REALTIME",state:"app.sms.realtime",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(710)&&!i.hasRole("admin")}}),a.saveItem("apps.openchannel",{id:800,title:"Openchannel",translate:"OPENCHANNEL.OPENCHANNEL",icon:"icon-google-earth",weight:9,hidden:function(){return!o.openchannel||i.hasRole("agent")||!i.hasPermission(800)&&!i.hasRole("admin")}}),a.saveItem("apps.openchannel.openchannelQueues",{id:801,title:"OpenchannelQueues",translate:"OPENCHANNEL.OPENCHANNELQUEUES",state:"app.openchannel.openchannelQueues",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(801)&&!i.hasRole("admin")}}),a.saveItem("apps.openchannel.openchannelAccounts",{id:802,title:"OpenchannelAccounts",translate:"OPENCHANNEL.OPENCHANNELACCOUNTS",state:"app.openchannel.openchannelAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(802)&&!i.hasRole("admin")}}),a.saveItem("apps.openchannel.realtime",{id:810,title:"Realtime",translate:"OPENCHANNEL.REALTIME",state:"app.openchannel.realtime",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(810)&&!i.hasRole("admin")}}),a.saveItem("apps.fax",{id:900,title:"Fax",translate:"FAX.FAX",icon:"icon-deskphone",weight:10,hidden:function(){return!o.fax||i.hasRole("agent")||!i.hasPermission(900)&&!i.hasRole("admin")}}),a.saveItem("apps.fax.faxQueues",{id:901,title:"FaxQueues",translate:"FAX.FAXQUEUES",state:"app.fax.faxQueues",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(901)&&!i.hasRole("admin")}}),a.saveItem("apps.fax.faxAccounts",{id:902,title:"FaxAccounts",translate:"FAX.FAXACCOUNTS",state:"app.fax.faxAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(902)&&!i.hasRole("admin")}}),a.saveItem("apps.fax.realtime",{id:910,title:"Realtime",translate:"FAX.REALTIME",state:"app.fax.realtime",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(910)&&!i.hasRole("admin")}}),a.saveItem("apps.tools",{id:1e3,title:"Tools",translate:"TOOLS.TOOLS",icon:"icon-auto-fix",weight:13,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1e3)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.cannedAnswers",{id:1002,title:"CannedAnswers",translate:"TOOLS.CANNEDANSWERS",state:"app.tools.cannedAnswers",weight:2,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1002)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.customDashboards",{id:1003,title:"CustomDashboards",translate:"TOOLS.CUSTOMDASHBOARDS",state:"app.tools.customDashboards",weight:3,badge:{content:"beta",color:"orange"},hidden:function(){return i.hasRole("agent")||!i.hasPermission(1003)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.intervals",{id:1004,title:"Intervals",translate:"TOOLS.INTERVALS",state:"app.tools.intervals",weight:4,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1004)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.pauses",{id:1005,title:"Pauses",translate:"TOOLS.PAUSES",state:"app.tools.pauses",weight:5,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1005)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.schedules",{id:42,title:"Scheduler",translate:"TOOLS.SCHEDULER",state:"app.tools.schedules",weight:6,hidden:function(){return i.hasRole("agent")||!i.hasPermission(42)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.sounds",{id:1006,title:"Sounds",translate:"TOOLS.SOUNDS",state:"app.tools.sounds",weight:7,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1006)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.tags",{id:1007,title:"Tags",translate:"TOOLS.TAGS",state:"app.tools.tags",weight:8,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1007)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.templates",{id:1008,title:"Templates",translate:"TOOLS.TEMPLATES",state:"app.tools.templates",weight:9,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1008)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.triggers",{id:1009,title:"Triggers",translate:"TOOLS.TRIGGERS",state:"app.tools.triggers",weight:10,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1009)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.trunks",{id:1010,title:"Trunks",translate:"TOOLS.TRUNKS",state:"app.tools.trunks",weight:11,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1010)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.variables",{id:1011,title:"Variables",translate:"TOOLS.VARIABLES",state:"app.tools.variables",weight:12,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1011)&&!i.hasRole("admin")}}),a.saveItem("apps.callysquare",{id:1100,title:"CallySquare",translate:"CALLYSQUARE.CALLYSQUARE",icon:"icon-sitemap",weight:11,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1100)&&!i.hasRole("admin")}}),a.saveItem("apps.callysquare.odbcs",{id:1101,title:"ODBC",translate:"CALLYSQUARE.ODBC",state:"app.callysquare.odbcs",weight:2,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1101)&&!i.hasRole("admin")}}),a.saveItem("apps.callysquare.squareRecordings",{id:1102,title:"SquareRecordings",translate:"CALLYSQUARE.SQUARERECORDINGS",state:"app.callysquare.squareRecordings",weight:3,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1102)&&!i.hasRole("admin")}}),a.saveItem("apps.callysquare.projects",{id:1103,title:"Projects",translate:"CALLYSQUARE.PROJECTS",state:"app.callysquare.projects",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1103)&&!i.hasRole("admin")}}),a.saveItem("apps.analytics",{id:1200,title:"Analytics",translate:"ANALYTICS.ANALYTICS",icon:"icon-chart-line",weight:14,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1200)&&!i.hasRole("admin")}}),a.saveItem("apps.analytics.metrics",{id:1201,title:"Metrics",translate:"ANALYTICS.METRICS",state:"app.analytics.metrics",weight:3,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1201)&&!i.hasRole("admin")}}),a.saveItem("apps.analytics.extractedReports",{id:1202,title:"ExtractedReports",translate:"ANALYTICS.EXTRACTEDREPORTS",state:"app.analytics.extractedReports",weight:2,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1202)&&!i.hasRole("admin")}}),a.saveItem("apps.analytics.reports",{id:1203,title:"Reports",translate:"ANALYTICS.REPORTS",state:"app.analytics.reports",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1203)&&!i.hasRole("admin")}}),a.saveItem("apps.integrations",{id:1300,title:"Integrations",translate:"INTEGRATIONS.INTEGRATIONS",icon:"icon-heart",weight:15,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1300)&&!i.hasRole("admin")}}),a.saveItem("apps.integrations.zendeskAccounts",{id:1301,title:"ZendeskAccounts",translate:"INTEGRATIONS.ZENDESKACCOUNTS",state:"app.integrations.zendeskAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1301)&&!i.hasRole("admin")}}),a.saveItem("apps.integrations.salesforceAccounts",{id:1302,title:"SalesforceAccounts",translate:"INTEGRATIONS.SALESFORCEACCOUNTS",state:"app.integrations.salesforceAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1302)&&!i.hasRole("admin")}}),a.saveItem("apps.integrations.freshdeskAccounts",{id:1303,title:"FreshdeskAccounts",translate:"INTEGRATIONS.FRESHDESKACCOUNTS",state:"app.integrations.freshdeskAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1303)&&!i.hasRole("admin")}}),a.saveItem("apps.integrations.sugarcrmAccounts",{id:1304,title:"SugarcrmAccounts",translate:"INTEGRATIONS.SUGARCRMACCOUNTS",state:"app.integrations.sugarcrmAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1304)&&!i.hasRole("admin")}}),a.saveItem("apps.integrations.deskAccounts",{id:1302,title:"DeskAccounts",translate:"INTEGRATIONS.DESKACCOUNTS",state:"app.integrations.deskAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1302)&&!i.hasRole("admin")}}),a.saveItem("apps.integrations.zohoAccounts",{id:1302,title:"ZohoAccounts",translate:"INTEGRATIONS.ZOHOACCOUNTS",state:"app.integrations.zohoAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1302)&&!i.hasRole("admin")}}),a.saveItem("apps.settings",{id:1400,title:"Settings",translate:"SETTINGS.SETTINGS",icon:"icon-cog",weight:16,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1400)&&!i.hasRole("admin")}}),a.saveItem("apps.settings.generals",{id:1401,title:"General",translate:"SETTINGS.GENERAL",state:"app.settings.generals",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1401)&&!i.hasRole("admin")}}),a.saveItem("apps.settings.smtps",{id:1402,title:"Smtp",translate:"SETTINGS.SMTP",state:"app.settings.smtps",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1402)&&!i.hasRole("admin")}}),a.saveItem("apps.settings.networks",{id:1403,title:"Networks",translate:"SETTINGS.NETWORKS",state:"app.settings.networks",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1403)&&!i.hasRole("admin")}}),a.saveItem("apps.settings.customizations",{id:1407,title:"Customizations",translate:"SETTINGS.CUSTOMIZATIONS",state:"app.settings.customizations",weight:1,hidden:function(){return!o.custom||i.hasRole("agent")||!i.hasPermission(1407)&&!i.hasRole("admin")}}),a.saveItem("apps.settings.updates",{id:1404,title:"Updates",translate:"SETTINGS.UPDATES",state:"app.settings.updates",weight:1,hidden:function(){return!o.update||i.hasRole("agent")||!i.hasPermission(1404)&&!i.hasRole("admin")}}),a.saveItem("apps.settings.license",{id:1405,title:"License",translate:"SETTINGS.LICENSE",state:"app.settings.license",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1405)&&!i.hasRole("admin")}}),a.saveItem("apps.settings.system",{id:1406,title:"System",translate:"SETTINGS.SYSTEM",state:"app.settings.system",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1406)&&!i.hasRole("admin")}}),a.saveItem("apps.help",{id:1600,title:"Help",translate:"HELP.HELP",icon:"icon-help",weight:17,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1600)&&!i.hasRole("admin")}}),a.saveItem("apps.help.about",{id:1601,title:"About",translate:"HELP.ABOUT",state:"app.help.about",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1601)&&!i.hasRole("admin")}}),a.saveItem("apps.motiondialer",{id:1500,title:"MotionDialer",translate:"MOTIONDIALER.MOTIONDIALER",icon:"icon-fire",weight:5,hidden:function(){return!o.dialer||i.hasRole("agent")||!i.hasPermission(1500)&&!i.hasRole("admin")}}),a.saveItem("apps.motiondialer.queueCampaigns",{id:1501,title:"QueueCampaigns",translate:"MOTIONDIALER.QUEUECAMPAIGNS",state:"app.motiondialer.queueCampaigns",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1501)&&!i.hasRole("admin")}}),a.saveItem("apps.motiondialer.ivrCampaigns",{id:1502,title:"IvrCampaigns",translate:"MOTIONDIALER.IVRCAMPAIGNS",state:"app.motiondialer.ivrCampaigns",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1502)&&!i.hasRole("admin")}}),a.saveItem("apps.motiondialer.realtime",{id:1510,title:"Realtime",translate:"MOTIONDIALER.REALTIME",state:"app.motiondialer.realtime",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1510)&&!i.hasRole("admin")}}),a.saveItem("apps.jscripty",{id:1700,title:"jscripty",translate:"JSCRIPTY.JSCRIPTY",icon:"icon-script",weight:12,hidden:function(){return!o.jscripty||i.hasRole("agent")||!i.hasPermission(1700)&&!i.hasRole("admin")}}),a.saveItem("apps.jscripty.projects",{id:1701,title:"Projects",translate:"JSCRIPTY.PROJECTS",state:"app.jscripty.projects",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1701)&&!i.hasRole("admin")}}),e.saveItem("apps",{title:"APPS",group:!0,weight:1}),e.saveItem("apps.home",{id:100,title:"Home",translate:"DASHBOARDS.HOME",icon:"icon-home",weight:1}),e.saveItem("apps.home.dashboard",{id:101,title:"Dashboard",translate:"DASHBOARDS.DASHBOARD",state:"dashboard",icon:"icon-tile-four",iconClass:"cyan-500-fg",weight:1,hidden:function(){return!i.hasPermission(101)}}),e.saveItem("apps.home.contacts",{id:102,title:"Contacts",translate:"DASHBOARDS.CONTACTS",state:"contacts",icon:"icon-account-circle",iconClass:"red-fg",weight:2,hidden:function(){return!o.cm||!i.hasPermission(102)}}),e.saveItem("apps.home.mycontacts",{id:103,title:"Contacts",translate:"DASHBOARDS.MYCONTACTS",state:"mycontacts",icon:"icon-account-multiple",iconClass:"red-fg",weight:3,hidden:function(){return!o.cm||!i.hasPermission(103)}}),e.saveItem("apps.home.voice",{id:110,title:"Voice",translate:"DASHBOARDS.VOICE",state:"voice",icon:"icon-phone",iconClass:"blue-A700-fg",weight:4,hidden:function(){return!i.hasPermission(110)}}),e.saveItem("apps.home.abandoned",{id:111,title:"Abandoned",translate:"DASHBOARDS.ABANDONED",state:"abandoned",icon:"icon-phone-missed",iconClass:"blue-fg",weight:5,hidden:function(){return!i.hasPermission(111)}}),e.saveItem("apps.home.recordings",{id:104,title:"Recordings",translate:"DASHBOARDS.RECORDINGS",state:"recordings",icon:"icon-audiobook",iconClass:"indigo-A100-fg",weight:6,hidden:function(){return!i.hasPermission(104)}}),e.saveItem("apps.home.chat",{id:105,title:"Chat",translate:"DASHBOARDS.CHAT",state:"chat",icon:"icon-hangouts",iconClass:"green-A700-fg",weight:7,hidden:function(){return!o.chat||!i.hasPermission(105)}}),e.saveItem("apps.home.mail",{id:106,title:"Mail",translate:"DASHBOARDS.MAIL",state:"mail",icon:"icon-email",iconClass:"teal-fg",weight:8,hidden:function(){return!o.mail||!i.hasPermission(106)}}),e.saveItem("apps.home.sms",{id:107,title:"Sms",translate:"DASHBOARDS.SMS",state:"sms",icon:"icon-message-text",iconClass:"orange-fg",weight:9,hidden:function(){return!o.messaging||!i.hasPermission(107)}}),e.saveItem("apps.home.openchannel",{id:108,title:"Openchannel",translate:"DASHBOARDS.OPENCHANNEL",state:"openchannel",icon:"icon-google-earth",iconClass:"amber-A200-fg",weight:10,hidden:function(){return!o.openchannel||!i.hasPermission(108)}}),e.saveItem("apps.home.fax",{id:109,title:"Fax",translate:"DASHBOARDS.FAX",state:"fax",icon:"icon-deskphone",iconClass:"blue-grey-A200-fg",weight:11,hidden:function(){return!o.fax||!i.hasPermission(109)}}),t.$on("$viewContentAnimationEnded",function(e){e.targetScope.$id===t.$id&&n.$broadcast("msSplashScreen::remove")})}e.$inject=["$scope","$rootScope","msNavigationService","msNavigationAgentService","Auth","license","api","setting"],angular.module("motion").controller("MainController",e)}(),function(){"use strict";function e(e,t,n,a,i,o){var s=this;function r(e){if(e&&e.id){var t=99999+e.id;i.saveItem("apps.dashboards.custom_"+t,{id:t,title:e.name||"NONAME",badge:{content:"beta",color:"orange"},state:"app.dashboards.custom",stateParams:e,weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(t)&&!o.hasRole("admin")}})}}s.bodyEl=angular.element("body"),s.msScrollOptions={suppressScrollX:!0},s.setting=n,s.$onInit=function(){s.folded="true"===t.get("motion.folded")||!1},s.toggleMsNavigationFolded=function(){s.folded=!s.folded,t.put("motion.folded",s.folded)},s.getLogo=function(){return s.setting.defaultHeaderWhiteLabel?"xCALLY Motion":s.setting.headerWhiteLabel},a.on("dashboard:save",r),a.on("dashboard:update",r),a.on("dashboard:remove",function(e){if(e&&e.id){var t=99999+e.id;i.deleteItem("apps.dashboards.custom_"+t)}}),e.$on("$stateChangeSuccess",function(){s.bodyEl.removeClass("ms-navigation-horizontal-mobile-menu-active")})}e.$inject=["$scope","$cookies","setting","socket","msNavigationService","Auth"],angular.module("app.navigation").controller("NavigationController",e)}(),function(){"use strict";function e(e,a,i,t,n,o,s,r){var l=this;function d(n){s.isSupported()?s.requestPermission().then(function(){var e,t;t={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"api/users/"+(e=n).FromId+"/avatar",body:e.body||"",focusOnclick:!0,closeOnClick:!0},s.show(a.instant("QUICKPANEL.NEW_INTERNAL_MESSAGE"),t)},function(e){console.error("Please enable browser notifications!",e)}):console.error("Browser notifications are not supported by the browser. Normal notifications will be used.")}l.date=moment().format(),l.currentUser=t.getCurrentUser(),l.license=r,l.unreadTotalMessages=0,l.unreadTotalGroupMessages=0,l.userIsNotPhonebar=function(){return"admin"===l.currentUser.role||"user"===l.currentUser.role||"agent"===l.currentUser.role&&0!==l.currentUser.showWebBar},l.onMessageSave=function(e){e.ToId===l.currentUser.id&&e.FromId!==l.currentUser.id&&!e.read&&e.ChatGroupId&&(l.unreadTotalGroupMessages++,d(e));e.ToId!==l.currentUser.id||e.ChatGroupId||(l.unreadTotalMessages+=1,d(e))},l.onMessageUpdate=function(e){e.ToId===l.currentUser.id&&e.read&&0<l.unreadTotalMessages&&!e.ChatGroupId&&(l.unreadTotalMessages-=1);e.ToId==l.currentUser.id&&e.FromId!==l.currentUser.id&&e.ChatGroupId&&e.read&&0<l.unreadTotalGroupMessages&&l.unreadTotalGroupMessages--},n.on("chatInternalMessage:save",l.onMessageSave),n.on("chatInternalMessage:update",l.onMessageUpdate),o.chatInternalMessage.get({fields:"FromId",ToId:l.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){return e&&e.count&&(l.unreadTotalMessages=e.count),o.user.getGroups({id:l.currentUser.id}).$promise}).then(function(e){for(var t=[],n=e.rows,a=0;a<n.length;a++)t.push(o.chatGroup.getUnread({id:n[a].id}).$promise);return i.all(t)}).then(function(e){for(var t=0;t<e.length;t++)l.unreadTotalGroupMessages+=e[t].count}).catch(function(e){console.error(e)}),e.$on("$destroy",function(){n.removeAllListeners("chatInternalMessage:save"),n.removeAllListeners("chatInternalMessage:update")})}e.$inject=["$scope","$translate","$q","Auth","socket","api","desktopNotification","license"],angular.module("app.quick-panel").controller("QuickPanelController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m){var u=this;function p(e){var t=angular.element("#chat-dialog");a(function(){t.animate({scrollTop:t[0].scrollHeight},e)},0)}function g(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function v(e){return m.get(e).success(function(){t.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(e){t.error({title:"PhoneBar API Error",msg:d.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}u.currentUser=i.getCurrentUser(),u.user=void 0,u.users={count:0,rows:[]},u.standardDate=moment(0).format("YYYY-MM-DD HH:mm:ss"),u.unreadMessage={},u.replyMessage="",u.disabled=!1,u.init=function(e){u.license=e},u.toggleChat=function(e){if(e){if(!e.allowmessenger&&"agent"===e.role)return t.warning({title:d.instant("QUICKPANEL.WARNING"),msg:d.instant("QUICKPANEL.MESSENGER_DISABLED")}),void(u.user=void 0);u.user=e,u.replyMessage="",n.chatInternalMessage.get({sort:"createdAt",FromId:u.currentUser.id+","+e.id,ToId:u.currentUser.id+","+e.id,ChatGroupId:"null"}).$promise.then(function(e){if(e&&e.rows){u.user.messages=e;for(var t=0;t<u.user.messages.rows.length;t+=1)!1===u.user.messages.rows[t].read&&u.user.messages.rows[t].ToId===u.currentUser.id&&n.chatInternalMessage.update({id:u.user.messages.rows[t].id,read:!0})}}).finally(function(){p(0)})}else u.user=void 0},u.reply=function(){u.disabled=!0;Date.now();if(""===u.replyMessage)return void(u.disabled=!1);var e={FromId:u.currentUser.id,ToId:u.user.id,body:u.replyMessage,read:!1};u.replyMessage="",n.chatInternalMessage.save(e).$promise.then(function(e){u.user.messages.rows.push(e),u.user.lastMessageAt=e.createdAt,u.user.lastMessage=e,p(400)}).catch(function(e){}).finally(function(){u.disabled=!1})},u.onMessageSave=function(e){if(e.ToId===u.currentUser.id&&!e.ChatGroupId){u.user&&u.user.id===e.FromId?(u.user.messages.rows.push(e),p(0),n.chatInternalMessage.update({id:e.id,read:!0})):u.unreadMessage[e.FromId]=u.unreadMessage[e.FromId]?u.unreadMessage[e.FromId]+1:1;var t=_.find(u.users.rows,{id:e.FromId});t&&(t.lastMessageAt=e.createdAt,t.lastMessage=e)}},u.onMessageUpdate=function(e){if((e.FromId===u.currentUser.id||e.ToId===u.currentUser.id)&&!e.ChatGroupId){if(u.user){var t=_.find(u.user.messages.rows,{id:e.id});t&&_.merge(t,e)}var n=_.find(u.users.rows,{id:u.currentUser.id===e.FromId?e.ToId:e.FromId});n&&n.lastMessage&&_.merge(n.lastMessage,e),e.ToId===u.currentUser.id&&e.read&&0<u.unreadMessage[e.FromId]&&(u.unreadMessage[e.FromId]-=1)}},u.onUserUpdate=function(e){var t=_.find(u.users.rows,{id:e.id});t&&(_.isNil(e.online)||t.online===e.online||(t.online=e.online),_.isNil(e.allowmessenger)||t.allowmessenger===e.allowmessenger||(t.allowmessenger=e.allowmessenger))},u.webcall=function(e){c.$broadcast("webrtc::call",{target:g(e)})},u.call=function(e){return v("http://127.0.0.1:"+(u.user.phoneBarRemoteControlPort||"9888")+"/api/originate/"+g(e))},u.transfer=function(e){return v("http://127.0.0.1:"+(u.user.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+g(e))},o.on("chatInternalMessage:save",u.onMessageSave),o.on("chatInternalMessage:update",u.onMessageUpdate),o.on("user:update",u.onUserUpdate),s("quick-panel").onClose(function(){u.user=void 0}),n.chatInternalMessage.get({fields:"FromId",ToId:u.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){u.unreadMessage=_.countBy(e.rows,"FromId")}).catch(function(e){}),n.chatInternalMessage.getUsers().$promise.then(function(e){u.users=e}).catch(function(e){console.error(e)}),e.$on("$destroy",function(){o.removeAllListeners("chatInternalMessage:save"),o.removeAllListeners("chatInternalMessage:update"),o.removeAllListeners("user:update")})}e.$inject=["$scope","toasty","api","$timeout","Auth","socket","$mdSidenav","$q","$interval","$translate","$rootScope","$http"],angular.module("app.quick-panel").controller("ChatInternalController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l){var d=this;function c(e){a.hide(e)}d.errors=[],d.title="QUICKPANEL.EDIT_CHATGROUP",d.group=angular.copy(r),d.currentUser=s.getCurrentUser(),d.members=l,d.newChatGroup=!0,d.group||(d.group={write:!0,members:[]},d.title="QUICKPANEL.NEW_CHATGROUP"),d.saveChatGroup=function(){var n;return d.errors=[],o.chatGroup.save({name:d.group.name,write:d.group.write}).$promise.then(function(e){var t=_.map(d.group.members,"id");return t.unshift(d.currentUser.id),n=e,o.chatGroup.addMembers({id:n.id,ids:t}).$promise}).then(function(){i.success({title:"Group properly saved!",msg:n.name+" has been saved!"}),c(n)}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.closeDialog=c,d.querySearch=function(e){return e?d.members.rows.filter((t=e,n=angular.lowercase(t),function(e){var t=e.name.toLowerCase();return-1!=t.indexOf(n)})):[];var t,n}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","group","members"],angular.module("app.quick-panel").controller("CreateOrEditChatGroupDialogController",e)}(),function(){"use strict";function e(e,n,a,o,t,s,i,r,l,d){var c=this;function m(){delete c.group}function u(e){var t=angular.element("#chat-group-dialog");a(function(){t.animate({scrollTop:t[0].scrollHeight},e)},0)}c.currentUser=i.getCurrentUser(),c.unreadGroupMessages={},c.groups={},c.participants,c.group,c.init=function(e){return c.license=e,r.user.getGroups({id:c.currentUser.id}).$promise.then(function(e){for(var t=0,n=[];t<e.rows.length;t++)e.rows[t].unreadGroupMessages=0,c.groups[e.rows[t].id]=e.rows[t],n.push(r.chatGroup.getUnread({id:e.rows[t].id}).$promise);return s.all(n)}).then(function(e){for(var t=0;t<e.length;t++)c.groups[e[t].id].unreadGroupMessages+=e[t].count}).catch(function(e){console.error(e)})},c.back=m,c.addGroup=function(e,t){o.show({controller:"CreateOrEditChatGroupDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/create/dialog.html",parent:angular.element(n.body),targetEvent:t,clickOutsideToClose:!0,locals:{group:e,me:c.currentUser,license:null,setting:null},resolve:{members:function(){return r.user.get({role:"agent"}).$promise}}}).then(function(e){e&&(c.groups[e.id]=e)}).catch(function(e){e&&console.error(e.message)})},c.deleteGroup=function(e,t){var n=o.confirm().title("Are you sure want to delete the selected group?").htmlContent("Group <b>"+e.name+"</b> will be deleted.").ariaLabel("delete Group").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){return r.chatGroup.delete({id:e.id}).$promise}).then(function(){delete c.groups[e.id],d.success({title:"Group properly deleted!",msg:e.name+" has been deleted!"})}).catch(function(e){e&&d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatGroup.delete",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.groupsToArray=function(){return _.values(c.groups)},c.showMessageInfo=function(e,i){o.show({controller:"ShowMessageInfoDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/info/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{message:i},resolve:{data:function(){var a={messages:[]};return r.chatInternalMessage.get({ChatInternalMessageId:i.id}).$promise.then(function(e){var t=[];a.messages=e.rows,a.messages.unshift(i);for(var n=0;n<a.messages.length;n++)t.push(r.user.get({id:a.messages[n].ToId,fields:"id,name,fullname,userpic"}).$promise);return s.all(t)}).then(function(e){return a.users=e,a}).catch(function(e){e&&console.error(e)})}}}).then(function(){}).catch(function(e){e&&console.error(e.message)})},c.toggleChat=function(t){c.group={id:t.id,write:t.write,messages:{}},r.chatGroup.getMembers({id:t.id,fields:"id,name,fullname"}).$promise.then(function(e){return c.group.membersByKeys=_.keyBy(e.rows,"id"),c.group.members=_.differenceBy(e.rows,[{id:c.currentUser.id}],"id"),c.participants=_.map(c.group.members,"fullname").join(", "),r.chatGroup.getMessages({id:t.id}).$promise}).then(function(e){for(var t,n=0,a=[];n<e.count;n++)e.rows[n].ToId===c.currentUser.id&&(t=e.rows[n],c.group.messages[t.id]=t,e.rows[n].ToId!=c.currentUser.id||e.rows[n].FromId===c.currentUser.id||t.read||a.push(r.chatInternalMessage.update({id:t.id,read:!0})));return s.all(a)}).then(function(){u(400)}).catch(function(e){console.error(e.message)})},c.reply=function(){if(!c.replyMessage)return;var n={id:c.group.id,FromId:c.currentUser.id,ToId:c.currentUser.id,body:c.replyMessage,read:!0},a=[];c.replyMessage="",r.chatGroup.addMessage(n).$promise.then(function(e){n.read=!1,n.ChatInternalMessageId=e.id;for(var t=0;t<c.group.members.length;t++)c.group.members[t].id!==c.currentUser.id&&(n.ToId=c.group.members[t].id,a.push(r.chatGroup.addMessage(angular.copy(n)).$promise));return s.all(a)}).catch(function(e){console.log(e)})},l.on("chatInternalMessage:save",function(t){if(!c.group&&t.ToId===c.currentUser.id&&t.FromId!==c.currentUser.id&&!t.read&&t.ChatGroupId){var e=c.groups[t.ChatGroupId];if(!e)return r.chatGroup.get({id:t.ChatGroupId}).$promise.then(function(e){e.unreadGroupMessages=1,c.groups[e.id]=e});e.unreadGroupMessages||(e.unreadGroupMessages=0),e.unreadGroupMessages++}c.group&&t.ChatGroupId===c.group.id&&t.ToId===c.currentUser.id&&r.chatInternalMessage.update({id:t.id,read:!0}).$promise.then(function(){var e;e=t,c.group.messages[e.id]=e,u(400)})}),l.on("chatInternalMessage:update",function(e){e.ToId==c.currentUser.id&&e.FromId!==c.currentUser.id&&e.ChatGroupId&&e.read&&(0<c.groups[e.ChatGroupId].unreadGroupMessages&&c.groups[e.ChatGroupId].unreadGroupMessages--,c.group.messages[e.id]&&(c.group.messages[e.id].read=!0))}),l.on("chatGroup:remove",function(e){c.groups[e.id]&&delete c.groups[e.id]}),t("quick-panel").onClose(m),e.$on("$destroy",function(){l.removeAllListeners("chatInternalMessage:save"),l.removeAllListeners("chatInternalMessage:update"),l.removeAllListeners("chatGroup:remove")})}e.$inject=["$scope","$document","$timeout","$mdDialog","$mdSidenav","$q","Auth","api","socket","toasty"],angular.module("app.quick-panel").controller("ChatGroupController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){this.data=r,this.title="QUICKPANEL.INFO",this.closeDialog=function(){a.hide()}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","data"],angular.module("app.quick-panel").controller("ShowMessageInfoDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o){var s=this;s.form={token:o.token},s.setting={},s.resetPassword=function(){return i.auth.reset(s.form).$promise.then(function(){t.success({title:n.instant("RESETPASSWORD.PASSWORD_RESET"),msg:n.instant("RESETPASSWORD.PASSWORD_RESET_MESSAGE")}),a.go("app.login")}).catch(function(e){e&&t.error({title:n.instant("RESETPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},s.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general");return i.setting.gdpr({id:1}).$promise.then(function(e){s.setting=e,s.passwordPattern=s.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:""}).catch(function(e){e&&t.error({title:"Error",msg:e.data?e.data.message||e.message||e:e.message||e})})}}e.$inject=["Auth","toasty","$translate","$state","api","$stateParams"],angular.module("app.reset").controller("ResetPasswordController",e)}(),function(){"use strict";function e(e,t,n,a,i,o){var s=this;function r(){e.hide()}s.errors=[],s.user=a,s.setting=i,s.reset=o,s.passwordPattern=s.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",s.savePassword=function(){s.errors=[],n.user.changePassword({id:s.user.id},{oldPassword:s.oldPassword,newPassword:s.password}).$promise.then(function(){t.show(t.simple().textContent("Your password properly updated").position("top right").hideDelay(5e3)),r()}).catch(function(e){console.error(e),s.errors=e.data.errors&&e.data.errors.length?e.data.errors:[{message:e.data.message||"Authorization error",type:"api.user.changePassword"}]})},s.closeDialog=r}e.$inject=["$mdDialog","$mdToast","api","user","setting","reset"],angular.module("app.toolbar").controller("ChangePasswordController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s){var r=this,l=[];function d(e){_.isNil(e)&&o.cmHopper.update({id:r.preview.id,UserId:null}),a.hide()}r.errors=[],r.preview=s,r.originated=!1,r.disable=!1,r.disableGetContact=!1,l.push(r.preview.id),r.originatePreview=function(){r.originated=!0,r.disable=!0,_.isEmpty(r.preview)?(i.error({title:"Message",msg:"Contact not available"}),r.disable=!1,l=[],d(!0)):o.rpc.getVoiceQueuesPreview({id:r.preview.id}).$promise.then(function(e){d(!0)}).catch(function(e){i.error({title:"Message",msg:e.data}),d(!0)}).finally(function(){r.disable=!1,l=[]})},r.closeDialog=d,r.nextContact=function(){r.disableGetContact=!0,r.originated||o.cmHopper.update({id:r.preview.id,UserId:null});return o.cmHopper.getPreview({hopperIds:l}).$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?i.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"}):(r.preview=e,l.push(r.preview.id))}).catch(function(e){if(l=[],a.hide(),404===e.status)i.info({title:"PREVIEW",msg:"CONTACT NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api preview"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){r.disableGetContact=!1})},e.$on("$destroy",function(){r.originated||o.cmHopper.update({id:r.preview.id,UserId:null})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","preview"],angular.module("app.toolbar").controller("PreviewDialogController",e)}(),function(){"use strict";function e(e,t,o,n,s,a,i,r,l,d,c,m,u,p,g,v,h,b,f,A,E){var y,S=this;function T(e){S.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}function C(){S.promise=b.user.getQueues(S.query,T).$promise}function x(e){return v.logout(e).then(function(){return h.disconnect(),t.$broadcast("webrtc::logout"),n.go("app.login")}).catch(function(e){console.error(e)})}function O(e,t){c.show({controller:"ChangePasswordController",controllerAs:"vm",templateUrl:"app/toolbar/changepassword/changepassword.html",parent:angular.element(m.body),targetEvent:e,clickOutsideToClose:!t,locals:{user:S.user,setting:A,reset:t}})}S.voiceQueues={},S.polling=!0,t.global={search:""},S.pauses=[],S.license=f,S.currentUser=v.getCurrentUser(),S.unreadTotalMessages=0,S.unreadTotalGroupMessages=0,S.contcts=0,"agent"===S.currentUser.role&&(y=E(function(){_.some(S.voiceQueues,{dialMethod:"preview",dialActive:!0})&&S.license.dialer&&S.polling?(S.polling=!1,b.cmHopper.getOpenContacts().$promise.then(function(e){e&&_.isNumber(e.contacts)&&(S.contacts=e.contacts)}).finally(function(){S.polling=!0})):S.contacts=0},14999)),S.setting=A,S.bodyEl=angular.element("body"),S.conf={realm:"asterisk",host:a.host(),protocol:a.protocol(),remotePlayerId:"remote-audio",ua:"Motion WebRTC Bar 0.2.0",license:S.license.webrtc,phoneBarExpires:S.currentUser.phoneBarExpires},S.query={id:v.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",nolimit:!0},S.userStatusOptions=[{title:"Online",icon:"icon-checkbox-marked-circle",color:"#4CAF50"},{title:"Away",icon:"icon-clock",color:"#FFC107"},{title:"Do not Disturb",icon:"icon-minus-circle",color:"#F44336"},{title:"Invisible",icon:"icon-checkbox-blank-circle-outline",color:"#BDBDBD"},{title:"Offline",icon:"icon-checkbox-blank-circle-outline",color:"#616161"}],S.languages={en:{title:"English",translation:"TOOLBAR.ENGLISH",code:"en",flag:"us"},it:{title:"Italian",translation:"TOOLBAR.ITALIAN",code:"it",flag:"it"},fr:{title:"French",translation:"TOOLBAR.FRENCH",code:"fr",flag:"fr"},ko:{title:"Korean",translation:"TOOLBAR.KOREAN",code:"ko",flag:"ko"},es:{title:"Spanish",translation:"TOOLBAR.SPANISH",code:"es",flag:"es"},sv:{title:"Swedish",translation:"TOOLBAR.SWEDISH",code:"sv",flag:"sv"},ru:{title:"Russian",translation:"TOOLBAR.RUSSIAN",code:"ru",flag:"ru"},de:{title:"German",translation:"TOOLBAR.GERMAN",code:"de",flag:"de"},ja:{title:"Japanese",translation:"TOOLBAR.JAPANESE",code:"ja",flag:"ja"},"zh-CN":{title:"ChineseSimplified",translation:"TOOLBAR.CHINESESIMPLIFIED",code:"zh-CN",flag:"zh-CN"},"zh-TW":{title:"ChineseTraditional",translation:"TOOLBAR.CHINESETRADITIONAL",code:"zh-TW",flag:"zh-TW"},nl:{title:"Dutch",translation:"TOOLBAR.DUTCH",code:"nl",flag:"nl"},fi:{title:"Finnish",translation:"TOOLBAR.FINNISH",code:"fi",flag:"fi"},da:{title:"Danish",translation:"TOOLBAR.DANISH",code:"da",flag:"da"},"pt-PT":{title:"Portuguese",translation:"TOOLBAR.PORTUGUESE",code:"pt-PT",flag:"pt-PT"},no:{title:"Norwegian",translation:"TOOLBAR.NORWEGIAN",code:"no",flag:"no"},hi:{title:"Hindi",translation:"TOOLBAR.HINDI",code:"hi",flag:"hi"},tr:{title:"Turkish",translation:"TOOLBAR.TURKISH",code:"tr",flag:"tr"},fa:{title:"Persian",translation:"TOOLBAR.PERSIAN",code:"fa",flag:"fa"},pl:{title:"Polish",translation:"TOOLBAR.POLISH",code:"pl",flag:"pl"},lv:{title:"Latvian",translation:"TOOLBAR.LATVIAN",code:"lv",flag:"lv"}},S.toggleSidenav=function(e){i(e).toggle()},S.logout=x,S.changeLanguage=function(e){if(!S.languages.hasOwnProperty(e.code)){return void l.show({template:'<md-toast id="language-message" layout="column" layout-align="center start"><div class="md-toast-content">Motion supports multiple translations through angular-translate module, but currently we do not support the selected language. If you want to help us, send us a message.</div></md-toast>',hideDelay:7e3,position:"top right",parent:"#content"})}S.selectedLanguage=e,u.put("motion.language",e.code),r.use(e.code),"app.callysquare.projects.edit"===n.current.name&&d.location.reload()},S.setUserStatus=function(e){S.userStatus=e},S.toggleHorizontalMobileMenu=function(){S.bodyEl.toggleClass("ms-navigation-horizontal-mobile-menu-active")},S.toggleMsNavigationFolded=function(){g.toggleFolded()},S.search=function(t){for(var e=[],n=g.getFlatNavigation(),a=o.defer(),i=0;i<n.length;i++)n[i].uisref&&e.push(n[i]);t&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(t)))return!0}));return s(function(){a.resolve(e)},1e3),a.promise},S.searchResultClick=function(e){e.uisref&&(e.stateParams?n.go(e.state,e.stateParams):n.go(e.state))},S.openSettings=function(e){t.$broadcast("webrtc::settings")},S.changePassword=O,S.isAgent=function(){return v.getCurrentUser()&&v.hasRole("agent")},S.onUserUpdate=function(e){if(e.id===S.user.id)if("agent"===e.role&&_.isBoolean(e.online)&&!e.online)if(0!==S.user.showWebBar){var t=c.confirm().title(r.instant("TOOLBAR.WARNING")+"!").textContent(r.instant("TOOLBAR.SOMEONE_LOGGED_YOU_OUT")).ariaLabel(r.instant("TOOLBAR.WARNING")+"!").ok(r.instant("TOOLBAR.STAY_LOGGED")).cancel("Logout");c.show(t).then(function(){v.queueLogin()}).catch(function(e){x(!0)}).finally(function(){_.merge(S.user,e),v.updateCurrentUser(S.user)})}else x(!0),_.merge(S.user,e),v.updateCurrentUser(S.user);else _.merge(S.user,e),v.updateCurrentUser(S.user)},S.onUserCalled=function(e){2===S.currentUser.showWebBar&&"agent"===S.currentUser.role&&S.currentUser.name===e.membername&&p.info({title:"WebRTC Popup",msg:"<div> <span>Call from: "+e.calleridnum+"</span><br> <span>Queue: "+e.queue+"</span><br> <span>Extra: "+(e.extravar||"Not defined")+"</span><br> </div>",showClose:!0,timeout:1e4,html:!0})},S.pause=function(e){return b.user.pause({id:S.user.id,type:e||"DEFAULT PAUSE"}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:PAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},S.unpause=function(){return b.user.unpause({id:S.user.id}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UNPAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},S.preview=function(t){return S.disable=!0,b.cmHopper.getPreview().$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?p.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"}):c.show({controller:"PreviewDialogController",controllerAs:"vm",templateUrl:"app/toolbar/preview/dialog.html",parent:angular.element(m.body),targetEvent:t,clickOutsideToClose:!0,locals:{preview:e}})}).catch(function(e){if(404===e.status)p.info({title:"PREVIEW",msg:"CONTACT NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){S.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var t=0;t<e.data.errors.length;t+=1)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){S.disable=!1})},S.getLogo=function(){return S.setting.defaultHeaderWhiteLabel?"xCALLY Motion":S.setting.headerWhiteLabel},S.userIsNotPhonebar=function(){return"admin"===S.currentUser.role||"user"===S.currentUser.role||"agent"===S.currentUser.role&&0!==S.currentUser.showWebBar},S.onInternalMessageSave=function(e){e.ToId!==S.currentUser.id||e.ChatGroupId||(S.unreadTotalMessages+=1);e.ToId===S.currentUser.id&&e.FromId!==S.currentUser.id&&!e.read&&e.ChatGroupId&&S.unreadTotalGroupMessages++},S.onInternalMessageUpdate=function(e){e.ToId===S.currentUser.id&&e.read&&0<S.unreadTotalMessages&&!e.ChatGroupId&&(S.unreadTotalMessages-=1);e.ToId===S.currentUser.id&&e.read&&e.ChatGroupId&&0<S.unreadTotalGroupMessages&&S.unreadTotalGroupMessages--},S.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===v.getCurrentUser().id&&C()},S.onVoiceQueue=function(e){C()},h.connect(),h.on("user:update",S.onUserUpdate),h.on("user:called",S.onUserCalled),h.on("chatInternalMessage:save",S.onInternalMessageSave),h.on("chatInternalMessage:update",S.onInternalMessageUpdate),h.on("userVoiceQueue:save",S.onUserVoiceQueue),h.on("voiceQueue:save",S.onVoiceQueue),h.on("userVoiceQueue:remove",S.onUserVoiceQueue),h.on("voiceQueue:remove",S.onVoiceQueue),h.on("voiceQueue:update",S.onVoiceQueue),function(){S.user=v.getCurrentUser(),S.conf.ha1=S.user.md5secret,S.conf.id=S.user.id,S.conf.name=S.user.name,S.conf.fullname=S.user.fullname,S.conf.internal=S.user.internal,S.conf.recording=S.user.phoneBarEnableRecording,S.conf.autoAnswer=S.user.phoneBarAutoAnswer,S.conf.enableSettings=S.user.phoneBarEnableSettings,S.conf.enableDtmfTone=S.user.phoneBarEnableDtmfTone,S.conf.autoAnswerDelay=S.user.phoneBarAutoAnswerDelay,S.userStatus=S.userStatusOptions[0];var e=u.get("motion.language");e&&S.languages.hasOwnProperty(e)?S.selectedLanguage=S.languages[e]:S.selectedLanguage=S.languages[r.preferredLanguage()];if(b.pause.get({fields:"name",nolimit:!0}).$promise.then(function(e){S.pauses=e.rows?e.rows:[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETPAUSES",msg:e.status?JSON.stringify(e.data):e.toString()})}),S.setting.securePassword)if(S.user.passwordResetAt){var t=moment(S.user.passwordResetAt).add(S.setting.passwordExpiresDays||90,"day");moment().isAfter(t)?O(null,!0):moment().add(15,"day").isAfter(t)&&p.warning({title:r.instant("TOOLBAR.WARNING")+"!",msg:r.instant("TOOLBAR.PASSWORD_EXPIRE_REMAINING_DAYS")+": "+Math.ceil(t.diff(moment(),"days",!0)),timeout:2e4})}else O(null,!0)}(),C(),b.chatInternalMessage.get({fields:"FromId",ToId:S.currentUser.id,read:!1,nolimit:!0}).$promise.then(function(e){S.unreadTotalMessages=e.rows.length}),e.$on("$destroy",function(){h.removeAllListeners("user:called"),h.removeAllListeners("user:update"),h.removeAllListeners("chatInternalMessage:save"),h.removeAllListeners("chatInternalMessage:update"),h.removeAllListeners("userVoiceQueue:save"),h.removeAllListeners("voiceQueue:save"),h.removeAllListeners("userVoiceQueue:remove"),h.removeAllListeners("voiceQueue:remove"),h.removeAllListeners("voiceQueue:update"),y&&(E.cancel(y),y=null)})}e.$inject=["$scope","$rootScope","$q","$state","$timeout","$location","$mdSidenav","$translate","$mdToast","$window","$mdDialog","$document","$cookies","toasty","msNavigationService","Auth","socket","api","license","setting","$interval"],angular.module("app.toolbar").controller("ToolbarController",e)}();var urlParams=function(e){var t=new Object,n=e.lastIndexOf("?");if(0<n)for(var a=e.substring(n+1).split("&"),i=0;i<a.length;i++)0<(n=a[i].indexOf("="))&&(t[a[i].substring(0,n)]=a[i].substring(n+1));return t}(window.location.href),t0=new Date,MAX_REQUEST_SIZE=10485760,MAX_WIDTH=12e3,MAX_HEIGHT=12e3,EXPORT_URL="http://exp.draw.io/ImageExport2/export",SHARE_HOST="http://localhost:3000",SAVE_URL="api/square/projects/",VARIABLE_URL="/api/variables",STENCIL_PATH="/assets/plugins/square/stencils",SHAPES_PATH="/assets/plugins/square/shapes",IMAGE_PATH="/assets/plugins/square/images",STYLE_PATH="/assets/plugins/square/styles",CSS_PATH="/assets/plugins/square/styles",OPEN_FORM="api/square/projects/open",TEMPLATE_PATH="/assets/plugins/square/templates",RESOURCES_PATH="/assets/plugins/square/resources",RESOURCE_BASE=RESOURCES_PATH+"/grapheditor",tapAndHoldStartsConnection=!0,showConnectorImg=!0,mxLoadResources=!1,mxLanguages=["it","fr","ko","es","sv","ru","de","ja","zh-CN","zh-TW","nl","fi","da","pt-PT","no","hi","tr","fa"],mxLanguage="en",match=document.cookie.match(new RegExp("(^| )motion.language=([^;]+)"));match&&mxLanguages.includes(match[2])&&(mxLanguage=match[2]);var mxBasePath="assets/plugins/mxgraph",mxClient={VERSION:"2.0.0.0",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&navigator.userAgent.indexOf("MSIE")<0,IS_OP:0<=navigator.userAgent.indexOf("Opera/"),IS_OT:navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&navigator.userAgent.indexOf("Chrome/")<0,IS_GC:0<=navigator.userAgent.indexOf("Chrome/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||0<=navigator.userAgent.indexOf("Iceweasel/")&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||0<=navigator.userAgent.indexOf("SeaMonkey/")&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||0<=navigator.userAgent.indexOf("Iceape/")&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||0<=navigator.userAgent.indexOf("Epiphany/")||0<=navigator.userAgent.indexOf("AppleWebKit/")||0<=navigator.userAgent.indexOf("Gecko/")||0<=navigator.userAgent.indexOf("Opera/"),NO_FO:0<=navigator.userAgent.indexOf("Firefox/1.")||0<=navigator.userAgent.indexOf("Iceweasel/1.")||0<=navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/1.")||0<=navigator.userAgent.indexOf("Camino/1.")||0<=navigator.userAgent.indexOf("Epiphany/2.")||0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("MSIE")||0<=navigator.userAgent.indexOf("Mozilla/2."),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_MAC:0<navigator.userAgent.toUpperCase().indexOf("MACINTOSH"),IS_TOUCH:0<navigator.userAgent.toUpperCase().indexOf("IPAD")||0<navigator.userAgent.toUpperCase().indexOf("IPOD")||0<navigator.userAgent.toUpperCase().indexOf("IPHONE")||0<navigator.userAgent.toUpperCase().indexOf("ANDROID"),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(e,t,n){if(n=n||document,mxClient.IS_IE6)n.write('<link rel="'+e+'" href="'+t+'" charset="ISO-8859-1" type="text/css"/>');else{var a=n.createElement("link");a.setAttribute("rel",e),a.setAttribute("href",t),a.setAttribute("charset","ISO-8859-1"),a.setAttribute("type","text/css"),n.getElementsByTagName("head")[0].appendChild(a)}},include:function(e){document.write('<script src="'+e+'"><\/script>')},dispose:function(){for(var e=0;e<mxEvent.objects.length;e++)null!=mxEvent.objects[e].mxListenerList&&mxEvent.removeAllListeners(mxEvent.objects[e])}};if(mxClient.IS_OP&&mxClient.IS_OT?mxClient.CSS_PREFIX="O":mxClient.IS_SF||mxClient.IS_GC?mxClient.CSS_PREFIX="Webkit":mxClient.IS_MT?mxClient.CSS_PREFIX="Moz":mxClient.IS_IE&&9<=document.documentMode&&(mxClient.CSS_PREFIX="ms"),void 0===mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),void 0!==mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images",mxClient.language=void 0!==mxLanguage?mxLanguage:mxClient.IS_IE?navigator.userLanguage:navigator.language,mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage?mxDefaultLanguage:"en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),void 0!==mxLanguages&&(mxClient.languages=mxLanguages),mxClient.IS_IE){if(9<=document.documentMode)mxClient.IS_VML=!1,mxClient.IS_SVG=!0;else{8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"));var ss=document.createStyleSheet();ss.cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css")}window.attachEvent("onunload",mxClient.dispose)}var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var e=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,t=document.createElement("table");t.setAttribute("width","100%"),t.setAttribute("height","100%");var n=document.createElement("tbody"),a=document.createElement("tr"),i=document.createElement("td");if(i.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxLog.textarea.style.width=mxClient.IS_NS&&"BackCompat"!=document.compatMode?"99%":"100%",i.appendChild(mxLog.textarea),a.appendChild(i),n.appendChild(a),a=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),a.appendChild(mxLog.td),n.appendChild(a),t.appendChild(n),mxLog.addButton("Info",function(e){mxLog.info()}),mxLog.addButton("DOM",function(e){e=mxUtils.getInnerHtml(document.body),mxLog.debug(e)}),mxLog.addButton("Trace",function(e){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")}),mxLog.addButton("Copy",function(e){try{mxUtils.copy(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Show",function(e){try{mxUtils.popup(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Clear",function(e){mxLog.textarea.value=""}),a=n=0,"number"==typeof window.innerWidth?(n=window.innerHeight,a=window.innerWidth):(n=document.documentElement.clientHeight||document.body.clientHeight,a=document.body.clientWidth),mxLog.window=new mxWindow(e,t,Math.max(0,a-320),Math.max(0,n-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode){var o=mxLog.window.getElement();e=function(e,t){mxLog.textarea.style.height=Math.max(0,o.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,e),mxLog.window.addListener(mxEvent.MAXIMIZE,e),mxLog.window.addListener(mxEvent.NORMALIZE,e),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(e,t){var n=document.createElement("button");mxUtils.write(n,e),mxEvent.addListener(n,"click",t),mxLog.td.appendChild(n)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(e){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(e)},enter:function(e){if(mxLog.TRACE)return mxLog.writeln("Entering "+e),(new Date).getTime()},leave:function(e,t){if(mxLog.TRACE){var n=0!=t?" ("+((new Date).getTime()-t)+" ms)":"";mxLog.writeln("Leaving "+e+n)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var e="",t=0;t<arguments.length;t++)e+=arguments[t],t<arguments.length-1&&(e+=" ");null!=mxLog.textarea?(mxLog.textarea.value+=e,0<=navigator.userAgent.indexOf("Presto/2.5")&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=e},writeln:function(){for(var e="",t=0;t<arguments.length;t++)e+=arguments[t],t<arguments.length-1&&(e+=" ");mxLog.write(e+"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(e){if("object"==typeof e&&null==e[mxObjectIdentity.FIELD_NAME]){var t=mxUtils.getFunctionName(e.constructor);e[mxObjectIdentity.FIELD_NAME]=t+"#"+mxObjectIdentity.counter++}return e[mxObjectIdentity.FIELD_NAME]},clear:function(e){"object"==typeof e&&delete e[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}mxDictionary.prototype.map=null,mxDictionary.prototype.clear=function(){this.map={}},mxDictionary.prototype.get=function(e){return e=mxObjectIdentity.get(e),this.map[e]},mxDictionary.prototype.put=function(e,t){var n=mxObjectIdentity.get(e),a=this.map[n];return this.map[n]=t,a},mxDictionary.prototype.remove=function(e){e=mxObjectIdentity.get(e);var t=this.map[e];return delete this.map[e],t},mxDictionary.prototype.getKeys=function(){var e,t=[];for(e in this.map)t.push(e);return t},mxDictionary.prototype.getValues=function(){var e,t=[];for(e in this.map)t.push(this.map[e]);return t},mxDictionary.prototype.visit=function(e){for(var t in this.map)e(t,this.map[t])};var mxResources={resources:[],extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(e){return null==mxClient.languages||0<=mxUtils.indexOf(mxClient.languages,e)},getDefaultBundle:function(e,t){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(t)?e+mxResources.extension:null},getSpecialBundle:function(e,t){if(null==mxClient.languages||!this.isLanguageSupported(t)){var n=t.indexOf("-");0<n&&(t=t.substring(0,n))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(t)&&t!=mxClient.defaultLanguage?e+"_"+t+mxResources.extension:null},add:function(e,t){if((t=null!=t?t:mxClient.language.toLowerCase())!=mxConstants.NONE){var n=mxResources.getDefaultBundle(e,t);if(null!=n)try{var a=mxUtils.load(n);a.isReady()&&mxResources.parse(a.getText())}catch(e){}if(null!=(n=mxResources.getSpecialBundle(e,t)))try{(a=mxUtils.load(n)).isReady()&&mxResources.parse(a.getText())}catch(e){}}},parse:function(e){if(null!=e){e=e.split("\n");for(var t=0;t<e.length;t++)if("#"!=e[t].charAt(0)){var n=e[t].indexOf("=");if(0<n){var a=e[t].substring(0,n),i=e[t].length;13==e[t].charCodeAt(i-1)&&i--,n=e[t].substring(n+1,i),this.resourcesEncoded?(n=n.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[a]=unescape(n)):mxResources.resources[a]=n}}}},get:function(e,t,n){if(null==(e=mxResources.resources[e])&&(e=n),null!=e&&null!=t){n=[];for(var a=null,i=0;i<e.length;i++){var o=e.charAt(i);"{"==o?a="":null!=a&&"}"==o?(0<=(a=parseInt(a)-1)&&a<t.length&&n.push(t[a]),a=null):null!=a?a+=o:n.push(o)}e=n.join("")}return e}};function mxPoint(e,t){this.x=null!=e?e:0,this.y=null!=t?t:0}function mxRectangle(e,t,n,a){mxPoint.call(this,e,t),this.width=null!=n?n:0,this.height=null!=a?a:0}mxPoint.prototype.x=null,mxPoint.prototype.y=null,mxPoint.prototype.equals=function(e){return e.x==this.x&&e.y==this.y},mxPoint.prototype.clone=function(){return mxUtils.clone(this)},mxRectangle.prototype=new mxPoint,mxRectangle.prototype.constructor=mxRectangle,mxRectangle.prototype.width=null,mxRectangle.prototype.height=null,mxRectangle.prototype.setRect=function(e,t,n,a){this.x=e,this.y=t,this.width=n,this.height=a},mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2},mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2},mxRectangle.prototype.add=function(e){if(null!=e){var t=Math.min(this.x,e.x),n=Math.min(this.y,e.y),a=Math.max(this.x+this.width,e.x+e.width);e=Math.max(this.y+this.height,e.y+e.height),this.x=t,this.y=n,this.width=a-t,this.height=e-n}},mxRectangle.prototype.grow=function(e){this.x-=e,this.y-=e,this.width+=2*e,this.height+=2*e},mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)},mxRectangle.prototype.equals=function(e){return e.x==this.x&&e.y==this.y&&e.width==this.width&&e.height==this.height};var mxEffects={animateChanges:function(l,d,c){var m=0,u=function(){for(var e=!1,t=0;t<d.length;t++){var n=d[t];if(n instanceof mxGeometryChange||n instanceof mxTerminalChange||n instanceof mxValueChange||n instanceof mxChildChange||n instanceof mxStyleChange){var a=l.getView().getState(n.cell||n.child,!1);if(null!=a)if(e=!0,n.constructor!=mxGeometryChange||l.model.isEdge(n.cell))mxUtils.setOpacity(a.shape.node,100*m/10);else{var i=l.getView().scale,o=(n.geometry.x-n.previous.x)*i,s=(n.geometry.y-n.previous.y)*i,r=(n.geometry.width-n.previous.width)*i;i=(n.geometry.height-n.previous.height)*i;0==m?(a.x-=o,a.y-=s,a.width-=r,a.height-=i):(a.x+=o/10,a.y+=s/10,a.width+=r/10,a.height+=i/10),l.cellRenderer.redraw(a),mxEffects.cascadeOpacity(l,n.cell,100*m/10)}}}m<10&&e?(m++,window.setTimeout(u,p)):null!=c&&c()},p=30;u()},cascadeOpacity:function(e,t,n){for(var a=e.model.getChildCount(t),i=0;i<a;i++){var o=e.model.getChildAt(t,i),s=e.getView().getState(o);null!=s&&(mxUtils.setOpacity(s.shape.node,n),mxEffects.cascadeOpacity(e,o,n))}if(null!=(t=e.model.getEdges(t)))for(i=0;i<t.length;i++)null!=(a=e.getView().getState(t[i]))&&mxUtils.setOpacity(a.shape.node,n)},fadeOut:function(e,t,n,a,i,o){a=a||40,i=i||30;var s=t||100;if(mxUtils.setOpacity(e,s),o||null==o){var r=function(){s=Math.max(s-a,0),mxUtils.setOpacity(e,s),0<s?window.setTimeout(r,i):(e.style.visibility="hidden",n&&e.parentNode&&e.parentNode.removeChild(e))};window.setTimeout(r,i)}else e.style.visibility="hidden",n&&e.parentNode&&e.parentNode.removeChild(e)}},mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(e){if(null!=e.style&&(e.style.cursor=""),null!=(e=e.childNodes))for(var t=e.length,n=0;n<t;n+=1)mxUtils.removeCursors(e[n])},getCurrentStyle:mxClient.IS_IE?function(e){return null!=e?e.currentStyle:null}:function(e){return null!=e?window.getComputedStyle(e,""):null},hasScrollbars:function(e){return null!=(e=mxUtils.getCurrentStyle(e))&&("scroll"==e.overflow||"auto"==e.overflow)},bind:function(e,t){return function(){return t.apply(e,arguments)}},eval:function(a){var b=null;if(0<=a.indexOf("function"))try{eval("var _mxJavaScriptExpression="+a),b=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(e){mxLog.warn(e.message+" while evaluating "+a)}else try{b=eval(a)}catch(e){mxLog.warn(e.message+" while evaluating "+a)}return b},findNode:function(e,t,n){var a=e.getAttribute(t);if(null!=a&&a==n)return e;for(e=e.firstChild;null!=e;){if(null!=(a=mxUtils.findNode(e,t,n)))return a;e=e.nextSibling}return null},findNodeByAttribute:9<=document.documentMode?function(e,t,n){var a=null;if(null!=e)if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.getAttribute(t)==n)a=e;else for(e=e.firstChild;null!=e&&null==a;)a=mxUtils.findNodeByAttribute(e,t,n),e=e.nextSibling;return a}:mxClient.IS_IE?function(e,t,n){return null==e?null:e.ownerDocument.selectSingleNode("//*[@"+t+"='"+n+"']")}:function(e,t,n){return null==e?null:e.ownerDocument.evaluate("//*[@"+t+"='"+n+"']",e.ownerDocument,null,XPathResult.ANY_TYPE,null).iterateNext()},getFunctionName:function(e){var t=null;if(null!=e)if(null!=e.name)t=e.name;else{for(e=e.toString(),t=9;" "==e.charAt(t);)t++;var n=e.indexOf("(",t);t=e.substring(t,n)}return t},indexOf:function(e,t){if(null!=e&&null!=t)for(var n=0;n<e.length;n++)if(e[n]==t)return n;return-1},remove:function(e,t){var n=null;if("object"==typeof t)for(var a=mxUtils.indexOf(t,e);0<=a;)t.splice(a,1),n=e,a=mxUtils.indexOf(t,e);for(var i in t)t[i]==e&&(delete t[i],n=e);return n},isNode:function(e,t,n,a){return!(null==e||isNaN(e.nodeType)||null!=t&&e.nodeName.toLowerCase()!=t.toLowerCase())&&(null==n||e.getAttribute(n)==a)},getChildNodes:function(e,t){t=t||mxConstants.NODETYPE_ELEMENT;for(var n=[],a=e.firstChild;null!=a;)a.nodeType==t&&n.push(a),a=a.nextSibling;return n},createXmlDocument:function(){var e=null;return document.implementation&&document.implementation.createDocument?e=document.implementation.createDocument("","",null):window.ActiveXObject&&(e=new ActiveXObject("Microsoft.XMLDOM")),e},parseXml:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){var t=mxUtils.createXmlDocument();return t.async="false",t.loadXML(e),t}:function(e){return(new DOMParser).parseFromString(e,"text/xml")},clearSelection:document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().removeAllRanges()}:void 0,getPrettyXml:function(e,t,n){var a=[];if(null!=e)if(t=t||" ",n=n||"",e.nodeType==mxConstants.NODETYPE_TEXT)a.push(e.nodeValue);else{a.push(n+"<"+e.nodeName);var i=e.attributes;if(null!=i)for(var o=0;o<i.length;o++){var s=mxUtils.htmlEntities(i[o].nodeValue);a.push(" "+i[o].nodeName+'="'+s+'"')}if(null!=(i=e.firstChild)){for(a.push(">\n");null!=i;)a.push(mxUtils.getPrettyXml(i,t,n+t)),i=i.nextSibling;a.push(n+"</"+e.nodeName+">\n")}else a.push("/>\n")}return a.join("")},removeWhitespace:function(e,t){for(var n=t?e.previousSibling:e.nextSibling;null!=n&&n.nodeType==mxConstants.NODETYPE_TEXT;){var a=t?n.previousSibling:n.nextSibling,i=mxUtils.getTextContent(n);0==mxUtils.trim(i).length&&n.parentNode.removeChild(n),n=a}},htmlEntities:function(e,t){return e=(e=(e=(e=(e=(e||"").replace(/&/g,"&")).replace(/"/g,""")).replace(/\'/g,"'")).replace(/</g,"<")).replace(/>/g,">"),(null==t||t)&&(e=e.replace(/\n/g,"
")),e},isVml:function(e){return null!=e&&"urn:schemas-microsoft-com:vml"==e.tagUrn},getXml:function(e,t){var n="";return null!=e&&(n=null==(n=e.xml)?e.innerHTML?e.innerHTML:(new XMLSerializer).serializeToString(e):n.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n")),n.replace(/\n/g,t||"
")},getTextContent:function(e){var t="";return null!=e&&(null!=e.firstChild&&(e=e.firstChild),t=e.nodeValue||""),t},getInnerHtml:mxClient.IS_IE?function(e){return null!=e?e.innerHTML:""}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},getOuterHtml:mxClient.IS_IE?function(e){if(null!=e){if(null!=e.outerHTML)return e.outerHTML;var t=[];t.push("<"+e.nodeName);var n=e.attributes;if(null!=n)for(var a=0;a<n.length;a++){var i=n[a].nodeValue;null!=i&&0<i.length&&(t.push(" "),t.push(n[a].nodeName),t.push('="'),t.push(i),t.push('"'))}return 0==e.innerHTML.length?t.push("/>"):(t.push(">"),t.push(e.innerHTML),t.push("</"+e.nodeName+">")),t.join("")}return""}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},write:function(e,t){var n=e.ownerDocument.createTextNode(t);return null!=e&&e.appendChild(n),n},writeln:function(e,t){var n=e.ownerDocument.createTextNode(t);return null!=e&&(e.appendChild(n),e.appendChild(document.createElement("br"))),n},br:function(e,t){t=t||1;for(var n=null,a=0;a<t;a++)null!=e&&(n=e.ownerDocument.createElement("br"),e.appendChild(n));return n},button:function(e,t,n){return n=(n=null!=n?n:document).createElement("button"),mxUtils.write(n,e),mxEvent.addListener(n,"click",function(e){t(e)}),n},para:function(e,t){var n=document.createElement("p");return mxUtils.write(n,t),null!=e&&e.appendChild(n),n},addTransparentBackgroundFilter:function(e){e.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(e,t,n,a,i){return mxUtils.link(e,t,function(){n.execute(a)},i)},linkInvoke:function(e,t,n,a,i,o){return mxUtils.link(e,t,function(){n[a](i)},o)},link:function(e,t,n,a){var i=document.createElement("span");return i.style.color="blue",i.style.textDecoration="underline",i.style.cursor="pointer",null!=a&&(i.style.paddingLeft=a+"px"),mxEvent.addListener(i,"click",n),mxUtils.write(i,t),null!=e&&e.appendChild(i),i},fit:function(e){var t=parseInt(e.offsetLeft),n=parseInt(e.offsetWidth),a=document.body,i=document.documentElement,o=(a.scrollLeft||i.scrollLeft)+(a.clientWidth||i.clientWidth);o<t+n&&(e.style.left=Math.max(a.scrollLeft||i.scrollLeft,o-n)+"px"),t=parseInt(e.offsetTop),n=parseInt(e.offsetHeight),(o=(a.scrollTop||i.scrollTop)+Math.max(a.clientHeight||0,i.clientHeight))<t+n&&(e.style.top=Math.max(a.scrollTop||i.scrollTop,o-n)+"px")},open:function(e){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return mxUtils.alert("Permission to read file denied."),""}var t=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);return t.initWithPath(e),t.exists()?((e=Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream)).init(t,1,4,null),(t=Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream)).init(e),t.read(t.available())):(mxUtils.alert("File not found."),"")}return e=(t=new ActiveXObject("Scripting.FileSystemObject").OpenTextFile(e,1)).readAll(),t.close(),e},save:function(e,t){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return void mxUtils.alert("Permission to write file denied.")}var n=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);n.initWithPath(e),n.exists()||n.create(0,420);var a=Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);a.init(n,34,4,null),a.write(t,t.length),a.flush(),a.close()}else(n=new ActiveXObject("Scripting.FileSystemObject").CreateTextFile(e,!0)).Write(t),n.Close()},saveAs:function(e){var t=document.createElement("iframe");t.setAttribute("src",""),t.style.visibility="hidden",document.body.appendChild(t);try{if(mxClient.IS_NS){var n=t.contentDocument;n.open(),n.write(e),n.close();try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"),t.focus(),saveDocument(n)}catch(e){mxUtils.alert("Permission to save document denied.")}}else(n=t.contentWindow.document).write(e),n.execCommand("SaveAs",!1,document.location)}finally{document.body.removeChild(t)}},copy:function(e){if(window.clipboardData)window.clipboardData.setData("Text",e);else{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");var t=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(t){var n=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(n){n.addDataFlavor("text/unicode");var a=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);a.data=e,n.setTransferData("text/unicode",a,2*e.length),t.setData(n,null,Components.interfaces.nsIClipboard.kGlobalClipboard)}}}},load:function(e){return(e=new mxXmlRequest(e,null,"GET",!1)).send(),e},get:function(e,t,n){return new mxXmlRequest(e,null,"GET").send(t,n)},post:function(e,t,n,a){return new mxXmlRequest(e,t).send(n,a)},submit:function(e,t,n,a){return new mxXmlRequest(e,t).simulate(n,a)},loadInto:function(e,t,n){mxClient.IS_IE?t.onreadystatechange=function(){4==t.readyState&&n()}:t.addEventListener("load",n,!1),t.load(e)},getValue:function(e,t,n){return null==(e=null!=e?e[t]:null)&&(e=n),e},getNumber:function(e,t,n){return null==(e=null!=e?e[t]:null)&&(e=n||0),Number(e)},getColor:function(e,t,n){return null==(e=null!=e?e[t]:null)?e=n:e==mxConstants.NONE&&(e=null),e},clone:function(e,t,n){n=null!=n&&n;var a=null;if(null!=e&&"function"==typeof e.constructor){var i;a=new e.constructor;for(i in e)i!=mxObjectIdentity.FIELD_NAME&&(null==t||mxUtils.indexOf(t,i)<0)&&(a[i]=n||"object"!=typeof e[i]?e[i]:mxUtils.clone(e[i]))}return a},equalPoints:function(e,t){if(null==e&&null!=t||null!=e&&null==t||null!=e&&null!=t&&e.length!=t.length)return!1;if(null!=e&&null!=t)for(var n=0;n<e.length;n++)if(e[n]==t[n]||null!=e[n]&&!e[n].equals(t[n]))return!1;return!0},equalEntries:function(e,t){if(null==e&&null!=t||null!=e&&null==t||null!=e&&null!=t&&e.length!=t.length)return!1;if(null!=e&&null!=t)for(var n in e)if(e[n]!=t[n])return!1;return!0},extend:function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},toString:function(e){var t,n="";for(t in e)try{if(null==e[t])n+=t+" = [null]\n";else if("function"==typeof e[t])n+=t+" => [Function]\n";else if("object"==typeof e[t])n=n+(t+" => [")+mxUtils.getFunctionName(e[t].constructor)+"]\n";else n+=t+" = "+e[t]+"\n"}catch(e){n+=t+"="+e.message}return n},toRadians:function(e){return Math.PI*e/180},arcToCurves:function(e,t,n,a,i,o,s,r,l){if(r-=e,l-=t,0===n||0===a)return h;n=Math.abs(n),a=Math.abs(a);var d=-r/2,c=-l/2,m=Math.cos(i*Math.PI/180);i=m*d+(h=Math.sin(i*Math.PI/180))*c;d=-1*h*d+m*c;1<(v=(c=i*i)/(g=n*n)+(p=d*d)/(A=a*a))?(n*=Math.sqrt(v),a*=Math.sqrt(v),o=0):(v=1,o===s&&(v=-1),o=v*Math.sqrt((g*A-g*p-A*c)/(g*p+A*c))),r=m*(c=o*n*d/a)-h*(p=-1*o*a*i/n)+r/2,l=h*c+m*p+l/2,o=0<=(g=Math.atan2((d-p)/a,(i-c)/n)-Math.atan2(0,1))?g:2*Math.PI+g,i=0<=(g=Math.atan2((-d-p)/a,(-i-c)/n)-Math.atan2((d-p)/a,(i-c)/n))?g:2*Math.PI+g,0==s&&0<i?i-=2*Math.PI:0!=s&&i<0&&(i+=2*Math.PI),s=2*i/Math.PI,i/=s=Math.ceil(s<0?-1*s:s),d=8/3*Math.sin(i/4)*Math.sin(i/4)/Math.sin(i/2),c=m*n,m*=a,n*=h,a*=h;for(var u=Math.cos(o),p=-d*(c*(f=Math.sin(o))+a*u),g=-d*(n*f-m*u),v=A=0,h=[],b=0;b<s;++b){o+=i;var f,A=c*(u=Math.cos(o))-a*(f=Math.sin(o))+r,E=(v=n*u+m*f+l,-d*(c*f+a*u));u=-d*(n*f-m*u);h[f=6*b]=Number(p+e),h[f+1]=Number(g+t),h[f+2]=Number(A-E+e),h[f+3]=Number(v-u+t),h[f+4]=Number(A+e),h[f+5]=Number(v+t),p=A+E,g=v+u}return h},getBoundingBox:function(e,t){var n=null;if(null!=e&&null!=t&&0!=t){var a=mxUtils.toRadians(t),i=(n=Math.cos(a),Math.sin(a)),o=new mxPoint(e.x+e.width/2,e.y+e.height/2),s=new mxPoint(e.x,e.y),r=new mxPoint((a=new mxPoint(e.x+e.width,e.y)).x,e.y+e.height),l=new mxPoint(e.x,r.y);s=mxUtils.getRotatedPoint(s,n,i,o),a=mxUtils.getRotatedPoint(a,n,i,o),r=mxUtils.getRotatedPoint(r,n,i,o),l=mxUtils.getRotatedPoint(l,n,i,o);(n=new mxRectangle(s.x,s.y,0,0)).add(new mxRectangle(a.x,a.y,0,0)),n.add(new mxRectangle(r.x,r.y,0,0)),n.add(new mxRectangle(l.x,l.y,0,0))}return n},getRotatedPoint:function(e,t,n,a){a=null!=a?a:new mxPoint;var i=e.x-a.x;return new mxPoint(i*t-(e=e.y-a.y)*n+a.x,e*t+i*n+a.y)},getPortConstraints:function(e,t,n,a){return null==(e=mxUtils.getValue(e.style,mxConstants.STYLE_PORT_CONSTRAINT,null))?a:(a=e.toString(),e=mxConstants.DIRECTION_MASK_NONE,0<=a.indexOf(mxConstants.DIRECTION_NORTH)&&(e|=mxConstants.DIRECTION_MASK_NORTH),0<=a.indexOf(mxConstants.DIRECTION_WEST)&&(e|=mxConstants.DIRECTION_MASK_WEST),0<=a.indexOf(mxConstants.DIRECTION_SOUTH)&&(e|=mxConstants.DIRECTION_MASK_SOUTH),0<=a.indexOf(mxConstants.DIRECTION_EAST)&&(e|=mxConstants.DIRECTION_MASK_EAST),e)},reversePortConstraints:function(e){return(e&mxConstants.DIRECTION_MASK_WEST)<<3|(e&mxConstants.DIRECTION_MASK_NORTH)<<1|(e&mxConstants.DIRECTION_MASK_SOUTH)>>1|(e&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(e,t,n){var a=-1;if(0<e.absolutePoints.length)for(var i=e.absolutePoints[0],o=null,s=1;s<e.absolutePoints.length;s++){var r=e.absolutePoints[s];i=mxUtils.ptSegDistSq(i.x,i.y,r.x,r.y,t,n);(null==o||i<o)&&(o=i,a=s-1),i=r}return a},rectangleIntersectsSegment:function(e,t,n){var a=e.y,i=e.x,o=a+e.height,s=i+e.width;e=t.x;var r=n.x;if(t.x>n.x&&(e=n.x,r=t.x),s<r&&(r=s),e<i&&(e=i),r<e)return!1;i=t.y,s=n.y;var l=n.x-t.x;return 1e-7<Math.abs(l)&&(i=(n=(n.y-t.y)/l)*e+(t=t.y-n*t.x),s=n*r+t),s<i&&(t=s,s=i,i=t),o<s&&(s=o),i<a&&(i=a),!(s<i)},contains:function(e,t,n){return e.x<=t&&e.x+e.width>=t&&e.y<=n&&e.y+e.height>=n},intersects:function(e,t){var n=e.width,a=e.height,i=t.width,o=t.height;if(i<=0||o<=0||n<=0||a<=0)return!1;var s=e.x,r=e.y,l=t.x,d=t.y;o+=d,n+=s,a+=r;return((i=i+l)<l||s<i)&&(o<d||r<o)&&(n<s||l<n)&&(a<r||d<a)},intersectsHotspot:function(e,t,n,a,i,o){if(i=null!=i?i:0,o=null!=o?o:0,0<(a=null!=a?a:1)){var s=e.getCenterX(),r=e.getCenterY(),l=e.width,d=e.height,c=mxUtils.getValue(e.style,mxConstants.STYLE_STARTSIZE)*e.view.scale;return 0<c&&(mxUtils.getValue(e.style,mxConstants.STYLE_HORIZONTAL,!0)?(r=e.y+c/2,d=c):(s=e.x+c/2,l=c)),l=Math.max(i,l*a),d=Math.max(i,d*a),0<o&&(l=Math.min(l,o),d=Math.min(d,o)),a=new mxRectangle(s-l/2,r-d/2,l,d),0!=(s=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(i=Math.cos(-s),o=Math.sin(-s),s=new mxPoint(e.getCenterX(),e.getCenterY()),t=(e=mxUtils.getRotatedPoint(new mxPoint(t,n),i,o,s)).x,n=e.y),mxUtils.contains(a,t,n)}return!0},getOffset:function(e,t){var n=0,a=0;if(null!=t&&t){var i=document.body,o=document.documentElement;n=n+(i.scrollLeft||o.scrollLeft),a=a+(i.scrollTop||o.scrollTop)}for(;e.offsetParent;)n+=e.offsetLeft,a+=e.offsetTop,e=e.offsetParent;return new mxPoint(n,a)},getScrollOrigin:function(e){for(var t=document.body,n=document.documentElement,a=new mxPoint(t.scrollLeft||n.scrollLeft,t.scrollTop||n.scrollTop);null!=e&&e!=t&&e!=n;)!isNaN(e.scrollLeft)&&!isNaN(e.scrollTop)&&(a.x+=e.scrollLeft,a.y+=e.scrollTop),e=e.parentNode;return a},convertPoint:function(e,t,n){var a=mxUtils.getScrollOrigin(e);return(e=mxUtils.getOffset(e)).x-=a.x,e.y-=a.y,new mxPoint(t-e.x,n-e.y)},ltrim:function(e,t){return e.replace(RegExp("^["+(t||"\\s")+"]+","g"),"")},rtrim:function(e,t){return e.replace(RegExp("["+(t||"\\s")+"]+$","g"),"")},trim:function(e,t){return mxUtils.ltrim(mxUtils.rtrim(e,t),t)},isNumeric:function(e){return null!=e&&(null==e.length||0<e.length&&e.indexOf("0x")<0&&e.indexOf("0X")<0)&&!isNaN(e)},mod:function(e,t){return(e%t+t)%t},intersection:function(e,t,n,a,i,o,s,r){var l=(r-o)*(n-e)-(s-i)*(a-t);return s=((s-i)*(t-o)-(r-o)*(e-i))/l,i=((n-e)*(t-o)-(a-t)*(e-i))/l,0<=s&&s<=1&&0<=i&&i<=1?new mxPoint(e+s*(n-e),t+s*(a-t)):null},ptSegDistSq:function(e,t,n,a,i,o){return(i-=e)*(n-=e)+(o-=t)*(a-=t)<=0?n=0:n=(e=(i=n-i)*n+(o=a-o)*a)<=0?0:e*e/(n*n+a*a),(i=i*i+o*o-n)<0&&(i=0),i},relativeCcw:function(e,t,n,a,i,o){return 0==(e=(i-=e)*(a-=t)-(o-=t)*(n-=e))&&(0<(e=i*n+o*a)&&((e=(i-n)*n+(o-a)*a)<0&&(e=0))),e<0?-1:0<e?1:0},animateChanges:function(e,t){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(e,t,n){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(e,t,n,a,i,o){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(e,t){mxUtils.isVml(e)?e.style.filter=100<=t?null:"alpha(opacity="+t/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?e.style.filter=100<=t?null:"alpha(opacity="+t+")":e.style.opacity=t/100},createImage:function(e){var t=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((t=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",e),t.style.borderStyle="none"):((t=document.createElement("img")).setAttribute("src",e),t.setAttribute("border","0")),t},sortCells:function(e,i){i=null==i||i;var o=new mxDictionary;return e.sort(function(e,t){var n=o.get(e);null==n&&(n=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),o.put(e,n));var a=o.get(t);return null==a&&(a=mxCellPath.create(t).split(mxCellPath.PATH_SEPARATOR),o.put(t,a)),0==(n=mxCellPath.compare(n,a))?0:0<n==i?1:-1}),e},getStylename:function(e){return null!=e&&(e=e.split(";")[0]).indexOf("=")<0?e:""},getStylenames:function(e){var t=[];if(null!=e){e=e.split(";");for(var n=0;n<e.length;n++)e[n].indexOf("=")<0&&t.push(e[n])}return t},indexOfStylename:function(e,t){if(null!=e&&null!=t)for(var n=e.split(";"),a=0,i=0;i<n.length;i++){if(n[i]==t)return a;a+=n[i].length+1}return-1},addStylename:function(e,t){return mxUtils.indexOfStylename(e,t)<0&&(null==e?e="":0<e.length&&";"!=e.charAt(e.length-1)&&(e+=";"),e+=t),e},removeStylename:function(e,t){var n=[];if(null!=e)for(var a=e.split(";"),i=0;i<a.length;i++)a[i]!=t&&n.push(a[i]);return n.join(";")},removeAllStylenames:function(e){var t=[];if(null!=e){e=e.split(";");for(var n=0;n<e.length;n++)0<=e[n].indexOf("=")&&t.push(e[n])}return t.join(";")},setCellStyles:function(e,t,n,a){if(null!=t&&0<t.length){e.beginUpdate();try{for(var i=0;i<t.length;i++)if(null!=t[i]){var o=mxUtils.setStyle(e.getStyle(t[i]),n,a);e.setStyle(t[i],o)}}finally{e.endUpdate()}}},setStyle:function(e,t,n){var a=null!=n&&(void 0===n.length||0<n.length);if(null==e||0==e.length)a&&(e=t+"="+n);else{var i=e.indexOf(t+"=");i<0?a&&(a=";"==e.charAt(e.length-1)?"":";",e=e+a+t+"="+n):(t=a?t+"="+n:"",n=e.indexOf(";",i),a||n++,e=e.substring(0,i)+t+(i<n?e.substring(n):""))}return e},setCellStyleFlags:function(e,t,n,a,i){if(null!=t&&0<t.length){e.beginUpdate();try{for(var o=0;o<t.length;o++)if(null!=t[o]){var s=mxUtils.setStyleFlag(e.getStyle(t[o]),n,a,i);e.setStyle(t[o],s)}}finally{e.endUpdate()}}},setStyleFlag:function(e,t,n,a){if(null==e||0==e.length)e=a||null==a?t+"="+n:t+"=0";else{var i=e.indexOf(t+"=");if(i<0)i=";"==e.charAt(e.length-1)?"":";",e=a||null==a?e+i+t+"="+n:e+i+t+"=0";else{var o=e.indexOf(";",i),s="";s=o<0?e.substring(i+t.length+1):e.substring(i+t.length+1,o),s=null==a?parseInt(s)^n:a?parseInt(s)|n:parseInt(s)&~n;e=e.substring(0,i)+t+"="+s+(0<=o?e.substring(o):"")}}return e},getAlignmentAsPoint:function(e,t){var n=0,a=0;return e==mxConstants.ALIGN_CENTER?n=-.5:e==mxConstants.ALIGN_RIGHT&&(n=-1),t==mxConstants.ALIGN_MIDDLE?a=-.5:t==mxConstants.ALIGN_BOTTOM&&(a=-1),new mxPoint(n,a)},getSizeForString:function(e,t,n){t=null!=t?t:mxConstants.DEFAULT_FONTSIZE,n=null!=n?n:mxConstants.DEFAULT_FONTFAMILY;var a=document.createElement("div");return a.style.fontFamily=n,a.style.fontSize=Math.round(t)+"px",a.style.lineHeight=Math.round(t*mxConstants.LINE_HEIGHT)+"px",a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,document.body.appendChild(a),e=new mxRectangle(0,0,a.offsetWidth,a.offsetHeight),document.body.removeChild(a),e},getViewXml:function(e,t,n,a,i){a=null!=a?a:0,i=null!=i?i:0,t=null!=t?t:1,null==n&&(n=[e.getModel().getRoot()]);var o=e.getView(),s=null,r=o.isEventsEnabled();o.setEventsEnabled(!1);var l=o.drawPane,d=o.overlayPane;e.dialect==mxConstants.DIALECT_SVG?(o.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),o.canvas.appendChild(o.drawPane),o.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(o.drawPane=o.drawPane.cloneNode(!1),o.canvas.appendChild(o.drawPane),o.overlayPane=o.overlayPane.cloneNode(!1)),o.canvas.appendChild(o.overlayPane);var c=o.getTranslate();o.translate=new mxPoint(a,i),t=new mxTemporaryCellStates(e.getView(),t,n);try{s=(new mxCodec).encode(e.getView())}finally{t.destroy(),o.translate=c,o.canvas.removeChild(o.drawPane),o.canvas.removeChild(o.overlayPane),o.drawPane=l,o.overlayPane=d,o.setEventsEnabled(r)}return s},getScaleForPageCount:function(e,t,n,a){if(e<1)return 1;a=null!=a?a:0;var i=(n=null!=n?n:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*a;n=n.height-2*a,a=t.getGraphBounds().clone(),t=t.getView().getScale(),a.width/=t,a.height/=t,n=(t=a.width)/a.height/(i/n),a=Math.sqrt(e);var o=Math.sqrt(n);if(n=a*o,a/=o,n<1&&e<a){var s=a/e;a=e,n/=s}for(a<1&&e<n&&(s=n/e,n=e,a/=s),s=Math.ceil(n)*Math.ceil(a),o=0;e<s;){s=Math.floor(n)/n;var r=Math.floor(a)/a;if(1==s&&(s=Math.floor(n-1)/n),1==r&&(r=Math.floor(a-1)/a),n*=s=r<s?s:r,a*=s,s=Math.ceil(n)*Math.ceil(a),10<++o)break}return i*n/t*.99999},show:function(e,t,n,a){if(n=null!=n?n:0,a=null!=a?a:0,null==t?t=window.open().document:t.open(),n=-(i=e.getGraphBounds()).x+n,a=-i.y+a,mxClient.IS_IE){for(var i="<html><head>",o=document.getElementsByTagName("base"),s=0;s<o.length;s++)i+=o[s].outerHTML;for(i+="<style>",s=0;s<document.styleSheets.length;s++)try{i+=document.styleSheets(s).cssText}catch(e){}i+="</style></head>",i+="<body>",i+=e.container.innerHTML,i+="</body>",i+="<html>",t.writeln(i),t.close(),null!=(e=t.body.getElementsByTagName("DIV")[0])&&(e.style.position="absolute",e.style.left=n+"px",e.style.top=a+"px")}else{for(t.writeln("<html"),t.writeln("<head>"),o=document.getElementsByTagName("base"),s=0;s<o.length;s++)t.writeln(mxUtils.getOuterHtml(o[s]));for(o=document.getElementsByTagName("link"),s=0;s<o.length;s++)t.writeln(mxUtils.getOuterHtml(o[s]));for(o=document.getElementsByTagName("style"),s=0;s<o.length;s++)t.writeln(mxUtils.getOuterHtml(o[s]));for(t.writeln("</head>"),t.writeln("</html>"),t.close(),null==t.body&&t.documentElement.appendChild(t.createElement("body")),t.body.style.overflow="auto",e=e.container.firstChild;null!=e;)s=e.cloneNode(!0),t.body.appendChild(s),e=e.nextSibling;null!=(e=t.getElementsByTagName("g")[0])&&(e.setAttribute("transform","translate("+n+","+a+")"),(n=e.ownerSVGElement).setAttribute("width",i.width+Math.max(i.x,0)+3),n.setAttribute("height",i.height+Math.max(i.y,0)+3))}return mxUtils.removeCursors(t.body),t},printScreen:function(e){var t=window.open();mxUtils.show(e,t.document),e=function(){t.focus(),t.print(),t.close()},mxClient.IS_GC?t.setTimeout(e,500):e()},popup:function(e,t){if(t){var n=document.createElement("div");n.style.overflow="scroll",n.style.width="636px",n.style.height="460px";var a=document.createElement("pre");a.innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g," "),n.appendChild(a),(n=new mxWindow("Popup Window",n,document.body.clientWidth/2-320,(document.body.clientHeight||document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),n.setVisible(!0)}else mxClient.IS_NS?((n=window.open()).document.writeln("<pre>"+mxUtils.htmlEntities(e)+"</pre"),n.document.close()):((a=(n=window.open()).document.createElement("pre")).innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g," "),n.document.body.appendChild(a))},alert:function(e){alert(e)},prompt:function(e,t){return prompt(e,t)},confirm:function(e){return confirm(e)},error:function(e,t,n,a){var i=document.createElement("div");i.style.padding="20px";var o=document.createElement("img");o.setAttribute("src",a||mxUtils.errorImage),o.setAttribute("valign","bottom"),o.style.verticalAlign="middle",i.appendChild(o),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),mxUtils.write(i,e),e=document.body.clientWidth,a=document.body.clientHeight||document.documentElement.clientHeight;var s=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,i,(e-t)/2,a/4,t,null,!1,!0);return n&&(mxUtils.br(i),t=document.createElement("p"),n=document.createElement("button"),mxClient.IS_IE?n.style.cssText="float:right":n.setAttribute("style","float:right"),mxEvent.addListener(n,"click",function(e){s.destroy()}),mxUtils.write(n,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),t.appendChild(n),i.appendChild(t),mxUtils.br(i),s.setClosable(!0)),s.setVisible(!0),s},makeDraggable:function(e,t,n,i,a,o,s,r,l,d){return(e=new mxDragSource(e,n)).dragOffset=new mxPoint(null!=a?a:0,null!=o?o:mxConstants.TOOLTIP_VERTICAL_OFFSET),e.autoscroll=s,e.setGuidesEnabled(!1),null!=l&&(e.highlightDropTargets=l),null!=d&&(e.getDropTarget=d),e.getGraphForEvent=function(e){return"function"==typeof t?t(e):t},null!=i&&(e.createDragElement=function(){return i.cloneNode(!0)},r&&(e.createPreviewElement=function(e){var t=i.cloneNode(!0),n=parseInt(t.style.width),a=parseInt(t.style.height);return t.style.width=Math.round(n*e.view.scale)+"px",t.style.height=Math.round(a*e.view.scale)+"px",t})),e}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",HIGHLIGHT_STROKEWIDTH:3,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_BEND_HANDLE:"pointer",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:7,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,LINE_HEIGHT:1.2,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:10,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,826,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,826),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_OPACITY:"opacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_SMOOTH:"smooth",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_LOOP:"loopStyle",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_SHADOW:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_BLOCK:"block",ARROW_OPEN:"open",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(e){this.name=e,this.properties=[];for(var t=1;t<arguments.length;t+=2)null!=arguments[t+1]&&(this.properties[arguments[t]]=arguments[t+1])}function mxMouseEvent(e,t){this.evt=e,this.state=t}function mxEventSource(e){this.setEventSource(e)}mxEventObject.prototype.name=null,mxEventObject.prototype.properties=null,mxEventObject.prototype.consumed=!1,mxEventObject.prototype.getName=function(){return this.name},mxEventObject.prototype.getProperties=function(){return this.properties},mxEventObject.prototype.getProperty=function(e){return this.properties[e]},mxEventObject.prototype.isConsumed=function(){return this.consumed},mxEventObject.prototype.consume=function(){this.consumed=!0},mxMouseEvent.prototype.consumed=!1,mxMouseEvent.prototype.evt=null,mxMouseEvent.prototype.graphX=null,mxMouseEvent.prototype.graphY=null,mxMouseEvent.prototype.state=null,mxMouseEvent.prototype.getEvent=function(){return this.evt},mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)},mxMouseEvent.prototype.isSource=function(e){if(null!=e)for(var t=this.getSource();null!=t;){if(t==e.node)return!0;t=t.parentNode}return!1},mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())},mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())},mxMouseEvent.prototype.getGraphX=function(){return this.graphX},mxMouseEvent.prototype.getGraphY=function(){return this.graphY},mxMouseEvent.prototype.getState=function(){return this.state},mxMouseEvent.prototype.getCell=function(){var e=this.getState();return null!=e?e.cell:null},mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())},mxMouseEvent.prototype.isConsumed=function(){return this.consumed},mxMouseEvent.prototype.consume=function(e){(null==e||e)&&this.evt.preventDefault&&this.evt.preventDefault(),this.evt.returnValue=!1,this.consumed=!0},mxEventSource.prototype.eventListeners=null,mxEventSource.prototype.eventsEnabled=!0,mxEventSource.prototype.eventSource=null,mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled},mxEventSource.prototype.setEventsEnabled=function(e){this.eventsEnabled=e},mxEventSource.prototype.getEventSource=function(){return this.eventSource},mxEventSource.prototype.setEventSource=function(e){this.eventSource=e},mxEventSource.prototype.addListener=function(e,t){null==this.eventListeners&&(this.eventListeners=[]),this.eventListeners.push(e),this.eventListeners.push(t)},mxEventSource.prototype.removeListener=function(e){if(null!=this.eventListeners)for(var t=0;t<this.eventListeners.length;)this.eventListeners[t+1]==e?this.eventListeners.splice(t,2):t+=2},mxEventSource.prototype.fireEvent=function(e,t){if(null!=this.eventListeners&&this.isEventsEnabled()){null==e&&(e=new mxEventObject),null==t&&(t=this.getEventSource()),null==t&&(t=this);for(var n=[t,e],a=0;a<this.eventListeners.length;a+=2){var i=this.eventListeners[a];(null==i||i==e.getName())&&this.eventListeners[a+1].apply(this,n)}}};var mxEvent={objects:[],addListener:function(){var a=function(e,t,n){null==e.mxListenerList&&(e.mxListenerList=[],mxEvent.objects.push(e)),e.mxListenerList.push({name:t,f:n})};return window.addEventListener?function(e,t,n){e.addEventListener(t,n,!1),a(e,t,n)}:function(e,t,n){e.attachEvent("on"+t,n),a(e,t,n)}}(),removeListener:function(){var a=function(e,t,n){if(null!=e.mxListenerList){t=e.mxListenerList.length;for(var a=0;a<t;a++)if(e.mxListenerList[a].f==n){e.mxListenerList.splice(a,1);break}0==e.mxListenerList.length&&(e.mxListenerList=null)}};return window.removeEventListener?function(e,t,n){e.removeEventListener(t,n,!1),a(e,t,n)}:function(e,t,n){e.detachEvent("on"+t,n),a(e,t,n)}}(),removeAllListeners:function(e){var t=e.mxListenerList;if(null!=t)for(;0<t.length;){var n=t[0];mxEvent.removeListener(e,n.name,n.f)}},addGestureListeners:function(e,t,n,a){null!=t&&mxEvent.addListener(e,"mousedown",t),null!=n&&mxEvent.addListener(e,"mousemove",n),null!=a&&mxEvent.addListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=t&&mxEvent.addListener(e,"touchstart",t),null!=n&&mxEvent.addListener(e,"touchmove",n),null!=a&&mxEvent.addListener(e,"touchend",a))},removeGestureListeners:function(e,t,n,a){null!=t&&mxEvent.removeListener(e,"mousedown",t),null!=n&&mxEvent.removeListener(e,"mousemove",n),null!=a&&mxEvent.removeListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=t&&mxEvent.removeListener(e,"touchstart",t),null!=n&&mxEvent.removeListener(e,"touchmove",n),null!=a&&mxEvent.removeListener(e,"touchend",a))},redirectMouseEvents:function(e,n,t,a,i,o,s){var r=function(e){return"function"==typeof t?t(e):t};mxEvent.addGestureListeners(e,function(e){null!=a?a(e):mxEvent.isConsumed(e)||n.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,r(e)))},function(e){null!=i?i(e):mxEvent.isConsumed(e)||n.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,r(e)))},function(e){null!=o?o(e):mxEvent.isConsumed(e)||n.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,r(e)))}),mxEvent.addListener(e,"dblclick",function(e){if(null!=s)s(e);else if(!mxEvent.isConsumed(e)){var t=r(e);n.dblClick(e,null!=t?t.cell:null)}})},release:function(e){if(null!=e&&(mxEvent.removeAllListeners(e),null!=(e=e.childNodes)))for(var t=e.length,n=0;n<t;n+=1)mxEvent.release(e[n])},addMouseWheelListener:function(n){if(null!=n){var e=function(e){null==e&&(e=window.event);var t=0;0!=(t=!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC?e.wheelDelta/120:-e.detail/2)&&n(e,0<t)};mxClient.IS_NS?mxEvent.addListener(window,mxClient.IS_SF||mxClient.IS_GC?"mousewheel":"DOMMouseScroll",e):mxEvent.addListener(document,"mousewheel",e)}},disableContextMenu:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){mxEvent.addListener(e,"contextmenu",function(){return!1})}:function(e){e.setAttribute("oncontextmenu","return false;")},getSource:function(e){return null!=e.srcElement?e.srcElement:e.target},isConsumed:function(e){return null!=e.isConsumed&&e.isConsumed},isLeftMouseButton:function(e){return e.button==(mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?1:0)},isRightMouseButton:function(e){return 2==e.button},isPopupTrigger:function(e){return mxEvent.isRightMouseButton(e)||mxEvent.isShiftDown(e)&&!mxEvent.isControlDown(e)},isShiftDown:function(e){return null!=e&&e.shiftKey},isAltDown:function(e){return null!=e&&e.altKey},isControlDown:function(e){return null!=e&&e.ctrlKey},isMetaDown:function(e){return null!=e&&e.metaKey},getMainEvent:function(e){return"touchstart"!=e.type&&"touchmove"!=e.type||null==e.touches||null==e.touches[0]?"touchend"==e.type&&null!=e.changedTouches&&null!=e.changedTouches[0]&&(e=e.changedTouches[0]):e=e.touches[0],e},getClientX:function(e){return mxEvent.getMainEvent(e).clientX},getClientY:function(e){return mxEvent.getMainEvent(e).clientY},consume:function(e,t,n){n=null==n||n,(null==t||t)&&(e.preventDefault?(n&&e.stopPropagation(),e.preventDefault()):n&&(e.cancelBubble=!0)),e.isConsumed=!0,e.returnValue=!1},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",SESSION:"session",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",CLICK:"click",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset"};function mxXmlRequest(e,t,n,a,i,o){this.url=e,this.params=t,this.method=n||"POST",this.async=null==a||a,this.username=i,this.password=o}mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(e){this.binary=e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var e=this.getXml();return null!=e?e.documentElement:null},mxXmlRequest.prototype.getXml=function(){var e=this.request.responseXML;return(9<=document.documentMode||null==e||null==e.documentElement)&&(e=mxUtils.parseXml(this.request.responseText)),e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.getStatus=function(){return this.request.status},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var e=new XMLHttpRequest;return this.isBinary()&&e.overrideMimeType&&e.overrideMimeType("text/plain; charset=x-user-defined"),e}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(e,t){this.request=this.create(),null!=this.request&&(null!=e&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&(e(this),this.onreadystatechaange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(e,t){null!=t&&e.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(e,t){var n=null;(e=e||document)==document&&(n=window.onbeforeunload,window.onbeforeunload=null);var a=e.createElement("form");a.setAttribute("method",this.method),a.setAttribute("action",this.url),null!=t&&a.setAttribute("target",t),a.style.display="none",a.style.visibility="hidden";for(var i=0<this.params.indexOf("&")?this.params.split("&"):this.params.split(),o=0;o<i.length;o++){if(0<(s=i[o].indexOf("="))){var s,r=i[o].substring(0,s),l=i[o].substring(s+1);(s=e.createElement("textarea")).setAttribute("name",r),l=l.replace(/\n/g,"
"),r=e.createTextNode(l),s.appendChild(r),a.appendChild(s)}}e.body.appendChild(a),a.submit(),e.body.removeChild(a),null!=n&&(window.onbeforeunload=n)};var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,isEmpty:function(){return null==mxClipboard.cells},cut:function(e,t){return t=mxClipboard.copy(e,t),mxClipboard.insertCount=0,mxClipboard.removeCells(e,t),t},removeCells:function(e,t){e.removeCells(t)},copy:function(e,t){t=t||e.getSelectionCells();var n=e.getExportableCells(t);return mxClipboard.insertCount=1,mxClipboard.cells=e.cloneCells(n),n},paste:function(e){if(null!=mxClipboard.cells){var t=e.getImportableCells(mxClipboard.cells),n=mxClipboard.insertCount*mxClipboard.STEPSIZE,a=e.getDefaultParent();t=e.importCells(t,n,n,a);mxClipboard.insertCount++,e.setSelectionCells(t)}}};function mxWindow(e,t,n,a,i,o,s,r,l,d){null!=t&&(s=null==s||s,this.content=t,this.init(n,a,i,o,d),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(s),this.setTitle(e),(null==r||r)&&this.installMoveHandler(),null!=l&&null!=l.parentNode?l.parentNode.replaceChild(this.div,l):document.body.appendChild(this.div))}function mxForm(e){this.table=document.createElement("table"),this.table.className=e,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(e,t,n){this.src=e,this.width=t,this.height=n}function mxDivResizer(e,t){if("div"==e.nodeName.toLowerCase()){null==t&&(t=window),this.div=e;var n=mxUtils.getCurrentStyle(e);null!=n&&(this.resizeWidth="auto"==n.width,this.resizeHeight="auto"==n.height),mxEvent.addListener(t,"resize",mxUtils.bind(this,function(e){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize()}}function mxDragSource(e,t){this.element=e,this.dropHandler=t,mxEvent.addGestureListeners(e,mxUtils.bind(this,this.mouseDown))}function mxToolbar(e){this.container=e}function mxSession(t,e,n,a){this.model=t,this.urlInit=e,this.urlPoll=n,this.urlNotify=a,null!=t&&(this.codec=new mxCodec,this.codec.lookup=function(e){return t.getCell(e)}),t.addListener(mxEvent.NOTIFY,mxUtils.bind(this,function(e,t){var n=t.getProperty("edit");(null!=n&&this.debug||this.connected&&!this.suspended)&&this.notify("<edit>"+this.encodeChanges(n.changes,n.undone)+"</edit>")}))}function mxUndoableEdit(e,t){this.source=e,this.changes=[],this.significant=null==t||t}function mxUndoManager(e){this.size=null!=e?e:100,this.clear()}mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.content=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.title=!1,mxWindow.prototype.content=!1,mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.init=function(e,t,n,a,i){i=null!=i?i:"mxWindow",this.div=document.createElement("div"),this.div.className=i,this.div.style.left=e+"px",this.div.style.top=t+"px",this.table=document.createElement("table"),this.table.className=i,null!=n&&(mxClient.IS_IE||(this.div.style.width=n+"px"),this.table.style.width=n+"px"),null!=a&&(mxClient.IS_IE||(this.div.style.height=a+"px"),this.table.style.height=a+"px"),e=document.createElement("tbody"),t=document.createElement("tr"),this.title=document.createElement("td"),this.title.className=i+"Title",t.appendChild(this.title),e.appendChild(t),t=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=i+"Pane",this.contentWrapper=document.createElement("div"),this.contentWrapper.className=i+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_IE||"DIV"!=this.content.nodeName.toUpperCase())&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),t.appendChild(this.td),e.appendChild(t),this.table.appendChild(e),this.div.appendChild(this.table),i=mxUtils.bind(this,function(e){this.activate()}),mxEvent.addListener(this.title,"mousedown",i),mxEvent.addListener(this.table,"mousedown",i),mxClient.IS_TOUCH&&(mxEvent.addListener(this.title,"touchstart",i),mxEvent.addListener(this.table,"touchstart",i)),this.hide()},mxWindow.prototype.setTitle=function(e){for(var t=this.title.firstChild;null!=t;){var n=t.nextSibling;t.nodeType==mxConstants.NODETYPE_TEXT&&t.parentNode.removeChild(t),t=n}mxUtils.write(this.title,e||"")},mxWindow.prototype.setScrollable=function(e){navigator.userAgent.indexOf("Presto/2.5")<0&&(this.contentWrapper.style.overflow=e?"auto":"hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var e=null!=(e=mxUtils.getCurrentStyle(this.getElement()))?e.zIndex:3;if(mxWindow.activeWindow){var t=mxWindow.activeWindow.getElement();null!=t&&null!=t.style&&(t.style.zIndex=e)}t=mxWindow.activeWindow,this.getElement().style.zIndex=parseInt(e)+1,(mxWindow.activeWindow=this).fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",t))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(e){e?null==this.resize?(this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",mxClient.imageBasePath+"/resize.gif"),this.resize.style.cursor="nw-resize",mxEvent.addGestureListeners(this.resize,mxUtils.bind(this,function(e){this.activate();var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),o=this.div.offsetWidth,s=this.div.offsetHeight,t=mxUtils.bind(this,function(e){var t=mxEvent.getClientX(e)-a,n=mxEvent.getClientY(e)-i;this.setSize(o+t,s+n),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",e)),mxEvent.consume(e)}),n=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",e)),mxEvent.consume(e)}),null,null),this.div.appendChild(this.resize)):this.resize.style.display="inline":null!=this.resize&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(e,t){e=Math.max(this.minimumSize.width,e),t=Math.max(this.minimumSize.height,t),mxClient.IS_IE||(this.div.style.width=e+"px",this.div.style.height=t+"px"),this.table.style.width=e+"px",this.table.style.height=t+"px",mxClient.IS_IE||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")},mxWindow.prototype.setMinimizable=function(e){this.minimize.style.display=e?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("align","right"),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginRight="1px",this.minimize.style.display="none",this.title.appendChild(this.minimize);var n=!1,a=null,i=null,e=mxUtils.bind(this,function(e){if(this.activate(),n)n=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=a,mxClient.IS_IE||(this.div.style.height=i),this.table.style.height=i,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{n=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",a=this.maximize.style.display,this.maximize.style.display="none",i=this.table.style.height;var t=this.getMinimumSize();0<t.height&&(mxClient.IS_IE||(this.div.style.height=t.height+"px"),this.table.style.height=t.height+"px"),0<t.width&&(mxClient.IS_IE||(this.div.style.width=t.width+"px"),this.table.style.width=t.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",e))}mxEvent.consume(e)});mxEvent.addListener(this.minimize,"mousedown",e),mxClient.IS_TOUCH&&mxEvent.addListener(this.minimize,"touchstart",e)},mxWindow.prototype.setMaximizable=function(e){this.maximize.style.display=e?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("align","right"),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="1px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.title.appendChild(this.maximize);var n=!1,a=null,i=null,o=null,s=null,e=mxUtils.bind(this,function(e){if(this.activate(),"none"!=this.maximize.style.display){if(n)n=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.visibility="",this.div.style.left=a+"px",this.div.style.top=i+"px",mxClient.IS_IE||(this.div.style.height=o,this.div.style.width=s,"auto"!=(t=mxUtils.getCurrentStyle(this.contentWrapper)).overflow&&null==this.resize)||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.table.style.height=o,this.table.style.width=s,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{if(n=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",this.minimize.style.visibility="hidden",a=parseInt(this.div.style.left),i=parseInt(this.div.style.top),o=this.table.style.height,s=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px",mxClient.IS_IE||(this.div.style.height=document.body.clientHeight-2+"px",this.div.style.width=document.body.clientWidth-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=document.body.clientHeight-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),!mxClient.IS_IE){var t=mxUtils.getCurrentStyle(this.contentWrapper);"auto"!=t.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")}this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",e))}mxEvent.consume(e)}});mxEvent.addGestureListeners(this.maximize,e),mxEvent.addListener(this.title,"dblclick",e)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(e){var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),o=this.getX(),s=this.getY(),t=mxUtils.bind(this,function(e){var t=mxEvent.getClientX(e)-a,n=mxEvent.getClientY(e)-i;this.setLocation(o+t,s+n),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",e)),mxEvent.consume(e)}),n=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",e)),mxEvent.consume(e)}))},mxWindow.prototype.setLocation=function(e,t){this.div.style.left=e+"px",this.div.style.top=t+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("align","right"),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.title.insertBefore(this.closeImg,this.title.firstChild),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",e)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(e)}))},mxWindow.prototype.setImage=function(e){this.image=document.createElement("img"),this.image.setAttribute("src",e),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(e){this.closeImg.style.display=e?"":"none"},mxWindow.prototype.isVisible=function(){return null!=this.div&&"hidden"!=this.div.style.visibility},mxWindow.prototype.setVisible=function(e){null!=this.div&&this.isVisible()!=e&&(e?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.visibility="",this.activate();var e=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_IE||"auto"!=e.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.visibility="hidden",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.contentWrapper=this.content=this.title=null},mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(e,t){var n=document.createElement("tr"),a=document.createElement("td");n.appendChild(a);a=document.createElement("td");var i=document.createElement("button");mxUtils.write(i,mxResources.get("ok")||"OK"),a.appendChild(i),mxEvent.addListener(i,"click",function(){e()}),i=document.createElement("button"),mxUtils.write(i,mxResources.get("cancel")||"Cancel"),a.appendChild(i),mxEvent.addListener(i,"click",function(){t()}),n.appendChild(a),this.body.appendChild(n)},mxForm.prototype.addText=function(e,t){var n=document.createElement("input");return n.setAttribute("type","text"),n.value=t,this.addField(e,n)},mxForm.prototype.addCheckbox=function(e,t){var n=document.createElement("input");return n.setAttribute("type","checkbox"),this.addField(e,n),t&&(n.checked=!0),n},mxForm.prototype.addTextarea=function(e,t,n){var a=document.createElement("textarea");return mxClient.IS_NS&&n--,a.setAttribute("rows",n||2),a.value=t,this.addField(e,a)},mxForm.prototype.addCombo=function(e,t,n){var a=document.createElement("select");return null!=n&&a.setAttribute("size",n),t&&a.setAttribute("multiple","true"),this.addField(e,a)},mxForm.prototype.addOption=function(e,t,n,a){var i=document.createElement("option");mxUtils.writeln(i,t),i.setAttribute("value",n),a&&i.setAttribute("selected",a),e.appendChild(i)},mxForm.prototype.addField=function(e,t){var n=document.createElement("tr"),a=document.createElement("td");return mxUtils.write(a,e),n.appendChild(a),(a=document.createElement("td")).appendChild(t),n.appendChild(a),this.body.appendChild(n),t},mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var e=this.getDocumentWidth(),t=this.getDocumentHeight(),n=parseInt(this.div.style.left),a=parseInt(this.div.style.right),i=parseInt(this.div.style.top),o=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(n)&&!isNaN(a)&&0<=n&&0<=a&&0<e-a-n&&(this.div.style.width=e-a-n+"px"),this.resizeHeight&&!isNaN(i)&&!isNaN(o)&&0<=i&&0<=o&&0<t-i-o&&(this.div.style.height=t-i-o+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(e){this.enabled=e},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(e){this.guidesEnabled=e},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxDragSource.prototype.getGraphForEvent=function(e){return null},mxDragSource.prototype.getDropTarget=function(e,t,n){return e.getCellAt(t,n)},mxDragSource.prototype.createDragElement=function(e){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(e){return null},mxDragSource.prototype.mouseDown=function(e){this.enabled&&!mxEvent.isConsumed(e)&&null==this.mouseMoveHandler&&(this.startDrag(e),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxEvent.consume(e,!0,!1))},mxDragSource.prototype.startDrag=function(e){this.dragElement=this.createDragElement(e),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity)},mxDragSource.prototype.stopDrag=function(e){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.graphContainsEvent=function(e,t){var n=mxEvent.getClientX(t),a=mxEvent.getClientY(t),i=mxUtils.getOffset(e.container),o=mxUtils.getScrollOrigin();return n>=i.x-o.x&&a>=i.y-o.y&&n<=i.x-o.x+e.container.offsetWidth&&a<=i.y-o.y+e.container.offsetHeight},mxDragSource.prototype.mouseMove=function(e){if(null!=(t=this.getGraphForEvent(e))&&!this.graphContainsEvent(t,e)&&(t=null),t!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph),this.currentGraph=t,null!=this.currentGraph&&this.dragEnter(this.currentGraph)),null!=this.currentGraph&&this.dragOver(this.currentGraph,e),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility="hidden");else{var t=mxEvent.getClientX(e),n=mxEvent.getClientY(e);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(t+=this.dragOffset.x,n+=this.dragOffset.y),t+=document.body.scrollLeft||document.documentElement.scrollLeft,n+=document.body.scrollTop||document.documentElement.scrollTop,this.dragElement.style.left=t+"px",this.dragElement.style.top=n+"px"}mxEvent.consume(e)},mxDragSource.prototype.mouseUp=function(e){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var t=this.currentGraph.view.scale,n=this.currentGraph.view.translate;this.drop(this.currentGraph,e,this.currentDropTarget,this.currentPoint.x/t-n.x,this.currentPoint.y/t-n.y)}this.dragExit(this.currentGraph)}this.stopDrag(e),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.currentGraph=this.mouseUpHandler=this.mouseMoveHandler=null,mxEvent.consume(e)},mxDragSource.prototype.dragEnter=function(e){e.isMouseDown=!0,this.previewElement=this.createPreviewElement(e),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(e,e.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(e,mxConstants.DROP_TARGET_COLOR))},mxDragSource.prototype.dragExit=function(e){this.currentPoint=this.currentDropTarget=null,e.isMouseDown=!1,null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(e,t){var n=mxUtils.getOffset(e.container),a=mxUtils.getScrollOrigin(e.container),i=mxEvent.getClientX(t)-n.x+a.x;n=mxEvent.getClientY(t)-n.y+a.y;if(e.autoScroll&&(null==this.autoscroll||this.autoscroll)&&e.scrollPointToVisible(i,n,e.autoExtend),null!=this.currentHighlight&&e.isDropEnabled()&&(this.currentDropTarget=this.getDropTarget(e,i,n),a=e.getView().getState(this.currentDropTarget),this.currentHighlight.highlight(a)),null!=this.previewElement){null==this.previewElement.parentNode&&(e.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");a=this.isGridEnabled()&&e.isGridEnabledEvent(t);var o=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(t))o=new mxRectangle(0,0,o=parseInt(this.previewElement.style.width),s=parseInt(this.previewElement.style.height)),n=new mxPoint(i,n),n=this.currentGuide.move(o,n,a),o=!1,i=n.x,n=n.y;else if(a){a=e.view.scale;var s=e.view.translate,r=e.gridSize/2;i=(e.snap(i/a-s.x-r)+s.x)*a,n=(e.snap(n/a-s.y-r)+s.y)*a}null!=this.currentGuide&&o&&this.currentGuide.hide(),null!=this.previewOffset&&(i+=this.previewOffset.x,n+=this.previewOffset.y),this.previewElement.style.left=Math.round(i)+"px",this.previewElement.style.top=Math.round(n)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(i,n)},mxDragSource.prototype.drop=function(e,t,n,a,i){this.dropHandler(e,t,n,a,i),e.container.focus()},mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(e,t,n,a,i,o){var s=document.createElement(null!=t?"img":"button"),r=i||(null!=o?"mxToolbarMode":"mxToolbarItem");return s.className=r,s.setAttribute("src",t),null!=e&&(null!=t?s.setAttribute("title",e):mxUtils.write(s,e)),this.container.appendChild(s),null!=n&&(mxEvent.addListener(s,"click",n),mxClient.IS_TOUCH&&mxEvent.addListener(s,"touchend",n)),e=mxUtils.bind(this,function(e){null!=a?s.setAttribute("src",t):s.style.backgroundColor=""}),mxEvent.addGestureListeners(s,mxUtils.bind(this,function(e){if(null!=a?s.setAttribute("src",a):s.style.backgroundColor="gray",null!=o){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var t=this.currentImg;this.menu.isMenuShowing()&&this.menu.hideMenu(),t!=s&&(this.currentImg=s,this.menu.factoryMethod=o,t=new mxPoint(s.offsetLeft,s.offsetTop+s.offsetHeight),this.menu.popup(t.x,t.y,null,e),this.menu.isMenuShowing()&&(s.className=r+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),s.className=r,this.currentImg=null}))}}),null,e),mxEvent.addListener(s,"mouseout",e),s},mxToolbar.prototype.addCombo=function(e){var t=document.createElement("div");t.style.display="inline",t.className="mxToolbarComboContainer";var n=document.createElement("select");return n.className=e||"mxToolbarCombo",t.appendChild(n),this.container.appendChild(t),n},mxToolbar.prototype.addActionCombo=function(e,t){var n=document.createElement("select");return n.className=t||"mxToolbarCombo",this.addOption(n,e,null),mxEvent.addListener(n,"change",function(e){var t=n.options[n.selectedIndex];n.selectedIndex=0,null!=t.funct&&t.funct(e)}),this.container.appendChild(n),n},mxToolbar.prototype.addOption=function(e,t,n){var a=document.createElement("option");return mxUtils.writeln(a,t),"function"==typeof n?a.funct=n:a.setAttribute("value",n),e.appendChild(a),a},mxToolbar.prototype.addSwitchMode=function(e,t,n,a,i){var o=document.createElement("img");return o.initialClassName=i||"mxToolbarMode",o.className=o.initialClassName,o.setAttribute("src",t),o.altIcon=a,null!=e&&o.setAttribute("title",e),mxEvent.addListener(o,"click",mxUtils.bind(this,function(e){null!=(e=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=o),null!=(e=(this.selectedMode=o).altIcon)?(o.altIcon=o.getAttribute("src"),o.setAttribute("src",e)):o.className=o.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),n()})),this.container.appendChild(o),null==this.defaultMode&&(this.defaultMode=o,this.selectMode(o),n()),o},mxToolbar.prototype.addMode=function(e,t,n,a,i,o){o=null==o||o;var s=document.createElement(null!=t?"img":"button");return s.initialClassName=i||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",t),s.altIcon=a,null!=e&&s.setAttribute("title",e),this.enabled&&o&&(mxEvent.addListener(s,"click",mxUtils.bind(this,function(e){this.selectMode(s,n),this.noReset=!1})),mxEvent.addListener(s,"dblclick",mxUtils.bind(this,function(e){this.selectMode(s,n),this.noReset=!0})),null==this.defaultMode&&(this.defaultMode=s,this.defaultFunction=n,this.selectMode(s,n))),this.container.appendChild(s),s},mxToolbar.prototype.selectMode=function(e,t){if(this.selectedMode!=e){if(null!=this.selectedMode){var n=this.selectedMode.altIcon;null!=n?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=e,null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",t))}},mxToolbar.prototype.resetMode=function(e){(e||!this.noReset)&&this.selectedMode!=this.defaultMode&&this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(e){return this.addItem(null,e,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var e=document.createElement("hr");e.style.marginRight="6px",e.setAttribute("size","1"),this.container.appendChild(e)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.selectedMode=this.defaultFunction=this.defaultMode=this.container=null,null!=this.menu&&this.menu.destroy()},mxSession.prototype=new mxEventSource,mxSession.prototype.constructor=mxSession,mxSession.prototype.model=null,mxSession.prototype.urlInit=null,mxSession.prototype.urlPoll=null,mxSession.prototype.urlNotify=null,mxSession.prototype.codec=null,mxSession.prototype.linefeed="
",mxSession.prototype.escapePostData=!0,mxSession.prototype.significantRemoteChanges=!0,mxSession.prototype.sent=0,mxSession.prototype.received=0,mxSession.prototype.debug=!1,mxSession.prototype.connected=!1,mxSession.prototype.suspended=!1,mxSession.prototype.polling=!1,mxSession.prototype.start=function(){this.debug?(this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT))):this.connected||this.get(this.urlInit,mxUtils.bind(this,function(e){this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT)),this.poll()}))},mxSession.prototype.suspend=function(){this.connected&&!this.suspended&&(this.suspended=!0,this.fireEvent(new mxEventObject(mxEvent.SUSPEND)))},mxSession.prototype.resume=function(e,t,n){this.connected&&this.suspended&&(this.suspended=!1,this.fireEvent(new mxEventObject(mxEvent.RESUME)),this.polling||this.poll())},mxSession.prototype.stop=function(e){this.connected&&(this.connected=!1),this.fireEvent(new mxEventObject(mxEvent.DISCONNECT,"reason",e))},mxSession.prototype.poll=function(){this.connected&&!this.suspended&&null!=this.urlPoll?(this.polling=!0,this.get(this.urlPoll,mxUtils.bind(this,function(){this.poll()}))):this.polling=!1},mxSession.prototype.notify=function(e,t,n){null!=e&&0<e.length&&(null!=this.urlNotify&&(this.debug?(mxLog.show(),mxLog.debug("mxSession.notify: "+this.urlNotify+" xml="+e)):(e="<message><delta>"+e+"</delta></message>",this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(this.urlNotify,"xml="+e,t,n))),this.sent+=e.length,this.fireEvent(new mxEventObject(mxEvent.NOTIFY,"url",this.urlNotify,"xml",e)))},mxSession.prototype.get=function(n,a,t){if(void 0!==mxUtils){var i=mxUtils.bind(this,function(e){null!=t?t(e):this.stop(e)});mxUtils.get(n,mxUtils.bind(this,function(e){if(void 0!==mxUtils)if(e.isReady()&&404!=e.getStatus()){if(this.received+=e.getText().length,this.fireEvent(new mxEventObject(mxEvent.GET,"url",n,"request",e)),this.isValidResponse(e)){if(0<e.getText().length){var t=e.getDocumentElement();null==t?i("Invalid response: "+e.getText()):this.receive(t)}null!=a&&a(e)}}else i("Response not ready")}),function(e){i("Transmission error")})}},mxSession.prototype.isValidResponse=function(e){return e.getText().indexOf("<?php")<0},mxSession.prototype.encodeChanges=function(e,t){for(var n="",a=t?-1:1,i=t?e.length-1:0;0<=i&&i<e.length;i+=a){var o=this.codec.encode(e[i]);n=n+mxUtils.getXml(o,this.linefeed)}return n},mxSession.prototype.receive=function(e){if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){var t=e.getAttribute("namespace");for(null!=t&&(this.model.prefix=t+"-"),t=e.firstChild;null!=t;){var n=t.nodeName.toLowerCase();"state"==n?this.processState(t):"delta"==n&&this.processDelta(t),t=t.nextSibling}this.fireEvent(new mxEventObject(mxEvent.RECEIVE,"node",e))}},mxSession.prototype.processState=function(e){new mxCodec(e.ownerDocument).decode(e.firstChild,this.model)},mxSession.prototype.processDelta=function(e){for(e=e.firstChild;null!=e;)"edit"==e.nodeName&&this.processEdit(e),e=e.nextSibling},mxSession.prototype.processEdit=function(e){if(0<(e=this.decodeChanges(e)).length){var t=this.createUndoableEdit(e);this.model.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",t,"changes",e)),this.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t)),this.fireEvent(new mxEventObject(mxEvent.FIRED,"edit",t))}},mxSession.prototype.createUndoableEdit=function(e){var t=new mxUndoableEdit(this.model,this.significantRemoteChanges);return t.changes=e,t.notify=function(){t.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",t,"changes",t.changes)),t.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",t,"changes",t.changes))},t},mxSession.prototype.decodeChanges=function(e){this.codec.document=e.ownerDocument;var t=[];for(e=e.firstChild;null!=e;){var n=this.decodeChange(e);null!=n&&t.push(n),e=e.nextSibling}return t},mxSession.prototype.decodeChange=function(e){var t=null;return e.nodeType==mxConstants.NODETYPE_ELEMENT&&(null!=(t="mxRootChange"==e.nodeName?new mxCodec(e.ownerDocument).decode(e):this.codec.decode(e))&&(t.model=this.model,t.execute(),"mxChildChange"==e.nodeName&&null==t.parent&&this.cellRemoved(t.child))),t},mxSession.prototype.cellRemoved=function(e,t){this.codec.putObject(e.getId(),e);for(var n=this.model.getChildCount(e),a=0;a<n;a++)this.cellRemoved(this.model.getChildAt(e,a))},mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(e){this.changes.push(e)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length-1;0<=e;e--){var t=this.changes[e];null!=t.execute?t.execute():null!=t.undo&&t.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",t))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length,t=0;t<e;t++){var n=this.changes[t];null!=n.execute?n.execute():null!=n.redo&&n.redo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",n))}this.undone=!1,this.redone=!0,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoManager.prototype=new mxEventSource,mxUndoManager.prototype.constructor=mxUndoManager,mxUndoManager.prototype.size=null,mxUndoManager.prototype.history=null,mxUndoManager.prototype.indexOfNextAdd=0,mxUndoManager.prototype.isEmpty=function(){return 0==this.history.length},mxUndoManager.prototype.clear=function(){this.history=[],this.indexOfNextAdd=0,this.fireEvent(new mxEventObject(mxEvent.CLEAR))},mxUndoManager.prototype.canUndo=function(){return 0<this.indexOfNextAdd},mxUndoManager.prototype.undo=function(){for(;0<this.indexOfNextAdd;){var e=this.history[--this.indexOfNextAdd];if(e.undo(),e.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length},mxUndoManager.prototype.redo=function(){for(var e=this.history.length;this.indexOfNextAdd<e;){var t=this.history[this.indexOfNextAdd++];if(t.redo(),t.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",t));break}}},mxUndoManager.prototype.undoableEditHappened=function(e){this.trim(),0<this.size&&this.size==this.history.length&&this.history.shift(),this.history.push(e),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",e))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var e=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),t=0;t<e.length;t++)e[t].die()};var mxUrlConverter=function(e){var n=!0,a=null,i=null;return{isEnabled:function(){return n},setEnabled:function(e){n=e},getBaseUrl:function(){return a},setBaseUrl:function(e){a=e},getBaseDomain:function(){return a},setBaseDomain:function(e){a=e},isRelativeUrl:function(e){return"http://"!=e.substring(0,7)&&"https://"!=e.substring(0,8)&&"data:image"!=e.substring(0,10)},convert:function(e){if(n&&this.isRelativeUrl(e)){if(null==a){i=location.protocol+"//"+location.host;var t=(a=i+location.pathname).lastIndexOf("/");0<t&&(a=a.substring(0,t+1))}e="/"==e.charAt(0)?i+e:a+e}return e}}};function mxPanningManager(o){this.thread=null,this.active=!1,this.dy=this.dx=this.t0y=this.t0x=this.tdy=this.tdx=0,this.scrollbars=!1,this.scrollTop=this.scrollLeft=0,this.mouseListener={mouseDown:function(e,t){},mouseMove:function(e,t){},mouseUp:mxUtils.bind(this,function(e,t){this.active&&this.stop()})},o.addMouseListener(this.mouseListener),mxEvent.addListener(document,"mouseup",mxUtils.bind(this,function(){this.active&&this.stop()}));var s=mxUtils.bind(this,function(){return this.scrollbars=mxUtils.hasScrollbars(o.container),this.scrollLeft=o.container.scrollLeft,this.scrollTop=o.container.scrollTop,window.setInterval(mxUtils.bind(this,function(){if(this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars){var e=-o.container.scrollLeft-Math.ceil(this.dx),t=-o.container.scrollTop-Math.ceil(this.dy);o.panGraph(e,t),o.panDx=this.scrollLeft-o.container.scrollLeft,o.panDy=this.scrollTop-o.container.scrollTop,o.fireEvent(new mxEventObject(mxEvent.PAN))}else o.panGraph(this.getDx(),this.getDy())}),this.delay)});this.isActive=function(){return active},this.getDx=function(){return Math.round(this.tdx)},this.getDy=function(){return Math.round(this.tdy)},this.start=function(){this.t0x=o.view.translate.x,this.t0y=o.view.translate.y,this.active=!0},this.panTo=function(e,t,n,a){this.active||this.start(),this.scrollLeft=o.container.scrollLeft,this.scrollTop=o.container.scrollTop,a=null!=a?a:0;var i=o.container;this.dx=e+(null!=n?n:0)-i.scrollLeft-i.clientWidth,this.dx<0&&Math.abs(this.dx)<this.border?this.dx=this.border+this.dx:this.dx=this.handleMouseOut?Math.max(this.dx,0):0,0==this.dx&&(this.dx=e-i.scrollLeft,this.dx=0<this.dx&&this.dx<this.border?this.dx-this.border:this.handleMouseOut?Math.min(0,this.dx):0),this.dy=t+a-i.scrollTop-i.clientHeight,this.dy<0&&Math.abs(this.dy)<this.border?this.dy=this.border+this.dy:this.dy=this.handleMouseOut?Math.max(this.dy,0):0,0==this.dy&&(this.dy=t-i.scrollTop,this.dy=0<this.dy&&this.dy<this.border?this.dy-this.border:this.handleMouseOut?Math.min(0,this.dy):0),0!=this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=s())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)},this.stop=function(){if(this.active)if(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdy=this.tdx=0,this.scrollbars)o.panDx=0,o.panDy=0,o.fireEvent(new mxEventObject(mxEvent.PAN));else{var e=o.panDx,t=o.panDy;0==e&&0==t||(o.panGraph(0,0),o.view.setTranslate(this.t0x+e/o.view.scale,this.t0y+t/o.view.scale))}},this.destroy=function(){o.removeMouseListener(this.mouseListener)}}function mxPopupMenu(e){null!=(this.factoryMethod=e)&&this.init()}function mxAutoSaveManager(e){this.changeHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.graphModelChanged(t.getProperty("edit").changes)}),this.setGraph(e)}function mxAnimation(e){this.delay=null!=e?e:20}function mxMorphing(e,t,n,a){mxAnimation.call(this,a),this.graph=e,this.steps=null!=t?t:6,this.ease=null!=n?n:1.5}function mxImageBundle(e){this.images=[],this.alt=null!=e&&e}function mxImageExport(){}function mxAbstractCanvas2D(){this.converter=this.createUrlConverter(),this.reset()}function mxXmlCanvas2D(e){mxAbstractCanvas2D.call(this),this.root=e,this.writeDefaults()}function mxSvgCanvas2D(e,t){mxAbstractCanvas2D.call(this),this.root=e,this.gradients=[],this.defs=null,this.styleEnabled=null!=t&&t;var n=null;if(e.ownerDocument!=document)for(n=e;null!=n&&"svg"!=n.nodeName;)n=n.parentNode;null!=n&&(0<n.getElementsByTagName("defs").length&&(this.defs=n.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=n.firstChild?n.insertBefore(this.defs,n.firstChild):n.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,mxPopupMenu.prototype=new mxEventSource,mxPopupMenu.prototype.constructor=mxPopupMenu,mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif",mxPopupMenu.prototype.zIndex=10006,mxPopupMenu.prototype.factoryMethod=null,mxPopupMenu.prototype.useLeftButtonForPopup=!1,mxPopupMenu.prototype.enabled=!0,mxPopupMenu.prototype.itemCount=0,mxPopupMenu.prototype.autoExpand=!1,mxPopupMenu.prototype.smartSeparators=!1,mxPopupMenu.prototype.labels=!0,mxPopupMenu.prototype.init=function(){this.table=document.createElement("table"),this.table.className="mxPopupMenu",this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.div=document.createElement("div"),this.div.className="mxPopupMenu",this.div.style.display="inline",this.div.style.zIndex=this.zIndex,this.div.appendChild(this.table),mxEvent.disableContextMenu(this.div)},mxPopupMenu.prototype.isEnabled=function(){return this.enabled},mxPopupMenu.prototype.setEnabled=function(e){this.enabled=e},mxPopupMenu.prototype.isPopupTrigger=function(e){return e.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(e.getEvent())},mxPopupMenu.prototype.addItem=function(e,t,n,a,i,o){a=a||this,this.itemCount++,a.willAddSeparator&&(a.containsItems&&this.addSeparator(a,!0),a.willAddSeparator=!1),a.containsItems=!0;var s=document.createElement("tr");s.className="mxPopupMenuItem";var r=document.createElement("td");return r.className="mxPopupMenuIcon",null!=t?((i=document.createElement("img")).src=t,r.appendChild(i)):null!=i&&((t=document.createElement("div")).className=i,r.appendChild(t)),s.appendChild(r),this.labels&&((r=document.createElement("td")).className="mxPopupMenuItem"+(null==o||o?"":" disabled"),mxUtils.write(r,e),r.align="left",s.appendChild(r),(e=document.createElement("td")).className="mxPopupMenuItem"+(null==o||o?"":" disabled"),e.style.paddingRight="6px",e.style.textAlign="right",s.appendChild(e),null==a.div&&this.createSubmenu(a)),a.tbody.appendChild(s),(null==o||o)&&(mxEvent.addGestureListeners(s,mxUtils.bind(this,function(e){this.eventReceiver=s,a.activeRow!=s&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),null!=s.div&&(this.showSubmenu(a,s),a.activeRow=s)),mxEvent.consume(e)}),mxUtils.bind(this,function(e){a.activeRow!=s&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),this.autoExpand&&null!=s.div&&(this.showSubmenu(a,s),a.activeRow=s)),s.className="mxPopupMenuItemHover"}),mxUtils.bind(this,function(e){this.eventReceiver==s&&(a.activeRow!=s&&this.hideMenu(),null!=n&&n(e)),this.eventReceiver=null,mxEvent.consume(e)})),mxEvent.addListener(s,"mouseout",mxUtils.bind(this,function(e){s.className="mxPopupMenuItem"}))),s},mxPopupMenu.prototype.createSubmenu=function(e){e.table=document.createElement("table"),e.table.className="mxPopupMenu",e.tbody=document.createElement("tbody"),e.table.appendChild(e.tbody),e.div=document.createElement("div"),e.div.className="mxPopupMenu",e.div.style.position="absolute",e.div.style.display="inline",e.div.style.zIndex=this.zIndex,e.div.appendChild(e.table);var t=document.createElement("img");t.setAttribute("src",this.submenuImage),td=e.firstChild.nextSibling.nextSibling,td.appendChild(t)},mxPopupMenu.prototype.showSubmenu=function(e,t){if(null!=t.div){t.div.style.left=e.div.offsetLeft+t.offsetLeft+t.offsetWidth-1+"px",t.div.style.top=e.div.offsetTop+t.offsetTop+"px",document.body.appendChild(t.div);var n=parseInt(t.div.offsetLeft),a=parseInt(t.div.offsetWidth),i=document.body,o=document.documentElement;n+a>(i.scrollLeft||o.scrollLeft)+(i.clientWidth||o.clientWidth)&&(t.div.style.left=e.div.offsetLeft-a+(mxClient.IS_IE?6:-6)+"px"),mxUtils.fit(t.div)}},mxPopupMenu.prototype.addSeparator=function(e,t){if(e=e||this,this.smartSeparators&&!t)e.willAddSeparator=!0;else if(null!=e.tbody){e.willAddSeparator=!1;var n=document.createElement("tr"),a=document.createElement("td");a.className="mxPopupMenuIcon",a.style.padding="0 0 0 0px",n.appendChild(a),(a=document.createElement("td")).style.padding="0 0 0 0px",a.setAttribute("colSpan","2");var i=document.createElement("hr");i.setAttribute("size","1"),a.appendChild(i),n.appendChild(a),e.tbody.appendChild(n)}},mxPopupMenu.prototype.popup=function(e,t,n,a){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=e+"px",this.div.style.top=t+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,n,a),0<this.itemCount&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){9<=document.documentMode&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1)},mxPopupMenu.prototype.hideSubmenu=function(e){null!=e.activeRow&&(this.hideSubmenu(e.activeRow),null!=e.activeRow.div.parentNode&&e.activeRow.div.parentNode.removeChild(e.activeRow.div),e.activeRow=null)},mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)},mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(e){this.enabled=e},mxAutoSaveManager.prototype.setGraph=function(e){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=e,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(e){(e=((new Date).getTime()-this.lastSnapshot)/1e3)>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){var e=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var t=0;t<this.cells.length;t++)this.animateCell(cells[t],e,!1);else this.animateCell(this.graph.getModel().getRoot(),e,!0);this.show(e),(e.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(e){e.show()},mxMorphing.prototype.animateCell=function(e,t,n){var a=this.graph.getView().getState(e),i=null;if(null!=a&&(i=this.getDelta(a),this.graph.getModel().isVertex(e)&&(0!=i.x||0!=i.y))){var o=this.graph.view.getTranslate(),s=this.graph.view.getScale();i.x+=o.x*s,i.y+=o.y*s,t.moveState(a,-i.x/this.ease,-i.y/this.ease)}if(n&&!this.stopRecursion(a,i))for(a=this.graph.getModel().getChildCount(e),i=0;i<a;i++)this.animateCell(this.graph.getModel().getChildAt(e,i),t,n)},mxMorphing.prototype.stopRecursion=function(e,t){return null!=t&&(0!=t.x||0!=t.y)},mxMorphing.prototype.getDelta=function(e){var t=this.getOriginForCell(e.cell),n=this.graph.getView().getTranslate(),a=this.graph.getView().getScale();return e=new mxPoint(e.x/a-n.x,e.y/a-n.y),new mxPoint((t.x-e.x)*a,(t.y-e.y)*a)},mxMorphing.prototype.getOriginForCell=function(e){var t=null;return null!=e&&(t=this.getOriginForCell(this.graph.getModel().getParent(e)),null!=(e=this.graph.getCellGeometry(e))&&(t.x+=e.x,t.y+=e.y)),null==t&&(t=new mxPoint(-(t=this.graph.view.getTranslate()).x,-t.y)),t},mxImageBundle.prototype.images=null,mxImageBundle.prototype.images=null,mxImageBundle.prototype.putImage=function(e,t,n){this.images[e]={value:t,fallback:n}},mxImageBundle.prototype.getImage=function(e){var t=null;return null!=e&&(null!=(e=this.images[e])&&(t=this.alt?e.fallback:e.value)),t},mxImageExport.prototype.includeOverlays=!1,mxImageExport.prototype.drawState=function(e,t){null!=e&&(this.visitStatesRecursive(e,t,this.drawCellState),this.includeOverlays&&this.visitStatesRecursive(e,t,this.drawOverlays))},mxImageExport.prototype.visitStatesRecursive=function(e,t,n){if(null!=e){n(e,t);for(var a=e.view.graph,i=a.model.getChildCount(e.cell),o=0;o<i;o++){var s=a.view.getState(a.model.getChildAt(e.cell,o));this.visitStatesRecursive(s,t,n)}}},mxImageExport.prototype.drawCellState=function(e,t){e.shape instanceof mxShape&&(t.save(),e.shape.paint(t),t.restore()),null!=e.text&&(t.save(),e.text.paint(t),t.restore())},mxImageExport.prototype.drawOverlays=function(e,n){null!=e.overlays&&e.overlays.visit(function(e,t){t instanceof mxShape&&t.paint(n)})},mxAbstractCanvas2D.prototype.state=null,mxAbstractCanvas2D.prototype.states=null,mxAbstractCanvas2D.prototype.path=null,mxAbstractCanvas2D.prototype.rotateHtml=!0,mxAbstractCanvas2D.prototype.lastX=0,mxAbstractCanvas2D.prototype.lastY=0,mxAbstractCanvas2D.prototype.moveOp="M",mxAbstractCanvas2D.prototype.lineOp="L",mxAbstractCanvas2D.prototype.quadOp="Q",mxAbstractCanvas2D.prototype.curveOp="C",mxAbstractCanvas2D.prototype.closeOp="Z",mxAbstractCanvas2D.prototype.pointerEvents=!1,mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter},mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState(),this.states=[]},mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillColor:null,fillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:!1,dashPattern:"3 3",lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1,shadowColor:mxConstants.SHADOWCOLOR,shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}},mxAbstractCanvas2D.prototype.format=function(e){return Math.round(parseFloat(e))},mxAbstractCanvas2D.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var e=this.state,t=2;t<arguments.length;t+=2)this.lastX=arguments[t-1],this.lastY=arguments[t],this.path.push(this.format((this.lastX+e.dx)*e.scale)),this.path.push(this.format((this.lastY+e.dy)*e.scale))},mxAbstractCanvas2D.prototype.rotatePoint=function(e,t,n,a,i){return n*=Math.PI/180,mxUtils.getRotatedPoint(new mxPoint(e,t),Math.cos(n),Math.sin(n),new mxPoint(a,i))},mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state),this.state=mxUtils.clone(this.state)},mxAbstractCanvas2D.prototype.restore=function(){this.state=this.states.pop()},mxAbstractCanvas2D.prototype.scale=function(e){this.state.scale*=e,this.state.strokeWidth*=e},mxAbstractCanvas2D.prototype.translate=function(e,t){this.state.dx+=e,this.state.dy+=t},mxAbstractCanvas2D.prototype.setAlpha=function(e){this.state.alpha=e},mxAbstractCanvas2D.prototype.setFillColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fillColor=e,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(e,t,n,a,i,o,s,r,l){(n=this.state).fillColor=e,n.fillAlpha=null!=r?r:1,n.gradientColor=t,n.gradientAlpha=null!=l?l:1,n.gradientDirection=s},mxAbstractCanvas2D.prototype.setStrokeColor=function(e){e==mxConstants.NONE&&(e=null),this.state.strokeColor=e},mxAbstractCanvas2D.prototype.setStrokeWidth=function(e){this.state.strokeWidth=e},mxAbstractCanvas2D.prototype.setDashed=function(e){this.state.dashed=e},mxAbstractCanvas2D.prototype.setDashPattern=function(e){this.state.dashPattern=e},mxAbstractCanvas2D.prototype.setLineCap=function(e){this.state.lineCap=e},mxAbstractCanvas2D.prototype.setLineJoin=function(e){this.state.lineJoin=e},mxAbstractCanvas2D.prototype.setMiterLimit=function(e){this.state.miterLimit=e},mxAbstractCanvas2D.prototype.setFontColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontColor=e},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBackgroundColor=e},mxAbstractCanvas2D.prototype.setFontBorderColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBorderColor=e},mxAbstractCanvas2D.prototype.setFontSize=function(e){this.state.fontSize=e},mxAbstractCanvas2D.prototype.setFontFamily=function(e){this.state.fontFamily=e},mxAbstractCanvas2D.prototype.setFontStyle=function(e){null==e&&(e=0),this.state.fontStyle=e},mxAbstractCanvas2D.prototype.setShadow=function(e){this.state.shadow=e},mxAbstractCanvas2D.prototype.setShadowColor=function(e){e==mxConstants.NONE&&(e=null),this.state.shadowColor=e},mxAbstractCanvas2D.prototype.setShadowAlpha=function(e){this.state.shadowAlpha=e},mxAbstractCanvas2D.prototype.setShadowOffset=function(e,t){this.state.shadowDx=e,this.state.shadowDy=t},mxAbstractCanvas2D.prototype.begin=function(){this.lastY=this.lastX=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(e,t){this.addOp(this.moveOp,e,t)},mxAbstractCanvas2D.prototype.lineTo=function(e,t){this.addOp(this.lineOp,e,t)},mxAbstractCanvas2D.prototype.quadTo=function(e,t,n,a){this.addOp(this.quadOp,e,t,n,a)},mxAbstractCanvas2D.prototype.curveTo=function(e,t,n,a,i,o){this.addOp(this.curveOp,e,t,n,a,i,o)},mxAbstractCanvas2D.prototype.arcTo=function(e,t,n,a,i,o,s){for(e=mxUtils.arcToCurves(this.lastX,this.lastY,e,t,n,a,i,o,s),t=0;t<e.length;t+=6)this.curveTo(e[t],e[t+1],e[t+2],e[t+3],e[t+4],e[t+5])},mxAbstractCanvas2D.prototype.close=function(e,t,n,a,i,o){this.addOp(this.closeOp)},mxAbstractCanvas2D.prototype.end=function(){},mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D),mxXmlCanvas2D.prototype.textEnabled=!0,mxXmlCanvas2D.prototype.compressed=!0,mxXmlCanvas2D.prototype.writeDefaults=function(){var e;(e=this.createElement("fontfamily")).setAttribute("family",mxConstants.DEFAULT_FONTFAMILY),this.root.appendChild(e),(e=this.createElement("fontsize")).setAttribute("size",mxConstants.DEFAULT_FONTSIZE),this.root.appendChild(e),(e=this.createElement("shadowcolor")).setAttribute("color",mxConstants.SHADOWCOLOR),this.root.appendChild(e),(e=this.createElement("shadowalpha")).setAttribute("alpha",mxConstants.SHADOW_OPACITY),this.root.appendChild(e),(e=this.createElement("shadowoffset")).setAttribute("dx",mxConstants.SHADOW_OFFSET_X),e.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y),this.root.appendChild(e)},mxXmlCanvas2D.prototype.format=function(e){return parseFloat(parseFloat(e).toFixed(2))},mxXmlCanvas2D.prototype.createElement=function(e){return this.root.ownerDocument.createElement(e)},mxXmlCanvas2D.prototype.save=function(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments),this.root.appendChild(this.createElement("save"))},mxXmlCanvas2D.prototype.restore=function(){this.compressed&&mxAbstractCanvas2D.prototype.restore.apply(this,arguments),this.root.appendChild(this.createElement("restore"))},mxXmlCanvas2D.prototype.scale=function(e){if(this.compressed){if(this.state.scale==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var t=this.createElement("scale");t.setAttribute("scale",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.translate=function(e,t){var n=this.createElement("translate");n.setAttribute("dx",this.format(e)),n.setAttribute("dy",this.format(t)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rotate=function(e,t,n,a,i){var o=this.createElement("rotate");(0!=e||t||n)&&(o.setAttribute("theta",this.format(e)),o.setAttribute("flipH",t?"1":"0"),o.setAttribute("flipV",n?"1":"0"),o.setAttribute("cx",this.format(a)),o.setAttribute("cy",this.format(i)),this.root.appendChild(o))},mxXmlCanvas2D.prototype.setAlpha=function(e){if(this.compressed){if(this.state.alpha==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var t=this.createElement("alpha");t.setAttribute("alpha",this.format(e)),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setFillColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fillColor==e)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var t=this.createElement("fillcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setGradient=function(e,t,n,a,i,o,s,r,l){if(null!=e&&null!=t){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var d=this.createElement("gradient");d.setAttribute("c1",e),d.setAttribute("c2",t),d.setAttribute("x",this.format(n)),d.setAttribute("y",this.format(a)),d.setAttribute("w",this.format(i)),d.setAttribute("h",this.format(o)),null!=s&&d.setAttribute("direction",s),null!=r&&d.setAttribute("alpha1",r),null!=l&&d.setAttribute("alpha2",l),this.root.appendChild(d)}},mxXmlCanvas2D.prototype.setStrokeColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.strokeColor==e)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var t=this.createElement("strokecolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setStrokeWidth=function(e){if(this.compressed){if(this.state.strokeWidth==e)return;mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var t=this.createElement("strokewidth");t.setAttribute("width",this.format(e)),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setDashed=function(e){if(this.compressed){if(this.state.dashed==e)return;mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var t=this.createElement("dashed");t.setAttribute("dashed",e?"1":"0"),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setDashPattern=function(e){if(this.compressed){if(this.state.dashPattern==e)return;mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var t=this.createElement("dashpattern");t.setAttribute("pattern",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setLineCap=function(e){if(this.compressed){if(this.state.lineCap==e)return;mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var t=this.createElement("linecap");t.setAttribute("cap",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setLineJoin=function(e){if(this.compressed){if(this.state.lineJoin==e)return;mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var t=this.createElement("linejoin");t.setAttribute("join",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setMiterLimit=function(e){if(this.compressed){if(this.state.miterLimit==e)return;mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var t=this.createElement("miterlimit");t.setAttribute("limit",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setFontColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontColor==e)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var t=this.createElement("fontcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontBackgroundColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBackgroundColor==e)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var t=this.createElement("fontbackgroundcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontBorderColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBorderColor==e)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var t=this.createElement("fontbordercolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontSize=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==e)return;mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var t=this.createElement("fontsize");t.setAttribute("size",e),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontFamily=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==e)return;mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var t=this.createElement("fontfamily");t.setAttribute("family",e),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontStyle=function(e){if(this.textEnabled){if(null==e&&(e=0),this.compressed){if(this.state.fontStyle==e)return;mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var t=this.createElement("fontstyle");t.setAttribute("style",e),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setShadow=function(e){if(this.compressed){if(this.state.shadow==e)return;mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var t=this.createElement("shadow");t.setAttribute("enabled",e?"1":"0"),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setShadowColor=function(e){if(this.compressed){if(e==mxConstants.NONE&&(e=null),this.state.shadowColor==e)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var t=this.createElement("shadowcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setShadowAlpha=function(e){if(this.compressed){if(this.state.shadowAlpha==e)return;mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var t=this.createElement("shadowalpha");t.setAttribute("alpha",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setShadowOffset=function(e,t){if(this.compressed){if(this.state.shadowDx==e&&this.state.shadowDy==t)return;mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var n=this.createElement("shadowoffset");n.setAttribute("dx",e),n.setAttribute("dy",t),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rect=function(e,t,n,a){var i=this.createElement("rect");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(t)),i.setAttribute("w",this.format(n)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.roundrect=function(e,t,n,a,i,o){var s=this.createElement("roundrect");s.setAttribute("x",this.format(e)),s.setAttribute("y",this.format(t)),s.setAttribute("w",this.format(n)),s.setAttribute("h",this.format(a)),s.setAttribute("dx",this.format(i)),s.setAttribute("dy",this.format(o)),this.root.appendChild(s)},mxXmlCanvas2D.prototype.ellipse=function(e,t,n,a){var i=this.createElement("ellipse");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(t)),i.setAttribute("w",this.format(n)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.image=function(e,t,n,a,i,o,s,r){i=this.converter.convert(i);var l=this.createElement("image");l.setAttribute("x",this.format(e)),l.setAttribute("y",this.format(t)),l.setAttribute("w",this.format(n)),l.setAttribute("h",this.format(a)),l.setAttribute("src",i),l.setAttribute("aspect",o?"1":"0"),l.setAttribute("flipH",s?"1":"0"),l.setAttribute("flipV",r?"1":"0"),this.root.appendChild(l)},mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin")),this.lastY=this.lastX=0},mxXmlCanvas2D.prototype.moveTo=function(e,t){var n=this.createElement("move");n.setAttribute("x",this.format(e)),n.setAttribute("y",this.format(t)),this.root.appendChild(n),this.lastX=e,this.lastY=t},mxXmlCanvas2D.prototype.lineTo=function(e,t){var n=this.createElement("line");n.setAttribute("x",this.format(e)),n.setAttribute("y",this.format(t)),this.root.appendChild(n),this.lastX=e,this.lastY=t},mxXmlCanvas2D.prototype.quadTo=function(e,t,n,a){var i=this.createElement("quad");i.setAttribute("x1",this.format(e)),i.setAttribute("y1",this.format(t)),i.setAttribute("x2",this.format(n)),i.setAttribute("y2",this.format(a)),this.root.appendChild(i),this.lastX=n,this.lastY=a},mxXmlCanvas2D.prototype.curveTo=function(e,t,n,a,i,o){var s=this.createElement("curve");s.setAttribute("x1",this.format(e)),s.setAttribute("y1",this.format(t)),s.setAttribute("x2",this.format(n)),s.setAttribute("y2",this.format(a)),s.setAttribute("x3",this.format(i)),s.setAttribute("y3",this.format(o)),this.root.appendChild(s),this.lastX=i,this.lastY=o},mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))},mxXmlCanvas2D.prototype.text=function(e,t,n,a,i,o,s,r,l,d,c,m){if(this.textEnabled&&null!=i){mxUtils.isNode(i)&&(i=mxUtils.getOuterHtml(i));var u=this.createElement("text");u.setAttribute("x",this.format(e)),u.setAttribute("y",this.format(t)),u.setAttribute("w",this.format(n)),u.setAttribute("h",this.format(a)),u.setAttribute("str",i),null!=o&&u.setAttribute("align",o),null!=s&&u.setAttribute("valign",s),u.setAttribute("wrap",r?"1":"0"),null==l&&(l=""),u.setAttribute("format",l),null!=d&&u.setAttribute("fill",d?"1":"0"),null!=c&&u.setAttribute("clip",c?"1":"0"),null!=m&&u.setAttribute("rotation",m),this.root.appendChild(u)}},mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))},mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))},mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))},mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),mxSvgCanvas2D.prototype.node=null,mxSvgCanvas2D.prototype.matchHtmlAlignment=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,mxSvgCanvas2D.prototype.strokeTolerance=0,mxSvgCanvas2D.prototype.refCount=0,mxSvgCanvas2D.prototype.blockImagePointerEvents=!1,mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(e){return(e=this.createElement("style")).setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(e,t){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(t||mxConstants.NS_SVG,e);var n=this.root.ownerDocument.createElement(e);return null!=t&&n.setAttribute("xmlns",t),n},mxSvgCanvas2D.prototype.createGradientId=function(e,t,n,a,i){return"#"==e.charAt(0)&&(e=e.substring(1)),"#"==t.charAt(0)&&(t=t.substring(1)),e=e.toLowerCase()+"-"+n,t=t.toLowerCase()+"-"+a,(n=null)==i||i==mxConstants.DIRECTION_SOUTH?n="s":i==mxConstants.DIRECTION_EAST?n="e":(a=e,e=t,t=a,i==mxConstants.DIRECTION_NORTH?n="s":i==mxConstants.DIRECTION_WEST&&(n="e")),"mx-gradient-"+e+"-"+t+"-"+n},mxSvgCanvas2D.prototype.getSvgGradient=function(e,t,n,a,i){var o=this.createGradientId(e,t,n,a,i),s=this.gradients[o];if(null==s){var r=this.root.ownerSVGElement,l=0,d=o+"-"+l;if(null!=r)for(s=r.ownerDocument.getElementById(d);null!=s&&s.ownerSVGElement!=r;)d=o+"-"+l++,s=r.ownerDocument.getElementById(d);else d="id"+ ++this.refCount;null==s&&((s=this.createSvgGradient(e,t,n,a,i)).setAttribute("id",d),null!=this.defs?this.defs.appendChild(s):r.appendChild(s)),this.gradients[o]=s}return s.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(e,t,n,a,i){var o=this.createElement("linearGradient");return o.setAttribute("x1","0%"),o.setAttribute("y1","0%"),o.setAttribute("x2","0%"),o.setAttribute("y2","0%"),null==i||i==mxConstants.DIRECTION_SOUTH?o.setAttribute("y2","100%"):i==mxConstants.DIRECTION_EAST?o.setAttribute("x2","100%"):i==mxConstants.DIRECTION_NORTH?o.setAttribute("y1","100%"):i==mxConstants.DIRECTION_WEST&&o.setAttribute("x1","100%"),n=n<1?";stop-opacity:"+n:"",(i=this.createElement("stop")).setAttribute("offset","0%"),i.setAttribute("style","stop-color:"+e+n),o.appendChild(i),n=a<1?";stop-opacity:"+a:"",(i=this.createElement("stop")).setAttribute("offset","100%"),i.setAttribute("style","stop-color:"+t+n),o.appendChild(i),o},mxSvgCanvas2D.prototype.addNode=function(e,t){var n=this.node,a=this.state;if(null!=n){if("path"==n.nodeName){if(!(null!=this.path&&0<this.path.length))return;n.setAttribute("d",this.path.join(" "))}e&&null!=a.fillColor?this.updateFill():this.styleEnabled||("ellipse"!=n.nodeName||!mxClient.IS_NS||mxClient.IS_GC||mxClient.IS_SF?n.setAttribute("fill","none"):n.setAttribute("fill","transparent"),e=!1),t&&null!=a.strokeColor?this.updateStroke():this.styleEnabled||n.setAttribute("stroke","none"),null!=a.transform&&0<a.transform.length&&n.setAttribute("transform",a.transform),a.shadow&&this.root.appendChild(this.createShadow(n)),0<this.strokeTolerance&&!e&&this.root.appendChild(this.createTolerance(n)),this.pointerEvents&&("path"!=n.nodeName||this.path[this.path.length-1]==this.closeOp)&&n.setAttribute("pointer-events","all"),this.root.appendChild(n)}},mxSvgCanvas2D.prototype.updateFill=function(){var e=this.state;e.alpha<1&&this.node.setAttribute("fill-opacity",e.alpha),null!=e.fillColor&&(null!=e.gradientColor?(e=this.getSvgGradient(e.fillColor,e.gradientColor,e.fillAlpha,e.gradientAlpha,e.gradientDirection),this.node.setAttribute("fill","url(#"+e+")")):this.node.setAttribute("fill",e.fillColor.toLowerCase()))},mxSvgCanvas2D.prototype.updateStroke=function(){var e=this.state;this.node.setAttribute("stroke",e.strokeColor.toLowerCase()),e.alpha<1&&this.node.setAttribute("stroke-opacity",e.alpha);var t=Math.max(1,this.format(e.strokeWidth*e.scale));1!=t&&this.node.setAttribute("stroke-width",t),"path"==this.node.nodeName&&this.updateStrokeAttributes(),e.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern(t))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var e=this.state;if(null!=e.lineJoin&&"miter"!=e.lineJoin&&this.node.setAttribute("stroke-linejoin",e.lineJoin),null!=e.lineCap){var t=e.lineCap;"flat"==t&&(t="butt"),"butt"!=t&&this.node.setAttribute("stroke-linecap",t)}null!=e.miterLimit&&(!this.styleEnabled||10!=e.miterLimit)&&this.node.setAttribute("stroke-miterlimit",e.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(e){var t=this.state.dashPattern.split(" "),n=[];if(0<t.length)for(var a=0;a<t.length;a++)n[a]=Number(t[a])*e;return n.join(" ")},mxSvgCanvas2D.prototype.createTolerance=function(e){e=e.cloneNode(!0);var t=parseFloat(e.getAttribute("stroke-width")||1)+this.strokeTolerance;return e.setAttribute("pointer-events","stroke"),e.setAttribute("visibility","hidden"),e.removeAttribute("stroke-dasharray"),e.setAttribute("stroke-width",t),e.setAttribute("fill","none"),e.setAttribute("stroke",mxClient.IS_OP?"none":"white"),e},mxSvgCanvas2D.prototype.createShadow=function(e){e=e.cloneNode(!0);var t=this.state;return"none"!=e.getAttribute("fill")&&e.setAttribute("fill",t.shadowColor),"none"!=e.getAttribute("stroke")&&e.setAttribute("stroke",t.shadowColor),e.setAttribute("transform","translate("+this.format(t.shadowDx*t.scale)+","+this.format(t.shadowDy*t.scale)+")"+(t.transform||"")),e.setAttribute("opacity",t.shadowAlpha),e},mxSvgCanvas2D.prototype.rotate=function(e,t,n,a,i){if(0!=e||t||n){var o=this.state;if(a+=o.dx,i+=o.dy,a*=o.scale,i*=o.scale,o.transform=o.transform||"",t&&n)e+=180;else if(t^n){var s=t?a:0,r=t?-1:1,l=n?i:0,d=n?-1:1;o.transform+="translate("+this.format(s)+","+this.format(l)+")scale("+this.format(r)+","+this.format(d)+")translate("+this.format(-s)+","+this.format(-l)+")"}(t?!n:n)&&(e*=-1),0!=e&&(o.transform+="rotate("+this.format(e)+","+this.format(a)+","+this.format(i)+")"),o.rotation+=e,o.rotationCx=a,o.rotationCy=i}},mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createElement("path")},mxSvgCanvas2D.prototype.rect=function(e,t,n,a){var i=this.state,o=this.createElement("rect");o.setAttribute("x",this.format((e+i.dx)*i.scale)),o.setAttribute("y",this.format((t+i.dy)*i.scale)),o.setAttribute("width",this.format(n*i.scale)),o.setAttribute("height",this.format(a*i.scale)),this.node=o},mxSvgCanvas2D.prototype.roundrect=function(e,t,n,a,i,o){this.rect(e,t,n,a),0<i&&this.node.setAttribute("rx",this.format(i*this.state.scale)),0<o&&this.node.setAttribute("ry",this.format(o*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(e,t,n,a){var i=this.state,o=this.createElement("ellipse");o.setAttribute("cx",Math.round((e+n/2+i.dx)*i.scale)),o.setAttribute("cy",Math.round((t+a/2+i.dy)*i.scale)),o.setAttribute("rx",n/2*i.scale),o.setAttribute("ry",a/2*i.scale),this.node=o},mxSvgCanvas2D.prototype.image=function(e,t,n,a,i,o,s,r){i=this.converter.convert(i),o=null==o||o,s=null!=s&&s,r=null!=r&&r;var l=this.state;e+=l.dx,t+=l.dy;var d=this.createElement("image");if(d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(t*l.scale)),d.setAttribute("width",this.format(n*l.scale)),d.setAttribute("height",this.format(a*l.scale)),null==d.setAttributeNS?d.setAttribute("xlink:href",i):d.setAttributeNS(mxConstants.NS_XLINK,"href",i),o||d.setAttribute("preserveAspectRatio","none"),l.alpha<1&&d.setAttribute("opacity",l.alpha),i=this.state.transform||"",s||r){var c=o=1,m=0,u=0;s&&(o=-1,m=-n-2*e),r&&(c=-1,u=-a-2*t),i+="scale("+o+","+c+")translate("+m+","+u+")"}0<i.length&&d.setAttribute("transform",i),this.root.appendChild(d),this.blockImagePointerEvents&&(d.setAttribute("style","pointer-events:none"),(d=this.createElement("rect")).setAttribute("visibility","hidden"),d.setAttribute("pointer-events","fill"),d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(t*l.scale)),d.setAttribute("width",this.format(n*l.scale)),d.setAttribute("height",this.format(a*l.scale)),this.root.appendChild(d))},mxSvgCanvas2D.prototype.createDiv=function(e,t,n,a,i){return n=this.state,a="display:inline-block;font-size:"+Math.round(n.fontSize)+"px;font-family:"+n.fontFamily+";color:"+n.fontColor+";line-height:"+Math.round(n.fontSize*mxConstants.LINE_HEIGHT)+"px;"+a,(n.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="font-weight:bold;"),(n.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="font-style:italic;"),(n.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(a+="font-decoration:underline;"),t==mxConstants.ALIGN_CENTER?a+="text-align:center;":t==mxConstants.ALIGN_RIGHT&&(a+="text-align:right;"),t="",null!=n.fontBackgroundColor&&(t+="background-color:"+n.fontBackgroundColor+";"),null!=n.fontBorderColor&&(t+="border:1px solid "+n.fontBorderColor+";"),mxUtils.isNode(e)||((n=document.createElement("textarea")).innerHTML=e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"<").replace(/>/g,">"),e=n.value,i?a+=t:0<t.length&&(e='<div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;'+t+'">'+e+"</div>")),!mxClient.IS_IE&&document.createElementNS?((i=document.createElementNS("http://www.w3.org/1999/xhtml","div")).setAttribute("style",a),mxUtils.isNode(e)?this.root.ownerDocument!=document?i.appendChild(e.cloneNode(!0)):i.appendChild(e):i.innerHTML=e,i):(mxUtils.isNode(e)&&this.root.ownerDocument!=document&&(e=e.outerHTML),e=e.replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />"),mxUtils.parseXml('<div xmlns="http://www.w3.org/1999/xhtml" style="'+a+'">'+e+"</div>").documentElement)},mxSvgCanvas2D.prototype.text=function(e,t,n,a,i,o,s,r,l,d,c,m){if(this.textEnabled&&null!=i){m=null!=m?m:0;var u=this.state;if(e+=u.dx,t+=u.dy,this.foEnabled&&"html"==l){var p="vertical-align:top;";if(c?(p+="overflow:hidden;",0<a&&(p+="max-height:"+Math.round(a)+"px;"),0<n&&(p+="width:"+Math.round(n)+"px;")):d&&(p+="width:"+Math.round(n)+"px;",0<a&&(p+="max-height:"+Math.round(a)+"px;")),r?(!c&&0<n&&(p+="width:"+Math.round(n)+"px;"),p+="white-space:normal;"):p+="white-space:nowrap;",r=this.createElement("g"),u.alpha<1&&r.setAttribute("opacity",u.alpha),(l=this.createElement("foreignObject")).setAttribute("pointer-events","all"),null!=(p=this.createDiv(i,o,s,p,d))){r.appendChild(l),this.root.appendChild(r);var g=0;if(mxClient.IS_IE&&!mxClient.IS_SVG){var v=document.createElement("div");v.style.cssText=p.getAttribute("style"),v.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",v.style.visibility="hidden",v.innerHTML=mxUtils.isNode(i)?i.outerHTML:i,document.body.appendChild(v),g=v.offsetWidth,a=mxClient.IS_QUIRKS&&0<a&&c?Math.min(a,v.offsetHeight+2):v.offsetHeight,v.parentNode.removeChild(v),l.appendChild(p)}else this.root.ownerDocument!=document?(p.style.visibility="hidden",document.body.appendChild(p),g=p.offsetWidth,a=p.offsetHeight,l.appendChild(p),p.style.visibility=""):(l.appendChild(p),g=p.offsetWidth,a=p.offsetHeight);n=d?Math.max(n,g):g,u.alpha<1&&r.setAttribute("opacity",u.alpha),d=i=0,o==mxConstants.ALIGN_CENTER?i-=n/2:o==mxConstants.ALIGN_RIGHT&&(i-=n),e+=i,s==mxConstants.ALIGN_MIDDLE?d-=a/2:s==mxConstants.ALIGN_BOTTOM&&(d-=a),t+=d,o=1!=u.scale?"scale("+u.scale+")":"",0!=u.rotation&&this.rotateHtml?(o+="rotate("+u.rotation+","+n/2+","+a/2+")",e=(t=this.rotatePoint((e+n/2)*u.scale,(t+a/2)*u.scale,u.rotation,u.rotationCx,u.rotationCy)).x-n*u.scale/2,t=t.y-a*u.scale/2):(e*=u.scale,t*=u.scale),0!=m&&(o+="rotate("+m+","+-i+","+-d+")"),r.setAttribute("transform","translate("+Math.round(e)+","+Math.round(t)+")"+o),l.setAttribute("width",Math.round(Math.max(1,n))),l.setAttribute("height",Math.round(Math.max(1,a)))}}else this.plainText(e,t,n,a,i,o,s,r,d,c,m)}},mxSvgCanvas2D.prototype.createClip=function(e,t,n,a){for(var i="mx-clip-"+(e=Math.round(e))+"-"+(t=Math.round(t))+"-"+(n=Math.round(n))+"-"+(a=Math.round(a)),o=0,s=i+"-"+o;null!=document.getElementById(s);)s=i+"-"+ ++o;return clip=this.createElement("clipPath"),clip.setAttribute("id",s),(i=this.createElement("rect")).setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("width",n),i.setAttribute("height",a),clip.appendChild(i),clip},mxSvgCanvas2D.prototype.plainText=function(e,t,n,a,i,o,s,r,l,d,c){c=null!=c?c:0,r=this.state;var m=Math.round(r.fontSize),u=this.createElement("g"),p=r.transform||"";if(0!=c&&(p+="rotate("+c+","+this.format(e*r.scale)+","+this.format(t*r.scale)+")"),d&&0<n&&0<a){var g=e;c=t,o==mxConstants.ALIGN_CENTER?g-=n/2:o==mxConstants.ALIGN_RIGHT&&(g-=n),s==mxConstants.ALIGN_MIDDLE?c-=a/2:s==mxConstants.ALIGN_BOTTOM&&(c-=a),c=this.createClip(g*r.scale-2,c*r.scale-2,n*r.scale+4,a*r.scale+4),null!=this.defs?this.defs.appendChild(c):this.root.appendChild(c),u.setAttribute("clip-path","url(#"+c.getAttribute("id")+")")}this.updateFont(u,o),"start"!=(c=o==mxConstants.ALIGN_RIGHT?"end":o==mxConstants.ALIGN_CENTER?"middle":"start")&&u.setAttribute("text-anchor",c),(!this.styleEnabled||m!=mxConstants.DEFAULT_FONTSIZE)&&u.setAttribute("font-size",Math.round(m*r.scale)+"px"),0<p.length&&u.setAttribute("transform",p),r.alpha<1&&u.setAttribute("opacity",r.alpha);p=i.split("\n"),g=Math.round(m*mxConstants.LINE_HEIGHT);var v=m+(p.length-1)*g;for(c=t+m-1,s==mxConstants.ALIGN_MIDDLE?c-=(a=(this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)/2)+1:s==mxConstants.ALIGN_BOTTOM&&(c-=(a=this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)+2),a=0;a<p.length;a++)0<p[a].length&&0<mxUtils.trim(p[a]).length&&((d=this.createElement("text")).setAttribute("x",this.format(e*r.scale)),d.setAttribute("y",this.format(c*r.scale)),mxUtils.write(d,p[a]),u.appendChild(d)),c+=g;this.root.appendChild(u),this.addTextBackground(u,i,e,t,n,v,o,s,l)},mxSvgCanvas2D.prototype.updateFont=function(e){var t=this.state;e.setAttribute("fill",t.fontColor),(!this.styleEnabled||t.fontFamily!=mxConstants.DEFAULT_FONTFAMILY)&&e.setAttribute("font-family",t.fontFamily),(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&e.setAttribute("font-weight","bold"),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&e.setAttribute("font-style","italic"),(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&e.setAttribute("text-decoration","underline")},mxSvgCanvas2D.prototype.addTextBackground=function(e,t,n,a,i,o,s,r,l){var d=this.state;if(null!=d.fontBackgroundColor||null!=d.fontBorderColor){var c=null;l?(s==mxConstants.ALIGN_CENTER?n-=i/2:s==mxConstants.ALIGN_RIGHT&&(n-=i),r==mxConstants.ALIGN_MIDDLE?a-=o/2:r==mxConstants.ALIGN_BOTTOM&&(a-=o),c=new mxRectangle((n+1)*d.scale,a*d.scale,(i-2)*d.scale,(o+2)*d.scale)):null!=e.getBBox&&this.root.ownerDocument==document?(c=e.getBBox(),t=mxClient.IS_IE&&mxClient.IS_SVG,c=new mxRectangle(c.x,c.y+(t?0:1),c.width,c.height+(t?1:0))):((c=document.createElement("div")).style.lineHeight=Math.round(d.fontSize*mxConstants.LINE_HEIGHT)+"px",c.style.fontSize=Math.round(d.fontSize)+"px",c.style.fontFamily=d.fontFamily,c.style.whiteSpace="nowrap",c.style.position="absolute",c.style.visibility="hidden",c.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",c.style.zoom="1",(d.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(c.style.fontWeight="bold"),(d.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(c.style.fontStyle="italic"),t=mxUtils.htmlEntities(t,!1),c.innerHTML=t.replace(/\n/g,"<br/>"),document.body.appendChild(c),i=c.offsetWidth,o=c.offsetHeight,c.parentNode.removeChild(c),s==mxConstants.ALIGN_CENTER?n-=i/2:s==mxConstants.ALIGN_RIGHT&&(n-=i),r==mxConstants.ALIGN_MIDDLE?a-=o/2:r==mxConstants.ALIGN_BOTTOM&&(a-=o),c=new mxRectangle((n+1)*d.scale,(a+2)*d.scale,i*d.scale,(o+1)*d.scale)),null!=c&&((t=this.createElement("rect")).setAttribute("fill",d.fontBackgroundColor||"none"),t.setAttribute("stroke",d.fontBorderColor||"none"),t.setAttribute("x",Math.floor(c.x-1)),t.setAttribute("y",Math.floor(c.y-1)),t.setAttribute("width",Math.ceil(c.width+2)),t.setAttribute("height",Math.ceil(c.height)),d=null!=d.fontBorderColor?Math.max(1,this.format(d.scale)):0,t.setAttribute("stroke-width",d),this.root.ownerDocument==document&&1==mxUtils.mod(d,2)&&t.setAttribute("transform","translate(0.5, 0.5)"),e.insertBefore(t,e.firstChild))}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)};var mxVmlCanvas2D=function(e){mxAbstractCanvas2D.call(this),this.root=e};function mxGuide(e,t){this.graph=e,this.setStates(t)}function mxStencil(e){this.desc=e,this.parseDescription(),this.parseConstraints()}function mxShape(e){this.stencil=e,this.strokewidth=1,this.rotation=0,this.opacity=100,this.flipV=this.flipH=!1}mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.addNode=function(e,t){var n=this.node,a=this.state;if(null!=n){if("shape"==n.nodeName){if(!(null!=this.path&&0<this.path.length))return;n.path=this.path.join(" ")+" e",n.style.width=this.root.style.width,n.style.height=this.root.style.height,n.coordsize=parseInt(n.style.width)+" "+parseInt(n.style.height)}n.strokeweight=this.format(Math.max(1,a.strokeWidth*a.scale/this.vmlScale))+"px",a.shadow&&this.root.appendChild(this.createShadow(n,e&&null!=a.fillColor,t&&null!=a.strokeColor)),t&&null!=a.strokeColor?(n.stroked="true",n.strokecolor=a.strokeColor):n.stroked="false",n.appendChild(this.createStroke()),e&&null!=a.fillColor?n.appendChild(this.createFill()):!this.pointerEvents||"shape"==n.nodeName&&this.path[this.path.length-1]!=this.closeOp?n.filled="false":n.appendChild(this.createTransparentFill()),this.root.appendChild(n)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.src=mxClient.imageBasePath+"/transparent.gif",e.type="tile",e},mxVmlCanvas2D.prototype.createFill=function(){var e=this.state,t=document.createElement(mxClient.VML_PREFIX+":fill");if(t.color=e.fillColor,null!=e.gradientColor){t.type="gradient",t.method="none",t.color2=e.gradientColor;var n=180-e.rotation;n=e.gradientDirection==mxConstants.DIRECTION_WEST?n-(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_EAST?n+(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_NORTH?n-(180+("y"==this.root.style.flip?-180:0)):n+("y"==this.root.style.flip?-180:0);"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(n*=-1),t.angle=mxUtils.mod(n,360),t.opacity=100*e.alpha*e.fillAlpha+"%",t.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",100*e.alpha*e.gradientAlpha+"%")}else e.alpha<1&&(t.opacity=100*e.alpha+"%");return t},mxVmlCanvas2D.prototype.createStroke=function(){var e=this.state,t=document.createElement(mxClient.VML_PREFIX+":stroke");return t.endcap=e.lineCap||"flat",t.joinstyle=e.lineJoin||"miter",t.miterlimit=e.miterLimit||"10",e.alpha<1&&(t.opacity=100*e.alpha+"%"),e.dashed&&(t.dashstyle=this.getVmlDashStyle()),t},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var e="dash";if(null!=this.state.dashPattern){var t=this.state.dashPattern.split(" ");0<t.length&&1==t[0]&&(e="0 2")}return e},mxVmlCanvas2D.prototype.createShadow=function(e,t,n){var a=this.state,i=-a.rotation*(Math.PI/180),o=Math.cos(i),s=(i=Math.sin(i),a.shadowDx*a.scale),r=a.shadowDy*a.scale;"x"==this.root.style.flip?s*=-1:"y"==this.root.style.flip&&(r*=-1);var l=e.cloneNode(!0);return l.style.marginLeft=Math.round(s*o-r*i)+"px",l.style.marginTop=Math.round(s*i+r*o)+"px",8==document.documentMode&&(l.strokeweight=e.strokeweight,"shape"==e.nodeName&&(l.path=this.path.join(" ")+" e",l.style.width=this.root.style.width,l.style.height=this.root.style.height,l.coordsize=parseInt(e.style.width)+" "+parseInt(e.style.height))),n?(l.strokecolor=a.shadowColor,l.appendChild(this.createShadowStroke())):l.stroked="false",t?l.appendChild(this.createShadowFill()):l.filled="false",l},mxVmlCanvas2D.prototype.createShadowFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.color=this.state.shadowColor,e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.createShadowStroke=function(){var e=this.createStroke();return e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.rotate=function(e,t,n,a,i){t&&n?e+=180:t?this.root.style.flip="x":n&&(this.root.style.flip="y"),(t?!n:n)&&(e*=-1),this.root.style.rotation=e,this.state.rotation+=e,this.state.rotationCx=a,this.state.rotationCy=i},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=document.createElement(mxClient.VML_PREFIX+":shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(e,t,n,a){var i=this.state,o=(this.lastX+i.dx)*i.scale,s=(this.lastY+i.dy)*i.scale;e=(e+i.dx)*i.scale;s+=2/3*((t=(t+i.dy)*i.scale)-s);var r=(n=(n+i.dx)*i.scale)+2/3*(e-n);t=(a=(a+i.dy)*i.scale)+2/3*(t-a),this.path.push("c "+this.format(o+2/3*(e-o))+" "+this.format(s)+" "+this.format(r)+" "+this.format(t)+" "+this.format(n)+" "+this.format(a)),this.lastX=n/i.scale-i.dx,this.lastY=a/i.scale-i.dy},mxVmlCanvas2D.prototype.createRect=function(e,t,n,a,i){var o=this.state;return(e=document.createElement(e)).style.position="absolute",e.style.left=this.format((t+o.dx)*o.scale)+"px",e.style.top=this.format((n+o.dy)*o.scale)+"px",e.style.width=this.format(a*o.scale)+"px",e.style.height=this.format(i*o.scale)+"px",e},mxVmlCanvas2D.prototype.rect=function(e,t,n,a){this.node=this.createRect(mxClient.VML_PREFIX+":rect",e,t,n,a)},mxVmlCanvas2D.prototype.roundrect=function(e,t,n,a,i,o){this.node=this.createRect(mxClient.VML_PREFIX+":roundrect",e,t,n,a),this.node.setAttribute("arcsize",Math.max(100*i/n,100*o/a)+"%")},mxVmlCanvas2D.prototype.ellipse=function(e,t,n,a){this.node=this.createRect(mxClient.VML_PREFIX+":oval",e,t,n,a)},mxVmlCanvas2D.prototype.image=function(e,t,n,a,i,o,s,r){var l=null;o?((l=this.createRect(mxClient.VML_PREFIX+":rect",e,t,n,a)).stroked="false",(e=document.createElement(mxClient.VML_PREFIX+":fill")).aspect=o?"atmost":"ignore",e.rotate="true",e.type="frame",e.src=i,l.appendChild(e)):(l=this.createRect(mxClient.VML_PREFIX+":image",e,t,n,a)).src=i,s&&r?l.style.rotation="180":s?l.style.flip="x":r&&(l.style.flip="y"),this.state.alpha<1&&(l.style.filter+="alpha(opacity="+100*this.state.alpha+")"),this.root.appendChild(l)},mxVmlCanvas2D.prototype.createDiv=function(e,t,n,a){n=document.createElement("div");var i=this.state,o="";return null!=i.fontBackgroundColor&&(o+="background-color:"+i.fontBackgroundColor+";"),null!=i.fontBorderColor&&(o+="border:1px solid "+i.fontBorderColor+";"),mxUtils.isNode(e)?n.appendChild(e):0<o.length&&!a?((a=document.createElement("div")).style.cssText=o,a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,n.appendChild(a)):(n.style.cssText=o,n.innerHTML=e),(e=n.style).fontSize=Math.round(i.fontSize/this.vmlScale)+"px",e.fontFamily=i.fontFamily,e.color=i.fontColor,e.verticalAlign="top",e.textAlign=t||"left",e.lineHeight=Math.round(i.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale)+"px",(i.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e.fontWeight="bold"),(i.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e.fontStyle="italic"),(i.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(e.fontDecoration="underline"),n},mxVmlCanvas2D.prototype.text=function(e,t,n,a,i,o,s,r,l,d,c,m){if(this.textEnabled&&null!=i){var u=this.state;if("html"==l){null!=u.rotation&&(e=(t=this.rotatePoint(e,t,u.rotation,u.rotationCx,u.rotationCy)).x,t=t.y),8==document.documentMode?(e+=u.dx,t+=u.dy):(e*=u.scale,t*=u.scale),(l=8==document.documentMode?document.createElement(mxClient.VML_PREFIX+":group"):document.createElement("div")).style.position="absolute",l.style.display="inline",l.style.left=this.format(e)+"px",l.style.top=this.format(t)+"px",l.style.zoom=u.scale;var p=document.createElement("div");p.style.position="relative",p.style.display="inline";var g=(v=mxUtils.getAlignmentAsPoint(o,s)).x,v=v.y;if(i=this.createDiv(i,o,s,d),o=document.createElement("div"),r?(!c&&0<n&&(i.style.width=Math.round(n)+"px"),i.style.whiteSpace="normal"):i.style.whiteSpace="nowrap",r=u.rotation+(m||0),this.rotateHtml&&0!=r?(o.style.display="inline",o.style.zoom="1",o.appendChild(i),8==document.documentMode&&"DIV"!=this.root.nodeName?(p.appendChild(o),l.appendChild(p)):l.appendChild(o)):8==document.documentMode?(p.appendChild(i),l.appendChild(p)):(i.style.display="inline",l.appendChild(i)),"DIV"!=this.root.nodeName?((m=document.createElement(mxClient.VML_PREFIX+":rect")).stroked="false",m.filled="false",m.appendChild(l),this.root.appendChild(m)):this.root.appendChild(l),c?(i.style.overflow="hidden",0<n&&(i.style.width=Math.round(n)+"px"),0<a&&8==document.documentMode&&(i.style.maxHeight=Math.round(a)+"px")):d&&(i.style.width=n+"px",0<a&&(i.style.maxHeight=Math.round(a)+"px")),this.rotateHtml&&0!=r){n=r*(Math.PI/180),r=parseFloat(parseFloat(Math.cos(n)).toFixed(8)),m=parseFloat(parseFloat(Math.sin(-n)).toFixed(8)),(n%=2*Math.PI)<0&&(n+=2*Math.PI),(n%=Math.PI)>Math.PI/2&&(n=Math.PI-n),s=Math.cos(n);var h=Math.sin(n);8==document.documentMode&&(i.style.display="inline-block",o.style.display="inline-block",p.style.display="inline-block"),i.style.visibility="hidden",document.body.appendChild(i),n=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&(c||d)&&a<p&&(p=a,i.style.height=p+"px"),c=((a=p)-a*s+n*-h)/2-m*n*(g+.5)+r*a*(v+.5),d=(n-n*s+a*-h)/2+r*n*(g+.5)+m*a*(v+.5),"group"==l.nodeName&&"DIV"==this.root.nodeName?((g=document.createElement("div")).style.display="inline-block",g.style.position="absolute",g.style.left=this.format(e+(d-n/2)*u.scale)+"px",g.style.top=this.format(t+(c-a/2)*u.scale)+"px",l.parentNode.appendChild(g),g.appendChild(l)):(u=8==document.documentMode?1:u.scale,l.style.left=this.format(e+(d-n/2)*u)+"px",l.style.top=this.format(t+(c-a/2)*u)+"px"),o.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+r+", M12="+m+", M21="+-m+", M22="+r+", sizingMethod='auto expand')",o.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(o.style.filter+="alpha(opacity="+100*this.state.alpha+")"),i.style.visibility="",o.appendChild(i)}else 8!=document.documentMode?(i.style.verticalAlign="top",this.state.alpha<1&&(l.style.filter="alpha(opacity="+100*this.state.alpha+")"),u=i.parentNode,i.style.visibility="hidden",document.body.appendChild(i),n=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&c&&a<p&&(p=a,i.style.height=p+"px"),a=p,i.style.visibility="",u.appendChild(i),l.style.left=this.format(e+n*g*this.state.scale)+"px",l.style.top=this.format(t+a*v*this.state.scale)+"px"):(this.state.alpha<1&&(i.style.filter="alpha(opacity="+100*this.state.alpha+")"),p.style.left=100*g+"%",p.style.top=100*v+"%")}else this.plainText(e,t,n,a,mxUtils.htmlEntities(i,!1),o,s,r,l,d,c,m)}},mxVmlCanvas2D.prototype.plainText=function(e,t,n,a,i,o,s,r,l,d,c,m){e=(e+(a=this.state).dx)*a.scale,t=(t+a.dy)*a.scale,(n=document.createElement(mxClient.VML_PREFIX+":shape")).style.width="1px",n.style.height="1px",n.stroked="false",(d=document.createElement(mxClient.VML_PREFIX+":fill")).color=a.fontColor,d.opacity=100*a.alpha+"%",n.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":path")).textpathok="true",d.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),n.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":textpath")).style.cssText="v-text-align:"+o,d.style.align=o,d.style.fontFamily=a.fontFamily,d.string=i,d.on="true",o=Math.round(a.fontSize*a.scale/this.vmlScale),d.style.fontSize=o+"px",(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold"),(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic"),(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(d.style.textDecoration="underline"),a=o+((i=i.split("\n")).length-1)*o*mxConstants.LINE_HEIGHT,o=i=0,s==mxConstants.ALIGN_BOTTOM?o=-a/2:s!=mxConstants.ALIGN_MIDDLE&&(o=a/2),null!=m&&(s=(n.style.rotation=m)*(Math.PI/180),i=Math.sin(s)*o,o*=Math.cos(s)),n.appendChild(d),n.style.left=this.format(e-i)+"px",n.style.top=this.format(t+o)+"px",this.root.appendChild(n)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.setStates=function(e){this.states=e},mxGuide.prototype.isEnabledForEvent=function(e){return!0},mxGuide.prototype.getGuideTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxGuide.prototype.createGuideShape=function(e){return(e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)).isDashed=!0,e},mxGuide.prototype.move=function(a,e,t){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=e){var n=this.graph.getView().translate,i=this.graph.getView().scale,o=e.x,s=e.y,r=!1,l=!1,d=b=this.getGuideTolerance(),c=b;(b=a.clone()).x+=e.x,b.y+=e.y;var m=b.x,u=b.x+b.width,p=b.getCenterX(),g=b.y,v=b.y+b.height,h=b.getCenterY();e=function(e){e+=this.graph.panDx;var t=!1;if(Math.abs(e-p)<d?(o=e-a.getCenterX(),d=Math.abs(e-p),t=!0):Math.abs(e-m)<d?(o=e-a.x,d=Math.abs(e-m),t=!0):Math.abs(e-u)<d&&(o=e-a.x-a.width,d=Math.abs(e-u),t=!0),t){null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane()));var n=this.graph.container;e-=this.graph.panDx,this.guideX.points=[new mxPoint(e,-this.graph.panDy),new mxPoint(e,n.scrollHeight-3-this.graph.panDy)]}r=r||t};for(var b=function(e){e+=this.graph.panDy;var t=!1;if(Math.abs(e-h)<c?(s=e-a.getCenterY(),c=Math.abs(e-h),t=!0):Math.abs(e-g)<c?(s=e-a.y,c=Math.abs(e-g),t=!0):Math.abs(e-v)<c&&(s=e-a.y-a.height,c=Math.abs(e-v),t=!0),t){null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()));var n=this.graph.container;e-=this.graph.panDy,this.guideY.points=[new mxPoint(-this.graph.panDx,e),new mxPoint(n.scrollWidth-3-this.graph.panDx,e)]}l=l||t},f=0;f<this.states.length;f++){var A=this.states[f];null!=A&&(this.horizontal&&(e.call(this,A.getCenterX()),e.call(this,A.x),e.call(this,A.x+A.width)),this.vertical&&(b.call(this,A.getCenterY()),b.call(this,A.y),b.call(this,A.y+A.height)))}r||null==this.guideX?null!=this.guideX&&(this.guideX.node.style.visibility="visible",this.guideX.redraw()):this.guideX.node.style.visibility="hidden",l||null==this.guideY?null!=this.guideY&&(this.guideY.node.style.visibility="visible",this.guideY.redraw()):this.guideY.node.style.visibility="hidden",t&&(r||(t=a.x-(this.graph.snap(a.x/i-n.x)+n.x)*i,o=this.graph.snap(o/i)*i-t),l||(n=a.y-(this.graph.snap(a.y/i-n.y)+n.y)*i,s=this.graph.snap(s/i)*i-n)),e=new mxPoint(o,s)}return e},mxGuide.prototype.hide=function(){null!=this.guideX&&(this.guideX.node.style.visibility="hidden"),null!=this.guideY&&(this.guideY.node.style.visibility="hidden")},mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null),null!=this.guideY&&(this.guideY.destroy(),this.guideY=null)},mxStencil.defaultLocalized=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var e=this.desc.getAttribute("aspect");this.aspect=null!=e?e:"variable",e=this.desc.getAttribute("strokewidth"),this.strokewidth=null!=e?e:"1"},mxStencil.prototype.parseConstraints=function(){var e=this.desc.getElementsByTagName("connections")[0];if(null!=e&&(null!=(e=mxUtils.getChildNodes(e))&&0<e.length)){this.constraints=[];for(var t=0;t<e.length;t++)this.constraints.push(this.parseConstraint(e[t]))}},mxStencil.prototype.parseConstraint=function(e){var t=Number(e.getAttribute("x")),n=Number(e.getAttribute("y"));return e="1"==e.getAttribute("perimeter"),new mxConnectionConstraint(new mxPoint(t,n),e)},mxStencil.prototype.evaluateTextAttribute=function(e,t,n){return t=this.evaluateAttribute(e,t,n),e=e.getAttribute("localized"),(mxStencil.defaultLocalized&&null==e||"1"==e)&&(t=mxResources.get(t)),t},mxStencil.prototype.evaluateAttribute=function(e,t,n){return null==(t=e.getAttribute(t))&&(null!=(e=mxUtils.getTextContent(e))&&("function"==typeof(e=mxUtils.eval(e))&&(t=e(n)))),t},mxStencil.prototype.drawShape=function(e,t,n,a,i,o){this.drawChildren(e,t,n,a,i,o,this.bgNode,!1),this.drawChildren(e,t,n,a,i,o,this.fgNode,!0)},mxStencil.prototype.drawChildren=function(e,t,n,a,i,o,s,r){if(null!=s){var l=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,null);for(n=this.computeAspect(t.style,n,a,i,o,l),a=Math.min(n.width,n.height),a="inherit"==this.strokewidth?Number(mxUtils.getNumber(t.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*a,e.setStrokeWidth(a),s=s.firstChild;null!=s;)s.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,t,s,n,r),s=s.nextSibling}},mxStencil.prototype.computeAspect=function(e,t,n,a,i,o){e=t,t=a/this.w0;var s=i/this.h0;if(o="north"==o||"south"==o){s=a/this.h0,t=i/this.w0;var r=(a-i)/2;e+=r,n-=r}return"fixed"==this.aspect&&(t=s=Math.min(t,s),o?(e+=(i-this.w0*t)/2,n+=(a-this.h0*s)/2):(e+=(a-this.w0*t)/2,n+=(i-this.h0*s)/2)),new mxRectangle(e,n,t,s)},mxStencil.prototype.drawNode=function(e,t,n,a,i){var o=n.nodeName,s=a.x,r=a.y,l=a.width,d=a.height,c=Math.min(l,d);if("save"==o)e.save();else if("restore"==o)e.restore();else if("path"==o)for(e.begin(),n=n.firstChild;null!=n;)n.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,t,n,a,i),n=n.nextSibling;else if("close"==o)e.close();else if("move"==o)e.moveTo(s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d);else if("line"==o)e.lineTo(s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d);else if("quad"==o)e.quadTo(s+Number(n.getAttribute("x1"))*l,r+Number(n.getAttribute("y1"))*d,s+Number(n.getAttribute("x2"))*l,r+Number(n.getAttribute("y2"))*d);else if("curve"==o)e.curveTo(s+Number(n.getAttribute("x1"))*l,r+Number(n.getAttribute("y1"))*d,s+Number(n.getAttribute("x2"))*l,r+Number(n.getAttribute("y2"))*d,s+Number(n.getAttribute("x3"))*l,r+Number(n.getAttribute("y3"))*d);else if("arc"==o)e.arcTo(Number(n.getAttribute("rx"))*l,Number(n.getAttribute("ry"))*d,Number(n.getAttribute("x-axis-rotation")),Number(n.getAttribute("large-arc-flag")),Number(n.getAttribute("sweep-flag")),s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d);else if("rect"==o)e.rect(s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,Number(n.getAttribute("w"))*l,Number(n.getAttribute("h"))*d);else if("roundrect"==o)0==(t=n.getAttribute("arcsize"))&&(t=100*mxConstants.RECTANGLE_ROUNDING_FACTOR),c=Number(n.getAttribute("w"))*l,a=Number(n.getAttribute("h"))*d,t=Number(t)/100,t=Math.min(c*t,a*t),e.roundrect(s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,c,a,t,t);else if("ellipse"==o)e.ellipse(s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,Number(n.getAttribute("w"))*l,Number(n.getAttribute("h"))*d);else if("image"==o)t=this.evaluateAttribute(n,"src",t),e.image(s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,Number(n.getAttribute("w"))*l,Number(n.getAttribute("h"))*d,t,!1,"1"==n.getAttribute("flipH"),"1"==n.getAttribute("flipV"));else if("text"==o){if(c=this.evaluateTextAttribute(n,"str",t),a="1"==n.getAttribute("vertical")?-90:0,"0"==n.getAttribute("align-shape")){var m=t.rotation,u=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0);t=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0),a=u&&t?a-m:u||t?a+m:a-m}a-=n.getAttribute("rotation"),e.text(s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,0,0,c,n.getAttribute("align")||"left",n.getAttribute("valign")||"top",!1,"",!1,!1,a)}else if("include-shape"==o)null!=(m=mxStencilRegistry.getStencil(n.getAttribute("name")))&&(s+=Number(n.getAttribute("x"))*l,r+=Number(n.getAttribute("y"))*d,c=Number(n.getAttribute("w"))*l,a=Number(n.getAttribute("h"))*d,m.drawShape(e,t,s,r,c,a));else if("fillstroke"==o)e.fillAndStroke();else if("fill"==o)e.fill();else if("stroke"==o)e.stroke();else if("strokewidth"==o)e.setStrokeWidth(Number(n.getAttribute("width"))*c);else if("dashed"==o)e.setDashed("1"==n.getAttribute("dashed"));else if("dashpattern"==o){if(null!=(n=n.getAttribute("pattern"))){for(n=n.split(" "),l=[],d=0;d<n.length;d++)0<n[d].length&&l.push(Number(n[d])*c);n=l.join(" "),e.setDashPattern(n)}}else"strokecolor"==o?e.setStrokeColor(n.getAttribute("color")):"linecap"==o?e.setLineCap(n.getAttribute("cap")):"linejoin"==o?e.setLineJoin(n.getAttribute("join")):"miterlimit"==o?e.setMiterLimit(Number(n.getAttribute("limit"))):"fillcolor"==o?e.setFillColor(n.getAttribute("color")):"alpha"==o?e.setAlpha(n.getAttribute("alpha")):"fontcolor"==o?e.setFontColor(n.getAttribute("color")):"fontstyle"==o?e.setFontStyle(n.getAttribute("style")):"fontfamily"==o?e.setFontFamily(n.getAttribute("family")):"fontsize"==o&&e.setFontSize(Number(n.getAttribute("size"))*c);i&&("fillstroke"==o||"fill"==o||"stroke"==o)&&e.setShadow(!1)},mxShape.prototype.dialect=null,mxShape.prototype.scale=1,mxShape.prototype.bounds=null,mxShape.prototype.points=null,mxShape.prototype.node=null,mxShape.prototype.style=null,mxShape.prototype.style=null,mxShape.prototype.boundingBox=null,mxShape.prototype.stencil=null,mxShape.prototype.svgStrokeTolerance=6,mxShape.prototype.pointerEvents=!0,mxShape.prototype.stencilPointerEvents=!1,mxShape.prototype.vmlScale=1,mxShape.prototype.init=function(e){null==this.node&&(this.node=this.create(e),null!=e&&e.appendChild(this.node))},mxShape.prototype.isParseVml=function(){return!0},mxShape.prototype.isHtmlAllowed=function(){return!1},mxShape.prototype.getSvgScreenOffset=function(){return 1==mxUtils.mod(Math.max(1,Math.round(this.strokewidth*this.scale)),2)?.5:0},mxShape.prototype.create=function(e){return null!=e.ownerSVGElement?this.createSvg(e):8==document.documentMode||this.dialect==mxConstants.DIALECT_SVG||this.dialect!=mxConstants.DIALECT_VML&&this.isHtmlAllowed()?this.createHtml(e):this.createVml(e)},mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")},mxShape.prototype.createVml=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e},mxShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxShape.prototype.reconfigure=function(){this.redraw()},mxShape.prototype.redraw=function(){this.updateBoundsFromPoints(),this.checkBounds()?(this.node.style.visibility="","DIV"==this.node.nodeName&&this.isHtmlAllowed()?this.redrawHtmlShape():this.redrawShape(),this.updateBoundingBox()):(this.node.style.visibility="hidden",this.boundingBox=null)},mxShape.prototype.updateBoundsFromPoints=function(){var e=this.points;if(null!=e&&0<e.length&&null!=e[0]){this.bounds=new mxRectangle(Number(e[0].x),Number(e[0].y),1,1);for(var t=1;t<this.points.length;t++)null!=e[t]&&this.bounds.add(new mxRectangle(Number(e[t].x),Number(e[t].y),1,1))}},mxShape.prototype.checkBounds=function(){return null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height},mxShape.prototype.createVmlGroup=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e.style.width=this.node.style.width,e.style.height=this.node.style.height,e},mxShape.prototype.redrawShape=function(){var e=this.createCanvas();for(e.pointerEvents=this.pointerEvents;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);this.paint(e),this.node!=e.root&&this.node.insertAdjacentHTML("beforeend",e.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",(null==this.stencil||!this.stencilPointerEvents)&&mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(e)},mxShape.prototype.createCanvas=function(){var e=null,t=null;if(null!=this.node.ownerSVGElement)(e=new mxSvgCanvas2D(this.node,!1)).strokeTolerance=this.svgStrokeTolerance,e.blockImagePointerEvents=mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC,0!=(t=this.getSvgScreenOffset())?this.node.setAttribute("transform","translate("+t+","+t+")"):this.node.removeAttribute("transform");else{this.updateVmlContainer();var n=Math.max(1,Math.round(this.bounds.width)),a=Math.max(1,Math.round(this.bounds.height));t=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t,!1);""!=t.tagUrn&&(t.coordsize=n*this.vmlScale+","+a*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale),t=this.scale,e.translate(-Math.round(this.bounds.x/t),-Math.round(this.bounds.y/t))}return e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var e=Math.max(1,Math.round(this.bounds.width)),t=Math.max(1,Math.round(this.bounds.height));this.node.style.width=e+"px",this.node.style.height=t+"px",this.node.style.overflow="visible"},mxShape.prototype.destroyCanvas=function(e){if(e instanceof mxSvgCanvas2D){for(var t in e.gradients){var n=e.gradients[t];n.mxRefCount=(n.mxRefCount||0)+1}this.releaseSvgGradients(this.oldGradients),this.oldGradients=e.gradients}},mxShape.prototype.paint=function(e){var t=this.scale,n=this.bounds.x/t,a=this.bounds.y/t,i=this.bounds.width/t,o=this.bounds.height/t;if(this.isPaintBoundsInverted()){n=n+(s=(i-o)/2),a=a-s;var s=i;i=o,o=s}if(this.updateTransform(e,n,a,i,o),this.configureCanvas(e,n,a,i,o),null!=this.stencil)this.paintStencilShape(e,n,a,i,o);else if(e.setStrokeWidth(this.strokewidth),null!=this.points){for(n=[],a=0;a<this.points.length;a++)n.push(new mxPoint(this.points[a].x/t,this.points[a].y/t));this.paintEdgeShape(e,n)}else this.paintVertexShape(e,n,a,i,o)},mxShape.prototype.configureCanvas=function(e,t,n,a,i){var o=null;null!=this.style&&(o=this.style.dashPattern),e.setAlpha(this.opacity/100),null!=this.isShadow&&e.setShadow(this.isShadow),null!=this.isDashed&&e.setDashed(this.isDashed),null!=o&&e.setDashPattern(o),null!=this.gradient?(t=this.getGradientBounds(e,t,n,a,i),e.setGradient(this.fill,this.gradient,t.x,t.y,t.width,t.height,this.gradientDirection)):e.setFillColor(this.fill),e.setStrokeColor(this.stroke)},mxShape.prototype.getGradientBounds=function(e,t,n,a,i){return new mxRectangle(t,n,a,i)},mxShape.prototype.updateTransform=function(e,t,n,a,i){e.scale(this.scale),e.rotate(this.getShapeRotation(),this.flipH,this.flipV,t+a/2,n+i/2)},mxShape.prototype.paintStencilShape=function(e,t,n,a,i){this.stencilPointerEvents&&(this.dialect==mxConstants.DIALECT_SVG?this.addTransparentBackgroundRectangle(this.node,t,n,a,i):8!=document.documentMode&&this.setTransparentBackgroundImage(this.node)),this.stencil.drawShape(e,this,t,n,a,i)},mxShape.prototype.paintVertexShape=function(e,t,n,a,i){this.paintBackground(e,t,n,a,i),e.setShadow(!1),this.paintForeground(e,t,n,a,i)},mxShape.prototype.paintBackground=function(e,t,n,a,i){},mxShape.prototype.paintForeground=function(e,t,n,a,i){},mxShape.prototype.paintEdgeShape=function(e,t){},mxShape.prototype.getArcSize=function(e,t){var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;return Math.min(e*n,t*n)},mxShape.prototype.paintGlassEffect=function(e,t,n,a,i,o){var s=Math.ceil(this.strokewidth/2);e.setGradient("#ffffff","#ffffff",t,n,a,.6*i,"south",.9,.1),e.begin(),o+=2*s,this.isRounded?(e.moveTo(t-s+o,n-s),e.quadTo(t-s,n-s,t-s,n-s+o),e.lineTo(t-s,n+.4*i),e.quadTo(t+.5*a,n+.7*i,t+a+s,n+.4*i),e.lineTo(t+a+s,n-s+o),e.quadTo(t+a+s,n-s,t+a+s-o,n-s)):(e.moveTo(t-s,n-s),e.lineTo(t-s,n+.4*i),e.quadTo(t+.5*a,n+.7*i,t+a+s,n+.4*i),e.lineTo(t+a+s,n-s)),e.close(),e.fill()},mxShape.prototype.apply=function(e){this.state=e,this.style=e.style,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill),this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient),this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke),this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth),this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing),this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,this.startSize),this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize),this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow),this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow),this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation),this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction),this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV),"north"!=this.direction&&"south"!=this.direction||(e=this.flipH,this.flipH=this.flipV,this.flipV=e),this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow),this.isDashed=1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed),this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded),this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass),"none"==this.fill&&(this.fill=null),"none"==this.gradient&&(this.gradient=null),"none"==this.stroke&&(this.stroke=null))},mxShape.prototype.setCursor=function(e){null==e&&(e=""),this.cursor=e,null!=this.node&&(this.node.style.cursor=e)},mxShape.prototype.getCursor=function(){return this.cursor},mxShape.prototype.updateBoundingBox=function(){if(null!=this.bounds){var e=this.createBoundingBox();if(null!=e){this.augmentBoundingBox(e);var t=this.getShapeRotation();0!=t&&(e=mxUtils.getBoundingBox(e,t)),e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.ceil(e.width),e.height=Math.ceil(e.height)}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var e=this.bounds.clone();if(this.isPaintBoundsInverted()){var t=(e.width-e.height)/2;e.x+=t,e.y-=t,t=e.width,e.width=e.height,e.height=t}return e},mxShape.prototype.augmentBoundingBox=function(e){this.isShadow&&(e.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),e.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale));var t=Math.ceil(this.strokewidth*this.scale);e.grow(Math.ceil(t/2))},mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&("north"==this.direction||"south"==this.direction)},mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0},mxShape.prototype.getTextRotation=function(){var e=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxShape.prototype.getShapeRotation=function(){var e=this.getRotation();return null!=this.direction&&("north"==this.direction?e+=270:"west"==this.direction?e+=180:"south"==this.direction&&(e+=90)),e},mxShape.prototype.addTransparentBackgroundRectangle=function(e,t,n,a,i){(e=document.createElementNS(mxConstants.NS_SVG,"rect")).setAttribute("x",t),e.setAttribute("y",n),e.setAttribute("width",a),e.setAttribute("height",i),e.setAttribute("fill","none"),e.setAttribute("stroke","none"),e.setAttribute("pointer-events","all"),this.node.appendChild(e)},mxShape.prototype.setTransparentBackgroundImage=function(e){e.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(e){if(null!=e)for(var t in e){var n=e[t];n.mxRefCount=(n.mxRefCount||0)-1,0==n.mxRefCount&&null!=n.parentNode&&n.parentNode.removeChild(n)}},mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null};var mxStencilRegistry={stencils:[],addStencil:function(e,t){mxStencilRegistry.stencils[e]=t},getStencil:function(e){return mxStencilRegistry.stencils[e]}},mxMarker={markers:[],addMarker:function(e,t){mxMarker.markers[e]=t},createMarker:function(e,t,n,a,i,o,s,r,l,d){var c=mxMarker.markers[n];return null!=c?c(e,t,n,a,i,o,s,r,l,d):null}};function mxActor(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxCloud(e,t,n,a){mxActor.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxRectangleShape(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxEllipse(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxDoubleEllipse(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxRhombus(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxPolyline(e,t,n){mxShape.call(this),this.points=e,this.stroke=t,this.strokewidth=null!=n?n:1}function mxArrow(e,t,n,a,i,o,s){mxShape.call(this),this.points=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1,this.arrowWidth=null!=i?i:mxConstants.ARROW_WIDTH,this.spacing=null!=o?o:mxConstants.ARROW_SPACING,this.endSize=null!=s?s:mxConstants.ARROW_SIZE}function mxText(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g,v,h,b,f,A){mxShape.call(this),this.value=e,this.bounds=t,this.color=null!=i?i:"black",this.align=null!=n?n:"",this.valign=null!=a?a:"",this.family=null!=o?o:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=s?s:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=r?r:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(l||2),this.spacingTop=this.spacing+parseInt(d||0),this.spacingRight=this.spacing+parseInt(c||0),this.spacingBottom=this.spacing+parseInt(m||0),this.spacingLeft=this.spacing+parseInt(u||0),this.horizontal=null==p||p,this.background=g,this.border=v,this.wrap=null!=h&&h,this.clipped=null!=b&&b,this.overflow=null!=f?f:"visible",this.labelPadding=null!=A?A:0,this.rotation=0}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(e,t,n){mxShape.call(this),this.bounds=e,this.stroke=t,this.strokewidth=null!=n?n:1}function mxImageShape(e,t,n,a,i){mxShape.call(this),this.bounds=e,this.image=t,this.fill=n,this.stroke=a,this.strokewidth=null!=i?i:1,this.shadow=!1}function mxLabel(e,t,n,a){mxRectangleShape.call(this,e,t,n,a)}function mxCylinder(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxConnector(e,t,n){mxPolyline.call(this,e,t,n)}function mxSwimlane(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxGraphLayout(e){this.graph=e}function mxStackLayout(e,t,n,a,i,o){mxGraphLayout.call(this,e),this.horizontal=null==t||t,this.spacing=null!=n?n:0,this.x0=null!=a?a:0,this.y0=null!=i?i:0,this.border=null!=o?o:0}function mxPartitionLayout(e,t,n,a){mxGraphLayout.call(this,e),this.horizontal=null==t||t,this.spacing=n||0,this.border=a||0}function mxCompactTreeLayout(e,t,n){mxGraphLayout.call(this,e),this.horizontal=null==t||t,this.invert=null!=n&&n}function WeightedCellSorter(e,t){this.cell=e,this.weightedValue=t}function mxFastOrganicLayout(e){mxGraphLayout.call(this,e)}function mxCircleLayout(e,t){mxGraphLayout.call(this,e),this.radius=null!=t?t:100}function mxParallelEdgeLayout(e){mxGraphLayout.call(this,e)}function mxCompositeLayout(e,t,n){mxGraphLayout.call(this,e),this.layouts=t,this.master=n}function mxEdgeLabelLayout(e,t){mxGraphLayout.call(this,e)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=e}function mxGraphHierarchyEdge(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.edges=e}function mxGraphHierarchyModel(e,t,n,a,i){for(e.getGraph(),this.tightenToSource=i,this.roots=n,this.parent=a,this.vertexMapper={},this.edgeMapper={},this.maxRank=0,n=[],null==t&&(t=this.graph.getChildVertices(a)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(e,t,n),a=0;a<t.length;a++){i=n[a].connectsAsSource;for(var o=0;o<i.length;o++){var s=i[o];if(null!=(r=s.edges)&&0<r.length){var r=r[0],l=e.getVisibleTerminal(r,!1);l=mxCellPath.create(l),l=this.vertexMapper[l];n[a]==l&&(l=e.getVisibleTerminal(r,!0),l=mxCellPath.create(l),l=this.vertexMapper[l]),null!=l&&n[a]!=l&&(0==(s.target=l).connectsAsTarget.length&&(l.connectsAsTarget=[]),mxUtils.indexOf(l.connectsAsTarget,s)<0&&l.connectsAsTarget.push(s))}}n[a].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(e){this.layout=e}function MedianCellSorter(){}function mxMinimumCycleRemover(e){this.layout=e}function mxCoordinateAssignment(e,t,n,a,i,o){this.layout=e,this.intraCellSpacing=t,this.interRankCellSpacing=n,this.orientation=a,this.initialX=i,this.parallelEdgeSpacing=o}!function(){function e(e,t,n,a,i,o,s,r,l,d){t=1.118*i*l,r=1.118*o*l,i*=s+l,o*=s+l;var c=a.clone();return c.x-=t,c.y-=r,s=n!=mxConstants.ARROW_CLASSIC?1:.75,a.x+=-i*s-t,a.y+=-o*s-r,function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i-o/2,c.y-o+i/2),n==mxConstants.ARROW_CLASSIC&&e.lineTo(c.x-3*i/4,c.y-3*o/4),e.lineTo(c.x+o/2-i,c.y-o-i/2),e.close(),d?e.fillAndStroke():e.stroke()}}function t(e,t,n,a,i,o,s,r,l,d){r=n==mxConstants.ARROW_DIAMOND?.7071:.9862,t=i*l*r,r*=o*l,i*=s+l,o*=s+l;var c=a.clone();c.x-=t,c.y-=r,a.x+=-i-t,a.y+=-o-r;var m=n==mxConstants.ARROW_DIAMOND?2:3.4;return function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i/2-o/m,c.y+i/m-o/2),e.lineTo(c.x-i,c.y-o),e.lineTo(c.x-i/2+o/m,c.y-o/2-i/m),e.close(),d?e.fillAndStroke():e.stroke()}}mxMarker.addMarker("classic",e),mxMarker.addMarker("block",e),mxMarker.addMarker("open",function(e,t,n,a,i,o,s,r,l,d){t=1.118*i*l,n=1.118*o*l,i*=s+l,o*=s+l;var c=a.clone();return c.x-=t,c.y-=n,a.x+=2*-t,a.y+=2*-n,function(){e.begin(),e.moveTo(c.x-i-o/2,c.y-o+i/2),e.lineTo(c.x,c.y),e.lineTo(c.x+o/2-i,c.y-o-i/2),e.stroke()}}),mxMarker.addMarker("oval",function(e,t,n,a,i,o,s,r,l,d){var c=s/2,m=a.clone();return a.x-=i*c,a.y-=o*c,function(){e.ellipse(m.x-c,m.y-c,s,s),d?e.fillAndStroke():e.stroke()}}),mxMarker.addMarker("diamond",t),mxMarker.addMarker("diamondThin",t)}(),mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(e,t,n,a,i){e.translate(t,n),e.begin(),this.redrawPath(e,t,n,a,i),e.fillAndStroke()},mxActor.prototype.redrawPath=function(e,t,n,a,i){t=a/3,e.moveTo(0,i),e.curveTo(0,3*i/5,0,2*i/5,a/2,2*i/5),e.curveTo(a/2-t,2*i/5,a/2-t,0,a/2,0),e.curveTo(a/2+t,0,a/2+t,2*i/5,a/2,2*i/5),e.curveTo(a,2*i/5,a,3*i/5,a,i),e.close()},mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(e,t,n,a,i){e.moveTo(.25*a,.25*i),e.curveTo(.05*a,.25*i,0,.5*i,.16*a,.55*i),e.curveTo(0,.66*i,.18*a,.9*i,.31*a,.8*i),e.curveTo(.4*a,i,.7*a,i,.8*a,.8*i),e.curveTo(a,.8*i,a,.6*i,.875*a,.5*i),e.curveTo(a,.3*i,.8*a,.1*i,.625*a,.2*i),e.curveTo(.5*a,.05*i,.3*a,.05*i,.25*a,.25*i),e.close()},mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.isRounded&&!this.glass&&0==this.rotation},mxRectangleShape.prototype.paintBackground=function(e,t,n,a,i){if(this.isRounded){var o=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;o=Math.min(a*o,i*o);e.roundrect(t,n,a,i,o,o)}else e.rect(t,n,a,i);e.fillAndStroke()},mxRectangleShape.prototype.paintForeground=function(e,t,n,a,i){this.glass&&this.paintGlassEffect(e,t,n,a,i,this.getArcSize(a+this.strokewidth,i+this.strokewidth))},mxRectangleShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxRectangleShape.prototype.updateHtmlBounds=function(e){var t=9<=document.documentMode?0:Math.ceil(this.strokewidth*this.scale);e.style.borderWidth=Math.max(1,t)+"px",e.style.overflow="hidden",e.style.left=Math.round(this.bounds.x-t/2)+"px",e.style.top=Math.round(this.bounds.y-t/2)+"px","CSS1Compat"==document.compatMode&&(t=-t),e.style.width=Math.round(Math.max(0,this.bounds.width+t))+"px",e.style.height=Math.round(Math.max(0,this.bounds.height+t))+"px"},mxRectangleShape.prototype.updateHtmlColors=function(e){var t=this.stroke;null!=t&&t!=mxConstants.NONE?(e.style.borderColor=t,this.isDashed?e.style.borderStyle="dashed":0<this.strokewidth&&(e.style.borderStyle="solid"),e.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):e.style.borderWidth="0px",null!=(t=this.fill)&&t!=mxConstants.NONE?(e.style.backgroundColor=t,e.style.backgroundImage="none"):this.pointerEvents?e.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(e):this.setTransparentBackgroundImage(e)},mxRectangleShape.prototype.updateHtmlFilters=function(e){var t="";if(this.opacity<100&&(t+="alpha(opacity="+this.opacity+")"),this.isShadow&&(t+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.SHADOWCOLOR+"')"),this.gradient){var n=this.fill,a=this.gradient,i="0",o={east:0,south:1,west:2,north:3},s=null!=this.direction?o[this.direction]:0;null!=this.gradientDirection&&(s=mxUtils.mod(s+o[this.gradientDirection]-1,4)),1==s?(i="1",o=n,n=a,a=o):2==s?(o=n,n=a,a=o):3==s&&(i="1"),t+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+n+"', endColorStr='"+a+"', gradientType='"+i+"')"}e.style.filter=t},mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(e,t,n,a,i){e.ellipse(t,n,a,i),e.fillAndStroke()},mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(e,t,n,a,i){e.ellipse(t,n,a,i),e.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(e,t,n,a,i){var o=Math.min(4,Math.min(a/5,i/5));i-=2*o,0<(a-=2*o)&&0<i&&e.ellipse(t+o,n+o,a,i),e.stroke()},mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.paintVertexShape=function(e,t,n,a,i){var o=a/2,s=i/2;e.begin(),e.moveTo(t+o,n),e.lineTo(t+a,n+s),e.lineTo(t+o,n+i),e.lineTo(t,n+s),e.close(),e.fillAndStroke()},mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.paintEdgeShape=function(e,t){this.paintLine(e,t,this.isRounded)},mxPolyline.prototype.paintLine=function(e,t,n){var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,i=t[0],o=t[t.length-1];e.begin(),e.moveTo(i.x,i.y);for(var s=1;s<t.length-1;s++){var r=t[s],l=i.x-r.x;i=i.y-r.y;if(n&&s<t.length-1&&(0!=l||0!=i)){var d=Math.sqrt(l*l+i*i);l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d;e.lineTo(r.x+l,r.y+i),l=(i=t[s+1]).x-r.x,i=i.y-r.y,d=Math.max(1,Math.sqrt(l*l+i*i)),l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d,l=r.x+l,i=r.y+i,e.quadTo(r.x,r.y,l,i),r=new mxPoint(l,i)}else e.lineTo(r.x,r.y);i=r}e.lineTo(o.x,o.y),e.stroke()},mxUtils.extend(mxArrow,mxShape),mxArrow.prototype.paintEdgeShape=function(e,t){var n=mxConstants.ARROW_SPACING,a=mxConstants.ARROW_WIDTH,i=mxConstants.ARROW_SIZE,o=t[0],s=t[t.length-1],r=s.x-o.x,l=s.y-o.y,d=(c=Math.sqrt(r*r+l*l))-2*n-i,c=(r=r/c,a*(l=l/c)/3),m=(a=-a*r/3,(i=o.x-c/2+n*r)+c),u=(o=o.y-a/2+n*l)+a,p=m+d*r,g=p+c,v=(d=u+d*l)+a,h=g-3*c,b=v-3*a;e.begin(),e.moveTo(i,o),e.lineTo(m,u),e.lineTo(p,d),e.lineTo(g,v),e.lineTo(s.x-n*r,s.y-n*l),e.lineTo(h,b),e.lineTo(h+c,b+a),e.close(),e.fillAndStroke()},mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!(null==this.bounds||isNaN(this.bounds.x)||isNaN(this.bounds.y)||isNaN(this.bounds.width)||isNaN(this.bounds.height))},mxText.prototype.updateBoundingBox=function(){var e=this.node;8==document.documentMode&&null!=e.firstChild&&(null!=(e=e.firstChild).firstChild&&(e=e.firstChild)),this.boundingBox=this.bounds.clone();var t=this.getTextRotation();if(this.ignoreStringSize||null==e||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize)this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height;else{var n=null,a=null;if(null!=e.ownerSVGElement)if(null!=e.firstChild&&null!=e.firstChild.firstChild&&"foreignObject"==e.firstChild.firstChild.nodeName)e=e.firstChild.firstChild,n=this.wrap?this.bounds.width:parseInt(e.getAttribute("width"))*this.scale,a=parseInt(e.getAttribute("height"))*this.scale;else{if(0==(t=e.getBBox()).width&&0==t.height)return;this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),t=0}else a=this.state.view.textDiv,null!=this.offsetWidth&&null!=this.offsetHeight?(n=this.wrap?this.bounds.width:this.offsetWidth*this.scale,a=this.offsetHeight*this.scale):null!=a?(this.updateFont(a),this.updateSize(a),mxUtils.isNode(this.value)?a.innerHTML=this.value.outerHTML:(n=this.replaceLinefeeds?this.value.replace(/\n/g,"<br/>"):this.value,a.innerHTML=n),n=this.wrap?this.bounds.width:a.offsetWidth*this.scale,a=a.offsetHeight*this.scale):(n=this.wrap?this.bounds.width:e.offsetWidth*this.scale,a=e.offsetHeight*this.scale);null!=n&&null!=a&&(this.boundingBox=new mxRectangle(this.bounds.x+this.margin.x*n,this.bounds.y+this.margin.y*a,n,a))}null!=this.boundingBox&&(0!=t&&(t=mxUtils.getBoundingBox(this.boundingBox,t),this.boundingBox.x=t.x,this.boundingBox.y=t.y,mxClient.IS_QUIRKS||(this.boundingBox.width=t.width,this.boundingBox.height=t.height)),this.boundingBox.x=Math.floor(this.boundingBox.x),this.boundingBox.y=Math.floor(this.boundingBox.y),this.boundingBox.width=Math.ceil(this.boundingBox.width),this.boundingBox.height=Math.ceil(this.boundingBox.height))},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(e,t,n,a,i){mxShape.prototype.configureCanvas.apply(this,arguments),e.setFontColor(this.color),e.setFontBackgroundColor(this.background),e.setFontBorderColor(this.border),e.setFontFamily(this.family),e.setFontSize(this.size),e.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.paint=function(e){var t=this.scale,n=this.bounds.x/t,a=this.bounds.y/t,i=this.bounds.width/t;t=this.bounds.height/t;this.updateTransform(e,n,a,i,t),this.configureCanvas(e,n,a,i,t);var o=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,s=o||e instanceof mxVmlCanvas2D?"html":"",r=this.value;!o&&"html"==s&&(r=mxUtils.htmlEntities(r,!1)),r=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==s?r.replace(/\n/g,"<br/>"):r,e.text(n,a,i,t,r,this.align,this.valign,this.wrap,s,"fill"==this.overflow,this.clipped,this.getTextRotation())},mxText.prototype.redrawHtmlShape=function(){var e=this.node.style;e.opacity=this.opacity<1?this.opacity:"",e.overflow="",e.width="",e.height="",this.updateFont(this.node),this.updateSize(this.node),this.updateValue(),this.offsetHeight=this.offsetWidth=null,null!=mxClient.CSS_PREFIX?this.updateHtmlTransform():this.updateHtmlFilter()},mxText.prototype.updateHtmlTransform=function(){var e=this.getTextRotation(),t=this.node.style,n=this.margin.x,a=this.margin.y;0!=e?(t[mxClient.CSS_PREFIX+"TransformOrigin"]=100*-n+"% "+100*-a+"%",t[mxClient.CSS_PREFIX+"Transform"]="translate("+100*n+"%,"+100*a+"%)scale("+this.scale+") rotate("+e+"deg)"):(t[mxClient.CSS_PREFIX+"TransformOrigin"]="0% 0%",t[mxClient.CSS_PREFIX+"Transform"]="scale("+this.scale+")translate("+100*n+"%,"+100*a+"%)"),t.left=Math.round(this.bounds.x)+"px",t.top=Math.round(this.bounds.y)+"px"},mxText.prototype.updateHtmlFilter=function(){var e=this.node.style,t=this.margin.x,n=this.margin.y,a=this.scale;e.filter="";var i=0,o=0;if(null!=(r=null!=this.state?this.state.view.textDiv:null)){if(r.style.overflow="",r.style.height="",r.style.width="",this.updateFont(r),this.updateSize(r),mxUtils.isNode(this.value))r.innerHTML=this.value.outerHTML;else{var s=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(s=mxUtils.htmlEntities(s,!1)),s=this.replaceLinefeeds?s.replace(/\n/g,"<br/>"):s,r.innerHTML=s}i=r.offsetWidth+2,o=r.offsetHeight+2}else i=this.node.offsetWidth,o=this.node.offsetHeight+1;this.offsetWidth=i,this.offsetHeight=o,r=this.bounds.width/a,s=this.bounds.height/a,mxClient.IS_QUIRKS&&(this.clipped||"fill"==this.overflow)&&0<s?(s=Math.min(s,o),e.height=Math.round(s+1)+"px"):s=o,"fill"!=this.overflow&&(mxClient.IS_QUIRKS&&(this.clipped||this.wrap)&&0<r?(r=Math.min(r,i),e.width=Math.round(r)+"px"):r=i);s*=a;var r=r*a,l=(i=this.getTextRotation()*(Math.PI/180),o=parseFloat(parseFloat(Math.cos(i)).toFixed(8)),parseFloat(parseFloat(Math.sin(-i)).toFixed(8)));(i=i%(2*Math.PI))<0&&(i+=2*Math.PI),(i%=Math.PI)>Math.PI/2&&(i=Math.PI-i);var d=Math.cos(i),c=Math.sin(-i),m=(s-s*d+r*c)/2+l*(t=r*-(t+.5))-o*(n=s*-(n+.5));0!=i&&(e.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+o+", M12="+l+", M21="+-l+", M22="+o+", sizingMethod='auto expand')"),e.zoom=a,e.left=Math.round(this.bounds.x+((r-r*d+s*c)/2-o*t-l*n)-r/2)+"px",e.top=Math.round(this.bounds.y+m-s/2)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1));e=this.replaceLinefeeds?e.replace(/\n/g,"<br/>"):e;var t=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,n=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if(null!=t||null!=n)if("fill"==this.overflow)null!=t&&(this.node.style.backgroundColor=t),null!=n&&(this.node.style.border="1px solid "+n);else{var a="";null!=t&&(a+="background-color:"+t+";"),null!=n&&(a+="border:1px solid "+n+";"),e='<div style="zoom:1;'+a+"display:inline-block;_display:inline;padding-bottom:1px;padding-right:1px;line-height:"+this.node.style.lineHeight+'">'+e+"</div>",this.node.style.lineHeight=""}this.node.innerHTML=e}},mxText.prototype.updateFont=function(e){(e=e.style).lineHeight=Math.round(this.size*mxConstants.LINE_HEIGHT)+"px",e.fontSize=Math.round(this.size)+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,e.fontWeight=(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"",e.fontStyle=(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"",e.fontDecoration=(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE?"underline":"",e.textAlign=this.align==mxConstants.ALIGN_CENTER?"center":this.align==mxConstants.ALIGN_RIGHT?"right":"left"},mxText.prototype.updateSize=function(e){var t=Math.round(this.bounds.width/this.scale),n=Math.round(this.bounds.height/this.scale);e=e.style,this.clipped?(e.overflow="hidden",0<n&&(e.maxHeight=n+"px"),0<t&&(e.width=t+"px")):"fill"==this.overflow&&(e.width=t+"px",0<n&&(e.maxHeight=n+"px")),this.wrap?(!this.clipped&&0<t&&(e.width=t+"px"),e.whiteSpace="normal"):e.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.redrawPath=function(e,t,n,a,i){e.moveTo(0,0),e.lineTo(a,.5*i),e.lineTo(0,i),e.close()},mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(e,t,n,a,i){e.moveTo(.25*a,0),e.lineTo(.75*a,0),e.lineTo(a,.5*i),e.lineTo(.75*a,i),e.lineTo(.25*a,i),e.lineTo(0,.5*i),e.close()},mxUtils.extend(mxLine,mxShape),mxLine.prototype.paintVertexShape=function(e,t,n,a,i){n+=i/2,e.begin(),e.moveTo(t,n),e.lineTo(t+a,n),e.stroke()},mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return mxClient.IS_IE?0:.5},mxImageShape.prototype.apply=function(e){mxShape.prototype.apply.apply(this,arguments),this.gradient=this.stroke=this.fill=null,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER),this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxImageShape.prototype.paintVertexShape=function(e,t,n,a,i){if(null!=this.image){var o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null==o&&null==s||(e.setFillColor(o),e.setStrokeColor(s),e.rect(t,n,a,i),e.fillAndStroke()),e.image(t,n,a,i,this.image,this.preserveImageAspect,!1,!1)}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.style.backgroundColor=this.fill||"",this.node.style.borderColor=this.stroke||"",this.node.innerHTML="",null!=this.image){var e=document.createElement(mxClient.IS_IE6||null==mxClient.CSS_PREFIX&&0!=this.rotation?mxClient.VML_PREFIX+":image":"img");e.style.position="absolute",e.src=this.image;var t=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=t,this.flipH&&this.flipV?t+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?t+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(t+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),e.style.filter!=t&&(e.style.filter=t),"image"==e.nodeName?e.style.rotation=this.rotation:e.style[mxClient.CSS_PREFIX+"Transform"]="rotate("+this.rotation+"deg)",e.style.width=this.node.style.width,e.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(e)}else this.setTransparentBackgroundImage(this.node)},mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(e){mxShape.prototype.init.apply(this,arguments),null!=this.indicatorColor&&null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.bounds=this.bounds,this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape},mxLabel.prototype.paintForeground=function(e,t,n,a,i){this.paintImage(e,t,n,a,i),this.paintIndicator(e,t,n,a,i),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(e,t,n,a,i){null!=this.image&&(t=this.getImageBounds(t,n,a,i),e.image(t.x,t.y,t.width,t.height,this.image,!1,!1,!1))},mxLabel.prototype.getImageBounds=function(e,t,n,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),s=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),r=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return new mxRectangle(e=i==mxConstants.ALIGN_CENTER?e+(n-s)/2:i==mxConstants.ALIGN_RIGHT?e+(n-s-l):e+l,t=o==mxConstants.ALIGN_TOP?t+l:o==mxConstants.ALIGN_BOTTOM?t+(a-r-l):t+(a-r)/2,s,r)},mxLabel.prototype.paintIndicator=function(e,t,n,a,i){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(t,n,a,i),this.indicator.paint(e)):null!=this.indicatorImage&&(t=this.getIndicatorBounds(t,n,a,i),e.image(t.x,t.y,t.width,t.height,this.indicatorImage,!1,!1,!1))},mxLabel.prototype.getIndicatorBounds=function(e,t,n,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),s=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),r=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),l=this.spacing+5;return new mxRectangle(e=i==mxConstants.ALIGN_RIGHT?e+(n-s-l):i==mxConstants.ALIGN_CENTER?e+(n-s)/2:e+l,t=o==mxConstants.ALIGN_BOTTOM?t+(a-r-l):o==mxConstants.ALIGN_TOP?t+l:t+(a-r)/2,s,r)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var e=document.createElement("img");e.style.position="relative",e.setAttribute("border","0");var t=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);t.x-=this.bounds.x,t.y-=this.bounds.y,e.style.left=Math.round(t.x)+"px",e.style.top=Math.round(t.y)+"px",e.style.width=Math.round(t.width)+"px",e.style.height=Math.round(t.height)+"px",e.src=this.image,this.node.appendChild(e)}},mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(e,t,n,a,i){e.translate(t,n),e.begin(),this.redrawPath(e,t,n,a,i,!1),e.fillAndStroke(),e.setShadow(!1),e.begin(),this.redrawPath(e,t,n,a,i,!0),e.stroke()},mxCylinder.prototype.redrawPath=function(e,t,n,a,i,o){t=Math.min(this.maxHeight,Math.round(i/5)),(o&&null!=this.fill||!o&&null==this.fill)&&(e.moveTo(0,t),e.curveTo(0,2*t,a,2*t,a,t),o||(e.stroke(),e.begin())),o||(e.moveTo(0,t),e.curveTo(0,-t/3,a,-t/3,a,t),e.lineTo(a,i-t),e.curveTo(a,i+t/3,0,i+t/3,0,i-t),e.close())},mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.paintEdgeShape=function(e,t){var n=this.createMarker(e,t,!0),a=this.createMarker(e,t,!1);null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(e,t,this.isRounded):this.paintCurvedLine(e,t),e.setFillColor(this.stroke),e.setShadow(!1),e.setDashed(!1),null!=n&&n(),null!=a&&a()},mxConnector.prototype.paintCurvedLine=function(e,t){e.begin();var n=t[0],a=t.length;for(e.moveTo(n.x,n.y),n=1;n<a-2;n++){var i=t[n],o=t[n+1];e.quadTo(i.x,i.y,(i.x+o.x)/2,(i.y+o.y)/2)}i=t[a-2],o=t[a-1],e.quadTo(i.x,i.y,o.x,o.y),e.stroke()},mxConnector.prototype.createMarker=function(e,t,n){var a=t.length,i=n?t[1]:t[a-2],o=(a=(t=n?t[0]:t[a-1]).x-i.x,t.y-i.y),s=(i=a/(s=Math.max(1,Math.sqrt(a*a+o*o))),a=o/s,o=mxUtils.getNumber(this.style,n?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),mxUtils.getValue(this.style,n?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW));return mxMarker.createMarker(e,this,s,t,i,a,o,n,this.strokewidth,0!=this.style[n?mxConstants.STYLE_STARTFILL:mxConstants.STYLE_ENDFILL])},mxConnector.prototype.augmentBoundingBox=function(e){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var t=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(t=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1),mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(t=Math.max(t,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+1),e.grow(Math.ceil(t*this.scale))},mxUtils.extend(mxSwimlane,mxShape),mxSwimlane.prototype.imageSize=16,mxSwimlane.prototype.getGradientBounds=function(e,t,n,a,i){return new mxRectangle(t,n,a,Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)))},mxSwimlane.prototype.getRotation=function(){var e=mxShape.prototype.getRotation.apply(this,arguments);return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxSwimlane.prototype.getTextRotation=function(){return this.getRotation()},mxSwimlane.prototype.isPaintBoundsInverted=function(){return mxShape.prototype.isPaintBoundsInverted.apply(this,arguments)||1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)},mxSwimlane.prototype.getArcSize=function(e,t,n){return 3*n*(mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100)},mxSwimlane.prototype.paintVertexShape=function(e,t,n,a,i){var o=Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),s=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE),r=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),l=0;e.translate(t,n),this.isRounded?(l=this.getArcSize(a,i,o),this.paintRoundedSwimlane(e,t,n,a,i,o,l,s,r)):this.paintSwimlane(e,t,n,a,i,o,s,r),s=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE),this.paintSeparator(e,a,o,i,s),null!=this.image&&(i=this.getImageBounds(t,o,a,i),e.image(i.x-t,i.y-n,i.width,i.height,this.image,!1,!1,!1)),this.glass&&(e.setShadow(!1),this.paintGlassEffect(e,0,0,a,o,l))},mxSwimlane.prototype.paintSwimlane=function(e,t,n,a,i,o,s,r){s!=mxConstants.NONE&&(e.save(),e.setFillColor(s),e.rect(0,0,a,i),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(0,o),e.lineTo(0,0),e.lineTo(a,0),e.lineTo(a,o),r&&e.close(),e.fillAndStroke(),o<i&&s==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,o),e.lineTo(0,i),e.lineTo(a,i),e.lineTo(a,o),e.stroke())},mxSwimlane.prototype.paintRoundedSwimlane=function(e,t,n,a,i,o,s,r,l){r!=mxConstants.NONE&&(e.save(),e.setFillColor(r),e.roundrect(0,0,a,i,s,s),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(a,o),e.lineTo(a,s),e.quadTo(a,0,a-Math.min(a/2,s),0),e.lineTo(Math.min(a/2,s),0),e.quadTo(0,0,0,s),e.lineTo(0,o),l&&e.close(),e.fillAndStroke(),o<i&&r==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,o),e.lineTo(0,i-s),e.quadTo(0,i,Math.min(a/2,s),i),e.lineTo(a-Math.min(a/2,s),i),e.quadTo(a,i,a,i-s),e.lineTo(a,o),e.stroke())},mxSwimlane.prototype.paintSeparator=function(e,t,n,a,i){i!=mxConstants.NONE&&(e.setStrokeColor(i),e.setDashed(!0),e.begin(),e.moveTo(t,n),e.lineTo(t,a),e.stroke(),e.setDashed(!1))},mxSwimlane.prototype.getImageBounds=function(e,t,n,a){return new mxRectangle(e+n-this.imageSize,t,this.imageSize,this.imageSize)},mxGraphLayout.prototype.graph=null,mxGraphLayout.prototype.useBoundingBox=!0,mxGraphLayout.prototype.parent=null,mxGraphLayout.prototype.moveCell=function(e,t,n){},mxGraphLayout.prototype.execute=function(e){},mxGraphLayout.prototype.getGraph=function(){return this.graph},mxGraphLayout.prototype.getConstraint=function(e,t,n,a){return null!=(t=null!=(n=this.graph.view.getState(t))?n.style:this.graph.getCellStyle(t))?t[e]:null},mxGraphLayout.traverse=function(e,t,n,a,i){if(null!=n&&null!=e){t=null==t||t,i=i||[];var o=mxCellPath.create(e);if(null==i[o]&&(null==(a=n(i[o]=e,a))||a)&&0<(a=this.graph.model.getEdgeCount(e)))for(o=0;o<a;o++){var s=this.graph.model.getEdgeAt(e,o),r=this.graph.model.getTerminal(s,!0)==e;t&&!r||(r=this.graph.view.getVisibleTerminal(s,!r),this.traverse(r,t,n,s,i))}}},mxGraphLayout.prototype.isVertexMovable=function(e){return this.graph.isCellMovable(e)},mxGraphLayout.prototype.isVertexIgnored=function(e){return!this.graph.getModel().isVertex(e)||!this.graph.isCellVisible(e)},mxGraphLayout.prototype.isEdgeIgnored=function(e){var t=this.graph.getModel();return!t.isEdge(e)||!this.graph.isCellVisible(e)||null==t.getTerminal(e,!0)||null==t.getTerminal(e,!1)},mxGraphLayout.prototype.setEdgeStyleEnabled=function(e,t){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,t?"0":"1",[e])},mxGraphLayout.prototype.setOrthogonalEdge=function(e,t){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,t?"1":"0",[e])},mxGraphLayout.prototype.getParentOffset=function(e){var t=new mxPoint;if(null!=e&&e!=this.parent){var n=this.graph.getModel();if(n.isAncestor(this.parent,e))for(var a=n.getGeometry(e);e!=this.parent;)t.x+=a.x,t.y+=a.y,e=n.getParent(e),a=n.getGeometry(e)}return t},mxGraphLayout.prototype.setEdgePoints=function(e,t){if(null!=e){var n=this.graph.model,a=n.getGeometry(e);if(null==a?(a=new mxGeometry).setRelative(!0):a=a.clone(),null!=this.parent&&null!=t)for(var i=n.getParent(e),o=(i=this.getParentOffset(i),0);o<t.length;o++)t[o].x-=i.x,t[o].y-=i.y;a.points=t,n.setGeometry(e,a)}},mxGraphLayout.prototype.setVertexLocation=function(e,t,n){var a=this.graph.getModel(),i=a.getGeometry(e),o=null;if(null!=i){if(o=new mxRectangle(t,n,i.width,i.height),this.useBoundingBox){var s=this.graph.getView().getState(e);if(null!=s&&null!=s.text&&null!=s.text.boundingBox){var r=this.graph.getView().scale,l=s.text.boundingBox;s.text.boundingBox.x<s.x&&(t+=(s.x-l.x)/r,o.width=l.width),s.text.boundingBox.y<s.y&&(n+=(s.y-l.y)/r,o.height=l.height)}}null!=this.parent&&(null!=(s=a.getParent(e))&&s!=this.parent&&(t-=(s=this.getParentOffset(s)).x,n-=s.y)),i.x==t&&i.y==n||((i=i.clone()).x=t,i.y=n,a.setGeometry(e,i))}return o},mxGraphLayout.prototype.getVertexBounds=function(e){var t=this.graph.getModel().getGeometry(e);if(this.useBoundingBox&&(null!=(r=this.graph.getView().getState(e))&&null!=r.text&&null!=r.text.boundingBox)){var n=this.graph.getView().scale,a=r.text.boundingBox,i=Math.max(r.x-a.x,0)/n,o=Math.max(r.y-a.y,0)/n,s=Math.max(a.x+a.width-(r.x+r.width),0)/n,r=Math.max(a.y+a.height-(r.y+r.height),0)/n;t=new mxRectangle(t.x-i,t.y-o,t.width+i+s,t.height+o+r)}return null!=this.parent&&(e=this.graph.getModel().getParent(e),t=t.clone(),null!=e&&e!=this.parent&&(e=this.getParentOffset(e),t.x+=e.x,t.y+=e.y)),new mxRectangle(t.x,t.y,t.width,t.height)},mxGraphLayout.prototype.arrangeGroups=function(e,t){this.graph.getModel().beginUpdate();try{for(var n=e.length-1;0<=n;n--){var a=e[n],i=this.graph.getChildVertices(a),o=this.graph.getBoundingBoxFromGeometry(i),s=this.graph.getCellGeometry(a),r=0,l=0;if(this.graph.isSwimlane(a)){var d=this.graph.getStartSize(a);r=d.width,l=d.height}null!=o&&null!=s&&((s=s.clone()).x=s.x+o.x-t-r,s.y=s.y+o.y-t-l,s.width=o.width+2*t+r,s.height=o.height+2*t+l,this.graph.getModel().setGeometry(a,s),this.graph.moveCells(i,t+r-o.x,t+l-o.y))}}finally{this.graph.getModel().endUpdate()}},mxStackLayout.prototype=new mxGraphLayout,mxStackLayout.prototype.constructor=mxStackLayout,mxStackLayout.prototype.horizontal=null,mxStackLayout.prototype.spacing=null,mxStackLayout.prototype.x0=null,mxStackLayout.prototype.y0=null,mxStackLayout.prototype.border=0,mxStackLayout.prototype.keepFirstLocation=!1,mxStackLayout.prototype.fill=!1,mxStackLayout.prototype.resizeParent=!1,mxStackLayout.prototype.resizeLast=!1,mxStackLayout.prototype.wrap=null,mxStackLayout.prototype.isHorizontal=function(){return this.horizontal},mxStackLayout.prototype.moveCell=function(e,t,n){var a=this.graph.getModel(),i=a.getParent(e),o=this.isHorizontal();if(null!=e&&null!=i){var s=0,r=0,l=a.getChildCount(i);for(t=o?t:n,null!=(s=this.graph.getView().getState(i))&&(t-=o?s.x:s.y),s=0;s<l;s++)if((n=a.getChildAt(i,s))!=e&&null!=(n=a.getGeometry(n))){if(n=o?n.x+n.width/2:n.y+n.height/2,r<t&&t<n)break;r=n}o=i.getIndex(e),o=Math.max(0,s-(o<s?1:0)),a.add(i,e,o)}},mxStackLayout.prototype.getParentSize=function(e){var t=this.graph.getModel(),n=t.getGeometry(e);return null!=this.graph.container&&(null==n&&t.isLayer(e)||e==this.graph.getView().currentRoot)&&(n=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),n},mxStackLayout.prototype.execute=function(e){if(null!=e){var t=this.isHorizontal(),n=this.graph.getModel(),a=this.getParentSize(e),i=0;null!=a&&(i=t?a.height:a.width);i=i-(2*this.spacing+2*this.border);var o=this.x0+this.border,s=this.y0+this.border;if(this.graph.isSwimlane(e)){var r=this.graph.getCellStyle(e),l=mxUtils.getValue(r,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);t==(r=mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0))&&(i-=l),t?s+=l:o+=l}n.beginUpdate();try{l=0,r=null;for(var d=n.getChildCount(e),c=0;c<d;c++){var m=n.getChildAt(e,c);if(!this.isVertexIgnored(m)&&this.isVertexMovable(m)){var u=n.getGeometry(m);null!=u&&(u=u.clone(),null!=this.wrap&&null!=r&&(t&&r.x+r.width+u.width+2*this.spacing>this.wrap||!t&&r.y+r.height+u.height+2*this.spacing>this.wrap)&&(r=null,t?s+=l+this.spacing:o+=l+this.spacing,l=0),l=Math.max(l,t?u.height:u.width),null!=r?t?u.x=r.x+r.width+this.spacing:u.y=r.y+r.height+this.spacing:this.keepFirstLocation||(t?u.x=o:u.y=s),t?u.y=s:u.x=o,this.fill&&0<i&&(t?u.height=i:u.width=i),n.setGeometry(m,u),r=u)}}this.resizeParent&&null!=a&&null!=r&&!this.graph.isCellCollapsed(e)?(a=a.clone(),t?a.width=r.x+r.width+this.spacing:a.height=r.y+r.height+this.spacing,n.setGeometry(e,a)):this.resizeLast&&null!=a&&null!=r&&(t?r.width=a.width-r.x-this.spacing:r.height=a.height-r.y-this.spacing)}finally{n.endUpdate()}}},mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(e,t,n){var a=(n=this.graph.getModel()).getParent(e);if(null!=e&&null!=a){var i=0,o=0,s=n.getChildCount(a);for(i=0;i<s;i++){var r=n.getChildAt(a,i);if(null!=(r=this.getVertexBounds(r))){if(r=r.x+r.width/2,o<t&&t<r)break;o=r}}t=a.getIndex(e),t=Math.max(0,i-(t<i?1:0)),n.add(a,e,t)}},mxPartitionLayout.prototype.execute=function(e){var t=this.isHorizontal(),n=this.graph.getModel(),a=n.getGeometry(e);if(null!=this.graph.container&&(null==a&&n.isLayer(e)||e==this.graph.getView().currentRoot)&&(a=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),null!=a){for(var i=[],o=n.getChildCount(e),s=0;s<o;s++){var r=n.getChildAt(e,s);!this.isVertexIgnored(r)&&this.isVertexMovable(r)&&i.push(r)}if(0<(o=i.length)){var l=this.border,d=this.border,c=(c=t?a.height:a.width)-2*this.border;if(e=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle,c-=t?e.height:e.width,l+=e.width,d+=e.height,e=this.border+(o-1)*this.spacing,0<(a=t?(a.width-l-e)/o:(a.height-d-e)/o)){n.beginUpdate();try{for(s=0;s<o;s++){r=i[s];var m=n.getGeometry(r);null!=m&&((m=m.clone()).x=l,m.y=d,t?(this.resizeVertices&&(m.width=a,m.height=c),l+=a+this.spacing):(this.resizeVertices&&(m.height=a,m.width=c),d+=a+this.spacing),n.setGeometry(r,m))}}finally{n.endUpdate()}}}}},mxCompactTreeLayout.prototype=new mxGraphLayout,mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout,mxCompactTreeLayout.prototype.horizontal=null,mxCompactTreeLayout.prototype.invert=null,mxCompactTreeLayout.prototype.resizeParent=!0,mxCompactTreeLayout.prototype.groupPadding=10,mxCompactTreeLayout.prototype.parentsChanged=null,mxCompactTreeLayout.prototype.moveTree=!1,mxCompactTreeLayout.prototype.levelDistance=10,mxCompactTreeLayout.prototype.nodeDistance=20,mxCompactTreeLayout.prototype.resetEdges=!0,mxCompactTreeLayout.prototype.prefHozEdgeSep=5,mxCompactTreeLayout.prototype.prefVertEdgeOff=4,mxCompactTreeLayout.prototype.minEdgeJetty=8,mxCompactTreeLayout.prototype.channelBuffer=4,mxCompactTreeLayout.prototype.edgeRouting=!0,mxCompactTreeLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal},mxCompactTreeLayout.prototype.execute=function(e,t){this.parent=e;var n=this.graph.getModel();if(null==t)if(0<this.graph.getEdges(e,n.getParent(e),this.invert,!this.invert,!1).length)t=e;else{if(0<(s=this.graph.findTreeRoots(e,!0,this.invert)).length)for(var a=0;a<s.length;a++)if(!this.isVertexIgnored(s[a])&&0<this.graph.getEdges(s[a],null,this.invert,!this.invert,!1).length){t=s[a];break}}if(null!=t){this.parentsChanged=this.resizeParent?{}:null,n.beginUpdate();try{var i=this.dfs(t,e);if(null!=i){this.layout(i);var o=this.graph.gridSize,s=o;if(!this.moveTree){var r=this.getVertexBounds(t);null!=r&&(o=r.x,s=r.y)}if((r=null)!=(r=this.isHorizontal()?this.horizontalLayout(i,o,s):this.verticalLayout(i,null,o,s))){var l=a=0;r.x<0&&(a=Math.abs(o-r.x)),r.y<0&&(l=Math.abs(s-r.y)),(0!=a||0!=l)&&this.moveNode(i,a,l),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(i)}}}finally{n.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(e,t,n){for(e.x+=t,e.y+=n,this.apply(e),e=e.child;null!=e;)this.moveNode(e,t,n),e=e.next},mxCompactTreeLayout.prototype.dfs=function(e,t,n){n=null!=n?n:[];var a=mxCellPath.create(e),i=null;if(null!=e&&null==n[a]&&!this.isVertexIgnored(e)){n[a]=e;i=this.createNode(e),a=this.graph.getModel();var o=null;e=this.graph.getEdges(e,t,this.invert,!this.invert,!1,!0);for(var s=this.graph.getView(),r=0;r<e.length;r++){var l=e[r];if(!this.isEdgeIgnored(l)){this.resetEdges&&this.setEdgePoints(l,null),this.edgeRouting&&(this.setEdgeStyleEnabled(l,!1),this.setEdgePoints(l,null));var d;l=null!=(d=s.getState(l))?d.getVisibleTerminal(this.invert):s.getVisibleTerminal(l,this.invert);null!=(d=this.dfs(l,t,n))&&null!=a.getGeometry(l)&&(null==o?i.child=d:o.next=d,o=d)}}}return i},mxCompactTreeLayout.prototype.layout=function(e){if(null!=e){for(var t=e.child;null!=t;)this.layout(t),t=t.next;null!=e.child?this.attachParent(e,this.join(e)):this.layoutLeaf(e)}},mxCompactTreeLayout.prototype.horizontalLayout=function(e,t,n,a){if(e.x+=t+e.offsetX,e.y+=n+e.offsetY,a=this.apply(e,a),null!=(t=e.child)){a=this.horizontalLayout(t,e.x,e.y,a),n=e.y+t.offsetY;for(var i=t.next;null!=i;)a=this.horizontalLayout(i,e.x+t.offsetX,n,a),n+=i.offsetY,i=i.next}return a},mxCompactTreeLayout.prototype.verticalLayout=function(e,t,n,a,i){if(e.x+=n+e.offsetY,e.y+=a+e.offsetX,i=this.apply(e,i),null!=(t=e.child))for(i=this.verticalLayout(t,e,e.x,e.y,i),n=e.x+t.offsetY,a=t.next;null!=a;)i=this.verticalLayout(a,e,n,e.y+t.offsetX,i),n+=a.offsetY,a=a.next;return i},mxCompactTreeLayout.prototype.attachParent=function(e,t){var n=this.nodeDistance+this.levelDistance,a=(t-e.width)/2-this.nodeDistance,i=a+e.width+2*this.nodeDistance-t;e.child.offsetX=n+e.height,e.child.offsetY=i,e.contour.upperHead=this.createLine(e.height,0,this.createLine(n,i,e.contour.upperHead)),e.contour.lowerHead=this.createLine(e.height,0,this.createLine(n,a,e.contour.lowerHead))},mxCompactTreeLayout.prototype.layoutLeaf=function(e){var t=2*this.nodeDistance;e.contour.upperTail=this.createLine(e.height+t,0),e.contour.upperHead=e.contour.upperTail,e.contour.lowerTail=this.createLine(0,-e.width-t),e.contour.lowerHead=this.createLine(e.height+t,0,e.contour.lowerTail)},mxCompactTreeLayout.prototype.join=function(e){var t=2*this.nodeDistance,n=e.child;e.contour=n.contour;var a=n.width+t,i=a;for(n=n.next;null!=n;){var o=this.merge(e.contour,n.contour);n.offsetY=o+a,n.offsetX=0,i+=o+(a=n.width+t),n=n.next}return i},mxCompactTreeLayout.prototype.merge=function(e,t){for(var n=0,a=0,i=0,o=e.lowerHead,s=t.upperHead;null!=s&&null!=o;){var r=this.offset(n,a,s.dx,s.dy,o.dx,o.dy);a=a+r,i=i+r;n+s.dx<=o.dx?(n+=s.dx,a+=s.dy,s=s.next):(n-=o.dx,a-=o.dy,o=o.next)}return null!=s?(n=this.bridge(e.upperTail,0,0,s,n,a),e.upperTail=null!=n.next?t.upperTail:n,e.lowerTail=t.lowerTail):null==(n=this.bridge(t.lowerTail,n,a,o,0,0)).next&&(e.lowerTail=n),e.lowerHead=t.lowerHead,i},mxCompactTreeLayout.prototype.offset=function(e,t,n,a,i,o){var s;return i<=e||e+n<=0?0:0<(s=0<i*a-n*o?e<0?e*a/n-t:0<e?e*o/i-t:-t:i<e+n?o-(t+(i-e)*a/n):e+n<i?(n+e)*o/i-(t+a):o-(t+a))?s:0},mxCompactTreeLayout.prototype.bridge=function(e,t,n,a,i,o){return t=i+a.dx-t,i=i=0,0==a.dx?i=a.dy:(i=t*a.dy,i/=a.dx),t=this.createLine(t,i,a.next),e.next=this.createLine(0,o+a.dy-i-n,t),t},mxCompactTreeLayout.prototype.createNode=function(e){var t={};return t.cell=e,t.x=0,t.y=0,t.width=0,t.height=0,null!=(e=this.getVertexBounds(e))&&(this.isHorizontal()?(t.width=e.height,t.height=e.width):(t.width=e.width,t.height=e.height)),t.offsetX=0,t.offsetY=0,t.contour={},t},mxCompactTreeLayout.prototype.apply=function(e,t){var n=this.graph.getModel(),a=e.cell,i=n.getGeometry(a);return null!=a&&null!=i&&(this.isVertexMovable(a)&&(i=this.setVertexLocation(a,e.x,e.y),this.resizeParent&&(n=n.getParent(a),a=mxCellPath.create(n),null==this.parentsChanged[a]&&(this.parentsChanged[a]=n))),t=null==t?new mxRectangle(i.x,i.y,i.width,i.height):new mxRectangle(Math.min(t.x,i.x),Math.min(t.y,i.y),Math.max(t.x+t.width,i.x+i.width),Math.max(t.y+t.height,i.y+i.height))),t},mxCompactTreeLayout.prototype.createLine=function(e,t,n){var a={};return a.dx=e,a.dy=t,a.next=n,a},mxCompactTreeLayout.prototype.adjustParents=function(){var e,t=[];for(e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(e){for(this.processNodeOutgoing(e),e=e.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(e){for(var t=e.child,n=e.cell,a=0,i=[];null!=t;){a++;var o=t.x;this.horizontal&&(o=t.y),i.push(new WeightedCellSorter(t,o)),t=t.next}i.sort(WeightedCellSorter.prototype.compare),(o=e.width)>(s=(a+1)*this.prefHozEdgeSep)+2*this.prefHozEdgeSep&&(o-=2*this.prefHozEdgeSep),t=(e=o/a)/2,o>s+2*this.prefHozEdgeSep&&(t+=this.prefHozEdgeSep);o=this.minEdgeJetty-this.prefVertEdgeOff;for(var s=0,r=this.getVertexBounds(n),l=0;l<i.length;l++){for(var d=i[l].cell.cell,c=this.getVertexBounds(d),m=(d=this.graph.getEdgesBetween(n,d,!1),[]),u=0,p=0,g=0;g<d.length;g++)this.horizontal?(u=r.x+r.width,p=r.y+t,m.push(new mxPoint(u,p)),u=r.x+r.width+o,m.push(new mxPoint(u,p)),p=c.y+c.height/2):(u=r.x+t,p=r.y+r.height,m.push(new mxPoint(u,p)),p=r.y+r.height+o,m.push(new mxPoint(u,p)),u=c.x+c.width/2),m.push(new mxPoint(u,p)),this.setEdgePoints(d[g],m);l<a/2?o+=this.prefVertEdgeOff:a/2<l&&(o-=this.prefVertEdgeOff),t+=e,s=Math.max(s,o)}},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,t){return null!=e&&null!=t?t.weightedValue>e.weightedValue?1:t.weightedValue<e.weightedValue?-1:t.nudge?1:-1:0},mxFastOrganicLayout.prototype=new mxGraphLayout,mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout,mxFastOrganicLayout.prototype.useInputOrigin=!0,mxFastOrganicLayout.prototype.resetEdges=!0,mxFastOrganicLayout.prototype.disableEdgeStyle=!0,mxFastOrganicLayout.prototype.forceConstant=50,mxFastOrganicLayout.prototype.forceConstantSquared=0,mxFastOrganicLayout.prototype.minDistanceLimit=2,mxFastOrganicLayout.prototype.maxDistanceLimit=500,mxFastOrganicLayout.prototype.minDistanceLimitSquared=4,mxFastOrganicLayout.prototype.initialTemp=200,mxFastOrganicLayout.prototype.temperature=0,mxFastOrganicLayout.prototype.maxIterations=0,mxFastOrganicLayout.prototype.iteration=0,mxFastOrganicLayout.prototype.allowedToRun=!0,mxFastOrganicLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxFastOrganicLayout.prototype.execute=function(e){var t=this.graph.getModel();this.vertexArray=[];for(var n=this.graph.getChildVertices(e),a=0;a<n.length;a++)this.isVertexIgnored(n[a])||this.vertexArray.push(n[a]);var i=this.useInputOrigin?this.graph.view.getBounds(this.vertexArray):null,o=this.vertexArray.length;for(this.indices=[],this.dispX=[],this.dispY=[],this.cellLocation=[],this.isMoveable=[],this.neighbours=[],this.radius=[],this.radiusSquared=[],this.forceConstant<.001&&(this.forceConstant=.001),this.forceConstantSquared=this.forceConstant*this.forceConstant,a=0;a<this.vertexArray.length;a++){var s=this.vertexArray[a];this.cellLocation[a]=[];var r=mxCellPath.create(s);this.indices[r]=a;var l=this.getVertexBounds(s),d=l.width,c=l.height,m=l.x,u=l.y;this.cellLocation[a][0]=m+d/2,this.cellLocation[a][1]=u+c/2,this.radius[a]=Math.min(d,c),this.radiusSquared[a]=this.radius[a]*this.radius[a]}t.beginUpdate();try{for(a=0;a<o;a++){this.dispX[a]=0,this.dispY[a]=0,this.isMoveable[a]=this.isVertexMovable(this.vertexArray[a]);var p=this.graph.getConnections(this.vertexArray[a],e);n=this.graph.getOpposites(p,this.vertexArray[a]);for(this.neighbours[a]=[],d=0;d<n.length;d++){this.resetEdges&&this.graph.resetEdge(p[d]),this.disableEdgeStyle&&this.setEdgeStyleEnabled(p[d],!1);r=mxCellPath.create(n[d]);var g=this.indices[r];this.neighbours[a][d]=null!=g?g:a}}for(this.temperature=this.initialTemp,0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(o)),this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;this.calcRepulsion(),this.calcAttraction(),this.calcPositions(),this.reduceTemperature()}for(e=n=null,a=0;a<this.vertexArray.length;a++)s=this.vertexArray[a],this.isVertexMovable(s)&&(null!=(l=this.getVertexBounds(s))&&(this.cellLocation[a][0]-=l.width/2,this.cellLocation[a][1]-=l.height/2,m=this.graph.snap(this.cellLocation[a][0]),u=this.graph.snap(this.cellLocation[a][1]),this.setVertexLocation(s,m,u),n=null==n?m:Math.min(n,m),e=null==e?u:Math.min(e,u)));a=1-(n||0),s=1-(e||0),null!=i&&(a+=i.x,s+=i.y),this.graph.moveCells(this.vertexArray,a,s)}finally{t.endUpdate()}},mxFastOrganicLayout.prototype.calcPositions=function(){for(var e=0;e<this.vertexArray.length;e++)if(this.isMoveable[e]){(n=Math.sqrt(this.dispX[e]*this.dispX[e]+this.dispY[e]*this.dispY[e]))<.001&&(n=.001);var t=this.dispX[e]/n*Math.min(n,this.temperature),n=this.dispY[e]/n*Math.min(n,this.temperature);this.dispX[e]=0,this.dispY[e]=0,this.cellLocation[e][0]+=t,this.cellLocation[e][1]+=n}},mxFastOrganicLayout.prototype.calcAttraction=function(){for(var e=0;e<this.vertexArray.length;e++)for(var t=0;t<this.neighbours[e].length;t++){var n=this.neighbours[e][t];if(e!=n&&this.isMoveable[e]&&this.isMoveable[n]){(a=(o=this.cellLocation[e][0]-this.cellLocation[n][0])*o+(s=this.cellLocation[e][1]-this.cellLocation[n][1])*s-this.radiusSquared[e]-this.radiusSquared[n])<this.minDistanceLimitSquared&&(a=this.minDistanceLimitSquared);var a,i=Math.sqrt(a),o=o/i*(a=a/this.forceConstant),s=s/i*a;this.dispX[e]-=o,this.dispY[e]-=s,this.dispX[n]+=o,this.dispY[n]+=s}}},mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var e=this.vertexArray.length,t=0;t<e;t++)for(var n=t;n<e;n++){if(!this.allowedToRun)return;if(n!=t&&this.isMoveable[t]&&this.isMoveable[n]){var a=this.cellLocation[t][0]-this.cellLocation[n][0],i=this.cellLocation[t][1]-this.cellLocation[n][1];0==a&&(a=.01+Math.random()),0==i&&(i=.01+Math.random());var o=Math.sqrt(a*a+i*i),s=o-this.radius[t]-this.radius[n];s>this.maxDistanceLimit||(s<this.minDistanceLimit&&(s=this.minDistanceLimit),a=a/o*(s=this.forceConstantSquared/s),i=i/o*s,this.dispX[t]+=a,this.dispY[t]+=i,this.dispX[n]-=a,this.dispY[n]-=i)}}},mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)},mxCircleLayout.prototype=new mxGraphLayout,mxCircleLayout.prototype.constructor=mxCircleLayout,mxCircleLayout.prototype.radius=null,mxCircleLayout.prototype.moveCircle=!1,mxCircleLayout.prototype.x0=0,mxCircleLayout.prototype.y0=0,mxCircleLayout.prototype.resetEdges=!0,mxCircleLayout.prototype.disableEdgeStyle=!0,mxCircleLayout.prototype.execute=function(e){var t=this.graph.getModel();t.beginUpdate();try{for(var n=0,a=null,i=null,o=[],s=t.getChildCount(e),r=0;r<s;r++){var l=t.getChildAt(e,r);if(this.isVertexIgnored(l))this.isEdgeIgnored(l)||(this.resetEdges&&this.graph.resetEdge(l),this.disableEdgeStyle&&this.setEdgeStyleEnabled(l,!1));else{o.push(l);var d=this.getVertexBounds(l);a=null==a?d.y:Math.min(a,d.y),i=null==i?d.x:Math.min(i,d.x),n=Math.max(n,Math.max(d.width,d.height))}}var c=this.getRadius(o.length,n);this.moveCircle&&(i=this.x0,a=this.y0),this.circle(o,c,i,a)}finally{t.endUpdate()}},mxCircleLayout.prototype.getRadius=function(e,t){return Math.max(e*t/Math.PI,this.radius)},mxCircleLayout.prototype.circle=function(e,t,n,a){for(var i=e.length,o=2*Math.PI/i,s=0;s<i;s++)this.isVertexMovable(e[s])&&this.setVertexLocation(e[s],n+t+t*Math.sin(s*o),a+t+t*Math.cos(s*o))},mxParallelEdgeLayout.prototype=new mxGraphLayout,mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout,mxParallelEdgeLayout.prototype.spacing=20,mxParallelEdgeLayout.prototype.execute=function(e){e=this.findParallels(e),this.graph.model.beginUpdate();try{for(var t in e){var n=e[t];1<n.length&&this.layout(n)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(e){for(var t=this.graph.getModel(),n=[],a=t.getChildCount(e),i=0;i<a;i++){var o=t.getChildAt(e,i);if(!this.isEdgeIgnored(o)){var s=this.getEdgeId(o);null!=s&&(null==n[s]&&(n[s]=[]),n[s].push(o))}}return n},mxParallelEdgeLayout.prototype.getEdgeId=function(e){var t=this.graph.getView(),n=t.getState(e),a=null!=n?n.getVisibleTerminal(!0):t.getVisibleTerminal(e,!0);return e=null!=n?n.getVisibleTerminal(!1):t.getVisibleTerminal(e,!1),null!=a&&null!=e?(a=mxCellPath.create(a),(e=mxCellPath.create(e))<a?e+"-"+a:a+"-"+e):null},mxParallelEdgeLayout.prototype.layout=function(e){var t=e[0];if((s=(n=this.graph.getModel()).getGeometry(n.getTerminal(t,!0)))==(o=n.getGeometry(n.getTerminal(t,!1)))){t=s.x+s.width+this.spacing;for(var n=s.y+s.height/2,a=0;a<e.length;a++)this.route(e[a],t,n),t+=this.spacing}else if(null!=s&&null!=o){t=s.x+s.width/2,n=s.y+s.height/2,a=o.x+o.width/2-t;var i=o.y+o.height/2-n,o=Math.sqrt(a*a+i*i),s=i*this.spacing/o;for(o=a*this.spacing/o,t=t+a/2+s*(e.length-1)/2,n=n+i/2-o*(e.length-1)/2,a=0;a<e.length;a++)this.route(e[a],t,n),t-=s,n+=o}},mxParallelEdgeLayout.prototype.route=function(e,t,n){this.graph.isCellMovable(e)&&this.setEdgePoints(e,[new mxPoint(t,n)])},mxCompositeLayout.prototype=new mxGraphLayout,mxCompositeLayout.prototype.constructor=mxCompositeLayout,mxCompositeLayout.prototype.layouts=null,mxCompositeLayout.prototype.master=null,mxCompositeLayout.prototype.moveCell=function(e,t,n){null!=this.master?this.master.move.apply(this.master,arguments):this.layouts[0].move.apply(this.layouts[0],arguments)},mxCompositeLayout.prototype.execute=function(e){var t=this.graph.getModel();t.beginUpdate();try{for(var n=0;n<this.layouts.length;n++)this.layouts[n].execute.apply(this.layouts[n],arguments)}finally{t.endUpdate()}},mxEdgeLabelLayout.prototype=new mxGraphLayout,mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout,mxEdgeLabelLayout.prototype.execute=function(e){for(var t=this.graph.view,n=this.graph.getModel(),a=[],i=[],o=n.getChildCount(e),s=0;s<o;s++){var r=n.getChildAt(e,s),l=t.getState(r);null!=l&&(this.isVertexIgnored(r)?this.isEdgeIgnored(r)||a.push(l):i.push(l))}this.placeLabels(i,a)},mxEdgeLabelLayout.prototype.placeLabels=function(e,t){var n=this.graph.getModel();n.beginUpdate();try{for(var a=0;a<t.length;a++){var i=t[a];if(null!=i&&null!=i.text&&null!=i.text.boundingBox)for(var o=0;o<e.length;o++){var s=e[o];null!=s&&this.avoid(i,s)}}}finally{n.endUpdate()}},mxEdgeLabelLayout.prototype.avoid=function(e,t){var n=this.graph.getModel(),a=e.text.boundingBox;if(mxUtils.intersects(a,t)){var i=-a.y-a.height+t.y,o=-a.y+t.y+t.height;i=Math.abs(i)<Math.abs(o)?i:o,o=-a.x-a.width+t.x,a=-a.x+t.x+t.width,a=Math.abs(o)<Math.abs(a)?o:a;Math.abs(a)<Math.abs(i)?i=0:a=0,null!=(o=n.getGeometry(e.cell))&&(null!=(o=o.clone()).offset?(o.offset.x+=a,o.offset.y+=i):o.offset=new mxPoint(a,i),n.setGeometry(e.cell,o))}},mxGraphAbstractHierarchyCell.prototype.maxRank=-1,mxGraphAbstractHierarchyCell.prototype.minRank=-1,mxGraphAbstractHierarchyCell.prototype.x=null,mxGraphAbstractHierarchyCell.prototype.y=null,mxGraphAbstractHierarchyCell.prototype.width=0,mxGraphAbstractHierarchyCell.prototype.height=0,mxGraphAbstractHierarchyCell.prototype.nextLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.previousLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.temp=null,mxGraphAbstractHierarchyCell.prototype.getNextLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return!1},mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1},mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(e){return null},mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(e,t){return null},mxGraphAbstractHierarchyCell.prototype.setX=function(e,t){this.isVertex()?this.x[0]=t:this.isEdge()&&(this.x[e-this.minRank-1]=t)},mxGraphAbstractHierarchyCell.prototype.getX=function(e){return this.isVertex()?this.x[0]:this.isEdge()?this.x[e-this.minRank-1]:0},mxGraphAbstractHierarchyCell.prototype.setY=function(e,t){this.isVertex()?this.y[0]=t:this.isEdge()&&(this.y[e-this.minRank-1]=t)},mxGraphHierarchyNode.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyNode.prototype.constructor=mxGraphHierarchyNode,mxGraphHierarchyNode.prototype.cell=null,mxGraphHierarchyNode.prototype.connectsAsTarget=[],mxGraphHierarchyNode.prototype.connectsAsSource=[],mxGraphHierarchyNode.prototype.hashCode=!1,mxGraphHierarchyNode.prototype.getRankValue=function(e){return this.maxRank},mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[],this.nextLayerConnectedCells[0]=[];for(var t=0;t<this.connectsAsTarget.length;t++){var n=this.connectsAsTarget[t];-1==n.maxRank||n.maxRank==e+1?this.nextLayerConnectedCells[0].push(n.source):this.nextLayerConnectedCells[0].push(n)}}return this.nextLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[],this.previousLayerConnectedCells[0]=[];for(var t=0;t<this.connectsAsSource.length;t++){var n=this.connectsAsSource[t];-1==n.minRank||n.minRank==e-1?this.previousLayerConnectedCells[0].push(n.target):this.previousLayerConnectedCells[0].push(n)}}return this.previousLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.isVertex=function(){return!0},mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(e){return this.temp[0]},mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(e,t){this.temp[0]=t},mxGraphHierarchyNode.prototype.isAncestor=function(e){if(null!=e&&null!=this.hashCode&&null!=e.hashCode&&this.hashCode.length<e.hashCode.length){if(this.hashCode==e.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var t=0;t<this.hashCode.length;t++)if(this.hashCode[t]!=e.hashCode[t])return!1;return!0}return!1},mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell},mxGraphHierarchyEdge.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyEdge.prototype.constructor=mxGraphHierarchyEdge,mxGraphHierarchyEdge.prototype.edges=null,mxGraphHierarchyEdge.prototype.source=null,mxGraphHierarchyEdge.prototype.target=null,mxGraphHierarchyEdge.prototype.isReversed=!1,mxGraphHierarchyEdge.prototype.invert=function(e){e=this.source,this.source=this.target,this.target=e,this.isReversed=!this.isReversed},mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var t=0;t<this.temp.length;t++)this.nextLayerConnectedCells[t]=[],t==this.temp.length-1?this.nextLayerConnectedCells[t].push(this.source):this.nextLayerConnectedCells[t].push(this)}return this.nextLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var t=0;t<this.temp.length;t++)this.previousLayerConnectedCells[t]=[],0==t?this.previousLayerConnectedCells[t].push(this.target):this.previousLayerConnectedCells[t].push(this)}return this.previousLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.isEdge=function(){return!0},mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(e){return this.temp[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(e,t){this.temp[e-this.minRank-1]=t},mxGraphHierarchyEdge.prototype.getCoreCell=function(){return null!=this.edges&&0<this.edges.length?this.edges[0]:null},mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(e,t,n){for(var a=e.getGraph(),i=0;i<t.length;i++){n[i]=new mxGraphHierarchyNode(t[i]);var o=mxCellPath.create(t[i]);this.vertexMapper[o]=n[i],o=e.getEdges(t[i]),n[i].connectsAsSource=[];for(var s=0;s<o.length;s++){if((d=e.getVisibleTerminal(o[s],!1))!=t[i]&&d!=t[i]&&e.graph.model.isVertex(d)&&!e.isVertexIgnored(d)){var r=e.getEdgesBetween(t[i],d,!1),l=e.getEdgesBetween(t[i],d,!0),d=mxCellPath.create(r[0]);if(null!=r&&0<r.length&&null==this.edgeMapper[d]&&2*l.length>=r.length){l=new mxGraphHierarchyEdge(r);for(var c=0;c<r.length;c++){var m=r[c];d=mxCellPath.create(m);this.edgeMapper[d]=l,a.resetEdge(m),e.disableEdgeStyle&&(e.setEdgeStyleEnabled(m,!1),e.setOrthogonalEdge(m,!0))}l.source=n[i],mxUtils.indexOf(n[i].connectsAsSource,l)<0&&n[i].connectsAsSource.push(l)}}}n[i].temp[0]=0}},mxGraphHierarchyModel.prototype.initialRank=function(){var e=[];if(null!=this.roots)for(var t=0;t<this.roots.length;t++){var n=mxCellPath.create(this.roots[t]);null!=(n=this.vertexMapper[n])&&e.push(n)}for(var a in this.vertexMapper)(n=this.vertexMapper[a]).temp[0]=-1;for(var i=e.slice();0<e.length;){var o,s;o=(n=e[0]).connectsAsTarget,s=n.connectsAsSource;var r=!0,l=this.SOURCESCANSTARTRANK;for(t=0;t<o.length;t++){var d=o[t];if(5270620!=d.temp[0]){r=!1;break}d=d.source,l=Math.min(l,d.temp[0]-1)}if(r){if(n.temp[0]=l,this.maxRank=Math.min(this.maxRank,l),null!=s)for(t=0;t<s.length;t++)(d=s[t]).temp[0]=5270620,-1==(d=d.target).temp[0]&&(e.push(d),d.temp[0]=-2);e.shift()}else if(t=e.shift(),e.push(n),t==n&&1==e.length)break}for(a in this.vertexMapper)(n=this.vertexMapper[a]).temp[0]-=this.maxRank;for(t=0;t<i.length;t++)for(e=0,o=(n=i[t]).connectsAsSource,a=0;a<o.length;a++)d=(d=o[a]).target,n.temp[0]=Math.max(e,d.temp[0]+1),e=n.temp[0];this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank},mxGraphHierarchyModel.prototype.fixRanks=function(){var o=[];this.ranks=[];for(var e=0;e<this.maxRank+1;e++)o[e]=[],this.ranks[e]=o[e];var t=null;if(null!=this.roots){var n=this.roots;for(t=[],e=0;e<n.length;e++){var a=mxCellPath.create(n[e]);t[e]=this.vertexMapper[a]}}this.visit(function(e,t,n,a,i){if(0==i&&t.maxRank<0&&t.minRank<0&&(o[t.temp[0]].push(t),t.maxRank=t.temp[0],t.minRank=t.temp[0],t.temp[0]=o[t.maxRank].length-1),null!=e&&null!=n&&1<e.maxRank-t.maxRank)for(n.maxRank=e.maxRank,n.minRank=t.maxRank,n.temp=[],n.x=[],n.y=[],e=n.minRank+1;e<n.maxRank;e++)o[e].push(n),n.setGeneralPurposeVariable(e,o[e].length-1)},t,!1,null)},mxGraphHierarchyModel.prototype.visit=function(e,t,n,a){if(null!=t){for(var i=0;i<t.length;i++){var o=t[i];null!=o&&(null==a&&(a={}),n?(o.hashCode=[],o.hashCode[0]=this.dfsCount,o.hashCode[1]=i,this.extendedDfs(null,o,null,e,a,o.hashCode,i,0)):this.dfs(null,o,null,e,a,0))}this.dfsCount++}},mxGraphHierarchyModel.prototype.dfs=function(e,t,n,a,i,o){if(null!=t){var s=mxCellPath.create(t.cell);if(null==i[s])for(a(e,i[s]=t,n,o,0),e=t.connectsAsSource.slice(),n=0;n<e.length;n++)s=e[n],this.dfs(t,s.target,s,a,i,o+1);else a(e,t,n,o,1)}},mxGraphHierarchyModel.prototype.extendedDfs=function(e,t,n,a,i,o,s,r){if(null!=t)if(null==e||null!=t.hashCode&&t.hashCode[0]==e.hashCode[0]||(o=e.hashCode.length+1,t.hashCode=e.hashCode.slice(),t.hashCode[o-1]=s),null==i[s=mxCellPath.create(t.cell)])for(a(e,i[s]=t,n,r,0),e=t.connectsAsSource.slice(),n=0;n<e.length;n++)s=e[n],this.extendedDfs(t,s.target,s,a,i,t.hashCode,n,r+1);else a(e,t,n,r,1)},mxHierarchicalLayoutStage.prototype.execute=function(e){},mxMedianHybridCrossingReduction.prototype=new mxHierarchicalLayoutStage,mxMedianHybridCrossingReduction.prototype.constructor=mxMedianHybridCrossingReduction,mxMedianHybridCrossingReduction.prototype.layout=null,mxMedianHybridCrossingReduction.prototype.maxIterations=24,mxMedianHybridCrossingReduction.prototype.nestedBestRanks=null,mxMedianHybridCrossingReduction.prototype.currentBestCrossings=0,mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement=0,mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations=2,mxMedianHybridCrossingReduction.prototype.execute=function(e){e=this.layout.getModel(),this.nestedBestRanks=[];for(var t=0;t<e.ranks.length;t++)this.nestedBestRanks[t]=e.ranks[t].slice();var n=0,a=this.calculateCrossings(e);for(t=0;t<this.maxIterations&&n<this.maxNoImprovementIterations;t++){this.weightedMedian(t,e),this.transpose(t,e);var i=this.calculateCrossings(e);if(i<a)for(a=i,i=n=0;i<this.nestedBestRanks.length;i++)for(var o=e.ranks[i],s=0;s<o.length;s++){var r=o[s];this.nestedBestRanks[i][r.getGeneralPurposeVariable(i)]=r}else for(n++,i=0;i<this.nestedBestRanks.length;i++)for(o=e.ranks[i],s=0;s<o.length;s++)(r=o[s]).setGeneralPurposeVariable(i,s);if(0==a)break}for(n=[],a=[],t=0;t<e.maxRank+1;t++)a[t]=[],n[t]=a[t];for(t=0;t<this.nestedBestRanks.length;t++)for(i=0;i<this.nestedBestRanks[t].length;i++)a[t].push(this.nestedBestRanks[t][i]);e.ranks=n},mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(e){for(var t=e.ranks.length,n=0,a=1;a<t;a++)n+=this.calculateRankCrossing(a,e);return n},mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(e,t){for(var n=0,a=t.ranks[e],i=a.length,o=t.ranks[e-1].length,s=[],r=0;r<i;r++)s[r]=[];for(r=0;r<a.length;r++)for(var l=(c=a[r]).getGeneralPurposeVariable(e),d=c.getPreviousLayerConnectedCells(e),c=0;c<d.length;c++){var m=d[c].getGeneralPurposeVariable(e-1);s[l][m]=201207}for(r=0;r<i;r++)for(c=0;c<o;c++)if(201207==s[r][c]){for(a=r+1;a<i;a++)for(l=0;l<c;l++)201207==s[a][l]&&n++;for(a=0;a<r;a++)for(l=c+1;l<o;l++)201207==s[a][l]&&n++}return n/2},mxMedianHybridCrossingReduction.prototype.transpose=function(e,t){for(var n=!0,a=0;n&&a++<10;)for(var i=1==e%2&&1==a%2,o=(n=!1,0);o<t.ranks.length;o++){for(var s=t.ranks[o],r=[],l=0;l<s.length;l++){(f=(b=s[l]).getGeneralPurposeVariable(o))<0&&(f=l),r[f]=b}var d=f=b=null,c=null,m=null,u=null,p=null,g=null,v=null,h=null;for(l=0;l<s.length-1;l++){if(0==l){for(var b=(v=r[l]).getNextLayerConnectedCells(o),f=v.getPreviousLayerConnectedCells(o),A=(m=[],u=[],0);A<b.length;A++)m[A]=b[A].getGeneralPurposeVariable(o+1);for(A=0;A<f.length;A++)u[A]=f[A].getGeneralPurposeVariable(o-1)}else b=d,f=c,m=p,u=g,v=h;for(d=(h=r[l+1]).getNextLayerConnectedCells(o),c=h.getPreviousLayerConnectedCells(o),p=[],g=[],A=0;A<d.length;A++)p[A]=d[A].getGeneralPurposeVariable(o+1);for(A=0;A<c.length;A++)g[A]=c[A].getGeneralPurposeVariable(o-1);var E=0,y=0;for(A=0;A<m.length;A++)for(var S=0;S<p.length;S++)m[A]>p[S]&&E++,m[A]<p[S]&&y++;for(A=0;A<u.length;A++)for(S=0;S<g.length;S++)u[A]>g[S]&&E++,u[A]<g[S]&&y++;(y<E||y==E&&i)&&(d=v.getGeneralPurposeVariable(o),v.setGeneralPurposeVariable(o,h.getGeneralPurposeVariable(o)),h.setGeneralPurposeVariable(o,d),d=b,c=f,p=m,g=u,h=v,i||(n=!0))}}},mxMedianHybridCrossingReduction.prototype.weightedMedian=function(e,t){var n=0==e%2;if(n)for(var a=t.maxRank-1;0<=a;a--)this.medianRank(a,n);else for(a=1;a<t.maxRank;a++)this.medianRank(a,n)},mxMedianHybridCrossingReduction.prototype.medianRank=function(e,t){for(var n=this.nestedBestRanks[e].length,a=[],i=[],o=0;o<n;o++){var s,r,l=this.nestedBestRanks[e][o],d=new MedianCellSorter;d.cell=l,r=t?e+1:e-1,null!=(s=t?l.getNextLayerConnectedCells(e):l.getPreviousLayerConnectedCells(e))&&0!=s.length?(d.medianValue=this.medianValue(s,r),a.push(d)):i[l.getGeneralPurposeVariable(e)]=!0}for(a.sort(MedianCellSorter.prototype.compare),o=0;o<n;o++)null==i[o]&&(l=a.shift().cell).setGeneralPurposeVariable(e,o)},mxMedianHybridCrossingReduction.prototype.medianValue=function(e,t){for(var n=[],a=0,i=0;i<e.length;i++){var o=e[i];n[a++]=o.getGeneralPurposeVariable(t)}return n.sort(function(e,t){return e-t}),1==a%2?n[Math.floor(a/2)]:2==a?(n[0]+n[1])/2:(o=n[(i=a/2)-1]-n[0],a=n[a-1]-n[i],(n[i-1]*a+n[i]*o)/(o+a))},MedianCellSorter.prototype.medianValue=0,MedianCellSorter.prototype.cell=!1,MedianCellSorter.prototype.compare=function(e,t){return null!=e&&null!=t?t.medianValue>e.medianValue?-1:t.medianValue<e.medianValue?1:0:0},mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage,mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover,mxMinimumCycleRemover.prototype.layout=null,mxMinimumCycleRemover.prototype.execute=function(e){var t=this.layout.getModel(),o={},s=mxUtils.clone(t.vertexMapper,null,!0),n=null;if(null!=t.roots){var a=t.roots;n=[];for(e=0;e<a.length;e++){var i=mxCellPath.create(a[e]);n[e]=t.vertexMapper[i]}}if(t.visit(function(e,t,n,a,i){t.isAncestor(e)&&(n.invert(),mxUtils.remove(n,e.connectsAsSource),e.connectsAsTarget.push(n),mxUtils.remove(n,t.connectsAsTarget),t.connectsAsSource.push(n)),e=mxCellPath.create(t.cell),o[e]=t,delete s[e]},n,!0,null),n=null,0<s.lenth&&(n=mxUtils.clone(s,null,!0)),e=mxUtils.clone(o,null,!0),t.visit(function(e,t,n,a,i){t.isAncestor(e)&&(n.invert(),mxUtils.remove(n,e.connectsAsSource),t.connectsAsSource.push(n),e.connectsAsTarget.push(n),mxUtils.remove(n,t.connectsAsTarget)),e=mxCellPath.create(t.cell),o[e]=t,delete s[e]},s,!0,e),a=this.layout.getGraph(),null!=n&&0<n.length)for(t=t.roots,e=0;e<n.length;e++)i=n[e].cell,0==a.getIncomingEdges(i).length&&t.push(i)};var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};function WeightedCellSorter(e,t){this.cell=e,this.weightedValue=t}function mxHierarchicalLayout(e,t,n){mxGraphLayout.call(this,e),this.orientation=null!=t?t:mxConstants.DIRECTION_NORTH,this.deterministic=null==n||n}function mxGraphModel(e){this.currentEdit=this.createUndoableEdit(),null!=e?this.setRoot(e):this.clear()}function mxRootChange(e,t){this.model=e,this.previous=this.root=t}function mxChildChange(e,t,n,a){this.model=e,this.previous=this.parent=t,this.child=n,this.previousIndex=this.index=a}function mxTerminalChange(e,t,n,a){this.model=e,this.cell=t,this.previous=this.terminal=n,this.source=a}function mxValueChange(e,t,n){this.model=e,this.cell=t,this.previous=this.value=n}function mxStyleChange(e,t,n){this.model=e,this.cell=t,this.previous=this.style=n}function mxGeometryChange(e,t,n){this.model=e,this.cell=t,this.previous=this.geometry=n}function mxCollapseChange(e,t,n){this.model=e,this.cell=t,this.previous=this.collapsed=n}function mxVisibleChange(e,t,n){this.model=e,this.cell=t,this.previous=this.visible=n}function mxCellAttributeChange(e,t,n){this.cell=e,this.attribute=t,this.previous=this.value=n}function mxCell(e,t,n){this.value=e,this.setGeometry(t),this.setStyle(n),null!=this.onInit&&this.onInit()}function mxGeometry(e,t,n,a){mxRectangle.call(this,e,t,n,a)}mxCoordinateAssignment.prototype=new mxHierarchicalLayoutStage,mxCoordinateAssignment.prototype.constructor=mxCoordinateAssignment,mxCoordinateAssignment.prototype.layout=null,mxCoordinateAssignment.prototype.intraCellSpacing=30,mxCoordinateAssignment.prototype.interRankCellSpacing=100,mxCoordinateAssignment.prototype.parallelEdgeSpacing=10,mxCoordinateAssignment.prototype.maxIterations=8,mxCoordinateAssignment.prototype.prefHozEdgeSep=5,mxCoordinateAssignment.prototype.prefVertEdgeOff=2,mxCoordinateAssignment.prototype.minEdgeJetty=12,mxCoordinateAssignment.prototype.channelBuffer=4,mxCoordinateAssignment.prototype.jettyPositions=null,mxCoordinateAssignment.prototype.orientation=mxConstants.DIRECTION_NORTH,mxCoordinateAssignment.prototype.initialX=null,mxCoordinateAssignment.prototype.limitX=null,mxCoordinateAssignment.prototype.currentXDelta=null,mxCoordinateAssignment.prototype.widestRank=null,mxCoordinateAssignment.prototype.rankTopY=null,mxCoordinateAssignment.prototype.rankBottomY=null,mxCoordinateAssignment.prototype.widestRankValue=null,mxCoordinateAssignment.prototype.rankWidths=null,mxCoordinateAssignment.prototype.rankY=null,mxCoordinateAssignment.prototype.fineTuning=!0,mxCoordinateAssignment.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE,mxCoordinateAssignment.prototype.nextLayerConnectedCache=null,mxCoordinateAssignment.prototype.previousLayerConnectedCache=null,mxCoordinateAssignment.prototype.groupPadding=10,mxCoordinateAssignment.prototype.printStatus=function(){var e=this.layout.getModel();mxLog.show(),mxLog.writeln("======Coord assignment debug=======");for(var t=0;t<e.ranks.length;t++){mxLog.write("Rank ",t," : ");for(var n=e.ranks[t],a=0;a<n.length;a++)mxLog.write(n[a].getGeneralPurposeVariable(t)," ");mxLog.writeln()}mxLog.writeln("====================================")},mxCoordinateAssignment.prototype.execute=function(e){this.jettyPositions=[],e=this.layout.getModel(),this.currentXDelta=0,this.initialCoords(this.layout.getGraph(),e),this.fineTuning&&this.minNode(e);var t=1e8;if(this.fineTuning)for(var n=0;n<this.maxIterations;n++){if(0!=n&&(this.medianPos(n,e),this.minNode(e)),this.currentXDelta<t){for(var a=0;a<e.ranks.length;a++)for(var i=e.ranks[a],o=0;o<i.length;o++){var s=i[o];s.setX(a,s.getGeneralPurposeVariable(a))}t=this.currentXDelta}else for(a=0;a<e.ranks.length;a++)for(i=e.ranks[a],o=0;o<i.length;o++)(s=i[o]).setGeneralPurposeVariable(a,s.getX(a));this.minPath(this.layout.getGraph(),e),this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),e)},mxCoordinateAssignment.prototype.minNode=function(e){for(var t=[],n=[],a=[],i=0;i<=e.maxRank;i++){a[i]=e.ranks[i];for(var o=0;o<a[i].length;o++){var s=a[i][o];(r=new WeightedCellSorter(s,i)).rankIndex=o,r.visited=!0,t.push(r),n[s=mxCellPath.create(s.getCoreCell())]=r}}for(e=10*t.length,o=0;0<t.length&&o<=e;){i=(r=t.shift()).cell;var r,l=r.weightedValue,d=parseInt(r.rankIndex),c=(s=i.getNextLayerConnectedCells(l),i.getPreviousLayerConnectedCells(l)),m=s.length,u=c.length,p=this.medianXValue(s,l+1),g=this.medianXValue(c,l-1),v=m+u,h=i.getGeneralPurposeVariable(l),b=h;if(0<v&&(b=(p*m+g*u)/v),m=!1,b<h-1?0==d?(i.setGeneralPurposeVariable(l,b),m=!0):(h=(h=(d=a[l][d-1]).getGeneralPurposeVariable(l))+d.width/2+this.intraCellSpacing+i.width/2)<b?(i.setGeneralPurposeVariable(l,b),m=!0):h<i.getGeneralPurposeVariable(l)-1&&(i.setGeneralPurposeVariable(l,h),m=!0):h+1<b&&(d==a[l].length-1?(i.setGeneralPurposeVariable(l,b),m=!0):b<(h=(h=(d=a[l][d+1]).getGeneralPurposeVariable(l))-d.width/2-this.intraCellSpacing-i.width/2)?(i.setGeneralPurposeVariable(l,b),m=!0):h>i.getGeneralPurposeVariable(l)+1&&(i.setGeneralPurposeVariable(l,h),m=!0)),m){for(i=0;i<s.length;i++)l=s[i],null!=(l=n[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,t.push(l));for(i=0;i<c.length;i++)l=c[i],null!=(l=n[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,t.push(l))}r.visited=!1,o++}},mxCoordinateAssignment.prototype.medianPos=function(e,t){if(0==e%2)for(var n=t.maxRank;0<n;n--)this.rankMedianPosition(n-1,t,n);else for(n=0;n<t.maxRank-1;n++)this.rankMedianPosition(n+1,t,n)},mxCoordinateAssignment.prototype.rankMedianPosition=function(e,t,n){t=t.ranks[e];for(var a=[],i=[],o=0;o<t.length;o++){var s=t[o];a[o]=new WeightedCellSorter,a[o].cell=s,a[o].rankIndex=o;var r=mxCellPath.create(s.getCoreCell());i[r]=a[o];var l=null;l=n<e?s.getPreviousLayerConnectedCells(e):s.getNextLayerConnectedCells(e);a[o].weightedValue=this.calculatedWeightedValue(s,l)}for(a.sort(WeightedCellSorter.prototype.compare),o=0;o<a.length;o++){r=0,s=a[o].cell,r=0,null!=(l=n<e?s.getPreviousLayerConnectedCells(e).slice():s.getNextLayerConnectedCells(e).slice())&&(r=0<(r=l.length)?this.medianXValue(l,n):s.getGeneralPurposeVariable(e));for(var d=0,c=(l=-1e8,a[o].rankIndex-1);0<=c;){var m;if(null!=(m=i[m=mxCellPath.create(t[c].getCoreCell())])){var u=m.cell;m.visited?(l=u.getGeneralPurposeVariable(e)+u.width/2+this.intraCellSpacing+d+s.width/2,c=-1):(d+=u.width+this.intraCellSpacing,c--)}}for(d=0,u=1e8,c=a[o].rankIndex+1;c<a.length;)if(null!=(m=i[m=mxCellPath.create(t[c].getCoreCell())])){var p=m.cell;m.visited?(u=p.getGeneralPurposeVariable(e)-p.width/2-this.intraCellSpacing-d-s.width/2,c=a.length):(d+=p.width+this.intraCellSpacing,c++)}l<=r&&r<=u?s.setGeneralPurposeVariable(e,r):r<l?(s.setGeneralPurposeVariable(e,l),this.currentXDelta+=l-r):u<r&&(s.setGeneralPurposeVariable(e,u),this.currentXDelta+=r-u),a[o].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(e,t){for(var n=0,a=0;a<t.length;a++){var i=t[a];e.isVertex()&&i.isVertex()?n++:n=e.isEdge()&&i.isEdge()?n+8:n+2}return n},mxCoordinateAssignment.prototype.medianXValue=function(e,t){if(0==e.length)return 0;for(var n=[],a=0;a<e.length;a++)n[a]=e[a].getGeneralPurposeVariable(t);return n.sort(function(e,t){return e-t}),1==e.length%2?n[Math.floor(e.length/2)]:(n[(a=e.length/2)-1]+n[a])/2},mxCoordinateAssignment.prototype.initialCoords=function(e,t){this.calculateWidestRank(e,t);for(var n=this.widestRank;0<=n;n--)n<t.maxRank&&this.rankCoordinates(n,e,t);for(n=this.widestRank+1;n<=t.maxRank;n++)0<n&&this.rankCoordinates(n,e,t)},mxCoordinateAssignment.prototype.rankCoordinates=function(e,t,n){t=n.ranks[e],n=0;for(var a=this.initialX+(this.widestRankValue-this.rankWidths[e])/2,i=!1,o=0;o<t.length;o++){var s=t[o];if(s.isVertex()){var r=this.layout.getVertexBounds(s.cell);null!=r?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(s.width=r.width,s.height=r.height):(s.width=r.height,s.height=r.width):i=!0,n=Math.max(n,s.height)}else s.isEdge()&&(r=1,null!=s.edges?r=s.edges.length:mxLog.warn("edge.edges is null"),s.width=(r-1)*this.parallelEdgeSpacing);a+=s.width/2,s.setX(e,a),s.setGeneralPurposeVariable(e,a),a+=s.width/2,a+=this.intraCellSpacing}1==i&&mxLog.warn("At least one cell has no bounds")},mxCoordinateAssignment.prototype.calculateWidestRank=function(e,t){var n=-this.interRankCellSpacing,a=0;this.rankWidths=[],this.rankY=[];for(var i=t.maxRank;0<=i;i--){for(var o=0,s=t.ranks[i],r=this.initialX,l=!1,d=0;d<s.length;d++){var c=s[d];if(c.isVertex()){var m=this.layout.getVertexBounds(c.cell);null!=m?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(c.width=m.width,c.height=m.height):(c.width=m.height,c.height=m.width):l=!0,o=Math.max(o,c.height)}else c.isEdge()&&(m=1,null!=c.edges?m=c.edges.length:mxLog.warn("edge.edges is null"),c.width=(m-1)*this.parallelEdgeSpacing);r+=c.width/2,c.setX(i,r),c.setGeneralPurposeVariable(i,r),r+=c.width/2,(r+=this.intraCellSpacing)>this.widestRankValue&&(this.widestRankValue=r,this.widestRank=i),this.rankWidths[i]=r}for(1==l&&mxLog.warn("At least one cell has no bounds"),this.rankY[i]=n,r=o/2+a/2+this.interRankCellSpacing,a=o,n=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?n+r:n-r,d=0;d<s.length;d++)s[d].setY(i,n)}},mxCoordinateAssignment.prototype.minPath=function(e,t){var n,a=t.edgeMapper;for(n in a){var i=a[n];if(!(i.maxRank-i.minRank-1<1)){for(var o=i.getGeneralPurposeVariable(i.minRank+1),s=!0,r=0,l=i.minRank+2;l<i.maxRank;l++){o!=(d=i.getGeneralPurposeVariable(l))?(s=!1,o=d):r++}if(!s){s=o=0;var d=[],c=[],m=i.getGeneralPurposeVariable(i.minRank+1);for(l=i.minRank+1;l<i.maxRank-1;l++){var u=i.getX(l+1);m==u?(d[l-i.minRank-1]=m,o++):this.repositionValid(t,i,l+1,m)?(d[l-i.minRank-1]=m,o++):m=d[l-i.minRank-1]=u}for(m=i.getX(l),l=i.maxRank-1;l>i.minRank+1;l--)m==(u=i.getX(l-1))?(c[l-i.minRank-2]=m,s++):this.repositionValid(t,i,l-1,m)?(c[l-i.minRank-2]=m,s++):(c[l-i.minRank-2]=i.getX(l-1),m=u);if(r<s||r<o)if(o<=s)for(l=i.maxRank-2;l>i.minRank;l--)i.setX(l,c[l-i.minRank-1]);else if(s<o)for(l=i.minRank+2;l<i.maxRank;l++)i.setX(l,d[l-i.minRank-2])}}}},mxCoordinateAssignment.prototype.repositionValid=function(e,t,n,a){e=e.ranks[n];for(var i=-1,o=0;o<e.length;o++)if(t==e[o]){i=o;break}if(i<0)return!1;if(a<(o=t.getGeneralPurposeVariable(n))){if(0==i)return!0;if(!((n=(n=(e=e[i-1]).getGeneralPurposeVariable(n))+e.width/2+this.intraCellSpacing+t.width/2)<=a))return!1}else if(o<a){if(i==e.length-1)return!0;if(!(a<=(n=(n=(e=e[i+1]).getGeneralPurposeVariable(n))-e.width/2-this.intraCellSpacing-t.width/2)))return!1}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(e,t){this.rankTopY=[],this.rankBottomY=[];for(var n=0;n<t.ranks.length;n++)this.rankTopY[n]=Number.MAX_VALUE,this.rankBottomY[n]=0;n=null,this.layout.resizeParent&&(n={});var a,i=t.edgeMapper,o=t.vertexMapper;for(a in o){var s=o[a];if(this.setVertexLocation(s),this.layout.resizeParent){s=e.model.getParent(s.cell);var r=mxCellPath.create(s);null==n[r]&&(n[r]=s)}}for(a in this.layout.resizeParent&&null!=n&&this.adjustParents(n),(this.edgeStyle==mxHierarchicalEdgeStyle.ORTHOGONAL||this.edgeStyle==mxHierarchicalEdgeStyle.POLYLINE||this.edgeStyle==mxHierarchicalEdgeStyle.CURVE)&&this.localEdgeProcessing(t),i)this.setEdgePosition(i[a])},mxCoordinateAssignment.prototype.adjustParents=function(e){var t,n=[];for(t in e)n.push(e[t]);this.layout.arrangeGroups(mxUtils.sortCells(n,!0),this.groupPadding)},mxCoordinateAssignment.prototype.localEdgeProcessing=function(e){for(var t=0;t<e.ranks.length;t++)for(var n=e.ranks[t],a=0;a<n.length;a++){var i=n[a];if(i.isVertex())for(var o=i.getPreviousLayerConnectedCells(t),s=t-1,r=0;r<2;r++){if(-1<s&&s<e.ranks.length&&null!=o&&0<o.length){for(var l=[],d=0;d<o.length;d++){var c=new WeightedCellSorter(o[d],o[d].getX(s));l.push(c)}l.sort(WeightedCellSorter.prototype.compare);var m=(c=i.x[0]-i.width/2)+i.width,u=o=0;for(s=[],d=0;d<l.length;d++){var p,g=l[d].cell;if(g.isVertex()){p=0==r?i.connectsAsSource:i.connectsAsTarget;for(var v=0;v<p.length;v++)p[v].source!=g&&p[v].target!=g||(o+=p[v].edges.length,u++,s.push(p[v]))}else o+=g.edges.length,u++,s.push(g)}for(i.width>(o+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(c+=this.prefHozEdgeSep,m-=this.prefHozEdgeSep),c+=(l=(m-c)/o)/2,m=this.minEdgeJetty-this.prefVertEdgeOff,d=u=0;d<s.length;d++){for(g=s[d].edges.length,v=mxCellPath.create(s[d].edges[0]),null==(p=this.jettyPositions[v])&&(p=[],this.jettyPositions[v]=p),d<o/2?m+=this.prefVertEdgeOff:o/2<d&&(m-=this.prefVertEdgeOff),v=0;v<g;v++)p[4*v+2*r]=c,c+=l,p[4*v+2*r+1]=m;u=Math.max(u,m)}}o=i.getNextLayerConnectedCells(t),s=t+1}}},mxCoordinateAssignment.prototype.setEdgePosition=function(e){var t=0;if(101207!=e.temp[0]){var n=e.maxRank,a=e.minRank;n==a&&(n=e.source.maxRank,a=e.target.minRank);for(var i=0,o=mxCellPath.create(e.edges[0]),s=(o=this.jettyPositions[o],e.isReversed?e.target.cell:e.source.cell),r=this.layout.graph,l=0;l<e.edges.length;l++){var d=e.edges[l],c=this.layout.getVisibleTerminal(d,!0),m=r.model.getTerminal(d,!0),u=[],p=e.isReversed;if(c!=s&&(p=!p),null!=o){var g=p?2:0,v=p?this.rankTopY[a]:this.rankBottomY[n],h=o[4*i+1+g];p&&(h=-h),v+=h,g=o[4*i+g],m=r.model.getTerminal(d,!0),this.layout.isPort(m)&&r.model.getParent(m)==c&&(g=null!=(g=r.view.getState(m))?g.x:c.geometry.x+e.source.width*m.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(g,v)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v+h))):(u.push(new mxPoint(v,g)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v+h,g)))}for(g=e.x.length-1,v=h=-1,c=e.maxRank-1,p&&(g=0,h=e.x.length,v=1,c=e.minRank+1);e.maxRank!=e.minRank&&g!=h;g+=v){m=e.x[g]+t;var b=(this.rankTopY[c]+this.rankBottomY[c+1])/2,f=(this.rankTopY[c-1]+this.rankBottomY[c])/2;if(p){var A=b;b=f,f=A}this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(m,b)),u.push(new mxPoint(m,f))):(u.push(new mxPoint(b,m)),u.push(new mxPoint(f,m))),this.limitX=Math.max(this.limitX,m),c+=v}null!=o&&(g=p?2:0,v=p?this.rankBottomY[n]:this.rankTopY[a],h=o[4*i+3-g],p&&(h=-h),v-=h,g=o[4*i+2-g],p=r.model.getTerminal(d,!1),c=this.layout.getVisibleTerminal(d,!1),this.layout.isPort(p)&&r.model.getParent(p)==c&&(g=null!=(g=r.view.getState(p))?g.x:c.geometry.x+e.target.width*p.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v-h)),u.push(new mxPoint(g,v))):(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v-h,g)),u.push(new mxPoint(v,g)))),e.isReversed&&this.processReversedEdge(e,d),this.layout.setEdgePoints(d,u),t=0==t?this.parallelEdgeSpacing:0<t?-t:-t+this.parallelEdgeSpacing,i++}e.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(e){var t=e.cell,n=e.x[0]-e.width/2,a=e.y[0]-e.height/2;this.rankTopY[e.minRank]=Math.min(this.rankTopY[e.minRank],a),this.rankBottomY[e.minRank]=Math.max(this.rankBottomY[e.minRank],a+e.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(t,n,a):this.layout.setVertexLocation(t,a,n),this.limitX=Math.max(this.limitX,n+e.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(e,t){},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,t){return null!=e&&null!=t?t.weightedValue>e.weightedValue?-1:t.weightedValue<e.weightedValue?1:t.nudge?-1:1:0},mxHierarchicalLayout.prototype=new mxGraphLayout,mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout,mxHierarchicalLayout.prototype.roots=null,mxHierarchicalLayout.prototype.resizeParent=!1,mxHierarchicalLayout.prototype.moveParent=!1,mxHierarchicalLayout.prototype.parentBorder=0,mxHierarchicalLayout.prototype.intraCellSpacing=30,mxHierarchicalLayout.prototype.interRankCellSpacing=100,mxHierarchicalLayout.prototype.interHierarchySpacing=60,mxHierarchicalLayout.prototype.parallelEdgeSpacing=10,mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH,mxHierarchicalLayout.prototype.fineTuning=!0,mxHierarchicalLayout.prototype.tightenToSource=!0,mxHierarchicalLayout.prototype.disableEdgeStyle=!0,mxHierarchicalLayout.prototype.traverseAncestors=!0,mxHierarchicalLayout.prototype.model=null,mxHierarchicalLayout.prototype.edgesCache=null,mxHierarchicalLayout.prototype.getModel=function(){return this.model},mxHierarchicalLayout.prototype.execute=function(e,t){this.parent=e;var n=this.graph.model;if(this.edgesCache={},null!=t||null!=e){if(null!=t&&null!=e){for(var a=[],i=0;i<t.length;i++)n.isAncestor(e,t[i])&&a.push(t[i]);this.roots=a}else this.roots=t;n.beginUpdate();try{this.run(e),this.resizeParent&&!this.graph.isCellCollapsed(e)&&this.graph.updateGroupBounds([e],this.parentBorder,this.moveParent)}finally{n.endUpdate()}}},mxHierarchicalLayout.prototype.findRoots=function(e,t){var n=[];if(null!=e&&null!=t){var a,i=this.graph.model,o=null,s=-1e5;for(a in t){var r=t[a];if(i.isVertex(r)&&this.graph.isCellVisible(r)){for(var l=this.getEdges(r),d=0,c=0,m=0;m<l.length;m++)this.getVisibleTerminal(l[m],!0)==r?d++:c++;0==c&&0<d&&n.push(r),s<(l=d-c)&&(s=l,o=r)}}0==n.length&&null!=o&&n.push(o)}return n},mxHierarchicalLayout.prototype.getEdges=function(e){var t=mxCellPath.create(e);if(null!=this.edgesCache[t])return this.edgesCache[t];for(var n=this.graph.model,a=[],i=this.graph.isCellCollapsed(e),o=n.getChildCount(e),s=0;s<o;s++){var r=n.getChildAt(e,s);this.isPort(r)?a=a.concat(n.getEdges(r,!0,!0)):!i&&this.graph.isCellVisible(r)||(a=a.concat(n.getEdges(r,!0,!0)))}for(a=a.concat(n.getEdges(e,!0,!0)),n=[],s=0;s<a.length;s++)((i=this.getVisibleTerminal(a[s],!0))==(o=this.getVisibleTerminal(a[s],!1))||i!=o&&(o==e&&(null==this.parent||this.graph.isValidAncestor(i,this.parent,this.traverseAncestors))||i==e&&(null==this.parent||this.graph.isValidAncestor(o,this.parent,this.traverseAncestors))))&&n.push(a[s]);return this.edgesCache[t]=n},mxHierarchicalLayout.prototype.getVisibleTerminal=function(e,t){var n=null!=(n=this.graph.view.getState(e))?n.getVisibleTerminal(t):this.graph.view.getVisibleTerminal(e,t);return this.isPort(n)&&(n=this.graph.model.getParent(n)),n},mxHierarchicalLayout.prototype.run=function(e){var t=[],n=[];if(null==this.roots&&null!=e){var a={};this.filterDescendants(e,a),this.roots=[];var i,o=!0;for(i in a)if(null!=a[i]){o=!1;break}for(;!o;){var s=this.findRoots(e,a);for(o=0;o<s.length;o++){var r=[];t.push(r),this.traverse(s[o],!0,null,n,r,t,a)}for(o=0;o<s.length;o++)this.roots.push(s[o]);for(i in o=!0,a)if(null!=a[i]){o=!1;break}}}else for(o=0;o<roots.length;o++)r=[],t.push(r),traverse(roots.get(o),!0,null,n,r,t,null);for(o=n=0;o<t.length;o++){for(i in a=[],r=t[o])a.push(r[i]);this.model=new mxGraphHierarchyModel(this,a,this.roots,e,this.tightenToSource),this.cycleStage(e),this.layeringStage(),this.crossingStage(e),n=this.placementStage(n,e)}},mxHierarchicalLayout.prototype.filterDescendants=function(e,t){var n=this.graph.model;if(n.isVertex(e)&&e!=this.parent&&this.graph.isCellVisible(e)&&(t[mxCellPath.create(e)]=e),this.traverseAncestors||e==this.parent&&this.graph.isCellVisible(e))for(var a=n.getChildCount(e),i=0;i<a;i++){var o=n.getChildAt(e,i);this.isPort(o)||this.filterDescendants(o,t)}},mxHierarchicalLayout.prototype.isPort=function(e){return!!e.geometry.relative},mxHierarchicalLayout.prototype.getEdgesBetween=function(e,t,n){n=null!=n&&n;for(var a=this.getEdges(e),i=[],o=0;o<a.length;o++){var s=this.getVisibleTerminal(a[o],!0),r=this.getVisibleTerminal(a[o],!1);(s==e&&r==t||!n&&s==t&&r==e)&&i.push(a[o])}return i},mxHierarchicalLayout.prototype.traverse=function(e,t,n,a,i,o,s){if(null!=e&&null!=a){var r=mxCellPath.create(e);if(null!=a[r]||null!=s&&null==s[r]){if(null==i[r])for(n=0;n<o.length;n++)if(null!=(e=o[n])[r]){for(l in i)e[l]=i[l];return o.pop(),e}}else{null==i[r]&&(i[r]=e),null==a[r]&&(a[r]=e),delete s[r];var l=this.getEdges(e);for(n=0;n<l.length;n++)r=this.getVisibleTerminal(l[n],!0)==e,(!t||r)&&(r=this.getVisibleTerminal(l[n],!r),i=this.traverse(r,t,l[n],a,i,o,s))}}return i},mxHierarchicalLayout.prototype.cycleStage=function(e){new mxMinimumCycleRemover(this).execute(e)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(e){new mxMedianHybridCrossingReduction(this).execute(e)},mxHierarchicalLayout.prototype.placementStage=function(e,t){var n=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,e,this.parallelEdgeSpacing);return n.fineTuning=this.fineTuning,n.execute(t),n.limitX+this.interHierarchySpacing},mxGraphModel.prototype=new mxEventSource,mxGraphModel.prototype.constructor=mxGraphModel,mxGraphModel.prototype.root=null,mxGraphModel.prototype.cells=null,mxGraphModel.prototype.maintainEdgeParent=!0,mxGraphModel.prototype.createIds=!0,mxGraphModel.prototype.prefix="",mxGraphModel.prototype.postfix="",mxGraphModel.prototype.nextId=0,mxGraphModel.prototype.currentEdit=null,mxGraphModel.prototype.updateLevel=0,mxGraphModel.prototype.endingUpdate=!1,mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())},mxGraphModel.prototype.isCreateIds=function(){return this.createIds},mxGraphModel.prototype.setCreateIds=function(e){this.createIds=e},mxGraphModel.prototype.createRoot=function(){var e=new mxCell;return e.insert(new mxCell),e},mxGraphModel.prototype.getCell=function(e){return null!=this.cells?this.cells[e]:null},mxGraphModel.prototype.filterCells=function(e,t){var n=null;if(null!=e){n=[];for(var a=0;a<e.length;a++)t(e[a])&&n.push(e[a])}return n},mxGraphModel.prototype.getDescendants=function(e){return this.filterDescendants(null,e)},mxGraphModel.prototype.filterDescendants=function(e,t){var n=[];t=t||this.getRoot(),(null==e||e(t))&&n.push(t);for(var a=this.getChildCount(t),i=0;i<a;i++){var o=this.getChildAt(t,i);n=n.concat(this.filterDescendants(e,o))}return n},mxGraphModel.prototype.getRoot=function(e){var t=e||this.root;if(null!=e)for(;null!=e;)t=e,e=this.getParent(e);return t},mxGraphModel.prototype.setRoot=function(e){return this.execute(new mxRootChange(this,e)),e},mxGraphModel.prototype.rootChanged=function(e){var t=this.root;return this.root=e,this.nextId=0,this.cells=null,this.cellAdded(e),t},mxGraphModel.prototype.isRoot=function(e){return null!=e&&this.root==e},mxGraphModel.prototype.isLayer=function(e){return this.isRoot(this.getParent(e))},mxGraphModel.prototype.isAncestor=function(e,t){for(;null!=t&&t!=e;)t=this.getParent(t);return t==e},mxGraphModel.prototype.contains=function(e){return this.isAncestor(this.root,e)},mxGraphModel.prototype.getParent=function(e){return null!=e?e.getParent():null},mxGraphModel.prototype.add=function(e,t,n){if(t!=e&&null!=e&&null!=t){null==n&&(n=this.getChildCount(e));var a=e!=this.getParent(t);this.execute(new mxChildChange(this,e,t,n)),this.maintainEdgeParent&&a&&this.updateEdgeParents(t)}return t},mxGraphModel.prototype.cellAdded=function(e){if(null!=e){if(null==e.getId()&&this.createIds&&e.setId(this.createId(e)),null!=e.getId())if((t=this.getCell(e.getId()))!=e){for(;null!=t;)e.setId(this.createId(e)),t=this.getCell(e.getId());null==this.cells&&(this.cells={}),this.cells[e.getId()]=e}mxUtils.isNumeric(e.getId())&&(this.nextId=Math.max(this.nextId,e.getId()));for(var t=this.getChildCount(e),n=0;n<t;n++)this.cellAdded(this.getChildAt(e,n))}},mxGraphModel.prototype.createId=function(e){return e=this.nextId,this.nextId++,this.prefix+e+this.postfix},mxGraphModel.prototype.updateEdgeParents=function(e,t){t=t||this.getRoot(e);for(var n=this.getChildCount(e),a=0;a<n;a++){var i=this.getChildAt(e,a);this.updateEdgeParents(i,t)}for(i=this.getEdgeCount(e),n=[],a=0;a<i;a++)n.push(this.getEdgeAt(e,a));for(a=0;a<n.length;a++)i=n[a],this.isAncestor(t,i)&&this.updateEdgeParent(i,t)},mxGraphModel.prototype.updateEdgeParent=function(e,t){for(var n=this.getTerminal(e,!0),a=this.getTerminal(e,!1),i=null;null!=n&&!this.isEdge(n)&&null!=n.geometry&&n.geometry.relative;)n=this.getParent(n);for(;null!=a&&!this.isEdge(a)&&null!=a.geometry&&a.geometry.relative;)a=this.getParent(a);if(this.isAncestor(t,n)&&this.isAncestor(t,a)&&(null!=(i=n==a?this.getParent(n):this.getNearestCommonAncestor(n,a))&&(this.getParent(i)!=this.root||this.isAncestor(i,e))&&this.getParent(e)!=i)){if(null!=(n=this.getGeometry(e))){var o=this.getOrigin(this.getParent(e)),s=this.getOrigin(i);a=s.x-o.x,o=s.y-o.y;(n=n.clone()).translate(-a,-o),this.setGeometry(e,n)}this.add(i,e,this.getChildCount(i))}},mxGraphModel.prototype.getOrigin=function(e){var t=null;return null!=e?(t=this.getOrigin(this.getParent(e)),this.isEdge(e)||null!=(e=this.getGeometry(e))&&(t.x+=e.x,t.y+=e.y)):t=new mxPoint,t},mxGraphModel.prototype.getNearestCommonAncestor=function(e,t){if(null!=e&&null!=t&&(null!=(o=mxCellPath.create(t))&&0<o.length)){var n=e,a=mxCellPath.create(n);if(o.length<a.length){n=t;var i=a,o=(a=o,i)}for(;null!=n;){if(i=this.getParent(n),0==o.indexOf(a+mxCellPath.PATH_SEPARATOR)&&null!=i)return n;a=mxCellPath.getParentPath(a),n=i}}return null},mxGraphModel.prototype.remove=function(e){return e==this.root?this.setRoot(null):null!=this.getParent(e)&&this.execute(new mxChildChange(this,null,e)),e},mxGraphModel.prototype.cellRemoved=function(e){if(null!=e&&null!=this.cells){for(var t=this.getChildCount(e)-1;0<=t;t--)this.cellRemoved(this.getChildAt(e,t));null!=this.cells&&null!=e.getId()&&delete this.cells[e.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(e,t,n){var a=this.getParent(e);return null!=t?(t!=a||a.getIndex(e)!=n)&&t.insert(e,n):null!=a&&(n=a.getIndex(e),a.remove(n)),this.contains(a)||null==t?null==t&&this.cellRemoved(e):this.cellAdded(e),a},mxGraphModel.prototype.getChildCount=function(e){return null!=e?e.getChildCount():0},mxGraphModel.prototype.getChildAt=function(e,t){return null!=e?e.getChildAt(t):null},mxGraphModel.prototype.getChildren=function(e){return null!=e?e.children:null},mxGraphModel.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraphModel.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraphModel.prototype.getChildCells=function(e,t,n){t=null!=t&&t,n=null!=n&&n;for(var a=this.getChildCount(e),i=[],o=0;o<a;o++){var s=this.getChildAt(e,o);(!n&&!t||n&&this.isEdge(s)||t&&this.isVertex(s))&&i.push(s)}return i},mxGraphModel.prototype.getTerminal=function(e,t){return null!=e?e.getTerminal(t):null},mxGraphModel.prototype.setTerminal=function(e,t,n){var a=t!=this.getTerminal(e,n);return this.execute(new mxTerminalChange(this,e,t,n)),this.maintainEdgeParent&&a&&this.updateEdgeParent(e,this.getRoot()),t},mxGraphModel.prototype.setTerminals=function(e,t,n){this.beginUpdate();try{this.setTerminal(e,t,!0),this.setTerminal(e,n,!1)}finally{this.endUpdate()}},mxGraphModel.prototype.terminalForCellChanged=function(e,t,n){var a=this.getTerminal(e,n);return null!=t?t.insertEdge(e,n):null!=a&&a.removeEdge(e,n),a},mxGraphModel.prototype.getEdgeCount=function(e){return null!=e?e.getEdgeCount():0},mxGraphModel.prototype.getEdgeAt=function(e,t){return null!=e?e.getEdgeAt(t):null},mxGraphModel.prototype.getDirectedEdgeCount=function(e,t,n){for(var a=0,i=this.getEdgeCount(e),o=0;o<i;o++){var s=this.getEdgeAt(e,o);s!=n&&this.getTerminal(s,t)==e&&a++}return a},mxGraphModel.prototype.getConnections=function(e){return this.getEdges(e,!0,!0,!1)},mxGraphModel.prototype.getIncomingEdges=function(e){return this.getEdges(e,!0,!1,!1)},mxGraphModel.prototype.getOutgoingEdges=function(e){return this.getEdges(e,!1,!0,!1)},mxGraphModel.prototype.getEdges=function(e,t,n,a){t=null==t||t,n=null==n||n,a=null==a||a;for(var i=this.getEdgeCount(e),o=[],s=0;s<i;s++){var r=this.getEdgeAt(e,s),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(a&&l==d||l!=d&&(t&&d==e||n&&l==e))&&o.push(r)}return o},mxGraphModel.prototype.getEdgesBetween=function(e,t,n){n=null!=n&&n;var a=this.getEdgeCount(e),i=this.getEdgeCount(t),o=e,s=a;for(i<a&&(s=i,o=t),a=[],i=0;i<s;i++){var r=this.getEdgeAt(o,i),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(l==e&&d==t||!n&&(d==e&&l==t))&&a.push(r)}return a},mxGraphModel.prototype.getOpposites=function(e,t,n,a){n=null==n||n,a=null==a||a;var i=[];if(null!=e)for(var o=0;o<e.length;o++){var s=this.getTerminal(e[o],!0),r=this.getTerminal(e[o],!1);s==t&&null!=r&&r!=t&&a?i.push(r):r==t&&null!=s&&s!=t&&n&&i.push(s)}return i},mxGraphModel.prototype.getTopmostCells=function(e){for(var t=[],n=0;n<e.length;n++){for(var a=e[n],i=!0,o=this.getParent(a);null!=o;){if(0<=mxUtils.indexOf(e,o)){i=!1;break}o=this.getParent(o)}i&&t.push(a)}return t},mxGraphModel.prototype.isVertex=function(e){return null!=e&&e.isVertex()},mxGraphModel.prototype.isEdge=function(e){return null!=e&&e.isEdge()},mxGraphModel.prototype.isConnectable=function(e){return null!=e&&e.isConnectable()},mxGraphModel.prototype.getValue=function(e){return null!=e?e.getValue():null},mxGraphModel.prototype.setValue=function(e,t){return this.execute(new mxValueChange(this,e,t)),t},mxGraphModel.prototype.valueForCellChanged=function(e,t){return e.valueChanged(t)},mxGraphModel.prototype.getGeometry=function(e,t){return null!=e?e.getGeometry():null},mxGraphModel.prototype.setGeometry=function(e,t){return t!=this.getGeometry(e)&&this.execute(new mxGeometryChange(this,e,t)),t},mxGraphModel.prototype.geometryForCellChanged=function(e,t){var n=this.getGeometry(e);return e.setGeometry(t),n},mxGraphModel.prototype.getStyle=function(e){return null!=e?e.getStyle():null},mxGraphModel.prototype.setStyle=function(e,t){return t!=this.getStyle(e)&&this.execute(new mxStyleChange(this,e,t)),t},mxGraphModel.prototype.styleForCellChanged=function(e,t){var n=this.getStyle(e);return e.setStyle(t),n},mxGraphModel.prototype.isCollapsed=function(e){return null!=e&&e.isCollapsed()},mxGraphModel.prototype.setCollapsed=function(e,t){return t!=this.isCollapsed(e)&&this.execute(new mxCollapseChange(this,e,t)),t},mxGraphModel.prototype.collapsedStateForCellChanged=function(e,t){var n=this.isCollapsed(e);return e.setCollapsed(t),n},mxGraphModel.prototype.isVisible=function(e){return null!=e&&e.isVisible()},mxGraphModel.prototype.setVisible=function(e,t){return t!=this.isVisible(e)&&this.execute(new mxVisibleChange(this,e,t)),t},mxGraphModel.prototype.visibleStateForCellChanged=function(e,t){var n=this.isVisible(e);return e.setVisible(t),n},mxGraphModel.prototype.execute=function(e){e.execute(),this.beginUpdate(),this.currentEdit.add(e),this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",e)),this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e)),this.endUpdate()},mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++,this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE)),1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))},mxGraphModel.prototype.endUpdate=function(){if(this.updateLevel--,0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT)),!this.endingUpdate){this.endingUpdate=0==this.updateLevel,this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{if(this.endingUpdate&&!this.currentEdit.isEmpty()){this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit));var e=this.currentEdit;this.currentEdit=this.createUndoableEdit(),e.notify(),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e))}}finally{this.endingUpdate=!1}}},mxGraphModel.prototype.createUndoableEdit=function(){var e=new mxUndoableEdit(this,!0);return e.notify=function(){e.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",e,"changes",e.changes)),e.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",e,"changes",e.changes))},e},mxGraphModel.prototype.mergeChildren=function(e,t,n){n=null==n||n,this.beginUpdate();try{var a={};for(var i in this.mergeChildrenImpl(e,t,n,a),a){var o=a[i],s=this.getTerminal(o,!0);null!=s&&(s=a[mxCellPath.create(s)],this.setTerminal(o,s,!0)),null!=(s=this.getTerminal(o,!1))&&(s=a[mxCellPath.create(s)],this.setTerminal(o,s,!1))}}finally{this.endUpdate()}},mxGraphModel.prototype.mergeChildrenImpl=function(e,t,n,a){this.beginUpdate();try{for(var i=e.getChildCount(),o=0;o<i;o++){var s=e.getChildAt(o);if("function"==typeof s.getId){var r=s.getId(),l=null==r||this.isEdge(s)&&n?null:this.getCell(r);if(null==l){var d=s.clone();d.setId(r),d.setTerminal(s.getTerminal(!0),!0),d.setTerminal(s.getTerminal(!1),!1),l=t.insert(d),this.cellAdded(l)}a[mxCellPath.create(s)]=l,this.mergeChildrenImpl(s,l,n,a)}}}finally{this.endUpdate()}},mxGraphModel.prototype.getParents=function(e){var t=[];if(null!=e)for(var n={},a=0;a<e.length;a++){var i=this.getParent(e[a]);if(null!=i){var o=mxCellPath.create(i);null==n[o]&&(n[o]=i,t.push(i))}}return t},mxGraphModel.prototype.cloneCell=function(e){return null!=e?this.cloneCells([e],!0)[0]:null},mxGraphModel.prototype.cloneCells=function(e,t){for(var n={},a=[],i=0;i<e.length;i++)null!=e[i]?a.push(this.cloneCellImpl(e[i],n,t)):a.push(null);for(i=0;i<a.length;i++)null!=a[i]&&this.restoreClone(a[i],e[i],n);return a},mxGraphModel.prototype.cloneCellImpl=function(e,t,n){var a=this.cellCloned(e);if(t[mxObjectIdentity.get(e)]=a,n){n=this.getChildCount(e);for(var i=0;i<n;i++){var o=this.cloneCellImpl(this.getChildAt(e,i),t,!0);a.insert(o)}}return a},mxGraphModel.prototype.cellCloned=function(e){return e.clone()},mxGraphModel.prototype.restoreClone=function(e,t,n){null!=(a=this.getTerminal(t,!0))&&(null!=(a=n[mxObjectIdentity.get(a)])&&a.insertEdge(e,!0)),null!=(a=this.getTerminal(t,!1))&&(null!=(a=n[mxObjectIdentity.get(a)])&&a.insertEdge(e,!1));for(var a=this.getChildCount(e),i=0;i<a;i++)this.restoreClone(this.getChildAt(e,i),this.getChildAt(t,i),n)},mxRootChange.prototype.execute=function(){this.root=this.previous,this.previous=this.model.rootChanged(this.previous)},mxChildChange.prototype.execute=function(){var e=this.model.getParent(this.child),t=null!=e?e.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1),e=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex),null!=this.previous&&this.connect(this.child,!0),this.parent=this.previous,this.previous=e,this.index=this.previousIndex,this.previousIndex=t},mxChildChange.prototype.connect=function(e,t){t=null==t||t;var n=e.getTerminal(!0),a=e.getTerminal(!1);for(null!=n&&(t?this.model.terminalForCellChanged(e,n,!0):this.model.terminalForCellChanged(e,null,!0)),null!=a&&(t?this.model.terminalForCellChanged(e,a,!1):this.model.terminalForCellChanged(e,null,!1)),e.setTerminal(n,!0),e.setTerminal(a,!1),n=this.model.getChildCount(e),a=0;a<n;a++)this.connect(this.model.getChildAt(e,a),t)},mxTerminalChange.prototype.execute=function(){this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source)},mxValueChange.prototype.execute=function(){this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous)},mxStyleChange.prototype.execute=function(){this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous)},mxGeometryChange.prototype.execute=function(){this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous)},mxCollapseChange.prototype.execute=function(){this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous)},mxVisibleChange.prototype.execute=function(){this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous)},mxCellAttributeChange.prototype.execute=function(){var e=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous),this.previous=e},mxCell.prototype.id=null,mxCell.prototype.value=null,mxCell.prototype.geometry=null,mxCell.prototype.style=null,mxCell.prototype.vertex=!1,mxCell.prototype.edge=!1,mxCell.prototype.connectable=!0,mxCell.prototype.visible=!0,mxCell.prototype.collapsed=!1,mxCell.prototype.parent=null,mxCell.prototype.source=null,mxCell.prototype.target=null,mxCell.prototype.children=null,mxCell.prototype.edges=null,mxCell.prototype.mxTransient="id value parent source target children edges".split(" "),mxCell.prototype.getId=function(){return this.id},mxCell.prototype.setId=function(e){this.id=e},mxCell.prototype.getValue=function(){return this.value},mxCell.prototype.setValue=function(e){this.value=e},mxCell.prototype.valueChanged=function(e){var t=this.getValue();return this.setValue(e),t},mxCell.prototype.getGeometry=function(){return this.geometry},mxCell.prototype.setGeometry=function(e){this.geometry=e},mxCell.prototype.getStyle=function(){return this.style},mxCell.prototype.setStyle=function(e){this.style=e},mxCell.prototype.isVertex=function(){return this.vertex},mxCell.prototype.setVertex=function(e){this.vertex=e},mxCell.prototype.isEdge=function(){return this.edge},mxCell.prototype.setEdge=function(e){this.edge=e},mxCell.prototype.isConnectable=function(){return this.connectable},mxCell.prototype.setConnectable=function(e){this.connectable=e},mxCell.prototype.isVisible=function(){return this.visible},mxCell.prototype.setVisible=function(e){this.visible=e},mxCell.prototype.isCollapsed=function(){return this.collapsed},mxCell.prototype.setCollapsed=function(e){this.collapsed=e},mxCell.prototype.getParent=function(){return this.parent},mxCell.prototype.setParent=function(e){this.parent=e},mxCell.prototype.getTerminal=function(e){return e?this.source:this.target},mxCell.prototype.setTerminal=function(e,t){return t?this.source=e:this.target=e,e},mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length},mxCell.prototype.getIndex=function(e){return mxUtils.indexOf(this.children,e)},mxCell.prototype.getChildAt=function(e){return null==this.children?null:this.children[e]},mxCell.prototype.insert=function(e,t){return null!=e&&(null==t&&(t=this.getChildCount(),e.getParent()==this&&t--),e.removeFromParent(),e.setParent(this),null==this.children?(this.children=[],this.children.push(e)):this.children.splice(t,0,e)),e},mxCell.prototype.remove=function(e){var t=null;return null!=this.children&&0<=e&&(null!=(t=this.getChildAt(e))&&(this.children.splice(e,1),t.setParent(null))),t},mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var e=this.parent.getIndex(this);this.parent.remove(e)}},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(e){return mxUtils.indexOf(this.edges,e)},mxCell.prototype.getEdgeAt=function(e){return null==this.edges?null:this.edges[e]},mxCell.prototype.insertEdge=function(e,t){return null!=e&&(e.removeFromTerminal(t),e.setTerminal(this,t),null==this.edges||e.getTerminal(!t)!=this||mxUtils.indexOf(this.edges,e)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(e)),e},mxCell.prototype.removeEdge=function(e,t){if(null!=e){if(e.getTerminal(!t)!=this&&null!=this.edges){var n=this.getEdgeIndex(e);0<=n&&this.edges.splice(n,1)}e.setTerminal(null,t)}return e},mxCell.prototype.removeFromTerminal=function(e){var t=this.getTerminal(e);null!=t&&t.removeEdge(this,e)},mxCell.prototype.getAttribute=function(e,t){var n=this.getValue();return(null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT?n.getAttribute(e):null)||t},mxCell.prototype.setAttribute=function(e,t){var n=this.getValue();null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT&&n.setAttribute(e,t)},mxCell.prototype.clone=function(){var e=mxUtils.clone(this,this.mxTransient);return e.setValue(this.cloneValue()),e},mxCell.prototype.cloneValue=function(){var e=this.getValue();return null!=e&&("function"==typeof e.clone?e=e.clone():isNaN(e.nodeType)||(e=e.cloneNode(!0))),e},mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=e}},mxGeometry.prototype.getTerminalPoint=function(e){return e?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(e,t){return t?this.sourcePoint=e:this.targetPoint=e,e},mxGeometry.prototype.translate=function(e,t){if(this.clone(),this.relative||(this.x+=e,this.y+=t),null!=this.sourcePoint&&(this.sourcePoint.x+=e,this.sourcePoint.y+=t),null!=this.targetPoint&&(this.targetPoint.x+=e,this.targetPoint.y+=t),this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(var n=this.points.length,a=0;a<n;a++){var i=this.points[a];null!=i&&(i.x+=e,i.y+=t)}};var mxCellPath={PATH_SEPARATOR:".",create:function(e){var t="";if(null!=e)for(var n=e.getParent();null!=n;)t=n.getIndex(e)+mxCellPath.PATH_SEPARATOR+t,n=(e=n).getParent();return 1<(e=t.length)&&(t=t.substring(0,e-1)),t},getParentPath:function(e){if(null!=e){var t=e.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(0<=t)return e.substring(0,t);if(0<e.length)return""}return null},resolve:function(e,t){var n=e;if(null!=t)for(var a=t.split(mxCellPath.PATH_SEPARATOR),i=0;i<a.length;i++)n=n.getChildAt(parseInt(a[i]));return n},compare:function(e,t){for(var n=Math.min(e.length,t.length),a=0,i=0;i<n;i++)if(e[i]!=t[i]){0==e[i].length||0==t[i].length?a=e[i]==t[i]?0:e[i]>t[i]?1:-1:a=(n=parseInt(e[i]))==(i=parseInt(t[i]))?0:i<n?1:-1;break}return 0==a&&((n=e.length)!=(i=t.length)&&(a=i<n?1:-1)),a}},mxPerimeter={RectanglePerimeter:function(e,t,n,a){t=e.getCenterX();var i=e.getCenterY(),o=Math.atan2(n.y-i,n.x-t),s=new mxPoint(0,0),r=Math.PI,l=Math.PI/2-o,d=Math.atan2(e.height,e.width);return o<-r+d||r-d<o?(s.x=e.x,s.y=i-e.width*Math.tan(o)/2):o<-d?(s.y=e.y,s.x=t-e.height*Math.tan(l)/2):o<d?(s.x=e.x+e.width,s.y=i+e.width*Math.tan(o)/2):(s.y=e.y+e.height,s.x=t+e.height*Math.tan(l)/2),a&&(n.x>=e.x&&n.x<=e.x+e.width?s.x=n.x:n.y>=e.y&&n.y<=e.y+e.height&&(s.y=n.y),n.x<e.x?s.x=e.x:n.x>e.x+e.width&&(s.x=e.x+e.width),n.y<e.y?s.y=e.y:n.y>e.y+e.height&&(s.y=e.y+e.height)),s},EllipsePerimeter:function(e,t,n,a){var i=e.x,o=e.y,s=e.width/2,r=e.height/2,l=i+s,d=o+r;t=n.x,n=n.y;var c=parseInt(t-l),m=parseInt(n-d);if(0==c&&0!=m)return new mxPoint(l,d+r*m/Math.abs(m));if(0==c&&0==m)return new mxPoint(t,n);if(a){if(o<=n&&n<=o+e.height)return e=n-d,e=Math.sqrt(s*s*(1-e*e/(r*r)))||0,t<=i&&(e=-e),new mxPoint(l+e,n);if(i<=t&&t<=i+e.width)return e=t-l,e=Math.sqrt(r*r*(1-e*e/(s*s)))||0,n<=o&&(e=-e),new mxPoint(t,d+e)}return d-=(i=m/c)*l,l=i*(s=(-(e=-2*l*(o=s*s*i*i+r*r))+(r=Math.sqrt(e*e-4*o*(s*s*i*i*l*l+r*r*l*l-s*s*r*r))))/(2*o))+d,d=i*(r=(-e-r)/(2*o))+d,i=Math.sqrt(Math.pow(s-t,2)+Math.pow(l-n,2)),t=Math.sqrt(Math.pow(r-t,2)+Math.pow(d-n,2)),o=n=0,i<t?(n=s,o=l):(n=r,o=d),new mxPoint(n,o)},RhombusPerimeter:function(e,t,n,a){t=e.x;var i=e.y,o=e.width,s=t+o/2,r=i+(e=e.height)/2,l=n.x;if(n=n.y,s==l)return new mxPoint(s,n<r?i:i+e);if(r==n)return new mxPoint(l<s?t:t+o,r);var d=s,c=r;return a&&(t<=l&&l<=t+o?d=l:i<=n&&n<=i+e&&(c=n)),l<s?n<r?mxUtils.intersection(l,n,d,c,s,i,t,r):mxUtils.intersection(l,n,d,c,s,i+e,t,r):n<r?mxUtils.intersection(l,n,d,c,s,i,t+o,r):mxUtils.intersection(l,n,d,c,s,i+e,t+o,r)},TrianglePerimeter:function(e,t,n,a){var i=(t=null!=t?t.style[mxConstants.STYLE_DIRECTION]:null)==mxConstants.DIRECTION_NORTH||t==mxConstants.DIRECTION_SOUTH,o=e.x,s=e.y,r=e.width,l=o+r/2,d=s+(e=e.height)/2,c=new mxPoint(o,s),m=new mxPoint(o+r,d),u=new mxPoint(o,s+e);t==mxConstants.DIRECTION_NORTH?(c=u,m=new mxPoint(l,s),u=new mxPoint(o+r,s+e)):t==mxConstants.DIRECTION_SOUTH?(m=new mxPoint(l,s+e),u=new mxPoint(o+r,s)):t==mxConstants.DIRECTION_WEST&&(c=new mxPoint(o+r,s),m=new mxPoint(o,d),u=new mxPoint(o+r,s+e));var p=n.x-l,g=n.y-d,v=(p=i?Math.atan2(p,g):Math.atan2(g,p),i?Math.atan2(r,e):Math.atan2(e,r));g=!1,g=t==mxConstants.DIRECTION_NORTH||t==mxConstants.DIRECTION_WEST?-v<p&&p<v:p<-Math.PI+v||p>Math.PI-v,v=null;return g?v=a&&(i&&n.x>=c.x&&n.x<=u.x||!i&&n.y>=c.y&&n.y<=u.y)?i?new mxPoint(n.x,c.y):new mxPoint(c.x,n.y):t==mxConstants.DIRECTION_NORTH?new mxPoint(o+r/2+e*Math.tan(p)/2,s+e):t==mxConstants.DIRECTION_SOUTH?new mxPoint(o+r/2-e*Math.tan(p)/2,s):t==mxConstants.DIRECTION_WEST?new mxPoint(o+r,s+e/2+r*Math.tan(p)/2):new mxPoint(o,s+e/2-r*Math.tan(p)/2):(a&&(a=new mxPoint(l,d),n.y>=s&&n.y<=s+e?(a.x=i?l:t==mxConstants.DIRECTION_WEST?o+r:o,a.y=n.y):n.x>=o&&n.x<=o+r&&(a.x=n.x,a.y=i?t==mxConstants.DIRECTION_NORTH?s+e:s:d),l=a.x,d=a.y),v=i&&n.x<=o+r/2||!i&&n.y<=s+e/2?mxUtils.intersection(n.x,n.y,l,d,c.x,c.y,m.x,m.y):mxUtils.intersection(n.x,n.y,l,d,m.x,m.y,u.x,u.y)),null==v&&(v=new mxPoint(l,d)),v}};function mxPrintPreview(e,t,n,a,i,o,s,r,l){this.graph=e,this.scale=null!=t?t:1/e.pageScale,this.border=null!=a?a:0,this.pageFormat=null!=n?n:e.pageFormat,this.title=null!=r?r:"Printer-friendly version",this.x0=null!=i?i:0,this.y0=null!=o?o:0,this.borderColor=s,this.pageSelector=null==l||l}function mxStylesheet(){this.styles={},this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(e,t,n){this.view=e,this.cell=t,this.style=n,this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(e){this.graph=e,this.cells=[]}function mxSelectionChange(e,t,n){this.selectionModel=e,this.added=null!=t?t.slice():null,this.removed=null!=n?n.slice():null}function mxCellEditor(e){this.graph=e}function mxCellRenderer(){}mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var e="";return 8==document.documentMode&&(e='<meta http-equiv="X-UA-Compatible" content="IE=8">'),e},mxPrintPreview.prototype.open=function(e){var t=this.graph.cellRenderer.initializeOverlay,n=null;try{if(this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(e,t){t.init(e.view.getDrawPane())}),null==this.wnd){this.wnd=window.open();var a=this.wnd.document,i=this.getDoctype();null!=i&&0<i.length&&a.writeln(i),a.writeln("<html>"),a.writeln("<head>"),this.writeHead(a,e),a.writeln("</head>"),a.writeln('<body class="mxPage">'),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",a),mxClient.IS_VML&&(a.namespaces.add("v","urn:schemas-microsoft-com:vml"),a.namespaces.add("o","urn:schemas-microsoft-com:office:office"),a.createStyleSheet().cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css",a));var o=this.graph.getGraphBounds().clone(),s=this.graph.getView().getScale(),r=s/this.scale,l=this.graph.getView().getTranslate();this.autoOrigin||(this.x0=-l.x*this.scale,this.y0=-l.y*this.scale,o.width+=o.x,o.height+=o.y,o.x=0,this.border=o.y=0),o.width/=r,o.height/=r;var d=this.pageFormat.width-2*this.border,c=this.pageFormat.height-2*this.border,m=Math.max(1,Math.ceil((o.width+this.x0)/d)),u=Math.max(1,Math.ceil((o.height+this.y0)/c));this.pageCount=m*u;var p=mxUtils.bind(this,function(){if(this.pageSelector&&(1<u||1<m)){var e=this.createPageSelector(u,m);if(a.body.appendChild(e),mxClient.IS_IE){e.style.position="absolute";var t=function(){e.style.top=a.body.scrollTop+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(e){t()}),mxEvent.addListener(this.wnd,"resize",function(e){t()})}}});if(e=function(e,t){if(null!=this.borderColor&&(e.style.borderColor=this.borderColor,e.style.borderStyle="solid",e.style.borderWidth="1px"),e.style.background="white",t&&(e.style.pageBreakAfter="always"),mxClient.IS_IE?(a.writeln(e.outerHTML),e.parentNode.removeChild(e)):(e.parentNode.removeChild(e),a.body.appendChild(e)),t){var n=a.createElement("hr");n.className="mxPageBreak",a.body.appendChild(n)}},null!=(b=this.getCoverPages(this.pageFormat.width,this.pageFormat.height)))for(var g=0;g<b.length;g++)e(b[g],!0);var v=this.getAppendices(this.pageFormat.width,this.pageFormat.height);for(g=0;g<u;g++)for(var h=g*c/this.scale-this.y0/this.scale+(o.y-l.y*s)/s,b=0;b<m;b++){if(null==this.wnd)return null;var f=b*d/this.scale-this.x0/this.scale+(o.x-l.x*s)/s,A=g*m+b+1;(n=this.renderPage(this.pageFormat.width,this.pageFormat.height,mxUtils.bind(this,function(e){this.addGraphFragment(-f,-h,this.scale,A,e)}))).setAttribute("id","mxPage-"+A),e(n,null!=v||g<u-1||b<m-1)}if(null!=v)for(g=0;g<v.length;g++)e(v[g],g<v.length);a.writeln("</body>"),a.writeln("</html>"),a.close(),p(),mxEvent.release(a.body)}this.wnd.focus()}catch(e){null!=n&&null!=n.parentNode&&n.parentNode.removeChild(n)}finally{this.graph.cellRenderer.initializeOverlay=t}return this.wnd},mxPrintPreview.prototype.writeHead=function(e,t){null!=this.title&&e.writeln("<title>"+this.title+"</title>"),e.writeln('<style type="text/css">'),e.writeln("@media print {"),e.writeln(" table.mxPageSelector { display: none; }"),e.writeln(" hr.mxPageBreak { display: none; }"),e.writeln("}"),e.writeln("@media screen {"),e.writeln(" table.mxPageSelector { position: fixed; right: 10px; top: 10px;font-family: Arial; font-size:10pt; border: solid 1px darkgray;background: white; border-collapse:collapse; }"),e.writeln(" table.mxPageSelector td { border: solid 1px gray; padding:4px; }"),e.writeln(" body.mxPage { background: gray; }"),e.writeln("}"),null!=t&&e.writeln(t),e.writeln("</style>")},mxPrintPreview.prototype.createPageSelector=function(e,t){var n=this.wnd.document,a=n.createElement("table");a.className="mxPageSelector",a.setAttribute("border","0");for(var i=n.createElement("tbody"),o=0;o<e;o++){for(var s=n.createElement("tr"),r=0;r<t;r++){var l=o*t+r+1,d=n.createElement("td");if(!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC){var c=n.createElement("a");c.setAttribute("href","#mxPage-"+l),mxUtils.write(c,l,n),d.appendChild(c)}else mxUtils.write(d,l,n);s.appendChild(d)}i.appendChild(s)}return a.appendChild(i),a},mxPrintPreview.prototype.renderPage=function(e,t,n){var a=document.createElement("div");try{a.style.width=e+"px",a.style.height=t+"px",a.style.overflow="hidden",a.style.pageBreakInside="avoid",a.style.position="relative";var i=document.createElement("div");i.style.top=this.border+"px",i.style.left=this.border+"px",i.style.width=e-2*this.border+"px",i.style.height=t-2*this.border+"px",i.style.overflow="hidden",this.graph.dialect==mxConstants.DIALECT_VML&&(i.style.position="absolute"),a.appendChild(i),document.body.appendChild(a),n(i)}catch(e){throw a.parentNode.removeChild(a),e}return a},mxPrintPreview.prototype.addGraphFragment=function(e,t,n,a,i){a=this.graph.getView();var o=this.graph.container;this.graph.container=i;var s=a.getCanvas(),r=a.getBackgroundPane(),l=a.getDrawPane(),d=a.getOverlayPane();this.graph.dialect==mxConstants.DIALECT_SVG?a.createSvg():this.graph.dialect==mxConstants.DIALECT_VML?a.createVml():a.createHtml();var c=a.isEventsEnabled();a.setEventsEnabled(!1);var m=this.graph.isEnabled();this.graph.setEnabled(!1);var u=a.getTranslate();a.translate=new mxPoint(e,t),e=null;try{var p=[this.graph.getModel().getRoot()];e=new mxTemporaryCellStates(a,n,p)}finally{if(mxClient.IS_IE)a.overlayPane.innerHTML="";else for(n=i.firstChild;null!=n;)p=n.nextSibling,"svg"==(t=n.nodeName.toLowerCase())?(n.setAttribute("width",parseInt(i.style.width)),n.setAttribute("height",parseInt(i.style.height))):"default"!=n.style.cursor&&"table"!=t&&n.parentNode.removeChild(n),n=p;a.overlayPane.parentNode.removeChild(a.overlayPane),this.graph.setEnabled(m),this.graph.container=o,a.canvas=s,a.backgroundPane=r,a.drawPane=l,a.overlayPane=d,a.translate=u,e.destroy(),a.setEventsEnabled(c)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(){var e=this.open();null!=e&&e.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},mxStylesheet.prototype.createDefaultVertexStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,e[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#774400",e},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,e[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#446299",e},mxStylesheet.prototype.putDefaultVertexStyle=function(e){this.putCellStyle("defaultVertex",e)},mxStylesheet.prototype.putDefaultEdgeStyle=function(e){this.putCellStyle("defaultEdge",e)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(e,t){this.styles[e]=t},mxStylesheet.prototype.getCellStyle=function(e,t){var n=t;if(null!=e&&0<e.length)for(var a=e.split(";"),i=(n=null!=n&&";"!=e.charAt(0)?mxUtils.clone(n):{},0);i<a.length;i++){var o=(s=a[i]).indexOf("=");if(0<=o){var s,r=s.substring(0,o);(s=s.substring(o+1))==mxConstants.NONE?delete n[r]:mxUtils.isNumeric(s)?n[r]=parseFloat(s):n[r]=s}else if(null!=(s=this.styles[s]))for(r in s)n[r]=s[r]}return n},mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalid=!0,mxCellState.prototype.invalidOrder=!1,mxCellState.prototype.orderChanged=!1,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.getPerimeterBounds=function(e,t){if(e=e||0,t=null!=t?t:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil){var n=this.shape.stencil.computeAspect(this.style,t.x,t.y,t.width,t.height);t.x=n.x,t.y=n.y,t.width=this.shape.stencil.w0*n.width,t.height=this.shape.stencil.h0*n.height}return 0!=e&&t.grow(e),t},mxCellState.prototype.setAbsoluteTerminalPoint=function(e,t){t?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[0]=e):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(e)):1==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[this.absolutePoints.length-1]=e},mxCellState.prototype.setCursor=function(e){null!=this.shape&&this.shape.setCursor(e),null!=this.text&&this.text.setCursor(e)},mxCellState.prototype.getVisibleTerminal=function(e){return null!=(e=this.getVisibleTerminalState(e))?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(e){return e?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(e,t){t?this.visibleSourceState=e:this.visibleTargetState=e},mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)},mxCellState.prototype.clone=function(){var e=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){e.absolutePoints=[];for(var t=0;t<this.absolutePoints.length;t++)e.absolutePoints[t]=this.absolutePoints[t].clone()}return null!=this.origin&&(e.origin=this.origin.clone()),null!=this.absoluteOffset&&(e.absoluteOffset=this.absoluteOffset.clone()),null!=this.boundingBox&&(e.boundingBox=this.boundingBox.clone()),e.terminalDistance=this.terminalDistance,e.segments=this.segments,e.length=this.length,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e},mxGraphSelectionModel.prototype=new mxEventSource,mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel,mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"",mxGraphSelectionModel.prototype.graph=null,mxGraphSelectionModel.prototype.singleSelection=!1,mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection},mxGraphSelectionModel.prototype.setSingleSelection=function(e){this.singleSelection=e},mxGraphSelectionModel.prototype.isSelected=function(e){return null!=e&&0<=mxUtils.indexOf(this.cells,e)},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(e){null!=e&&this.setCells([e])},mxGraphSelectionModel.prototype.setCells=function(e){if(null!=e){this.singleSelection&&(e=[this.getFirstSelectableCell(e)]);for(var t=[],n=0;n<e.length;n++)this.graph.isCellSelectable(e[n])&&t.push(e[n]);this.changeSelection(t,this.cells)}},mxGraphSelectionModel.prototype.getFirstSelectableCell=function(e){if(null!=e)for(var t=0;t<e.length;t++)if(this.graph.isCellSelectable(e[t]))return e[t];return null},mxGraphSelectionModel.prototype.addCell=function(e){null!=e&&this.addCells([e])},mxGraphSelectionModel.prototype.addCells=function(e){if(null!=e){var t=null;this.singleSelection&&(t=this.cells,e=[this.getFirstSelectableCell(e)]);for(var n=[],a=0;a<e.length;a++)!this.isSelected(e[a])&&this.graph.isCellSelectable(e[a])&&n.push(e[a]);this.changeSelection(n,t)}},mxGraphSelectionModel.prototype.removeCell=function(e){null!=e&&this.removeCells([e])},mxGraphSelectionModel.prototype.removeCells=function(e){if(null!=e){for(var t=[],n=0;n<e.length;n++)this.isSelected(e[n])&&t.push(e[n]);this.changeSelection(null,t)}},mxGraphSelectionModel.prototype.changeSelection=function(e,t){if(null!=e&&0<e.length&&null!=e[0]||null!=t&&0<t.length&&null!=t[0]){var n=new mxSelectionChange(this,e,t);n.execute();var a=new mxUndoableEdit(this,!1);a.add(n),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",a))}},mxGraphSelectionModel.prototype.cellAdded=function(e){null!=e&&!this.isSelected(e)&&this.cells.push(e)},mxGraphSelectionModel.prototype.cellRemoved=function(e){null!=e&&(0<=(e=mxUtils.indexOf(this.cells,e))&&this.cells.splice(e,1))},mxSelectionChange.prototype.execute=function(){var e=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var t=0;t<this.removed.length;t++)this.selectionModel.cellRemoved(this.removed[t]);if(null!=this.added)for(t=0;t<this.added.length;t++)this.selectionModel.cellAdded(this.added[t]);t=this.added,this.added=this.removed,this.removed=t,window.status=mxResources.get(this.selectionModel.doneResource)||this.selectionModel.doneResource,mxLog.leave("mxSelectionChange.execute",e),this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))},mxCellEditor.prototype.graph=null,mxCellEditor.prototype.textarea=null,mxCellEditor.prototype.editingCell=null,mxCellEditor.prototype.trigger=null,mxCellEditor.prototype.modified=!1,mxCellEditor.prototype.autoSize=!0,mxCellEditor.prototype.emptyLabelText="",mxCellEditor.prototype.textNode="",mxCellEditor.prototype.init=function(){this.textarea=document.createElement("textarea"),this.textarea.className="mxCellEditor",this.textarea.style.position="absolute",this.textarea.style.overflow="visible",this.textarea.setAttribute("cols","20"),this.textarea.setAttribute("rows","4"),mxClient.IS_NS&&(this.textarea.style.resize="none"),mxEvent.addListener(this.textarea,"blur",mxUtils.bind(this,function(e){this.focusLost()})),mxEvent.addListener(this.textarea,"keydown",mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(113==e.keyCode||this.graph.isEnterStopsCellEditing()&&13==e.keyCode&&!mxEvent.isControlDown(e)&&!mxEvent.isShiftDown(e)?(this.graph.stopEditing(!1),mxEvent.consume(e)):27==e.keyCode?(this.graph.stopEditing(!0),mxEvent.consume(e)):(this.clearOnChange&&(this.clearOnChange=!1,this.textarea.value=""),this.setModified(!0)))})),mxEvent.addListener(this.textarea,"keypress",mxUtils.bind(this,function(e){this.autoSize&&!mxEvent.isConsumed(e)&&setTimeout(mxUtils.bind(this,function(){this.resize()}),0)}))},mxCellEditor.prototype.resize=function(){if(null!=this.textDiv){var e=this.graph.getView().getState(this.editingCell),t=this.graph.isLabelClipped(e.cell),n=this.graph.isWrapping(e.cell);if(this.graph.getModel().isEdge(e.cell))this.bounds.x=e.absoluteOffset.x,this.bounds.y=e.absoluteOffset.y,this.bounds.width=0,this.bounds.height=0;else if(null!=this.bounds){this.bounds.x=e.x,this.bounds.y=e.y,this.bounds.width=e.width,this.bounds.height=e.height,(a=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?this.bounds.x-=e.width:a==mxConstants.ALIGN_RIGHT&&(this.bounds.x+=e.width),(a=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?this.bounds.y-=e.height:a==mxConstants.ALIGN_BOTTOM&&(this.bounds.y+=e.height)}"\n"!=(a=this.textarea.value).charAt(a.length-1)&&""!=a||(a+=" "),a=mxUtils.htmlEntities(a,!1),n?(this.textDiv.style.whiteSpace="normal",this.textDiv.style.width=this.bounds.width+"px"):a=a.replace(/ /g," "),a=a.replace(/\n/g,"<br/>"),this.textDiv.innerHTML=a;var a=this.textDiv.offsetWidth+30,i=this.textDiv.offsetHeight+16;a=Math.max(a,40),i=Math.max(i,20);t&&(a=Math.min(this.bounds.width-4,a),i=Math.min(this.bounds.height,i));var o=null!=e.text?e.text.margin:null;null==o&&(o=mxUtils.getValue(e.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),e=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getAlignmentAsPoint(o,e)),null!=o&&(!t&&n||(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-o.x*this.bounds.width+o.x*a)-3)+"px"),this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-o.y*this.bounds.height+o.y*i)+4)+"px"),!t&&n||(this.textarea.style.width=a+"px"),this.textarea.style.height=i+"px"}},mxCellEditor.prototype.isModified=function(){return this.modified},mxCellEditor.prototype.setModified=function(e){this.modified=e},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.startEditing=function(e,t){null==this.textarea&&this.init(),this.stopEditing(!0);var n=this.graph.getView().getState(e);if(null!=n){this.editingCell=e,this.trigger=t,(this.textNode=null)!=n.text&&this.isHideLabel(n)&&(this.textNode=n.text.node,this.textNode.style.visibility="hidden");var a=this.graph.getView().scale,i=(a=mxUtils.getValue(n.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)*a,mxUtils.getValue(n.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)),o=mxUtils.getValue(n.style,mxConstants.STYLE_FONTCOLOR,"black"),s=mxUtils.getValue(n.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),r=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,l=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,d=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.fontSize=Math.round(a)+"px",this.textarea.style.lineHeight=Math.round(a*mxConstants.LINE_HEIGHT)+"px",this.textarea.style.fontFamily=i,this.textarea.style.textAlign=s,this.textarea.style.color=o,this.textarea.style.fontWeight=r?"bold":"normal",this.textarea.style.fontStyle=l?"italic":"",this.textarea.style.textDecoration=d?"underline":"",this.textarea.style.overflow="auto",this.textarea.style.outline="none",this.bounds=a=this.getEditorBounds(n),this.textarea.style.left=a.x+"px",this.textarea.style.top=a.y+"px",this.textarea.style.width=a.width+"px",this.textarea.style.height=a.height+"px",this.textarea.style.zIndex=5,null==(n=this.getInitialValue(n,t))||0==n.length?(n=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=!1,this.setModified(!1),this.textarea.value=n,this.graph.container.appendChild(this.textarea),"none"!=this.textarea.style.display&&(this.autoSize&&(this.textDiv=this.createTextDiv(),document.body.appendChild(this.textDiv),this.resize()),this.textarea.focus(),this.textarea.select())}},mxCellEditor.prototype.createTextDiv=function(){var e=document.createElement("div"),t=e.style;return t.position="absolute",t.whiteSpace="nowrap",t.visibility="hidden",t.display=mxClient.IS_QUIRKS?"inline":"inline-block",t.zoom="1",t.verticalAlign="top",t.lineHeight=this.textarea.style.lineHeight,t.fontSize=this.textarea.style.fontSize,t.fontFamily=this.textarea.style.fontFamily,t.fontWeight=this.textarea.style.fontWeight,t.textAlign=this.textarea.style.textAlign,t.fontStyle=this.textarea.style.fontStyle,t.textDecoration=this.textarea.style.textDecoration,e},mxCellEditor.prototype.stopEditing=function(e){null!=this.editingCell&&(null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null),!e&&this.isModified()&&this.graph.labelChanged(this.editingCell,this.getCurrentValue(),this.trigger),null!=this.textDiv&&(document.body.removeChild(this.textDiv),this.textDiv=null),this.bounds=this.trigger=this.editingCell=null,this.textarea.blur(),this.textarea.parentNode.removeChild(this.textarea))},mxCellEditor.prototype.getInitialValue=function(e,t){return this.graph.getEditingValue(e.cell,t)},mxCellEditor.prototype.getCurrentValue=function(){return this.textarea.value.replace(/\r/g,"")},mxCellEditor.prototype.isHideLabel=function(e){return!0},mxCellEditor.prototype.getMinimumSize=function(e){var t=this.graph.getView().scale;return new mxRectangle(0,0,null==e.text?30:e.text.size*t+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(e){var t=this.graph.getModel().isEdge(e.cell),n=this.graph.getView().scale,a=(i=this.getMinimumSize(e)).width,i=i.height,o=parseInt(e.style[mxConstants.STYLE_SPACING]||2)*n,s=parseInt(e.style[mxConstants.STYLE_SPACING_TOP]||0)*n+o,r=parseInt(e.style[mxConstants.STYLE_SPACING_RIGHT]||0)*n+o,l=parseInt(e.style[mxConstants.STYLE_SPACING_BOTTOM]||0)*n+o;n=parseInt(e.style[mxConstants.STYLE_SPACING_LEFT]||0)*n+o,r=new mxRectangle(e.x,e.y,Math.max(a,e.width-n-r),Math.max(i,e.height-s-l));return t?(r.x=e.absoluteOffset.x,r.y=e.absoluteOffset.y,null!=e.text&&null!=e.text.boundingBox&&(0<e.text.boundingBox.x&&(r.x=e.text.boundingBox.x),0<e.text.boundingBox.y&&(r.y=e.text.boundingBox.y))):null!=e.text&&null!=e.text.boundingBox&&(r.x=Math.min(r.x,e.text.boundingBox.x),r.y=Math.min(r.y,e.text.boundingBox.y)),r.x+=n,r.y+=s,null!=e.text&&null!=e.text.boundingBox&&(t?(r.width=Math.max(a,e.text.boundingBox.width),r.height=Math.max(i,e.text.boundingBox.height)):(r.width=Math.max(r.width,e.text.boundingBox.width),r.height=Math.max(r.height,e.text.boundingBox.height))),this.graph.getModel().isVertex(e.cell)&&((t=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?r.x-=e.width:t==mxConstants.ALIGN_RIGHT&&(r.x+=e.width),(t=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?r.y-=e.height:t==mxConstants.ALIGN_BOTTOM&&(r.y+=e.height)),r},mxCellEditor.prototype.getEmptyLabelText=function(e){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null)},mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.defaultShapes={},mxCellRenderer.registerShape=function(e,t){mxCellRenderer.prototype.defaultShapes[e]=t},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initialize=function(e,t){var n=e.view.graph.getModel();null!=e.view.graph.container&&null==e.shape&&e.cell!=e.view.currentRoot&&(n.isVertex(e.cell)||n.isEdge(e.cell))&&(this.createShape(e),null==e.shape||null!=t&&!t||(this.initializeShape(e),e.view.graph.ordered||n.isEdge(e.cell)?e.invalidOrder=!0:e.view.graph.keepEdgesInForeground&&null!=this.firstEdge&&(this.firstEdge.parentNode==e.shape.node.parentNode?this.insertState(e,this.firstEdge):this.firstEdge=null),e.shape.scale=e.view.scale,this.createCellOverlays(e),this.installListeners(e)))},mxCellRenderer.prototype.initializeShape=function(e){e.shape.init(e.view.getDrawPane())},mxCellRenderer.prototype.getPreviousStateInContainer=function(e,t){for(var n=null,a=e.view.graph,i=a.getModel(),o=e.cell,s=i.getParent(o);null!=s&&null==n;)n=this.findPreviousStateInContainer(a,s,o,t),o=s,s=i.getParent(o);return n},mxCellRenderer.prototype.findPreviousStateInContainer=function(e,t,n,a){var i=null,o=e.getModel();for(n=null!=n?t.getIndex(n)-1:o.getChildCount(t)-1;0<=n&&null==i;n--)i=this.findPreviousStateInContainer(e,o.getChildAt(t,n),null,a);return null!=i||(null==(i=e.view.getState(t))||null!=i.shape&&null!=i.shape.node&&i.shape.node.parentNode==a)||(i=null),i},mxCellRenderer.prototype.order=function(e){var t=e.shape.node.parentNode,n=this.getPreviousStateInContainer(e,t),a=t.firstChild;null!=n&&(a=n.shape.node,null!=n.text&&null!=n.text.node&&n.text.node.parentNode==t&&(a=n.text.node),a=a.nextSibling),this.insertState(e,a)},mxCellRenderer.prototype.orderEdge=function(e){var t=(n=e.view).graph.getModel();if(n.graph.keepEdgesInForeground)null!=this.firstEdge&&null!=this.firstEdge.parentNode&&this.firstEdge.parentNode==e.shape.node.parentNode||(this.firstEdge=e.shape.node);else if(n.graph.keepEdgesInBackground){var n,a=e.shape.node,i=a.parentNode;t=t.getParent(e.cell);null!=(i=null!=(n=n.getState(t))&&null!=n.shape&&null!=n.shape.node?n.shape.node.nextSibling:i.firstChild)&&i!=a&&this.insertState(e,i)}},mxCellRenderer.prototype.insertState=function(e,t){e.shape.node.parentNode.insertBefore(e.shape.node,t),null!=e.text&&null!=e.text.node&&e.text.node.parentNode==e.shape.node.parentNode&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling)},mxCellRenderer.prototype.createShape=function(e){if(null!=e.style){var t=mxStencilRegistry.getStencil(e.style[mxConstants.STYLE_SHAPE]);null!=t?e.shape=new mxShape(t):(t=this.getShapeConstructor(e),e.shape=new t),e.shape.points=e.absolutePoints,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.dialect=e.view.graph.dialect,this.configureShape(e)}},mxCellRenderer.prototype.getShape=function(e){return null!=e?mxCellRenderer.prototype.defaultShapes[e]:null},mxCellRenderer.prototype.getShapeConstructor=function(e){var t=this.getShape(e.style[mxConstants.STYLE_SHAPE]);return null==t&&(t=e.view.graph.getModel().isEdge(e.cell)?this.defaultEdgeShape:this.defaultVertexShape),t},mxCellRenderer.prototype.configureShape=function(e){e.shape.apply(e),e.shape.image=e.view.graph.getImage(e),e.shape.indicatorShape=this.getShape(e.view.graph.getIndicatorShape(e)),e.shape.indicatorColor=e.view.graph.getIndicatorColor(e),e.shape.indicatorGradientColor=e.view.graph.getIndicatorGradientColor(e),e.shape.indicatorDirection=e.style[mxConstants.STYLE_INDICATOR_DIRECTION],e.shape.indicatorImage=e.view.graph.getIndicatorImage(e),this.postConfigureShape(e)},mxCellRenderer.prototype.postConfigureShape=function(e){null!=e.shape&&(this.resolveColor(e,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(e,"fill",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(e,"gradient",mxConstants.STYLE_GRADIENTCOLOR))},mxCellRenderer.prototype.resolveColor=function(e,t,n){var a=e.shape[t],i=e.view.graph,o=null;"inherit"==a?o=i.model.getParent(e.cell):"swimlane"==a?(o=null!=i.model.getTerminal(e.cell,!1)?i.model.getTerminal(e.cell,!1):e.cell,o=i.getSwimlane(o),n=i.swimlaneIndicatorColorAttribute):"indicated"==a&&(e.shape[t]=e.shape.indicatorColor),null!=o&&(a=i.getView().getState(o),(e.shape[t]=null)!=a&&(e.shape[t]=null!=a.shape&&"indicatorColor"!=t?a.shape[t]:a.style[n]))},mxCellRenderer.prototype.getLabelValue=function(e){return e.view.graph.getLabel(e.cell)},mxCellRenderer.prototype.createLabel=function(n,e){var a=n.view.graph;if(a.getModel().isEdge(n.cell),0<n.style[mxConstants.STYLE_FONTSIZE]||null==n.style[mxConstants.STYLE_FONTSIZE]){var t=a.isHtmlLabel(n.cell)||null!=e&&mxUtils.isNode(e);n.text=new this.defaultTextShape(e,new mxRectangle,n.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,a.getVerticalAlign(n),n.style[mxConstants.STYLE_FONTCOLOR],n.style[mxConstants.STYLE_FONTFAMILY],n.style[mxConstants.STYLE_FONTSIZE],n.style[mxConstants.STYLE_FONTSTYLE],n.style[mxConstants.STYLE_SPACING],n.style[mxConstants.STYLE_SPACING_TOP],n.style[mxConstants.STYLE_SPACING_RIGHT],n.style[mxConstants.STYLE_SPACING_BOTTOM],n.style[mxConstants.STYLE_SPACING_LEFT],n.style[mxConstants.STYLE_HORIZONTAL],n.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],n.style[mxConstants.STYLE_LABEL_BORDERCOLOR],a.isWrapping(n.cell)&&a.isHtmlLabel(n.cell),a.isLabelClipped(n.cell),n.style[mxConstants.STYLE_OVERFLOW],n.style[mxConstants.STYLE_LABEL_PADDING]),n.text.opacity=mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_OPACITY,100),n.text.dialect=t?mxConstants.DIALECT_STRICTHTML:n.view.graph.dialect,n.text.state=n,this.initializeLabel(n);var i=!1,o=function(e){var t=n;return(mxClient.IS_TOUCH||i)&&(t=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,t,e),t=a.view.getState(a.getCellAt(e.x,e.y))),t};mxEvent.addGestureListeners(n.text.node,mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&(a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,n)),i=a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName)}),mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,o(e)))}),mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&(a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,o(e))),i=!1)})),mxEvent.addListener(n.text.node,"dblclick",mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&(a.dblClick(e,n.cell),mxEvent.consume(e))}))}},mxCellRenderer.prototype.initializeLabel=function(e){var t=e.view.graph;e.text.dialect!=mxConstants.DIALECT_SVG&&(mxClient.IS_SVG&&mxClient.NO_FO?e.text.init(t.container):mxUtils.isVml(e.view.getDrawPane())&&(null!=e.shape.label?e.text.init(e.shape.label):e.text.init(e.shape.node))),null==e.text.node&&(e.text.init(e.view.getDrawPane()),null!=e.shape&&null!=e.text&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling))},mxCellRenderer.prototype.createCellOverlays=function(e){var t=e.view.graph.getCellOverlays(e.cell),n=null;if(null!=t){n=new mxDictionary;for(var a=0;a<t.length;a++){var i=null!=e.overlays?e.overlays.remove(t[a]):null;null==i&&((i=new mxImageShape(new mxRectangle,t[a].image.src)).dialect=e.view.graph.dialect,i.preserveImageAspect=!1,i.overlay=t[a],this.initializeOverlay(e,i),this.installCellOverlayListeners(e,t[a],i),null!=t[a].cursor&&(i.node.style.cursor=t[a].cursor)),n.put(t[a],i)}}null!=e.overlays&&e.overlays.visit(function(e,t){t.destroy()}),e.overlays=n},mxCellRenderer.prototype.initializeOverlay=function(e,t){t.init(e.view.getOverlayPane())},mxCellRenderer.prototype.installCellOverlayListeners=function(t,n,e){var a=t.view.graph;mxEvent.addListener(e.node,"click",function(e){a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),n.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",t.cell))}),mxEvent.addGestureListeners(e.node,function(e){mxEvent.consume(e)},function(e){a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))}),mxClient.IS_TOUCH&&mxEvent.addListener(e.node,"touchend",function(e){n.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",t.cell))})},mxCellRenderer.prototype.createControl=function(n){var a=n.view.graph,e=a.getFoldingImage(n);if(a.foldingEnabled&&null!=e){if(null==n.control){var t=new mxRectangle(0,0,e.width,e.height);n.control=new mxImageShape(t,e.src),n.control.preserveImageAspect=!1,n.control.dialect=a.dialect,this.initControl(n,n.control,!0,function(e){if(a.isEnabled()){var t=!a.isCellCollapsed(n.cell);a.foldCells(t,!1,[n.cell]),mxEvent.consume(e)}})}}else null!=n.control&&(n.control.destroy(),n.control=null)},mxCellRenderer.prototype.initControl=function(t,e,n,a){var i=t.view.graph;return i.isHtmlLabel(t.cell)&&mxClient.NO_FO&&i.dialect==mxConstants.DIALECT_SVG?(e.dialect=mxConstants.DIALECT_PREFERHTML,e.init(i.container),e.node.style.zIndex=1):e.init(t.view.getOverlayPane()),e=e.innerNode||e.node,a&&(i.isEnabled()&&(e.style.cursor="pointer"),mxEvent.addListener(e,"click",a)),n&&mxEvent.addGestureListeners(e,function(e){i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),mxEvent.consume(e)},function(e){i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))}),e},mxCellRenderer.prototype.isShapeEvent=function(e,t){return!0},mxCellRenderer.prototype.isLabelEvent=function(e,t){return!0},mxCellRenderer.prototype.installListeners=function(n){var a=n.view.graph,t=function(e){var t=n;return(a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName||mxClient.IS_TOUCH)&&(t=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,t,e),t=a.view.getState(a.getCellAt(e.x,e.y))),t},i=!1;mxEvent.addListener(n.shape.node,"gesturestart",mxUtils.bind(this,function(e){a.lastTouchTime=0,i=!0,mxEvent.consume(e)})),mxEvent.addGestureListeners(n.shape.node,mxUtils.bind(this,function(e){this.isShapeEvent(n,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:n)):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(n,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:t(e))):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(n,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:t(e))):i&&mxEvent.consume(e)}));var o=mxClient.IS_TOUCH?"gestureend":"dblclick";mxEvent.addListener(n.shape.node,o,mxUtils.bind(this,function(e){i=!1,"gestureend"==o?(a.lastTouchTime=0,a.gestureEnabled&&(a.handleGesture(n,e),mxEvent.consume(e))):this.isShapeEvent(n,e)&&(a.dblClick(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:n.cell),mxEvent.consume(e))}))},mxCellRenderer.prototype.redrawLabel=function(e,t){var n=this.getLabelValue(e);if(null==e.text&&null!=n&&(mxUtils.isNode(n)||0<n.length)?this.createLabel(e,n):null==e.text||null!=n&&0!=n.length||(e.text.destroy(),e.text=null),null!=e.text){var a=(i=e.view.graph).isWrapping(e.cell),i=i.isLabelClipped(e.cell),o=this.getLabelBounds(e);!t&&e.text.value==n&&e.text.isWrapping==a&&e.text.isClipping==i&&e.text.scale==e.view.scale&&e.text.bounds.equals(o)||(e.text.value=n,e.text.bounds=o,e.text.scale=this.getTextScale(e),e.text.isWrapping=a,e.text.isClipping=i,e.text.redraw())}},mxCellRenderer.prototype.getTextScale=function(e){return e.view.scale},mxCellRenderer.prototype.getLabelBounds=function(e){var t=e.view.graph,n=e.view.scale,a=t.getModel().isEdge(e.cell),i=new mxRectangle(e.absoluteOffset.x,e.absoluteOffset.y);return e.text.updateMargin(),a?(a=e.text.getSpacing(),i.x+=a.x*n,i.y+=a.y*n,null!=(t=t.getCellGeometry(e.cell))&&(i.width=Math.max(0,e.text.margin.x*t.width*n-e.text.spacingLeft*n-e.text.spacingRight*n),i.height=Math.max(0,e.text.margin.y*t.height*n-e.text.spacingTop*n-e.text.spacingBottom*n))):(e.text.isPaintBoundsInverted()&&(a=i.x,i.x=i.y,i.y=a),i.x+=e.x,i.y+=e.y,i.width=Math.max(1,e.width),i.height=Math.max(1,e.height),t.isSwimlane(e.cell)&&(0<(t=t.getStartSize(e.cell)).width?(a=Math.min(i.width,t.width*n),e.shape.flipH&&(i.x+=i.width-a),i.width=a):0<t.height&&(a=Math.min(i.height,t.height*n),e.shape.flipV&&(i.y+=i.height-a),i.height=a)),this.rotateLabelBounds(e,i)),i},mxCellRenderer.prototype.rotateLabelBounds=function(e,t){if(e.text.isPaintBoundsInverted()){var n=(e.width-e.height)/2;t.x+=n,t.y-=n,n=t.width,t.width=t.height,t.height=n}if(t.x-=e.text.margin.x*t.width,t.y-=e.text.margin.y*t.height,"fill"!=e.style[mxConstants.STYLE_OVERFLOW]){n=e.view.scale;var a=e.text.getSpacing();t.x+=a.x*n,t.y+=a.y*n,t.width=Math.max(0,t.width-e.text.spacingLeft*n-e.text.spacingRight*n),t.height=Math.max(0,t.height-e.text.spacingTop*n-e.text.spacingBottom*n)}var i=e.text.getTextRotation();0!=i&&null!=e&&e.view.graph.model.isVertex(e.cell)&&(n=e.getCenterX(),a=e.getCenterY(),t.x!=n||t.y!=a)&&(i*=Math.PI/180,pt=mxUtils.getRotatedPoint(new mxPoint(t.x,t.y),Math.cos(i),Math.sin(i),new mxPoint(n,a)),t.x=pt.x,t.y=pt.y)},mxCellRenderer.prototype.redrawCellOverlays=function(o,s){if(this.createCellOverlays(o),null!=o.overlays){var r=mxUtils.mod(mxUtils.getValue(o.style,mxConstants.STYLE_ROTATION,0),90),e=mxUtils.toRadians(r),l=Math.cos(e),d=Math.sin(e);o.overlays.visit(function(e,t){var n=t.overlay.getBounds(o);if(!o.view.graph.getModel().isEdge(o.cell)&&null!=o.shape&&0!=r){var a=n.getCenterX(),i=n.getCenterY();a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),l,d,new mxPoint(o.getCenterX(),o.getCenterY()))).x,i=i.y;n.x=Math.round(a-n.width/2),n.y=Math.round(i-n.height/2)}!s&&null!=t.bounds&&t.scale==o.view.scale&&t.bounds.equals(n)||(t.bounds=n,t.scale=o.view.scale,t.redraw())})}},mxCellRenderer.prototype.redrawControl=function(e,t){if(null!=e.control){var n=this.getControlBounds(e),a=this.legacyControlPosition?mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0):e.shape.getTextRotation(),i=e.view.scale;!t&&e.control.scale==i&&e.control.bounds.equals(n)&&e.control.rotation==a||(e.control.rotation=a,e.control.bounds=n,e.control.scale=i,e.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(e){if(null!=e.control){var t=e.control.scale,n=e.control.bounds.width/t,a=(t=e.control.bounds.height/t,e.view.scale),i=e.getCenterX(),o=e.getCenterY();if(!e.view.graph.getModel().isEdge(e.cell)&&(i=e.x+n*a,o=e.y+t*a,null!=e.shape)){var s=e.shape.getShapeRotation();if(this.legacyControlPosition)s=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0);else if(e.shape.isPaintBoundsInverted()){var r=(e.width-e.height)/2;i=i+r,o=o-r}0!=s&&(r=mxUtils.toRadians(s),s=Math.cos(r),r=Math.sin(r),i=(o=mxUtils.getRotatedPoint(new mxPoint(i,o),s,r,new mxPoint(e.getCenterX(),e.getCenterY()))).x,o=o.y)}return e.view.graph.getModel().isEdge(e.cell),new mxRectangle(Math.round(i-n/2*a),Math.round(o-t/2*a),Math.round(n*a),Math.round(t*a))}return null},mxCellRenderer.prototype.redraw=function(e,t,n){if(null!=e.shape){var a=!1;e.view.graph.getModel().isEdge(e.cell),reconfigure=null!=t&&t,this.createControl(e),(e.orderChanged||e.invalidOrder)&&(e.view.graph.ordered?this.order(e):this.orderEdge(e)),!e.orderChanged&&mxUtils.equalEntries(e.shape.style,e.style)||(this.configureShape(e),t=!0),delete e.invalidOrder,delete e.orderChanged,!t&&null!=e.shape.bounds&&e.shape.scale==e.view.scale&&e.shape.bounds.equals(e)&&mxUtils.equalPoints(e.shape.points,e.absolutePoints)||(a=!0,e.shape.points=null!=e.absolutePoints?e.absolutePoints.slice():null,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.scale=e.view.scale,null==n||n?e.shape.redraw():e.shape.updateBoundingBox()),(null==n||n)&&(this.redrawLabel(e,a),this.redrawCellOverlays(e,a),this.redrawControl(e,a))}},mxCellRenderer.prototype.destroy=function(e){null!=e.shape&&(null!=e.text&&(e.text.destroy(),e.text=null),null!=e.overlays&&(e.overlays.visit(function(e,t){t.destroy()}),e.overlays=null),null!=e.control&&(e.control.destroy(),e.control=null),e.shape.destroy(),e.shape=null)};var mxEdgeStyle={EntityRelation:function(e,t,n,a,i){var o=e.view,s=o.graph;a=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*o.scale;var r=(d=e.absolutePoints)[0],l=d[d.length-1],d=!1;if(null!=r)(t=new mxCellState).x=r.x,t.y=r.y;else{if(null==t)return;var c=mxUtils.getPortConstraints(t,e,!0,mxConstants.DIRECTION_MASK_NONE);c!=mxConstants.DIRECTION_MASK_NONE?d=c==mxConstants.DIRECTION_MASK_WEST:(r=s.getCellGeometry(t.cell)).relative?d=r.x<=.5:null!=n&&(d=n.x+n.width<t.x)}r=!0,null!=l?((n=new mxCellState).x=l.x,n.y=l.y):null!=n&&((c=mxUtils.getPortConstraints(n,e,!1,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE?r=c==mxConstants.DIRECTION_MASK_WEST:(e=s.getCellGeometry(n.cell)).relative?r=e.x<=.5:null!=t&&(r=t.x+t.width<n.x)),null!=t&&null!=n&&(e=d?t.x:t.x+t.width,t=o.getRoutingCenterY(t),s=r?n.x:n.x+n.width,n=o.getRoutingCenterY(n),o=new mxPoint(e+(d?-a:a),t),l=new mxPoint(s+(r?-a:a),n),d==r?(a=d?Math.min(e,s)-a:Math.max(e,s)+a,i.push(new mxPoint(a,t)),i.push(new mxPoint(a,n))):(o.x<l.x==d?(a=t+(n-t)/2,i.push(o),i.push(new mxPoint(o.x,a)),i.push(new mxPoint(l.x,a))):i.push(o),i.push(l)))},Loop:function(e,t,n,a,i){if(null!=t){var o=(n=e.view).graph;null!=(a=null!=a&&0<a.length?a[0]:null)&&(a=n.transformControlPoint(e,a),mxUtils.contains(t,a.x,a.y)&&(a=null));var s=0,r=0,l=0,d=0;o=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,o.gridSize)*n.scale;(e=mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST))==mxConstants.DIRECTION_NORTH||e==mxConstants.DIRECTION_SOUTH?(s=n.getRoutingCenterX(t),r=o):(l=n.getRoutingCenterY(t),d=o),null==a||a.x<t.x||a.x>t.x+t.width?null!=a?(s=a.x,d=Math.max(Math.abs(l-a.y),d)):e==mxConstants.DIRECTION_NORTH?l=t.y-2*r:e==mxConstants.DIRECTION_SOUTH?l=t.y+t.height+2*r:s=e==mxConstants.DIRECTION_EAST?t.x-2*d:t.x+t.width+2*d:null!=a&&(s=n.getRoutingCenterX(t),r=Math.max(Math.abs(s-a.x),d),l=a.y,d=0),i.push(new mxPoint(s-r,l-d)),i.push(new mxPoint(s+r,l+d))}},ElbowConnector:function(e,t,n,a,i){var o=null!=a&&0<a.length?a[0]:null,s=!1,r=!1;if(null!=t&&null!=n)if(null!=o){var l=Math.min(t.x,n.x),d=Math.max(t.x+t.width,n.x+n.width),c=(r=Math.min(t.y,n.y),Math.max(t.y+t.height,n.y+n.height));s=(o=e.view.transformControlPoint(e,o)).y<r||o.y>c,r=o.x<l||o.x>d}else(s=(l=Math.max(t.x,n.x))==(d=Math.min(t.x+t.width,n.x+n.width)))||(r=(r=Math.max(t.y,n.y))==(c=Math.min(t.y+t.height,n.y+n.height)));r||!s&&e.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(e,t,n,a,i):mxEdgeStyle.TopToBottom(e,t,n,a,i)},SideToSide:function(e,t,n,a,i){var o=e.view;a=null!=a&&0<a.length?a[0]:null;var s=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=o.transformControlPoint(e,a)),null!=s&&((t=new mxCellState).x=s.x,t.y=s.y),null!=r&&((n=new mxCellState).x=r.x,n.y=r.y),null!=t&&null!=n&&(e=Math.max(t.x,n.x),s=Math.min(t.x+t.width,n.x+n.width),e=null!=a?a.x:s+(e-s)/2,s=o.getRoutingCenterY(t),o=o.getRoutingCenterY(n),null!=a&&(a.y>=t.y&&a.y<=t.y+t.height&&(s=a.y),a.y>=n.y&&a.y<=n.y+n.height&&(o=a.y)),!mxUtils.contains(n,e,s)&&!mxUtils.contains(t,e,s)&&i.push(new mxPoint(e,s)),!mxUtils.contains(n,e,o)&&!mxUtils.contains(t,e,o)&&i.push(new mxPoint(e,o)),1==i.length&&(null!=a?!mxUtils.contains(n,e,a.y)&&!mxUtils.contains(t,e,a.y)&&i.push(new mxPoint(e,a.y)):(o=Math.max(t.y,n.y),t=Math.min(t.y+t.height,n.y+n.height),i.push(new mxPoint(e,o+(t-o)/2)))))},TopToBottom:function(e,t,n,a,i){var o=e.view;a=null!=a&&0<a.length?a[0]:null;var s=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=o.transformControlPoint(e,a)),null!=s&&((t=new mxCellState).x=s.x,t.y=s.y),null!=r&&((n=new mxCellState).x=r.x,n.y=r.y),null!=t&&null!=n&&(s=Math.max(t.y,n.y),r=Math.min(t.y+t.height,n.y+n.height),e=o.getRoutingCenterX(t),null!=a&&a.x>=t.x&&a.x<=t.x+t.width&&(e=a.x),s=null!=a?a.y:r+(s-r)/2,!mxUtils.contains(n,e,s)&&!mxUtils.contains(t,e,s)&&i.push(new mxPoint(e,s)),e=null!=a&&a.x>=n.x&&a.x<=n.x+n.width?a.x:o.getRoutingCenterX(n),!mxUtils.contains(n,e,s)&&!mxUtils.contains(t,e,s)&&i.push(new mxPoint(e,s)),1==i.length&&(null!=a&&1==i.length?!mxUtils.contains(n,a.x,s)&&!mxUtils.contains(t,a.x,s)&&i.push(new mxPoint(a.x,s)):(o=Math.max(t.x,n.x),t=Math.min(t.x+t.width,n.x+n.width),i.push(new mxPoint(o+(t-o)/2,s)))))},SegmentConnector:function(e,t,n,a,i){var o=e.absolutePoints,s=!0,r=null,l=o[0];null==l&&null!=t?l=new mxPoint(e.view.getRoutingCenterX(t),e.view.getRoutingCenterY(t)):null!=l&&(l=l.clone());var d=o.length-1;if(null!=a&&0<a.length){r=e.view.transformControlPoint(e,a[0]);for(var c=t,m=o[0],u=!1,p=!1,g=(u=r,a.length),v=0;v<2;v++){var h=null!=m&&m.x==u.x,b=null!=m&&m.y==u.y,f=null!=c&&u.y>=c.y&&u.y<=c.y+c.height;c=null!=c&&u.x>=c.x&&u.x<=c.x+c.width,u=b||null==m&&f,p=h||null==m&&c;if(null!=m&&!b&&!h&&(f||c)){s=!f;break}if(p||u){s=u,1==v&&(s=0==a.length%2?u:p);break}c=n,m=o[d],u=e.view.transformControlPoint(e,a[g-1])}for(s&&(null!=o[0]&&o[0].y!=r.y||null==o[0]&&null!=t&&(r.y<t.y||r.y>t.y+t.height))?i.push(new mxPoint(l.x,r.y)):!s&&(null!=o[0]&&o[0].x!=r.x||null==o[0]&&null!=t&&(r.x<t.x||r.x>t.x+t.width))&&i.push(new mxPoint(r.x,l.y)),s?l.y=r.y:l.x=r.x,v=0;v<a.length;v++)s=!s,r=e.view.transformControlPoint(e,a[v]),s?l.y=r.y:l.x=r.x,i.push(l.clone())}else r=l,s=!0;if(null==(l=o[d])&&null!=n&&(l=new mxPoint(e.view.getRoutingCenterX(n),e.view.getRoutingCenterY(n))),s&&(null!=o[d]&&o[d].y!=r.y||null==o[d]&&null!=n&&(r.y<n.y||r.y>n.y+n.height))?i.push(new mxPoint(l.x,r.y)):!s&&(null!=o[d]&&o[d].x!=r.x||null==o[d]&&null!=n&&(r.x<n.x||r.x>n.x+n.width))&&i.push(new mxPoint(r.x,l.y)),null==o[0]&&null!=t)for(;1<i.length&&mxUtils.contains(t,i[1].x,i[1].y);)i=i.splice(1,1);if(null==o[d]&&null!=n)for(;1<i.length&&mxUtils.contains(n,i[i.length-1].x,i[i.length-1].y);)i=i.splice(i.length-1,1)},orthBuffer:10,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,OrthConnector:function(e,t,n,a,i){var o=e.view.graph,s=null!=t&&o.getModel().isEdge(t.cell);o=null!=n&&o.getModel().isEdge(n.cell);if(null!=a&&0<a.length||s||o)mxEdgeStyle.SegmentConnector(e,t,n,a,i);else{var r=(a=e.absolutePoints)[0],l=a[a.length-1];a=null!=t?t.x:r.x;s=null!=t?t.y:r.y;var d=null!=t?t.width:1,c=null!=t?t.height:1,m=null!=n?n.x:l.x,u=null!=n?n.y:l.y,p=null!=n?n.width:1,g=null!=n?n.height:1,v=(o=e.view.scale*mxEdgeStyle.orthBuffer,[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL]);for(null!=t&&(v[0]=mxUtils.getPortConstraints(t,e,!0,mxConstants.DIRECTION_MASK_ALL)),null!=n&&(v[1]=mxUtils.getPortConstraints(n,e,!1,mxConstants.DIRECTION_MASK_ALL)),e=[0,0],a=[[a,s,d,c],[m,u,p,g]],d=0;d<2;d++)mxEdgeStyle.limits[d][1]=a[d][0]-o,mxEdgeStyle.limits[d][2]=a[d][1]-o,mxEdgeStyle.limits[d][4]=a[d][0]+a[d][2]+o,mxEdgeStyle.limits[d][8]=a[d][1]+a[d][3]+o;for(d=a[0][0]+a[0][2]/2-(a[1][0]+a[1][2]/2),c=a[0][1]+a[0][3]/2-(a[1][1]+a[1][3]/2),d<(s=0)?s=c<0?2:1:c<=0&&(s=3,0==d&&(s=2)),(c=null)!=t&&(c=r),t=[[.5,.5],[.5,.5]],d=0;d<2;d++)null!=c&&(t[d][0]=(c.x-a[d][0])/a[d][2],t[d][0]<.01?e[d]=mxConstants.DIRECTION_MASK_WEST:.99<t[d][0]&&(e[d]=mxConstants.DIRECTION_MASK_EAST),t[d][1]=(c.y-a[d][1])/a[d][3],t[d][1]<.01?e[d]=mxConstants.DIRECTION_MASK_NORTH:.99<t[d][1]&&(e[d]=mxConstants.DIRECTION_MASK_SOUTH)),(c=null)!=n&&(c=l);for(d=a[0][1]-(a[1][1]+a[1][3]),c=a[0][0]-(a[1][0]+a[1][2]),m=a[1][1]-(a[0][1]+a[0][3]),u=a[1][0]-(a[0][0]+a[0][2]),mxEdgeStyle.vertexSeperations[1]=Math.max(c-2*o,0),mxEdgeStyle.vertexSeperations[2]=Math.max(d-2*o,0),mxEdgeStyle.vertexSeperations[4]=Math.max(m-2*o,0),mxEdgeStyle.vertexSeperations[3]=Math.max(u-2*o,0),n=[],l=[],(r=[])[0]=u<=c?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,l[0]=m<=d?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,r[1]=mxUtils.reversePortConstraints(r[0]),l[1]=mxUtils.reversePortConstraints(l[0]),c=u<=c?c:u,m=m<=d?d:m,p=!(u=[[0,0],[0,0]]),d=0;d<2;d++)0==e[d]&&(0==(r[d]&v[d])&&(r[d]=mxUtils.reversePortConstraints(r[d])),0==(l[d]&v[d])&&(l[d]=mxUtils.reversePortConstraints(l[d])),u[d][0]=l[d],u[d][1]=r[d]);for(2*o<m&&2*o<c&&(0<(r[0]&v[0])&&0<(l[1]&v[1])?(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=l[1],u[1][1]=r[1],p=!0):0<(l[0]&v[0])&&0<(r[1]&v[1])&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=r[1],u[1][1]=l[1],p=!0)),2*o<m&&!p&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=l[1],u[1][1]=r[1],p=!0),2*o<c&&!p&&(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=r[1],u[1][1]=l[1]),d=0;d<2;d++)0==e[d]&&(0==(u[d][0]&v[d])&&(u[d][0]=u[d][1]),n[d]=u[d][0]&v[d],n[d]|=(u[d][1]&v[d])<<8,n[d]|=(u[1-d][d]&v[d])<<16,n[d]|=(u[1-d][1-d]&v[d])<<24,0==(15&n[d])&&(n[d]<<=8),0==(3840&n[d])&&(n[d]=15&n[d]|n[d]>>8),0==(983040&n[d])&&(n[d]=65535&n[d]|(251658240&n[d])>>8),e[d]=15&n[d],v[d]==mxConstants.DIRECTION_MASK_WEST||v[d]==mxConstants.DIRECTION_MASK_NORTH||v[d]==mxConstants.DIRECTION_MASK_EAST||v[d]==mxConstants.DIRECTION_MASK_SOUTH)&&(e[d]=v[d]);switch(d=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0],v=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(d-=s)<1&&(d+=4),(v-=s)<1&&(v+=4),v=mxEdgeStyle.routePatterns[d-1][v-1],mxEdgeStyle.wayPoints1[0][0]=a[0][0],mxEdgeStyle.wayPoints1[0][1]=a[0][1],e[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=o,mxEdgeStyle.wayPoints1[0][1]+=t[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=t[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]+=a[0][3]+o;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=a[0][2]+o,mxEdgeStyle.wayPoints1[0][1]+=t[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=t[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]-=o}for(r=n=(o=0)<(e[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1,d=l=0;d<v.length;d++){g=(l=15&v[d])==mxConstants.DIRECTION_MASK_EAST?3:l,4<(g+=s)&&(g-=4),c=mxEdgeStyle.dirVectors[g-1],(l=0<g%2?0:1)!=n&&(o++,mxEdgeStyle.wayPoints1[o][0]=mxEdgeStyle.wayPoints1[o-1][0],mxEdgeStyle.wayPoints1[o][1]=mxEdgeStyle.wayPoints1[o-1][1]);var h=0<(v[d]&mxEdgeStyle.TARGET_MASK);p=0<(v[d]&mxEdgeStyle.SOURCE_MASK);15<(m=(m=(v[d]&mxEdgeStyle.SIDE_MASK)>>5)<<s)&&(m>>=4),u=0<(v[d]&mxEdgeStyle.CENTER_MASK),(p||h)&&m<9?(g=0,p=p?0:1,g=u&&0==l?a[p][0]+t[p][0]*a[p][2]:u?a[p][1]+t[p][1]*a[p][3]:mxEdgeStyle.limits[p][m],0==l?0<(m=(g-mxEdgeStyle.wayPoints1[o][0])*c[0])&&(mxEdgeStyle.wayPoints1[o][0]+=c[0]*m):0<(m=(g-mxEdgeStyle.wayPoints1[o][1])*c[1])&&(mxEdgeStyle.wayPoints1[o][1]+=c[1]*m)):u&&(mxEdgeStyle.wayPoints1[o][0]+=c[0]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2),mxEdgeStyle.wayPoints1[o][1]+=c[1]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2)),0<o&&mxEdgeStyle.wayPoints1[o][l]==mxEdgeStyle.wayPoints1[o-1][l]?o--:n=l}for(d=0;d<=o&&(d!=o||((0<(e[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1)==r?0:1)==(o+1)%2);d++)i.push(new mxPoint(mxEdgeStyle.wayPoints1[d][0],mxEdgeStyle.wayPoints1[d][1]))}},getRoutePattern:function(e,t,n,a){var i=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0];return e=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(i-=t)<1&&(i+=4),(e-=t)<1&&(e+=4),t=routePatterns[i-1][e-1],0!=n&&0!=a||null!=inlineRoutePatterns[i-1][e-1]&&(t=inlineRoutePatterns[i-1][e-1]),t}},mxStyleRegistry={values:[],putValue:function(e,t){mxStyleRegistry.values[e]=t},getValue:function(e){return mxStyleRegistry.values[e]},getName:function(e){for(var t in mxStyleRegistry.values)if(mxStyleRegistry.values[t]==e)return t;return null}};function mxGraphView(e){this.graph=e,this.translate=new mxPoint,this.graphBounds=new mxRectangle,this.states=new mxDictionary}function mxCurrentRootChange(e,t){if(this.view=e,this.previous=this.root=t,this.isUp=null==t,!this.isUp)for(var n=this.view.currentRoot,a=this.view.graph.getModel();null!=n;){if(n==t){this.isUp=!0;break}n=a.getParent(n)}}function mxGraph(e,t,n,a){this.mouseListeners=null,this.renderHint=n,this.dialect=mxClient.IS_SVG?mxConstants.DIALECT_SVG:n==mxConstants.RENDERING_HINT_EXACT&&mxClient.IS_VML?mxConstants.DIALECT_VML:n==mxConstants.RENDERING_HINT_FASTEST?mxConstants.DIALECT_STRICTHTML:n==mxConstants.RENDERING_HINT_FASTER?mxConstants.DIALECT_PREFERHTML:mxConstants.DIALECT_MIXEDHTML,this.model=null!=t?t:new mxGraphModel,this.multiplicities=[],this.imageBundles=[],this.cellRenderer=this.createCellRenderer(),this.setSelectionModel(this.createSelectionModel()),this.setStylesheet(null!=a?a:this.createStylesheet()),this.view=this.createGraphView(),this.graphModelChangeListener=mxUtils.bind(this,function(e,t){this.graphModelChanged(t.getProperty("edit").changes)}),this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener),this.createHandlers(),null!=e&&this.init(e),this.view.revalidate()}function mxCellOverlay(e,t,n,a,i,o){this.image=e,this.tooltip=t,this.align=null!=n?n:this.align,this.verticalAlign=null!=a?a:this.verticalAlign,this.offset=null!=i?i:new mxPoint,this.cursor=null!=o?o:"help"}function mxOutline(e,t){this.source=e,null!=t&&this.init(t)}function mxMultiplicity(e,t,n,a,i,o,s,r,l,d){this.source=e,this.type=t,this.attr=n,this.value=a,this.min=null!=i?i:0,this.max=null!=o?o:"n",this.validNeighbors=s,this.countError=mxResources.get(r)||r,this.typeError=mxResources.get(l)||l,this.validNeighborsAllowed=null==d||d}function mxLayoutManager(e){this.undoHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.beforeUndo(t.getProperty("edit"))}),this.moveHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.cellsMoved(t.getProperty("cells"),t.getProperty("event"))}),this.setGraph(e)}function mxSpaceManager(e,t,n,a){this.resizeHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.cellsResized(t.getProperty("cells"))}),this.foldHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.cellsResized(t.getProperty("cells"))}),this.shiftRightwards=null==t||t,this.shiftDownwards=null==n||n,this.extendParents=null==a||a,this.setGraph(e)}function mxSwimlaneManager(e,t,n,a){this.horizontal=null==t||t,this.addEnabled=null==n||n,this.resizeEnabled=null==a||a,this.addHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(t.getProperty("cells"))}),this.resizeHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(t.getProperty("cells"))}),this.setGraph(e)}function mxTemporaryCellStates(e,t,n){if(this.view=e,t=null!=t?t:1,this.oldBounds=e.getGraphBounds(),this.oldStates=e.getStates(),this.oldScale=e.getScale(),e.setStates(new mxDictionary),e.setScale(t),null!=n){t=e.createState(new mxCell);for(var a=0;a<n.length;a++)e.validateBounds(t,n[a]);var i=null;for(a=0;a<n.length;a++){var o=e.validatePoints(t,n[a]);null==i?i=o:i.add(o)}null==i&&(i=new mxRectangle),e.setGraphBounds(i)}}function mxCellStatePreview(e){this.graph=e,this.deltas={}}function mxConnectionConstraint(e,t){this.point=e,this.perimeter=null==t||t}function mxGraphHandler(e){this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.updatePreviewShape()}),this.graph.addListener(mxEvent.PAN,this.panHandler)}function mxPanningHandler(e,t){null!=e&&(this.graph=e,this.factoryMethod=t,this.graph.addMouseListener(this),this.init())}function mxCellMarker(e,t,n,a){mxEventSource.call(this),null!=e&&(this.graph=e,this.validColor=null!=t?t:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=t?n:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=a?a:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(e))}function mxSelectionCellsHandler(e){mxEventSource.call(this),this.graph=e,this.handlers=new mxDictionary,this.graph.addMouseListener(this),this.refreshHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.refresh()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler),this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}function mxConnectionHandler(e,t){mxEventSource.call(this),null!=e&&(this.graph=e,this.factoryMethod=t,this.init())}function mxConstraintHandler(e){this.graph=e}function mxRubberband(e){null!=e&&(this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.addListener(mxEvent.PAN,this.panHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxVertexHandler(e){null!=e&&(this.state=e,this.init())}function mxEdgeHandler(e){null!=e&&(this.state=e,this.init())}function mxElbowEdgeHandler(e){mxEdgeHandler.call(this,e)}function mxEdgeSegmentHandler(e){mxEdgeHandler.call(this,e)}function mxKeyHandler(e,t){null!=e&&(this.graph=e,this.target=t||document.documentElement,this.normalKeys=[],this.shiftKeys=[],this.controlKeys=[],this.controlShiftKeys=[],mxEvent.addListener(this.target,"keydown",mxUtils.bind(this,function(e){this.keyDown(e)})),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxTooltipHandler(e,t){null!=e&&(this.graph=e,this.delay=t||500,this.graph.addMouseListener(this))}function mxCellTracker(e,t,n){mxCellMarker.call(this,e,t),this.graph.addMouseListener(this),null!=n&&(this.getCell=n),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}function mxCellHighlight(e,t,n,a){null!=e&&(this.graph=e,this.highlightColor=null!=t?t:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=n?n:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=a&&a,this.repaintHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}function mxDefaultKeyHandler(t){if(null!=t){this.editor=t,this.handler=new mxKeyHandler(t.graph);var n=this.handler.escape;this.handler.escape=function(e){n.apply(this,arguments),t.hideProperties(),t.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",e))}}}function mxDefaultPopupMenu(e){this.config=e}function mxDefaultToolbar(e,t){this.editor=t,null!=e&&null!=t&&this.init(e)}function mxEditor(e){this.actions=[],this.addActions(),null!=document.body&&(this.cycleAttributeValues=[],this.popupHandler=new mxDefaultPopupMenu,this.undoManager=new mxUndoManager,this.graph=this.createGraph(),this.toolbar=this.createToolbar(),this.keyHandler=new mxDefaultKeyHandler(this),this.configure(e),this.graph.swimlaneIndicatorColorAttribute=this.cycleAttributeName,!mxClient.IS_LOCAL&&null!=this.urlInit&&(this.session=this.createSession()),null!=this.onInit&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector),mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter),mxGraphView.prototype=new mxEventSource,mxGraphView.prototype.constructor=mxGraphView,mxGraphView.prototype.EMPTY_POINT=new mxPoint,mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"",mxGraphView.prototype.allowEval=!1,mxGraphView.prototype.captureDocumentGesture=!0,mxGraphView.prototype.optimizeVmlReflows=!0,mxGraphView.prototype.rendering=!0,mxGraphView.prototype.graph=null,mxGraphView.prototype.currentRoot=null,mxGraphView.prototype.graphBounds=null,mxGraphView.prototype.scale=1,mxGraphView.prototype.translate=null,mxGraphView.prototype.updateStyle=!1,mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds},mxGraphView.prototype.setGraphBounds=function(e){this.graphBounds=e},mxGraphView.prototype.getBounds=function(e){var t=null;if(null!=e&&0<e.length)for(var n=this.graph.getModel(),a=0;a<e.length;a++)if(n.isVertex(e[a])||n.isEdge(e[a])){var i=this.getState(e[a]);null!=i&&(null==t?t=new mxRectangle(i.x,i.y,i.width,i.height):t.add(i))}return t},mxGraphView.prototype.setCurrentRoot=function(e){if(this.currentRoot!=e){var t=new mxCurrentRootChange(this,e);t.execute();var n=new mxUndoableEdit(this,!1);n.add(t),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n)),this.graph.sizeDidChange()}return e},mxGraphView.prototype.scaleAndTranslate=function(e,t,n){var a=this.scale,i=new mxPoint(this.translate.x,this.translate.y);this.scale==e&&this.translate.x==t&&this.translate.y==n||(this.scale=e,this.translate.x=t,this.translate.y=n,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",e,"previousScale",a,"translate",this.translate,"previousTranslate",i))},mxGraphView.prototype.getScale=function(){return this.scale},mxGraphView.prototype.setScale=function(e){var t=this.scale;this.scale!=e&&(this.scale=e,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",e,"previousScale",t))},mxGraphView.prototype.getTranslate=function(){return this.translate},mxGraphView.prototype.setTranslate=function(e,t){var n=new mxPoint(this.translate.x,this.translate.y);this.translate.x==e&&this.translate.y==t||(this.translate.x=e,this.translate.y=t,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",n))},mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear(),this.revalidate()},mxGraphView.prototype.revalidate=function(){this.invalidate(),this.validate()},mxGraphView.prototype.clear=function(e,t,n){var a=this.graph.getModel();if(e=e||a.getRoot(),t=null!=t&&t,n=null==n||n,this.removeState(e),n&&(t||e!=this.currentRoot)){n=a.getChildCount(e);for(var i=0;i<n;i++)this.clear(a.getChildAt(e,i),t)}else this.invalidate(e)},mxGraphView.prototype.invalidate=function(e,t,n,a){var i=this.graph.getModel();if(e=e||i.getRoot(),t=null==t||t,n=null==n||n,a=null!=a&&a,null!=(s=this.getState(e))&&(s.invalid=!0,a&&(s.orderChanged=!0)),t)for(var o=i.getChildCount(e),s=0;s<o;s++){var r=i.getChildAt(e,s);this.invalidate(r,t,n,a)}if(n)for(a=i.getEdgeCount(e),s=0;s<a;s++)this.invalidate(i.getEdgeAt(e,s),t,n)},mxGraphView.prototype.validate=function(e){var t=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource;var n=null;if(this.optimizeVmlReflows&&null!=this.canvas&&null==this.textDiv&&(8==document.documentMode||mxClient.IS_QUIRKS)){n=this.canvas.style.display,this.canvas.style.display="none";var a=document.createElement("div");a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",document.body.appendChild(a),this.textDiv=a}e=e||(null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot()),this.validateBounds(null,e),null==(e=this.validatePoints(null,e))&&(e=new mxRectangle),this.setGraphBounds(e),this.validateBackground(),null!=n&&(this.canvas.style.display=n,document.body.removeChild(this.textDiv),this.textDiv=null),window.status=mxResources.get(this.doneResource)||this.doneResource,mxLog.leave("mxGraphView.validate",t)},mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,"white","black")},mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var t=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(t,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);this.graph.pageVisible?(t=this.getBackgroundPageBounds(),null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(t),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=t,this.backgroundPageShape.redraw())):null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.graph.pageFormat,t=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,e.width*t,e.height*t)},mxGraphView.prototype.redrawBackgroundImage=function(e,t){e.scale=this.scale,e.bounds.x=this.scale*this.translate.x,e.bounds.y=this.scale*this.translate.y,e.bounds.width=this.scale*t.width,e.bounds.height=this.scale*t.height,e.redraw()},mxGraphView.prototype.validateBounds=function(e,t){var n=this.graph.getModel(),a=this.getState(t,!0);if(null!=a&&a.invalid){if(this.graph.isCellVisible(t)){if(t!=this.currentRoot&&null!=e)if(a.absoluteOffset.x=0,a.absoluteOffset.y=0,a.origin.x=e.origin.x,a.origin.y=e.origin.y,null!=(o=this.graph.getCellGeometry(t))){if(!n.isEdge(t)){var i=o.offset||this.EMPTY_POINT;o.relative?(a.origin.x+=o.x*e.width/this.scale+i.x,a.origin.y+=o.y*e.height/this.scale+i.y):(a.absoluteOffset.x=this.scale*i.x,a.absoluteOffset.y=this.scale*i.y,a.origin.x+=o.x,a.origin.y+=o.y)}if(a.x=this.scale*(this.translate.x+a.origin.x),a.y=this.scale*(this.translate.y+a.origin.y),a.width=this.scale*o.width,a.height=this.scale*o.height,n.isVertex(t)){if(o.relative&&0!=(i=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"))){var o=Math.cos(i),s=(i=Math.sin(i),new mxPoint(a.getCenterX(),a.getCenterY())),r=new mxPoint(e.getCenterX(),e.getCenterY());o=mxUtils.getRotatedPoint(s,o,i,r);a.x=o.x-a.width/2,a.y=o.y-a.height/2}this.updateVertexLabelOffset(a)}}}else this.removeState(t);null!=(i=this.graph.getChildOffsetForCell(t))&&(a.origin.x+=i.x,a.origin.y+=i.y)}if(null!=a&&(!this.graph.isCellCollapsed(t)||t==this.currentRoot))for(o=n.getChildCount(t),i=0;i<o;i++)s=n.getChildAt(t,i),this.validateBounds(a,s)},mxGraphView.prototype.updateVertexLabelOffset=function(e){var t=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);t==mxConstants.ALIGN_LEFT?e.absoluteOffset.x-=e.width:t==mxConstants.ALIGN_RIGHT&&(e.absoluteOffset.x+=e.width),(t=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?e.absoluteOffset.y-=e.height:t==mxConstants.ALIGN_BOTTOM&&(e.absoluteOffset.y+=e.height)},mxGraphView.prototype.validatePoints=function(e,t){var n=this.graph.getModel(),a=this.getState(t),i=null;if(null!=a){if(a.invalid){var o=this.graph.getCellGeometry(t);if(null!=o&&n.isEdge(t)){var s=this.getState(this.getVisibleTerminal(t,!0));if(a.setVisibleTerminalState(s,!0),null!=s&&n.isEdge(s.cell)&&!n.isAncestor(s.cell,t)){var r=this.getState(n.getParent(s.cell));this.validatePoints(r,s.cell)}var l=this.getState(this.getVisibleTerminal(t,!1));a.setVisibleTerminalState(l,!1),null!=l&&n.isEdge(l.cell)&&!n.isAncestor(l.cell,t)&&(r=this.getState(n.getParent(l.cell)),this.validatePoints(r,l.cell)),this.updateFixedTerminalPoints(a,s,l),this.updatePoints(a,o.points,s,l),this.updateFloatingTerminalPoints(a,s,l),this.updateEdgeBounds(a),this.updateEdgeLabelOffset(a)}else null!=o&&o.relative&&null!=e&&n.isEdge(e.cell)&&(null!=(o=this.getPoint(e,o))&&(a.x=o.x,a.y=o.y,o.x=o.x/this.scale-this.translate.x,o.y=o.y/this.scale-this.translate.y,a.origin=o,this.childMoved(e,a)));a.invalid=!1,t!=this.currentRoot&&this.graph.cellRenderer.redraw(a,!1,this.isRendering())}(n.isEdge(t)||n.isVertex(t))&&(null!=a.shape&&null!=a.shape.boundingBox&&(i=a.shape.boundingBox.clone()),null!=a.text&&!this.graph.isLabelClipped(a.cell)&&null!=a.text.boundingBox&&(null!=i?i.add(a.text.boundingBox):i=a.text.boundingBox.clone()))}if(null!=a&&(!this.graph.isCellCollapsed(t)||t==this.currentRoot))for(o=n.getChildCount(t),s=0;s<o;s++)r=n.getChildAt(t,s),null!=(r=this.validatePoints(a,r))&&(null==i?i=r:i.add(r));return i},mxGraphView.prototype.childMoved=function(e,t){var n=t.cell;if(!this.graph.isCellCollapsed(n)||n==this.currentRoot)for(var a=this.graph.getModel(),i=a.getChildCount(n),o=0;o<i;o++)this.validateBounds(t,a.getChildAt(n,o))},mxGraphView.prototype.updateFixedTerminalPoints=function(e,t,n){this.updateFixedTerminalPoint(e,t,!0,this.graph.getConnectionConstraint(e,t,!0)),this.updateFixedTerminalPoint(e,n,!1,this.graph.getConnectionConstraint(e,n,!1))},mxGraphView.prototype.updateFixedTerminalPoint=function(e,t,n,a){var i=null;if(null!=a&&(i=this.graph.getConnectionPoint(t,a)),null==i&&null==t){t=this.scale,a=this.translate;var o=e.origin;null!=(i=this.graph.getCellGeometry(e.cell).getTerminalPoint(n))&&(i=new mxPoint(t*(a.x+i.x+o.x),t*(a.y+i.y+o.y)))}e.setAbsoluteTerminalPoint(i,n)},mxGraphView.prototype.updatePoints=function(e,t,n,a){if(null!=e){var i=[];i.push(e.absolutePoints[0]);var o=this.getEdgeStyle(e,t,n,a);if(null!=o)o(e,n=this.getTerminalPort(e,n,!0),a=this.getTerminalPort(e,a,!1),t,i);else if(null!=t)for(o=0;o<t.length;o++)null!=t[o]&&(a=mxUtils.clone(t[o]),i.push(this.transformControlPoint(e,a)));t=e.absolutePoints,i.push(t[t.length-1]),e.absolutePoints=i}},mxGraphView.prototype.transformControlPoint=function(e,t){var n=e.origin;return new mxPoint(this.scale*(t.x+this.translate.x+n.x),this.scale*(t.y+this.translate.y+n.y))},mxGraphView.prototype.getEdgeStyle=function(e,t,n,a){return"string"==typeof(e=null!=n&&n==a?mxUtils.getValue(e.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(e.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:e.style[mxConstants.STYLE_EDGE])&&(null==(t=mxStyleRegistry.getValue(e))&&this.isAllowEval()&&(t=mxUtils.eval(e)),e=t),"function"==typeof e?e:null},mxGraphView.prototype.updateFloatingTerminalPoints=function(e,t,n){var a=e.absolutePoints,i=a[0];null==a[a.length-1]&&null!=n&&this.updateFloatingTerminalPoint(e,n,t,!1),null==i&&null!=t&&this.updateFloatingTerminalPoint(e,t,n,!0)},mxGraphView.prototype.updateFloatingTerminalPoint=function(e,t,n,a){t=this.getTerminalPort(e,t,a);var i=this.getNextPoint(e,n,a),o=this.graph.isOrthogonal(e);n=mxUtils.toRadians(Number(t.style[mxConstants.STYLE_ROTATION]||"0"));var s=new mxPoint(t.getCenterX(),t.getCenterY());if(0!=n){var r=Math.cos(-n),l=Math.sin(-n);i=mxUtils.getRotatedPoint(i,r,l,s)}r=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0),r+=parseFloat(e.style[a?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0),t=this.getPerimeterPoint(t,i,0==n&&o,r),0!=n&&(r=Math.cos(n),l=Math.sin(n),t=mxUtils.getRotatedPoint(t,r,l,s)),e.setAbsoluteTerminalPoint(t,a)},mxGraphView.prototype.getTerminalPort=function(e,t,n){return null!=(e=mxUtils.getValue(e.style,n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT))&&(null!=(e=this.getState(this.graph.getModel().getCell(e)))&&(t=e)),t},mxGraphView.prototype.getPerimeterPoint=function(e,t,n,a){var i=null;if(null!=e){var o=this.getPerimeterFunction(e);null!=o&&null!=t&&(0<(a=this.getPerimeterBounds(e,a)).width||0<a.height)&&(i=o(a,e,t,n)),null==i&&(i=this.getPoint(e))}return i},mxGraphView.prototype.getRoutingCenterX=function(e){var t=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return e.getCenterX()+t*e.width},mxGraphView.prototype.getRoutingCenterY=function(e){var t=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return e.getCenterY()+t*e.height},mxGraphView.prototype.getPerimeterBounds=function(e,t){return t=null!=t?t:0,null!=e&&(t+=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),e.getPerimeterBounds(t*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(e){if("string"==typeof(e=e.style[mxConstants.STYLE_PERIMETER])){var t=mxStyleRegistry.getValue(e);null==t&&this.isAllowEval()&&(t=mxUtils.eval(e)),e=t}return"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(e,t,n){var a=null;return null!=(e=e.absolutePoints)&&(n||2<e.length||null==t)&&(a=e.length,a=e[n?Math.min(1,a-1):Math.max(0,a-2)]),null==a&&null!=t&&(a=new mxPoint(t.getCenterX(),t.getCenterY())),a},mxGraphView.prototype.getVisibleTerminal=function(e,t){for(var n=this.graph.getModel(),a=n.getTerminal(e,t),i=a;null!=a&&a!=this.currentRoot;)this.graph.isCellVisible(i)&&!this.graph.isCellCollapsed(a)||(i=a),a=n.getParent(a);return n.getParent(i)==n.getRoot()&&(i=null),i},mxGraphView.prototype.updateEdgeBounds=function(e){var t=e.absolutePoints;if(e.length=0,null!=t&&0<t.length){var n=t[0],a=t[t.length-1];if(null==n||null==a)e.cell!=this.currentRoot&&this.clear(e.cell,!0);else{if(n.x!=a.x||n.y!=a.y){var i=a.x-n.x,o=a.y-n.y;e.terminalDistance=Math.sqrt(i*i+o*o)}else e.terminalDistance=0;a=0;var s=[];if(null!=(o=n)){n=o.x;for(var r=o.y,l=n,d=r,c=1;c<t.length;c++){var m=t[c];null!=m&&(i=o.x-m.x,o=o.y-m.y,i=Math.sqrt(i*i+o*o),s.push(i),a+=i,o=m,n=Math.min(o.x,n),r=Math.min(o.y,r),l=Math.max(o.x,l),d=Math.max(o.y,d))}e.length=a,e.segments=s,e.x=n,e.y=r,e.width=Math.max(1,l-n),e.height=Math.max(1,d-r)}}}},mxGraphView.prototype.getPoint=function(e,t){var n=e.getCenterX(),a=e.getCenterY();if(null==e.segments||null!=t&&!t.relative)null!=t&&(null!=(d=t.offset)&&(n+=d.x,a+=d.y));else{for(var i=e.absolutePoints.length,o=(.5+(null!=t?t.x/2:0))*e.length,s=e.segments[0],r=0,l=1;r+s<o&&l<i-1;)r+=s,s=e.segments[l++];if(i=0==s?0:(o-r)/s,o=e.absolutePoints[l-1],l=e.absolutePoints[l],null!=o&&null!=l){if(r=n=a=0,null!=t){a=t.y;var d=t.offset;null!=d&&(n=d.x,r=d.y)}d=l.x-o.x,l=l.y-o.y,n=o.x+d*i+((0==s?0:l/s)*a+n)*this.scale,a=o.y+l*i-((0==s?0:d/s)*a-r)*this.scale}}return new mxPoint(n,a)},mxGraphView.prototype.getRelativePoint=function(e,t,n){if(null!=(i=this.graph.getModel().getGeometry(e.cell))){var a=e.absolutePoints.length;if(i.relative&&1<a){for(var i=e.length,o=e.segments,s=e.absolutePoints[0],r=e.absolutePoints[1],l=mxUtils.ptSegDistSq(s.x,s.y,r.x,r.y,t,n),d=0,c=0,m=0,u=2;u<a;u++)c+=o[u-2],r=e.absolutePoints[u],(s=mxUtils.ptSegDistSq(s.x,s.y,r.x,r.y,t,n))<=l&&(l=s,d=u-1,m=c),s=r;return a=o[d],s=e.absolutePoints[d],l=(r=e.absolutePoints[d+1]).x,o=r.y,o=(l=(e=s.x-l)-(l=t-l))*e+(o=(d=s.y-o)-(o=n-o))*d,a<(e=Math.sqrt(o<=0?0:o*o/(e*e+d*d)))&&(e=a),a=Math.sqrt(mxUtils.ptSegDistSq(s.x,s.y,r.x,r.y,t,n)),-1==mxUtils.relativeCcw(s.x,s.y,r.x,r.y,t,n)&&(a=-a),new mxPoint((i/2-m-e)/i*-2,a/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(e){var t=e.absolutePoints;if(e.absoluteOffset.x=e.getCenterX(),e.absoluteOffset.y=e.getCenterY(),null!=t&&0<t.length&&null!=e.segments)if((i=this.graph.getCellGeometry(e.cell)).relative){null!=(n=this.getPoint(e,i))&&(e.absoluteOffset=n)}else{var n=t[0],a=t[t.length-1];if(null!=n&&null!=a){t=a.x-n.x;var i,o=a.y-n.y,s=a=0;null!=(i=i.offset)&&(a=i.x,s=i.y),i=n.y+o/2+s*this.scale,e.absoluteOffset.x=n.x+t/2+a*this.scale,e.absoluteOffset.y=i}}},mxGraphView.prototype.getState=function(e,t){t=t||!1;var n=null;return null!=e&&(n=this.states.get(e),this.graph.isCellVisible(e)&&(null==n&&t&&this.graph.isCellVisible(e)?(n=this.createState(e),this.states.put(e,n)):t&&null!=n&&this.updateStyle&&(n.style=this.graph.getCellStyle(e)))),n},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(e){this.rendering=e},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(e){this.allowEval=e},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(e){this.states=e},mxGraphView.prototype.getCellStates=function(e){if(null==e)return this.states;for(var t=[],n=0;n<e.length;n++){var a=this.getState(e[n]);null!=a&&t.push(a)}return t},mxGraphView.prototype.removeState=function(e){var t=null;return null!=e&&(null!=(t=this.states.remove(e))&&(this.graph.cellRenderer.destroy(t),t.destroy())),t},mxGraphView.prototype.createState=function(e){return e=new mxCellState(this,e,this.graph.getCellStyle(e)),this.graph.cellRenderer.initialize(e,this.isRendering()),e},mxGraphView.prototype.getCanvas=function(){return this.canvas},mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane},mxGraphView.prototype.getDrawPane=function(){return this.drawPane},mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane},mxGraphView.prototype.isContainerEvent=function(e){return(e=mxEvent.getSource(e))==this.graph.container||e.parentNode==this.backgroundPane||null!=e.parentNode&&e.parentNode.parentNode==this.backgroundPane||e==this.canvas.parentNode||e==this.canvas||e==this.backgroundPane||e==this.drawPane||e==this.overlayPane},mxGraphView.prototype.isScrollEvent=function(e){var t=mxUtils.getOffset(this.graph.container);e=new mxPoint(e.clientX-t.x,e.clientY-t.y);t=this.graph.container.offsetWidth;var n=this.graph.container.clientWidth;return n<t&&e.x>n+2&&e.x<=t||(t=this.graph.container.offsetHeight,(n=this.graph.container.clientHeight)<t&&e.y>n+2&&e.y<=t)},mxGraphView.prototype.init=function(){this.installListeners();var e=this.graph;e.dialect==mxConstants.DIALECT_SVG?this.createSvg():e.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var a=this.graph,i=a.container;if(null!=i){mxEvent.addGestureListeners(i,mxUtils.bind(this,function(e){mxClient.IS_TOUCH&&a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),this.isContainerEvent(e)&&(!mxClient.IS_IE&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(e))&&a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))})),mxEvent.addListener(i,"dblclick",mxUtils.bind(this,function(e){a.dblClick(e)}));a.addMouseListener({mouseDown:function(e,t){a.panningHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(e){var t,n;null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide(),this.captureDocumentGesture&&a.isMouseDown&&!mxEvent.isConsumed(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,(t=e,n=null,mxClient.IS_TOUCH&&(n=mxEvent.getClientX(t),t=mxEvent.getClientY(t),t=mxUtils.convertPoint(i,n,t),n=a.view.getState(a.getCellAt(t.x,t.y))),n)))}),this.endHandler=mxUtils.bind(this,function(e){this.captureDocumentGesture&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var e=this.graph.container;null!=e&&(this.canvas=this.createHtmlPane("100%","100%"),this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas),mxClient.IS_QUIRKS&&(e=mxUtils.bind(this,function(e){e=this.getGraphBounds(),this.updateHtmlCanvasSize(e.x+e.width+this.graph.border,e.y+e.height+this.graph.border)}),mxEvent.addListener(window,"resize",e)))},mxGraphView.prototype.updateHtmlCanvasSize=function(e,t){if(null!=this.graph.container){var n=this.graph.container.offsetHeight;this.canvas.style.width=this.graph.container.offsetWidth<e?e+"px":"100%",this.canvas.style.height=n<t?t+"px":"100%"}},mxGraphView.prototype.createHtmlPane=function(e,t){var n=document.createElement("DIV");return null!=e&&null!=t?(n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=e,n.style.height=t):n.style.position="relative",n},mxGraphView.prototype.createVml=function(){var e=this.graph.container;if(null!=e){var t=e.offsetWidth,n=e.offsetHeight;this.canvas=this.createVmlPane(t,n),this.backgroundPane=this.createVmlPane(t,n),this.drawPane=this.createVmlPane(t,n),this.overlayPane=this.createVmlPane(t,n),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas)}},mxGraphView.prototype.createVmlPane=function(e,t){var n=document.createElement(mxClient.VML_PREFIX+":group");return n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=e+"px",n.style.height=t+"px",n.setAttribute("coordsize",e+","+t),n.setAttribute("coordorigin","0,0"),n},mxGraphView.prototype.createSvg=function(){var e=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g"),this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.backgroundPane),this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.drawPane),this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.overlayPane);var t=document.createElementNS(mxConstants.NS_SVG,"svg");t.style.width="100%",t.style.height="100%",t.style.display="block",t.appendChild(this.canvas),null!=e&&(e.appendChild(t),"static"==mxUtils.getCurrentStyle(e).position&&(e.style.position="relative"))},mxGraphView.prototype.destroy=function(){var e=null!=this.canvas?this.canvas.ownerSVGElement:null;null==e&&(e=this.canvas),null!=e&&null!=e.parentNode&&(this.clear(this.currentRoot,!0),mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler),mxEvent.release(this.graph.container),e.parentNode.removeChild(e),this.overlayPane=this.drawPane=this.backgroundPane=this.canvas=this.endHandler=this.moveHandler=null)},mxCurrentRootChange.prototype.execute=function(){var e=this.view.currentRoot;this.view.currentRoot=this.previous,this.previous=e,null!=(e=this.view.graph.getTranslateForRoot(this.view.currentRoot))&&(this.view.translate=new mxPoint(-e.x,-e.y)),this.view.fireEvent(new mxEventObject(this.isUp?mxEvent.UP:mxEvent.DOWN,"root",this.view.currentRoot,"previous",this.previous)),this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh(),this.isUp=!this.isUp},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/graph"),mxGraph.prototype=new mxEventSource,mxGraph.prototype.constructor=mxGraph,mxGraph.prototype.EMPTY_ARRAY=[],mxGraph.prototype.mouseListeners=null,mxGraph.prototype.isMouseDown=!1,mxGraph.prototype.model=null,mxGraph.prototype.view=null,mxGraph.prototype.stylesheet=null,mxGraph.prototype.selectionModel=null,mxGraph.prototype.cellEditor=null,mxGraph.prototype.cellRenderer=null,mxGraph.prototype.multiplicities=null,mxGraph.prototype.renderHint=null,mxGraph.prototype.dialect=null,mxGraph.prototype.gridSize=10,mxGraph.prototype.gridEnabled=!0,mxGraph.prototype.portsEnabled=!0,mxGraph.prototype.doubleTapEnabled=!0,mxGraph.prototype.doubleTapTimeout=700,mxGraph.prototype.doubleTapTolerance=25,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchTime=0,mxGraph.prototype.gestureEnabled=!0,mxGraph.prototype.tolerance=4,mxGraph.prototype.defaultOverlap=.5,mxGraph.prototype.defaultParent=null,mxGraph.prototype.alternateEdgeStyle=null,mxGraph.prototype.backgroundImage=null,mxGraph.prototype.pageVisible=!1,mxGraph.prototype.pageBreaksVisible=!1,mxGraph.prototype.pageBreakColor="gray",mxGraph.prototype.pageBreakDashed=!0,mxGraph.prototype.minPageBreakDist=20,mxGraph.prototype.preferPageSize=!1,mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT,mxGraph.prototype.pageScale=1.5,mxGraph.prototype.enabled=!0,mxGraph.prototype.escapeEnabled=!0,mxGraph.prototype.invokesStopCellEditing=!0,mxGraph.prototype.enterStopsCellEditing=!1,mxGraph.prototype.useScrollbarsForPanning=!0,mxGraph.prototype.exportEnabled=!0,mxGraph.prototype.importEnabled=!0,mxGraph.prototype.cellsLocked=!1,mxGraph.prototype.cellsCloneable=!0,mxGraph.prototype.foldingEnabled=!0,mxGraph.prototype.cellsEditable=!0,mxGraph.prototype.cellsDeletable=!0,mxGraph.prototype.cellsMovable=!0,mxGraph.prototype.edgeLabelsMovable=!0,mxGraph.prototype.vertexLabelsMovable=!1,mxGraph.prototype.dropEnabled=!1,mxGraph.prototype.splitEnabled=!0,mxGraph.prototype.cellsResizable=!0,mxGraph.prototype.cellsBendable=!0,mxGraph.prototype.cellsSelectable=!0,mxGraph.prototype.cellsDisconnectable=!0,mxGraph.prototype.autoSizeCells=!1,mxGraph.prototype.autoScroll=!0,mxGraph.prototype.timerAutoScroll=!1,mxGraph.prototype.allowAutoPanning=!1,mxGraph.prototype.ignoreScrollbars=!1,mxGraph.prototype.autoExtend=!0,mxGraph.prototype.maximumGraphBounds=null,mxGraph.prototype.minimumGraphSize=null,mxGraph.prototype.minimumContainerSize=null,mxGraph.prototype.maximumContainerSize=null,mxGraph.prototype.resizeContainer=!1,mxGraph.prototype.border=0,mxGraph.prototype.ordered=!0,mxGraph.prototype.keepEdgesInForeground=!1,mxGraph.prototype.keepEdgesInBackground=!0,mxGraph.prototype.allowNegativeCoordinates=!0,mxGraph.prototype.constrainChildren=!0,mxGraph.prototype.extendParents=!0,mxGraph.prototype.extendParentsOnAdd=!0,mxGraph.prototype.collapseToPreferredSize=!0,mxGraph.prototype.zoomFactor=1.2,mxGraph.prototype.keepSelectionVisibleOnZoom=!1,mxGraph.prototype.centerZoom=!0,mxGraph.prototype.resetViewOnRootChange=!0,mxGraph.prototype.resetEdgesOnResize=!1,mxGraph.prototype.resetEdgesOnMove=!1,mxGraph.prototype.resetEdgesOnConnect=!0,mxGraph.prototype.allowLoops=!1,mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop,mxGraph.prototype.multigraph=!0,mxGraph.prototype.connectableEdges=!1,mxGraph.prototype.allowDanglingEdges=!0,mxGraph.prototype.cloneInvalidEdges=!1,mxGraph.prototype.disconnectOnMove=!0,mxGraph.prototype.labelsVisible=!0,mxGraph.prototype.htmlLabels=!1,mxGraph.prototype.swimlaneSelectionEnabled=!0,mxGraph.prototype.swimlaneNesting=!0,mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR,mxGraph.prototype.imageBundles=null,mxGraph.prototype.minFitScale=.1,mxGraph.prototype.maxFitScale=8,mxGraph.prototype.panDx=0,mxGraph.prototype.panDy=0,mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9),mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9),mxGraph.prototype.warningImage=new mxImage("/assets/plugins/mxgraph/images/warning.gif",16,16),mxGraph.prototype.alreadyConnectedResource="none"!=mxClient.language?"alreadyConnected":"",mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":"",mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"collapse-expand":"",mxGraph.prototype.init=function(e){this.container=e,this.cellEditor=this.createCellEditor(),this.view.init(),this.sizeDidChange(),mxClient.IS_IE&&(mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})),mxEvent.addListener(e,"selectstart",mxUtils.bind(this,function(){return this.isEditing()}))),8==document.documentMode&&e.insertAdjacentHTML("beforeend",'<v:group style="DISPLAY: none;"></v:group>')},mxGraph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(e){this.stylesheet=e},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(e){this.selectionModel=e},mxGraph.prototype.getSelectionCellsForChanges=function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n];if(a.constructor!=mxRootChange){var i=null;a instanceof mxChildChange&&null==a.previous?i=a.child:null!=a.cell&&a.cell instanceof mxCell&&(i=a.cell),null!=i&&mxUtils.indexOf(t,i)<0&&t.push(i)}}return this.getModel().getTopmostCells(t)},mxGraph.prototype.graphModelChanged=function(e){for(var t=0;t<e.length;t++)this.processChange(e[t]);this.removeSelectionCells(this.getRemovedCellsForChanges(e)),this.view.validate(),this.sizeDidChange()},mxGraph.prototype.getRemovedCellsForChanges=function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n];if(a instanceof mxRootChange)break;a instanceof mxChildChange?null!=a.previous&&null==a.parent&&(t=t.concat(this.model.getDescendants(a.child))):a instanceof mxVisibleChange&&(t=t.concat(this.model.getDescendants(a.cell)))}return t},mxGraph.prototype.processChange=function(e){if(e instanceof mxRootChange)this.clearSelection(),this.removeStateForCell(e.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(e instanceof mxChildChange){var t=this.model.getParent(e.child);null!=t?this.view.invalidate(e.child,!0,!1,null!=e.previous):(this.removeStateForCell(e.child),this.view.currentRoot==e.child&&this.home()),t!=e.previous&&(null!=t&&this.view.invalidate(t,!1,!1),null!=e.previous&&this.view.invalidate(e.previous,!1,!1))}else e instanceof mxTerminalChange||e instanceof mxGeometryChange?this.view.invalidate(e.cell):e instanceof mxValueChange?this.view.invalidate(e.cell,!1,!1):e instanceof mxStyleChange?(this.view.invalidate(e.cell,!0,!0,!1),this.view.removeState(e.cell)):null!=e.cell&&e.cell instanceof mxCell&&this.removeStateForCell(e.cell)},mxGraph.prototype.removeStateForCell=function(e){for(var t=this.model.getChildCount(e),n=0;n<t;n++)this.removeStateForCell(this.model.getChildAt(e,n));this.view.removeState(e)},mxGraph.prototype.addCellOverlay=function(e,t){null==e.overlays&&(e.overlays=[]),e.overlays.push(t);var n=this.view.getState(e);return null!=n&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",e,"overlay",t)),t},mxGraph.prototype.getCellOverlays=function(e){return e.overlays},mxGraph.prototype.removeCellOverlay=function(e,t){if(null==t)this.removeCellOverlays(e);else{var n=mxUtils.indexOf(e.overlays,t);0<=n?(e.overlays.splice(n,1),0==e.overlays.length&&(e.overlays=null),null!=(n=this.view.getState(e))&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",t))):t=null}return t},mxGraph.prototype.removeCellOverlays=function(e){var t=e.overlays;if(null!=t){e.overlays=null;var n=this.view.getState(e);for(null!=n&&this.cellRenderer.redraw(n),n=0;n<t.length;n++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",t[n]))}return t},mxGraph.prototype.clearCellOverlays=function(e){e=null!=e?e:this.model.getRoot(),this.removeCellOverlays(e);for(var t=this.model.getChildCount(e),n=0;n<t;n++){var a=this.model.getChildAt(e,n);this.clearCellOverlays(a)}},mxGraph.prototype.setCellWarning=function(n,e,t,a){return null!=e&&0<e.length?(e=new mxCellOverlay(t=null!=t?t:this.warningImage,"<font color=red>"+e+"</font>"),a&&e.addListener(mxEvent.CLICK,mxUtils.bind(this,function(e,t){this.isEnabled()&&this.setSelectionCell(n)})),this.addCellOverlay(n,e)):(this.removeCellOverlays(n),null)},mxGraph.prototype.startEditing=function(e){this.startEditingAtCell(null,e)},mxGraph.prototype.startEditingAtCell=function(e,t){null==e&&(null!=(e=this.getSelectionCell())&&!this.isCellEditable(e)&&(e=null)),null!=e&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",e,"event",t)),this.cellEditor.startEditing(e,t))},mxGraph.prototype.getEditingValue=function(e,t){return this.convertValueToString(e)},mxGraph.prototype.stopEditing=function(e){this.cellEditor.stopEditing(e)},mxGraph.prototype.labelChanged=function(e,t,n){this.model.beginUpdate();try{this.cellLabelChanged(e,t,this.isAutoSizeCell(e)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",e,"value",t,"event",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellLabelChanged=function(e,t,n){this.model.beginUpdate();try{this.model.setValue(e,t),n&&this.cellSizeUpdated(e,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(e){this.stopEditing(!0),this.connectionHandler.reset(),this.graphHandler.reset(),e=this.getSelectionCells();for(var t=0;t<e.length;t++){var n=this.view.getState(e[t]);null!=n&&null!=n.handler&&n.handler.reset()}},mxGraph.prototype.click=function(e){var t=e.getEvent(),n=e.getCell(),a=new mxEventObject(mxEvent.CLICK,"event",t,"cell",n);e.isConsumed()&&a.consume(),this.fireEvent(a),this.isEnabled()&&!mxEvent.isConsumed(t)&&!a.isConsumed()&&(null!=n?this.selectCellForEvent(n,t):(n=null,this.isSwimlaneSelectionEnabled()&&(n=this.getSwimlaneAt(e.getGraphX(),e.getGraphY())),null!=n?this.selectCellForEvent(n,t):this.isToggleEvent(t)||this.clearSelection()))},mxGraph.prototype.dblClick=function(e,t){var n=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",t);this.fireEvent(n),this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed()&&null!=t&&this.isCellEditable(t)&&this.startEditingAtCell(t,e)},mxGraph.prototype.scrollPointToVisible=function(e,t,n,a){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.active&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(e+this.panDx,t+this.panDy));else{var i=this.container;if(a=null!=a?a:20,e>=i.scrollLeft&&t>=i.scrollTop&&e<=i.scrollLeft+i.clientWidth&&t<=i.scrollTop+i.clientHeight){var o=i.scrollLeft+i.clientWidth-e;if(o<a){if(e=i.scrollLeft,i.scrollLeft+=a-o,n&&e==i.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){e=this.view.getDrawPane().ownerSVGElement;var s=this.container.scrollWidth+a-o}else s=Math.max(i.clientWidth,i.scrollWidth)+a-o,e=this.view.getCanvas();e.style.width=s+"px",i.scrollLeft+=a-o}}else(o=e-i.scrollLeft)<a&&(i.scrollLeft-=a-o);(o=i.scrollTop+i.clientHeight-t)<a?(e=i.scrollTop,i.scrollTop+=a-o,e==i.scrollTop&&n&&(this.dialect==mxConstants.DIALECT_SVG?(e=this.view.getDrawPane().ownerSVGElement,t=this.container.scrollHeight+a-o):(t=Math.max(i.clientHeight,i.scrollHeight)+a-o,e=this.view.getCanvas()),e.style.height=t+"px",i.scrollTop+=a-o)):(o=t-i.scrollTop)<a&&(i.scrollTop-=a-o)}}},mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)},mxGraph.prototype.getBorderSizes=function(){function e(e){var t=0;t="thin"==e?2:"medium"==e?4:"thick"==e?6:parseInt(e);return isNaN(t)&&(t=0),t}var t=mxUtils.getCurrentStyle(this.container),n=new mxRectangle;return n.x=e(t.borderLeftWidth)+parseInt(t.paddingLeft||0),n.y=e(t.borderTopWidth)+parseInt(t.paddingTop||0),n.width=e(t.borderRightWidth)+parseInt(t.paddingRight||0),n.height=e(t.borderBottomWidth)+parseInt(t.paddingBottom||0),n},mxGraph.prototype.getPreferredPageSize=function(e,t,n){e=this.view.scale;var a=this.view.translate,i=this.pageFormat,o=e*this.pageScale;i=new mxRectangle(0,0,i.width*o,i.height*o);return t=this.pageBreaksVisible?Math.ceil(t/i.width):1,n=this.pageBreaksVisible?Math.ceil(n/i.height):1,new mxRectangle(0,0,t*i.width+2+a.x/e,n*i.height+2+a.y/e)},mxGraph.prototype.sizeDidChange=function(){var e=this.getGraphBounds();if(null!=this.container){var t=this.getBorder(),n=Math.max(0,e.x+e.width+1+t);t=Math.max(0,e.y+e.height+1+t);if(null!=this.minimumContainerSize&&(n=Math.max(n,this.minimumContainerSize.width),t=Math.max(t,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(n,t),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var a=this.getPreferredPageSize(e,n,t);null!=a&&(n=a.width,t=a.height)}null!=this.minimumGraphSize&&(n=Math.max(n,this.minimumGraphSize.width*this.view.scale),t=Math.max(t,this.minimumGraphSize.height*this.view.scale)),n=Math.ceil(n-1),t=Math.ceil(t-1),this.dialect==mxConstants.DIALECT_SVG?((a=this.view.getDrawPane().ownerSVGElement).style.minWidth=Math.max(1,n)+"px",a.style.minHeight=Math.max(1,t)+"px",a.style.width="100%",a.style.height="100%"):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,n),Math.max(1,t)):(this.view.canvas.style.minWidth=Math.max(1,n)+"px",this.view.canvas.style.minHeight=Math.max(1,t)+"px"),this.updatePageBreaks(this.pageBreaksVisible,n-1,t-1)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",e))},mxGraph.prototype.doResizeContainer=function(e,t){if(mxClient.IS_IE)if(mxClient.IS_QUIRKS){var n=this.getBorderSizes();e+=Math.max(2,n.x+n.width+1),t+=Math.max(2,n.y+n.height+1)}else 9<=document.documentMode?(e+=3,t+=5):(e+=1,t+=1);else t+=1;null!=this.maximumContainerSize&&(e=Math.min(this.maximumContainerSize.width,e),t=Math.min(this.maximumContainerSize.height,t)),this.container.style.width=Math.ceil(e)+"px",this.container.style.height=Math.ceil(t)+"px"},mxGraph.prototype.updatePageBreaks=function(e,t,n){var a=this.view.scale,i=this.view.translate,o=this.pageFormat,s=a*this.pageScale;i=new mxRectangle(a*i.x,a*i.y,o.width*s,o.height*s);if(e=e&&Math.min(i.width,i.height)>this.minPageBreakDist,i.x=mxUtils.mod(i.x,i.width),i.y=mxUtils.mod(i.y,i.height),o=e?Math.ceil((t-i.x)/i.width):0,e=e?Math.ceil((n-i.y)/i.height):0,null==this.horizontalPageBreaks&&0<o&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(s=0;s<=o;s++){var r=[new mxPoint(i.x+s*i.width,1),new mxPoint(i.x+s*i.width,n)];null!=this.horizontalPageBreaks[s]?(this.horizontalPageBreaks[s].scale=1,this.horizontalPageBreaks[s].points=r,this.horizontalPageBreaks[s].redraw()):((r=new mxPolyline(r,this.pageBreakColor,this.scale)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.horizontalPageBreaks[s]=r)}for(s=o;s<this.horizontalPageBreaks.length;s++)this.horizontalPageBreaks[s].destroy();this.horizontalPageBreaks.splice(o,this.horizontalPageBreaks.length-o)}if(null==this.verticalPageBreaks&&0<e&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(s=0;s<=e;s++)r=[new mxPoint(1,i.y+s*i.height),new mxPoint(t,i.y+s*i.height)],null!=this.verticalPageBreaks[s]?(this.verticalPageBreaks[s].scale=1,this.verticalPageBreaks[s].points=r,this.verticalPageBreaks[s].redraw()):((r=new mxPolyline(r,this.pageBreakColor,a)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.verticalPageBreaks[s]=r);for(s=e;s<this.verticalPageBreaks.length;s++)this.verticalPageBreaks[s].destroy();this.verticalPageBreaks.splice(e,this.verticalPageBreaks.length-e)}},mxGraph.prototype.getCellStyle=function(e){var t=this.model.getStyle(e),n=null;n=this.model.isEdge(e)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();return null!=t&&(n=this.postProcessCellStyle(this.stylesheet.getCellStyle(t,n))),null==n&&(n=mxGraph.prototype.EMPTY_ARRAY),n},mxGraph.prototype.postProcessCellStyle=function(e){if(null!=e){var t=e[mxConstants.STYLE_IMAGE],n=this.getImageFromBundles(t);null!=n?e[mxConstants.STYLE_IMAGE]=n:n=t,null!=n&&"data:image/"==n.substring(0,11)&&(0<(t=n.indexOf(","))&&(n=n.substring(0,t)+";base64,"+n.substring(t+1)),e[mxConstants.STYLE_IMAGE]=n)}return e},mxGraph.prototype.setCellStyle=function(e,t){if(null!=(t=t||this.getSelectionCells())){this.model.beginUpdate();try{for(var n=0;n<t.length;n++)this.model.setStyle(t[n],e)}finally{this.model.endUpdate()}}},mxGraph.prototype.toggleCellStyle=function(e,t,n){n=n||this.getSelectionCell(),this.toggleCellStyles(e,t,[n])},mxGraph.prototype.toggleCellStyles=function(e,t,n){var a;(t=null!=t&&t,null!=(n=n||this.getSelectionCells())&&0<n.length)&&(null!=(a=null!=(a=this.view.getState(n[0]))?a.style:this.getCellStyle(n[0]))&&(t=mxUtils.getValue(a,e,t)?0:1,this.setCellStyles(e,t,n)))},mxGraph.prototype.setCellStyles=function(e,t,n){n=n||this.getSelectionCells(),mxUtils.setCellStyles(this.model,n,e,t)},mxGraph.prototype.toggleCellStyleFlags=function(e,t,n){this.setCellStyleFlags(e,t,null,n)},mxGraph.prototype.setCellStyleFlags=function(e,t,n,a){if(null!=(a=a||this.getSelectionCells())&&0<a.length){var i;if(null==n)null!=(i=null!=(i=this.view.getState(a[0]))?i.style:this.getCellStyle(a[0]))&&(n=(parseInt(i[e]||0)&t)!=t);mxUtils.setCellStyleFlags(this.model,a,e,t,n)}},mxGraph.prototype.alignCells=function(e,t,n){if(null==t&&(t=this.getSelectionCells()),null!=t&&1<t.length){if(null==n)for(var a=0;a<t.length;a++){var i=this.getCellGeometry(t[a]);if(null!=i&&!this.model.isEdge(t[a]))if(null==n){if(e==mxConstants.ALIGN_CENTER){n=i.x+i.width/2;break}if(e==mxConstants.ALIGN_RIGHT)n=i.x+i.width;else if(e==mxConstants.ALIGN_TOP)n=i.y;else{if(e==mxConstants.ALIGN_MIDDLE){n=i.y+i.height/2;break}n=e==mxConstants.ALIGN_BOTTOM?i.y+i.height:i.x}}else n=e==mxConstants.ALIGN_RIGHT?Math.max(n,i.x+i.width):e==mxConstants.ALIGN_TOP?Math.min(n,i.y):e==mxConstants.ALIGN_BOTTOM?Math.max(n,i.y+i.height):Math.min(n,i.x)}if(null!=n){this.model.beginUpdate();try{for(a=0;a<t.length;a++)null!=(i=this.getCellGeometry(t[a]))&&!this.model.isEdge(t[a])&&(i=i.clone(),e==mxConstants.ALIGN_CENTER?i.x=n-i.width/2:e==mxConstants.ALIGN_RIGHT?i.x=n-i.width:e==mxConstants.ALIGN_TOP?i.y=n:e==mxConstants.ALIGN_MIDDLE?i.y=n-i.height/2:e==mxConstants.ALIGN_BOTTOM?i.y=n-i.height:i.x=n,this.model.setGeometry(t[a],i));this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",e,"cells",t))}finally{this.model.endUpdate()}}}return t},mxGraph.prototype.flipEdge=function(e){if(null!=e&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var t=this.model.getStyle(e);null==t||0==t.length?this.model.setStyle(e,this.alternateEdgeStyle):this.model.setStyle(e,null),this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",e))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.addImageBundle=function(e){this.imageBundles.push(e)},mxGraph.prototype.removeImageBundle=function(e){for(var t=[],n=0;n<this.imageBundles.length;n++)this.imageBundles[n]!=e&&t.push(this.imageBundles[n]);this.imageBundles=t},mxGraph.prototype.getImageFromBundles=function(e){if(null!=e)for(var t=0;t<this.imageBundles.length;t++){var n=this.imageBundles[t].getImage(e);if(null!=n)return n}return null},mxGraph.prototype.orderCells=function(e,t){null==t&&(t=mxUtils.sortCells(this.getSelectionCells(),!0)),this.model.beginUpdate();try{this.cellsOrdered(t,e),this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",e,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsOrdered=function(e,t){if(null!=e){this.model.beginUpdate();try{for(var n=0;n<e.length;n++){var a=this.model.getParent(e[n]);t?this.model.add(a,e[n],n):this.model.add(a,e[n],this.model.getChildCount(a)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",t,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.groupCells=function(e,t,n){null==n&&(n=mxUtils.sortCells(this.getSelectionCells(),!0)),n=this.getCellsForGroup(n),null==e&&(e=this.createGroupCell(n));var a=this.getBoundsForGroup(e,n,t);if(0<n.length&&null!=a){var i=this.model.getParent(e);null==i&&(i=this.model.getParent(n[0])),this.model.beginUpdate();try{null==this.getCellGeometry(e)&&this.model.setGeometry(e,new mxGeometry);var o=this.model.getChildCount(i);this.cellsAdded([e],i,o,null,null,!1),o=this.model.getChildCount(e),this.cellsAdded(n,e,o,null,null,!1,!1),this.cellsMoved(n,-a.x,-a.y,!1,!0),this.cellsResized([e],[a]),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",e,"border",t,"cells",n))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.getCellsForGroup=function(e){var t=[];if(null!=e&&0<e.length){var n=this.model.getParent(e[0]);t.push(e[0]);for(var a=1;a<e.length;a++)this.model.getParent(e[a])==n&&t.push(e[a])}return t},mxGraph.prototype.getBoundsForGroup=function(e,t,n){return null!=(t=this.getBoundingBoxFromGeometry(t))&&(this.isSwimlane(e)&&(e=this.getStartSize(e),t.x-=e.width,t.y-=e.height,t.width+=e.width,t.height+=e.height),t.x-=n,t.y-=n,t.width+=2*n,t.height+=2*n),t},mxGraph.prototype.createGroupCell=function(e){return(e=new mxCell("")).setVertex(!0),e.setConnectable(!1),e},mxGraph.prototype.ungroupCells=function(e){var t=[];if(null==e){e=this.getSelectionCells();for(var n=[],a=0;a<e.length;a++)0<this.model.getChildCount(e[a])&&n.push(e[a]);e=n}if(null!=e&&0<e.length){this.model.beginUpdate();try{for(a=0;a<e.length;a++){if(null!=(i=this.model.getChildren(e[a]))&&0<i.length){var i=i.slice(),o=this.model.getParent(e[a]),s=this.model.getChildCount(o);this.cellsAdded(i,o,s,null,null,!0),t=t.concat(i)}}this.cellsRemoved(this.addAllEdges(e)),this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",e))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.removeCellsFromParent=function(e){null==e&&(e=this.getSelectionCells()),this.model.beginUpdate();try{var t=this.getDefaultParent(),n=this.model.getChildCount(t);this.cellsAdded(e,t,n,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",e))}finally{this.model.endUpdate()}return e},mxGraph.prototype.updateGroupBounds=function(e,t,n){null==e&&(e=this.getSelectionCells()),t=null!=t?t:0,n=null!=n&&n,this.model.beginUpdate();try{for(var a=0;a<e.length;a++){if(null!=(r=this.getCellGeometry(e[a]))){var i=this.getChildCells(e[a]);if(null!=i&&0<i.length){var o=this.getBoundingBoxFromGeometry(i);if(0<o.width&&0<o.height){var s=this.isSwimlane(e[a])?this.getStartSize(e[a]):new mxRectangle,r=r.clone();n&&(r.x+=o.x-s.width-t,r.y+=o.y-s.height-t),r.width=o.width+s.width+2*t,r.height=o.height+s.height+2*t,this.model.setGeometry(e[a],r),this.moveCells(i,-o.x+s.width+t,-o.y+s.height+t)}}}}}finally{this.model.endUpdate()}return e},mxGraph.prototype.cloneCells=function(e,t){t=null==t||t;var n=null;if(null!=e){for(var a={},i=(n=[],0);i<e.length;i++){a[o=mxCellPath.create(e[i])]=e[i],n.push(e[i])}if(0<n.length){var o=this.view.scale,s=this.view.translate;for(n=this.model.cloneCells(e,!0),i=0;i<e.length;i++)if(!t&&this.model.isEdge(n[i])&&null!=this.getEdgeValidationError(n[i],this.model.getTerminal(n[i],!0),this.model.getTerminal(n[i],!1)))n[i]=null;else{var r=this.model.getGeometry(n[i]);if(null!=r){var l=this.view.getState(e[i]),d=this.view.getState(this.model.getParent(e[i]));if(null!=l&&null!=d){var c=d.origin.x;d=d.origin.y;if(this.model.isEdge(n[i])){l=l.absolutePoints;for(var m=this.model.getTerminal(e[i],!0),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);for(null==m&&r.setTerminalPoint(new mxPoint(l[0].x/o-s.x,l[0].y/o-s.y),!0),m=this.model.getTerminal(e[i],!1),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);if(null==m&&(m=l.length-1,r.setTerminalPoint(new mxPoint(l[m].x/o-s.x,l[m].y/o-s.y),!1)),null!=(r=r.points))for(l=0;l<r.length;l++)r[l].x+=c,r[l].y+=d}else r.x+=c,r.y+=d}}}}else n=[]}return n},mxGraph.prototype.insertVertex=function(e,t,n,a,i,o,s,r,l){return t=this.createVertex(e,t,n,a,i,o,s,r,l),this.addCell(t,e)},mxGraph.prototype.createVertex=function(e,t,n,a,i,o,s,r,l){return(e=new mxGeometry(a,i,o,s)).relative=null!=l&&l,(n=new mxCell(n,e,r)).setId(t),n.setVertex(!0),n.setConnectable(!0),n},mxGraph.prototype.insertEdge=function(e,t,n,a,i,o){return t=this.createEdge(e,t,n,a,i,o),this.addEdge(t,e,a,i)},mxGraph.prototype.createEdge=function(e,t,n,a,i,o){return(e=new mxCell(n,new mxGeometry,o)).setId(t),e.setEdge(!0),e.geometry.relative=!0,e},mxGraph.prototype.addEdge=function(e,t,n,a,i){return this.addCell(e,t,i,n,a)},mxGraph.prototype.addCell=function(e,t,n,a,i){return this.addCells([e],t,n,a,i)[0]},mxGraph.prototype.addCells=function(e,t,n,a,i){null==t&&(t=this.getDefaultParent()),null==n&&(n=this.model.getChildCount(t)),this.model.beginUpdate();try{this.cellsAdded(e,t,n,a,i,!1,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",e,"parent",t,"index",n,"source",a,"target",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsAdded=function(e,t,n,a,i,o,s){if(null!=e&&null!=t&&null!=n){this.model.beginUpdate();try{for(var r=null!=(d=o?this.view.getState(t):null)?d.origin:null,l=new mxPoint(0,0),d=0;d<e.length;d++)if(null==e[d])n--;else{var c=this.model.getParent(e[d]);if(null!=r&&e[d]!=t&&t!=c){var m=this.view.getState(c),u=null!=m?m.origin:l;if(null!=(p=this.model.getGeometry(e[d]))){var p,g=u.x-r.x,v=u.y-r.y;(p=p.clone()).translate(g,v),!p.relative&&this.model.isVertex(e[d])&&!this.isAllowNegativeCoordinates()&&(p.x=Math.max(0,p.x),p.y=Math.max(0,p.y)),this.model.setGeometry(e[d],p)}}t==c&&n+d>this.model.getChildCount(t)&&n--,this.model.add(t,e[d],n+d),this.isExtendParentsOnAdd()&&this.isExtendParent(e[d])&&this.extendParent(e[d]),(null==s||s)&&this.constrainChild(e[d]),null!=a&&this.cellConnected(e[d],a,!0),null!=i&&this.cellConnected(e[d],i,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",e,"parent",t,"index",n,"source",a,"target",i,"absolute",o))}finally{this.model.endUpdate()}}},mxGraph.prototype.removeCells=function(e,t){t=null==t||t,null==e&&(e=this.getDeletableCells(this.getSelectionCells())),t&&(e=this.getDeletableCells(this.addAllEdges(e))),this.model.beginUpdate();try{this.cellsRemoved(e),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells",e,"includeEdges",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsRemoved=function(e){if(null!=e&&0<e.length){var t=this.view.scale,n=this.view.translate;this.model.beginUpdate();try{for(var a={},i=0;i<e.length;i++){var o=mxCellPath.create(e[i]);a[o]=e[i]}for(i=0;i<e.length;i++){for(var s=this.getConnections(e[i]),r=0;r<s.length;r++)if(null==a[o=mxCellPath.create(s[r])]){if(null!=(d=this.model.getGeometry(s[r]))){var l=this.view.getState(s[r]);if(null!=l){var d=d.clone(),c=l.getVisibleTerminal(!0)==e[i],m=l.absolutePoints,u=c?0:m.length-1;d.setTerminalPoint(new mxPoint(m[u].x/t-n.x,m[u].y/t-n.y),c),this.model.setTerminal(s[r],null,c),this.model.setGeometry(s[r],d)}}}this.model.remove(e[i])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.splitEdge=function(e,t,n,a,i){a=a||0,i=i||0,null==n&&(n=this.cloneCells([e])[0]);var o=this.model.getParent(e),s=this.model.getTerminal(e,!0);this.model.beginUpdate();try{this.cellsMoved(t,a,i,!1,!1),this.cellsAdded(t,o,this.model.getChildCount(o),null,null,!0),this.cellsAdded([n],o,this.model.getChildCount(o),s,t[0],!1),this.cellConnected(e,t[0],!0),this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",e,"cells",t,"newEdge",n,"dx",a,"dy",i))}finally{this.model.endUpdate()}return n},mxGraph.prototype.toggleCells=function(e,t,n){null==t&&(t=this.getSelectionCells()),n&&(t=this.addAllEdges(t)),this.model.beginUpdate();try{this.cellsToggled(t,e),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",e,"cells",t,"includeEdges",n))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsToggled=function(e,t){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var n=0;n<e.length;n++)this.model.setVisible(e[n],t)}finally{this.model.endUpdate()}}},mxGraph.prototype.foldCells=function(e,t,n,a){t=null!=t&&t,null==n&&(n=this.getFoldableCells(this.getSelectionCells(),e)),this.stopEditing(!1),this.model.beginUpdate();try{this.cellsFolded(n,e,t,a),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",e,"recurse",t,"cells",n))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsFolded=function(e,t,n,a){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var i=0;i<e.length;i++)if((!a||this.isCellFoldable(e[i],t))&&t!=this.isCellCollapsed(e[i])&&(this.model.setCollapsed(e[i],t),this.swapBounds(e[i],t),this.isExtendParent(e[i])&&this.extendParent(e[i]),n)){var o=this.model.getChildren(e[i]);this.foldCells(o,t,n)}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",e,"collapse",t,"recurse",n))}finally{this.model.endUpdate()}}},mxGraph.prototype.swapBounds=function(e,t){if(null!=e){var n=this.model.getGeometry(e);null!=n&&(n=n.clone(),this.updateAlternateBounds(e,n,t),n.swap(),this.model.setGeometry(e,n))}},mxGraph.prototype.updateAlternateBounds=function(e,t,n){if(null!=e&&null!=t){if(n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e),null==t.alternateBounds){var a=t;this.collapseToPreferredSize&&(null!=(e=this.getPreferredSizeForCell(e))&&(a=e,0<(e=mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE))&&(a.height=Math.max(a.height,e)))),t.alternateBounds=new mxRectangle(0,0,a.width,a.height)}if(null!=t.alternateBounds){t.alternateBounds.x=t.x,t.alternateBounds.y=t.y;var i=mxUtils.toRadians(n[mxConstants.STYLE_ROTATION]||"0");0!=i&&(e=t.alternateBounds.getCenterX()-t.getCenterX(),n=t.alternateBounds.getCenterY()-t.getCenterY(),a=Math.cos(i),i=Math.sin(i),t.alternateBounds.x+=a*e-i*n-e,t.alternateBounds.y+=i*e+a*n-n)}}},mxGraph.prototype.addAllEdges=function(e){var t=e.slice();return t.concat(this.getAllEdges(e))},mxGraph.prototype.getAllEdges=function(e){var t=[];if(null!=e)for(var n=0;n<e.length;n++){for(var a=this.model.getEdgeCount(e[n]),i=0;i<a;i++)t.push(this.model.getEdgeAt(e[n],i));a=this.model.getChildren(e[n]),t=t.concat(this.getAllEdges(a))}return t},mxGraph.prototype.updateCellSize=function(e,t){t=null!=t&&t,this.model.beginUpdate();try{this.cellSizeUpdated(e,t),this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",e,"ignoreChildren",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellSizeUpdated=function(e,t){if(null!=e){this.model.beginUpdate();try{var n=this.getPreferredSizeForCell(e),a=this.model.getGeometry(e);if(null!=n&&null!=a){var i=this.isCellCollapsed(e);a=a.clone();if(this.isSwimlane(e)){var o=this.view.getState(e),s=null!=o?o.style:this.getCellStyle(e),r=this.model.getStyle(e);null==r&&(r=""),mxUtils.getValue(s,mxConstants.STYLE_HORIZONTAL,!0)?(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,n.height+8),i&&(a.height=n.height+8),a.width=n.width):(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,n.width+8),i&&(a.width=n.width+8),a.height=n.height),this.model.setStyle(e,r)}else a.width=n.width,a.height=n.height;if(!t&&!i){var l=this.view.getBounds(this.model.getChildren(e));if(null!=l){var d=this.view.translate,c=this.view.scale,m=(l.y+l.height)/c-a.y-d.y;a.width=Math.max(a.width,(l.x+l.width)/c-a.x-d.x),a.height=Math.max(a.height,m)}}this.cellsResized([e],[a])}}finally{this.model.endUpdate()}}},mxGraph.prototype.getPreferredSizeForCell=function(e){var t=null;if(null!=e){var n=this.view.getState(e),a=null!=n?n.style:this.getCellStyle(e);if(null!=a&&!this.model.isEdge(e)){var i=a[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE,o=0;t=0;null==this.getImage(n)&&null==a[mxConstants.STYLE_IMAGE]||a[mxConstants.STYLE_SHAPE]!=mxConstants.SHAPE_LABEL||(a[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(o+=parseFloat(a[mxConstants.STYLE_IMAGE_WIDTH])||mxLabel.prototype.imageSize),a[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(t+=parseFloat(a[mxConstants.STYLE_IMAGE_HEIGHT])||mxLabel.prototype.imageSize)),o+=2*(a[mxConstants.STYLE_SPACING]||0),o+=a[mxConstants.STYLE_SPACING_LEFT]||0,o+=a[mxConstants.STYLE_SPACING_RIGHT]||0,t+=2*(a[mxConstants.STYLE_SPACING]||0),t+=a[mxConstants.STYLE_SPACING_TOP]||0,t+=a[mxConstants.STYLE_SPACING_BOTTOM]||0,null!=(n=this.getFoldingImage(n))&&(o+=n.width+8),null!=(n=this.getLabel(e))&&0<n.length?(this.isHtmlLabel(e)||(n=n.replace(/\n/g,"<br>")),e=(i=mxUtils.getSizeForString(n,i,a[mxConstants.STYLE_FONTFAMILY])).width+o,t=i.height+t,mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)||(a=t,t=e,e=a),this.gridEnabled&&(e=this.snap(e+this.gridSize/2),t=this.snap(t+this.gridSize/2)),t=new mxRectangle(0,0,e,t)):t=new mxRectangle(0,0,a=4*this.gridSize,a)}}return t},mxGraph.prototype.handleGesture=function(e,t){if(.2<Math.abs(1-t.scale)){var n=this.view.scale,a=this.view.translate,i=e.width*t.scale,o=e.height*t.scale,s=e.y-(o-e.height)/2;n=new mxRectangle(this.snap((e.x-(i-e.width)/2)/n)-a.x,this.snap(s/n)-a.y,this.snap(i/n),this.snap(o/n));this.resizeCell(e.cell,n)}},mxGraph.prototype.resizeCell=function(e,t){return this.resizeCells([e],[t])[0]},mxGraph.prototype.resizeCells=function(e,t){this.model.beginUpdate();try{this.cellsResized(e,t),this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",e,"bounds",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsResized=function(e,t){if(null!=e&&null!=t&&e.length==t.length){this.model.beginUpdate();try{for(var n=0;n<e.length;n++){var a=t[n],i=this.model.getGeometry(e[n]);if(null!=i&&(i.x!=a.x||i.y!=a.y||i.width!=a.width||i.height!=a.height)){if((i=i.clone()).relative){var o=i.offset;null!=o&&(o.x+=a.x-i.x,o.y+=a.y-i.y)}else i.x=a.x,i.y=a.y;i.width=a.width,i.height=a.height,!i.relative&&this.model.isVertex(e[n])&&!this.isAllowNegativeCoordinates()&&(i.x=Math.max(0,i.x),i.y=Math.max(0,i.y)),this.model.setGeometry(e[n],i),this.isExtendParent(e[n])&&this.extendParent(e[n])}}this.resetEdgesOnResize&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",e,"bounds",t))}finally{this.model.endUpdate()}}},mxGraph.prototype.extendParent=function(e){if(null!=e){var t=this.model.getParent(e),n=this.model.getGeometry(t);null!=t&&null!=n&&!this.isCellCollapsed(t)&&(null!=(e=this.model.getGeometry(e))&&(n.width<e.x+e.width||n.height<e.y+e.height))&&((n=n.clone()).width=Math.max(n.width,e.x+e.width),n.height=Math.max(n.height,e.y+e.height),this.cellsResized([t],[n]))}},mxGraph.prototype.importCells=function(e,t,n,a,i){return this.moveCells(e,t,n,!0,a,i)},mxGraph.prototype.moveCells=function(e,t,n,a,i,o){if(t=null!=t?t:0,n=null!=n?n:0,a=null!=a&&a,null!=e&&(0!=t||0!=n||a||null!=i)){this.model.beginUpdate();try{a&&(e=this.cloneCells(e,this.isCloneInvalidEdges()),null==i&&(i=this.getDefaultParent()));var s=this.isAllowNegativeCoordinates();if(null!=i&&this.setAllowNegativeCoordinates(!0),this.cellsMoved(e,t,n,!a&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==i),this.setAllowNegativeCoordinates(s),null!=i){var r=this.model.getChildCount(i);this.cellsAdded(e,i,r,null,null,!0)}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",e,"dx",t,"dy",n,"clone",a,"target",i,"event",o))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.cellsMoved=function(e,t,n,a,i){if(null!=e&&(0!=t||0!=n)){this.model.beginUpdate();try{a&&this.disconnectGraph(e);for(var o=0;o<e.length;o++)this.translateCell(e[o],t,n),i&&this.constrainChild(e[o]);this.resetEdgesOnMove&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",e,"dx",n,"dy",n,"disconnect",a))}finally{this.model.endUpdate()}}},mxGraph.prototype.translateCell=function(e,t,n){var a=this.model.getGeometry(e);null!=a&&((a=a.clone()).translate(t,n),!a.relative&&this.model.isVertex(e)&&!this.isAllowNegativeCoordinates()&&(a.x=Math.max(0,a.x),a.y=Math.max(0,a.y)),a.relative&&!this.model.isEdge(e)&&(null==a.offset?a.offset=new mxPoint(t,n):(a.offset.x+=t,a.offset.y+=n)),this.model.setGeometry(e,a))},mxGraph.prototype.getCellContainmentArea=function(e){if(null!=e&&!this.model.isEdge(e)){var t=this.model.getParent(e);if(t==this.getDefaultParent()||t==this.getCurrentRoot())return this.getMaximumGraphBounds();if(null!=t&&t!=this.getDefaultParent())if(null!=(i=this.model.getGeometry(t))){var n=e=0,a=i.width,i=i.height;return this.isSwimlane(t)&&(e=(t=this.getStartSize(t)).width,a-=t.width,n=t.height,i-=t.height),new mxRectangle(e,n,a,i)}}return null},mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds},mxGraph.prototype.constrainChild=function(e){if(null!=e){var t=this.model.getGeometry(e),n=this.isConstrainChild(e)?this.getCellContainmentArea(e):this.getMaximumGraphBounds();null!=t&&null!=n&&!t.relative&&(t.x<n.x||t.y<n.y||n.width<t.x+t.width||n.height<t.y+t.height)&&(e=this.getOverlap(e),0<n.width&&(t.x=Math.min(t.x,n.x+n.width-(1-e)*t.width)),0<n.height&&(t.y=Math.min(t.y,n.y+n.height-(1-e)*t.height)),t.x=Math.max(t.x,n.x-t.width*e),t.y=Math.max(t.y,n.y-t.height*e))}},mxGraph.prototype.resetEdges=function(e){if(null!=e){for(var t={},n=0;n<e.length;n++){var a=mxCellPath.create(e[n]);t[a]=e[n]}this.model.beginUpdate();try{for(n=0;n<e.length;n++){var i=this.model.getEdges(e[n]);if(null!=i)for(a=0;a<i.length;a++){var o=this.view.getState(i[a]),s=null!=o?o.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[a],!0),r=null!=o?o.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[a],!1),l=mxCellPath.create(s),d=mxCellPath.create(r);(null==t[l]||null==t[d])&&this.resetEdge(i[a])}this.resetEdges(this.model.getChildren(e[n]))}}finally{this.model.endUpdate()}}},mxGraph.prototype.resetEdge=function(e){var t=this.model.getGeometry(e);return null!=t&&null!=t.points&&0<t.points.length&&((t=t.clone()).points=[],this.model.setGeometry(e,t)),e},mxGraph.prototype.getAllConnectionConstraints=function(e,t){return null!=e&&null!=e.shape&&null!=e.shape.stencil?e.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(e,t,n){t=null;var a=e.style[n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=a){var i=e.style[n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=i&&(t=new mxPoint(parseFloat(a),parseFloat(i)))}return a=!1,null!=t&&(a=mxUtils.getValue(e.style,n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0)),new mxConnectionConstraint(t,a)},mxGraph.prototype.setConnectionConstraint=function(e,t,n,a){if(null!=a){this.model.beginUpdate();try{null==a||null==a.point?(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[e]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[e]),this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e])):null!=a.point&&(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,a.point.x,[e]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,a.point.y,[e]),a.perimeter?this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e]):this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[e]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(e,t){var n=null;if(null!=e){var a=this.view.getPerimeterBounds(e),i=new mxPoint(a.getCenterX(),a.getCenterY()),o=e.style[mxConstants.STYLE_DIRECTION],s=0;if(null!=o&&("north"==o?s+=270:"west"==o?s+=180:"south"==o&&(s+=90),"north"==o||"south"==o)){a.x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var r=a.width;a.width=a.height,a.height=r}if(null!=t.point){var l=n=1,d=0,c=0;if(this.getModel().isVertex(e.cell)){var m=e.style[mxConstants.STYLE_FLIPH],u=e.style[mxConstants.STYLE_FLIPV];null!=e.shape.stencil&&(m=1==mxUtils.getValue(e.style,"stencilFlipH",0)||m,u=1==mxUtils.getValue(e.style,"stencilFlipV",0)||u),"north"!=o&&"south"!=o||(r=m,m=u,u=r),m&&(n=-1,d=-a.width),u&&(l=-1,c=-a.height)}n=new mxPoint(a.x+t.point.x*a.width*n-d,a.y+t.point.y*a.height*l-c)}o=e.style[mxConstants.STYLE_ROTATION]||0,t.perimeter?(0!=s&&null!=n&&(r=a=0,90==s?r=1:180==s?a=-1:270==o&&(r=-1),n=mxUtils.getRotatedPoint(n,a,r,i)),null!=n&&t.perimeter&&(n=this.view.getPerimeterPoint(e,n,!1))):o+=s,0!=o&&null!=n&&(s=mxUtils.toRadians(o),a=Math.cos(s),r=Math.sin(s),n=mxUtils.getRotatedPoint(n,a,r,i))}return n},mxGraph.prototype.connectCell=function(e,t,n,a){this.model.beginUpdate();try{var i=this.model.getTerminal(e,n);this.cellConnected(e,t,n,a),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",e,"terminal",t,"source",n,"previous",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellConnected=function(e,t,n,a){if(null!=e){this.model.beginUpdate();try{var i=this.model.getTerminal(e,n);this.setConnectionConstraint(e,t,n,a),this.isPortsEnabled()&&(a=null,this.isPort(t)&&(a=t.getId(),t=this.getTerminalForPort(t,n)),this.setCellStyles(n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,a,[e])),this.model.setTerminal(e,t,n),this.resetEdgesOnConnect&&this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",e,"terminal",t,"source",n,"previous",i))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(e){if(null!=e){this.model.beginUpdate();try{for(var t=this.view.scale,n=this.view.translate,a={},i=0;i<e.length;i++){a[mxCellPath.create(e[i])]=e[i]}for(i=0;i<e.length;i++)if(this.model.isEdge(e[i])){if(null!=(r=this.model.getGeometry(e[i]))){var o=this.view.getState(e[i]),s=this.view.getState(this.model.getParent(e[i]));if(null!=o&&null!=s){var r=r.clone(),l=-s.origin.x,d=-s.origin.y,c=o.absolutePoints,m=this.model.getTerminal(e[i],!0);if(null!=m&&this.isCellDisconnectable(e[i],m,!0)){for(var u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);null==m&&(r.setTerminalPoint(new mxPoint(c[0].x/t-n.x+l,c[0].y/t-n.y+d),!0),this.model.setTerminal(e[i],null,!0))}var p=this.model.getTerminal(e[i],!1);if(null!=p&&this.isCellDisconnectable(e[i],p,!1)){for(var g=mxCellPath.create(p);null!=p&&null==a[g];)p=this.model.getParent(p),g=mxCellPath.create(p);if(null==p){var v=c.length-1;r.setTerminalPoint(new mxPoint(c[v].x/t-n.x+l,c[v].y/t-n.y+d),!1),this.model.setTerminal(e[i],null,!1)}}this.model.setGeometry(e[i],r)}}}}finally{this.model.endUpdate()}}},mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot},mxGraph.prototype.getTranslateForRoot=function(e){return null},mxGraph.prototype.isPort=function(e){return!1},mxGraph.prototype.getTerminalForPort=function(e,t){return this.model.getParent(e)},mxGraph.prototype.getChildOffsetForCell=function(e){return null},mxGraph.prototype.enterGroup=function(e){null!=(e=e||this.getSelectionCell())&&this.isValidRoot(e)&&(this.view.setCurrentRoot(e),this.clearSelection())},mxGraph.prototype.exitGroup=function(){var e=this.model.getRoot(),t=this.getCurrentRoot();if(null!=t){for(var n=this.model.getParent(t);n!=e&&!this.isValidRoot(n)&&this.model.getParent(n)!=e;)n=this.model.getParent(n);n==e||this.model.getParent(n)==e?this.view.setCurrentRoot(null):this.view.setCurrentRoot(n),null!=this.view.getState(t)&&this.setSelectionCell(t)}},mxGraph.prototype.home=function(){var e=this.getCurrentRoot();null!=e&&(this.view.setCurrentRoot(null),null!=this.view.getState(e)&&this.setSelectionCell(e))},mxGraph.prototype.isValidRoot=function(e){return null!=e},mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()},mxGraph.prototype.getCellBounds=function(e,t,n){var a=[e];if(t&&(a=a.concat(this.model.getEdges(e))),a=this.view.getBounds(a),n){n=this.model.getChildCount(e);for(var i=0;i<n;i++){var o=this.getCellBounds(this.model.getChildAt(e,i),t,!0);null!=a?a.add(o):a=o}}return a},mxGraph.prototype.getBoundingBoxFromGeometry=function(e,t){t=null!=t&&t;var n=null;if(null!=e)for(var a=0;a<e.length;a++)if(t||this.model.isVertex(e[a])){var i=this.getCellGeometry(e[a]);if(null!=i){var o=i.points;if(null!=o&&0<o.length){for(var s=new mxRectangle(o[0].x,o[0].y,0,0),r=function(e){null!=e&&s.add(new mxRectangle(e.x,e.y,0,0))},l=1;l<o.length;l++)r(o[l]);r(i.getTerminalPoint(!0)),r(i.getTerminalPoint(!1))}null==n?n=new mxRectangle(i.x,i.y,i.width,i.height):n.add(i)}}return n},mxGraph.prototype.refresh=function(e){this.view.clear(e,null==e),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(e){return this.gridEnabled&&(e=Math.round(e/this.gridSize)*this.gridSize),e},mxGraph.prototype.panGraph=function(e,t){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-e,this.container.scrollTop=-t;else{var n=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==e&&0==t){if(mxClient.IS_IE?n.setAttribute("transform","translate("+e+","+t+")"):n.removeAttribute("transform"),null!=this.shiftPreview1){for(var a=this.shiftPreview1.firstChild;null!=a;){var i=a.nextSibling;this.container.appendChild(a),a=i}for(this.shiftPreview1.parentNode.removeChild(this.shiftPreview1),this.shiftPreview1=null,this.container.appendChild(n.parentNode),a=this.shiftPreview2.firstChild;null!=a;)i=a.nextSibling,this.container.appendChild(a),a=i;this.shiftPreview2.parentNode.removeChild(this.shiftPreview2),this.shiftPreview2=null}}else{if(n.setAttribute("transform","translate("+e+","+t+")"),null==this.shiftPreview1){this.shiftPreview1=document.createElement("div"),this.shiftPreview1.style.position="absolute",this.shiftPreview1.style.overflow="visible",this.shiftPreview2=document.createElement("div"),this.shiftPreview2.style.position="absolute",this.shiftPreview2.style.overflow="visible";var o=this.shiftPreview1;for(a=this.container.firstChild;null!=a;)i=a.nextSibling,a!=n.parentNode?o.appendChild(a):o=this.shiftPreview2,a=i;this.container.insertBefore(this.shiftPreview1,n.parentNode),this.container.appendChild(this.shiftPreview2)}this.shiftPreview1.style.left=e+"px",this.shiftPreview1.style.top=t+"px",this.shiftPreview2.style.left=e+"px",this.shiftPreview2.style.top=t+"px"}else n.style.left=e+"px",n.style.top=t+"px";this.panDx=e,this.panDy=t,this.fireEvent(new mxEventObject(mxEvent.PAN))}},mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)},mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)},mxGraph.prototype.zoomActual=function(){1==this.view.scale?this.view.setTranslate(0,0):(this.view.translate.x=0,this.view.translate.y=0,this.view.setScale(1))},mxGraph.prototype.zoomTo=function(e,t){this.zoom(e/this.view.scale,t)},mxGraph.prototype.zoom=function(e,t){t=null!=t?t:this.centerZoom;var n=this.view.scale*e,a=this.view.getState(this.getSelectionCell());if(this.keepSelectionVisibleOnZoom&&null!=a)a=new mxRectangle(a.x*e,a.y*e,a.width*e,a.height*e),this.view.scale=n,this.scrollRectToVisible(a)||(this.view.revalidate(),this.view.setScale(n));else if(t&&!mxUtils.hasScrollbars(this.container)){a=this.container.offsetWidth;var i=this.container.offsetHeight;if(1<e){var o=(e-1)/(2*n);a=a*-o,i=i*-o}else a*=o=(1/e-1)/(2*this.view.scale),i*=o;this.view.scaleAndTranslate(n,this.view.translate.x+a,this.view.translate.y+i)}else this.view.setScale(n),mxUtils.hasScrollbars(this.container)&&(i=a=0,t&&(a=this.container.offsetWidth*(e-1)/2,i=this.container.offsetHeight*(e-1)/2),this.container.scrollLeft=Math.round(this.container.scrollLeft*e+a),this.container.scrollTop=Math.round(this.container.scrollTop*e+i))},mxGraph.prototype.zoomToRect=function(e){var t=this.container.clientWidth/e.width/(this.container.clientHeight/e.height);e.x=Math.max(0,e.x),e.y=Math.max(0,e.y);var n=Math.min(this.container.scrollWidth,e.x+e.width),a=Math.min(this.container.scrollHeight,e.y+e.height);e.width=n-e.x,e.height=a-e.y,t<1?(n=((t=e.height/t)-e.height)/2,e.height=t,t=Math.min(e.y,n),e.y-=t,a=Math.min(this.container.scrollHeight,e.y+e.height),e.height=a-e.y):(n=((t*=e.width)-e.width)/2,e.width=t,t=Math.min(e.x,n),e.x-=t,n=Math.min(this.container.scrollWidth,e.x+e.width),e.width=n-e.x),t=this.container.clientWidth/e.width,n=this.view.scale*t,mxUtils.hasScrollbars(this.container)?(this.view.setScale(n),this.container.scrollLeft=Math.round(e.x*t),this.container.scrollTop=Math.round(e.y*t)):this.view.scaleAndTranslate(n,this.view.translate.x-e.x/this.view.scale,this.view.translate.y-e.y/this.view.scale)},mxGraph.prototype.fit=function(e,t){if(null!=this.container){e=null!=e?e:0,t=null!=t&&t;var n=this.container.clientWidth,a=this.container.clientHeight,i=this.view.getGraphBounds();t&&null!=i.x&&null!=i.y&&(i.width+=i.x,i.height+=i.y,i.x=0,i.y=0);var o=this.view.scale,s=i.width/o,r=i.height/o;null!=this.backgroundImage&&(s=Math.max(s,this.backgroundImage.width-i.x/o),r=Math.max(r,this.backgroundImage.height-i.y/o));var l=t?e:2*e;n=Math.floor(100*Math.min(n/(s+l),a/(r+l)))/100;null!=this.minFitScale&&(n=Math.max(n,this.minFitScale)),null!=this.maxFitScale&&(n=Math.min(n,this.maxFitScale)),t?this.view.scale!=n&&this.view.setScale(n):mxUtils.hasScrollbars(this.container)?(this.view.setScale(n),null!=i.x&&(this.container.scrollLeft=Math.round(i.x/o)*n-e-Math.max(0,(this.container.clientWidth-s*n)/2)),null!=i.y&&(this.container.scrollTop=Math.round(i.y/o)*n-e-Math.max(0,(this.container.clientHeight-r*n)/2))):this.view.scaleAndTranslate(n,null!=i.x?Math.floor(this.view.translate.x-i.x/o+e+1):e,null!=i.y?Math.floor(this.view.translate.y-i.y/o+e+1):e)}return this.view.scale},mxGraph.prototype.scrollCellToVisible=function(e,t){var n=-this.view.translate.x,a=-this.view.translate.y,i=this.view.getState(e);null!=i&&(n=new mxRectangle(n+i.x,a+i.y,i.width,i.height),t&&null!=this.container&&(a=this.container.clientWidth,i=this.container.clientHeight,n.x=n.getCenterX()-a/2,n.width=a,n.y=n.getCenterY()-i/2,n.height=i),this.scrollRectToVisible(n)&&this.view.setTranslate(this.view.translate.x,this.view.translate.y))},mxGraph.prototype.scrollRectToVisible=function(e){var t=!1;if(null!=e){var n=this.container.offsetWidth,a=this.container.offsetHeight,i=Math.min(n,e.width),o=Math.min(a,e.height);if(mxUtils.hasScrollbars(this.container)){n=this.container,e.x+=this.view.translate.x,e.y+=this.view.translate.y;var s=n.scrollLeft-e.x;a=Math.max(s-n.scrollLeft,0);0<s?n.scrollLeft-=s+2:0<(s=e.x+i-n.scrollLeft-n.clientWidth)&&(n.scrollLeft+=s+2),i=n.scrollTop-e.y,s=Math.max(0,i-n.scrollTop),0<i?n.scrollTop-=i+2:0<(i=e.y+o-n.scrollTop-n.clientHeight)&&(n.scrollTop+=i+2),!this.useScrollbarsForPanning&&(0!=a||0!=s)&&this.view.setTranslate(a,s)}else{s=-this.view.translate.x;var r=-this.view.translate.y,l=this.view.scale;e.x+i>s+n&&(this.view.translate.x-=(e.x+i-n-s)/l,t=!0),e.y+o>r+a&&(this.view.translate.y-=(e.y+o-a-r)/l,t=!0),e.x<s&&(this.view.translate.x+=(s-e.x)/l,t=!0),e.y<r&&(this.view.translate.y+=(r-e.y)/l,t=!0),t&&(this.view.refresh(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.refresh())}}return t},mxGraph.prototype.getCellGeometry=function(e){return this.model.getGeometry(e)},mxGraph.prototype.isCellVisible=function(e){return this.model.isVisible(e)},mxGraph.prototype.isCellCollapsed=function(e){return this.model.isCollapsed(e)},mxGraph.prototype.isCellConnectable=function(e){return this.model.isConnectable(e)},mxGraph.prototype.isOrthogonal=function(e){var t=e.style[mxConstants.STYLE_ORTHOGONAL];return null!=t?t:(e=this.view.getEdgeStyle(e))==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom||e==mxEdgeStyle.EntityRelation||e==mxEdgeStyle.OrthConnector},mxGraph.prototype.isLoop=function(e){var t=e.getVisibleTerminalState(!0);return e=e.getVisibleTerminalState(!1),null!=t&&t==e},mxGraph.prototype.isCloneEvent=function(e){return mxEvent.isControlDown(e)},mxGraph.prototype.isToggleEvent=function(e){return mxClient.IS_MAC?mxEvent.isMetaDown(e):mxEvent.isControlDown(e)},mxGraph.prototype.isGridEnabledEvent=function(e){return null!=e&&!mxEvent.isAltDown(e)},mxGraph.prototype.isConstrainedEvent=function(e){return mxEvent.isShiftDown(e)},mxGraph.prototype.isForceMarqueeEvent=function(e){return mxEvent.isAltDown(e)},mxGraph.prototype.validationAlert=function(e){mxUtils.alert(e)},mxGraph.prototype.isEdgeValid=function(e,t,n){return null==this.getEdgeValidationError(e,t,n)},mxGraph.prototype.getEdgeValidationError=function(e,t,n){if(null!=e&&!this.isAllowDanglingEdges()&&(null==t||null==n))return"";if(null!=e&&null==this.model.getTerminal(e,!0)&&null==this.model.getTerminal(e,!1))return null;if(!this.allowLoops&&t==n&&null!=t||!this.isValidConnection(t,n))return"";if(null!=t&&null!=n){var a="";if(!this.multigraph)(1<(i=this.model.getEdgesBetween(t,n,!0)).length||1==i.length&&i[0]!=e)&&(a+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n");var i=this.model.getDirectedEdgeCount(t,!0,e),o=this.model.getDirectedEdgeCount(n,!1,e);if(null!=this.multiplicities)for(var s=0;s<this.multiplicities.length;s++){var r=this.multiplicities[s].check(this,e,t,n,i,o);null!=r&&(a+=r)}return null!=(r=this.validateEdge(e,t,n))&&(a+=r),0<a.length?a:null}return this.allowDanglingEdges?null:""},mxGraph.prototype.validateEdge=function(e,t,n){return null},mxGraph.prototype.validateGraph=function(e,t){e=null!=e?e:this.model.getRoot(),t=null!=t?t:{};for(var n=!0,a=this.model.getChildCount(e),i=0;i<a;i++){var o=this.model.getChildAt(e,i),s=t;this.isValidRoot(o)&&(s={}),null!=(s=this.validateGraph(o,s))?this.setCellWarning(o,s.replace(/\n/g,"<br>")):this.setCellWarning(o,null),n=n&&null==s}return a="",this.isCellCollapsed(e)&&!n&&(a+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),a=this.model.isEdge(e)?a+(this.getEdgeValidationError(e,this.model.getTerminal(e,!0),this.model.getTerminal(e,!1))||""):a+(this.getCellValidationError(e)||""),null!=(i=this.validateCell(e,t))&&(a+=i),null==this.model.getParent(e)&&this.view.validate(),0<a.length||!n?a:null},mxGraph.prototype.getCellValidationError=function(e){var t=this.model.getDirectedEdgeCount(e,!0),n=this.model.getDirectedEdgeCount(e,!1);e=this.model.getValue(e);var a="";if(null!=this.multiplicities)for(var i=0;i<this.multiplicities.length;i++){var o=this.multiplicities[i];o.source&&mxUtils.isNode(e,o.type,o.attr,o.value)&&(0==o.max&&0<t||1==o.min&&0==t||1==o.max&&1<t)?a+=o.countError+"\n":!o.source&&mxUtils.isNode(e,o.type,o.attr,o.value)&&(0==o.max&&0<n||1==o.min&&0==n||1==o.max&&1<n)&&(a+=o.countError+"\n")}return 0<a.length?a:null},mxGraph.prototype.validateCell=function(e,t){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(e){this.backgroundImage=e},mxGraph.prototype.getFoldingImage=function(e){if(null!=e&&this.foldingEnabled&&!this.getModel().isEdge(e.cell)){var t=this.isCellCollapsed(e.cell);if(this.isCellFoldable(e.cell,!t))return t?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(e){if(null!=(e=this.model.getValue(e))){if(mxUtils.isNode(e))return e.nodeName;if("function"==typeof e.toString)return e.toString()}return""},mxGraph.prototype.getLabel=function(e){var t="";if(this.labelsVisible&&null!=e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);mxUtils.getValue(n,mxConstants.STYLE_NOLABEL,!1)||(t=this.convertValueToString(e))}return t},mxGraph.prototype.isHtmlLabel=function(e){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(e){this.htmlLabels=e},mxGraph.prototype.isWrapping=function(e){var t=this.view.getState(e);return null!=(e=null!=t?t.style:this.getCellStyle(e))&&"wrap"==e[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(e){var t=this.view.getState(e);return null!=(e=null!=t?t.style:this.getCellStyle(e))&&"hidden"==e[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(e,n,t,a){var i=null;return null!=e&&(null==e.control||n!=e.control.node&&n.parentNode!=e.control.node||(i=this.collapseExpandResource,i=mxResources.get(i)||i),null==i&&null!=e.overlays&&e.overlays.visit(function(e,t){null!=i||n!=t.node&&n.parentNode!=t.node||(i=t.overlay.toString())}),null==i&&(null!=(t=this.selectionCellsHandler.getHandler(e.cell))&&"function"==typeof t.getTooltipForNode&&(i=t.getTooltipForNode(n))),null==i&&(i=this.getTooltipForCell(e.cell))),i},mxGraph.prototype.getTooltipForCell=function(e){return null!=e&&null!=e.getTooltip?e.getTooltip():this.convertValueToString(e)},mxGraph.prototype.getCursorForCell=function(e){return null},mxGraph.prototype.getStartSize=function(e){var t=new mxRectangle,n=this.view.getState(e);return null!=(e=null!=n?n.style:this.getCellStyle(e))&&(n=parseInt(mxUtils.getValue(e,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,!0)?t.height=n:t.width=n),t},mxGraph.prototype.getImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.getVerticalAlign=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(e){this.border=e},mxGraph.prototype.isSwimlane=function(e){var t;if(null!=e&&this.model.getParent(e)!=this.model.getRoot()&&(null!=(t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e))&&!this.model.isEdge(e)))return t[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE;return!1},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(e){this.resizeContainer=e},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(e){this.enabled=e},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(e){this.escapeEnabled=e},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(e){this.invokesStopCellEditing=e},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(e){this.enterStopsCellEditing=e},mxGraph.prototype.isCellLocked=function(e){var t=this.model.getGeometry(e);return this.isCellsLocked()||null!=t&&this.model.isVertex(e)&&t.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(e){this.cellsLocked=e},mxGraph.prototype.getCloneableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellCloneable(e)}))},mxGraph.prototype.isCellCloneable=function(e){var t=this.view.getState(e);return e=null!=t?t.style:this.getCellStyle(e),this.isCellsCloneable()&&0!=e[mxConstants.STYLE_CLONEABLE]},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(e){this.cellsCloneable=e},mxGraph.prototype.getExportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canExportCell(e)}))},mxGraph.prototype.canExportCell=function(e){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canImportCell(e)}))},mxGraph.prototype.canImportCell=function(e){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(e){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(e){this.cellsSelectable=e},mxGraph.prototype.getDeletableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellDeletable(e)}))},mxGraph.prototype.isCellDeletable=function(e){var t=this.view.getState(e);return e=null!=t?t.style:this.getCellStyle(e),this.isCellsDeletable()&&0!=e[mxConstants.STYLE_DELETABLE]},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(e){this.cellsDeletable=e},mxGraph.prototype.isLabelMovable=function(e){return!this.isCellLocked(e)&&(this.model.isEdge(e)&&this.edgeLabelsMovable||this.model.isVertex(e)&&this.vertexLabelsMovable)},mxGraph.prototype.getMovableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellMovable(e)}))},mxGraph.prototype.isCellMovable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsMovable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_MOVABLE]},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(e){this.cellsMovable=e},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(e){this.portsEnabled=e},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(e){this.gridSize=e},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(e){this.tolerance=e},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(e){this.vertexLabelsMovable=e},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(e){this.edgeLabelsMovable=e},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(e){this.swimlaneNesting=e},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(e){this.swimlaneSelectionEnabled=e},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(e){this.multigraph=e},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(e){this.allowDanglingEdges=e},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(e){this.connectableEdges=e},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(e){this.cloneInvalidEdges=e},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(e){this.allowLoops=e},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(e){this.disconnectOnMove=e},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(e){this.dropEnabled=e},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(e){this.splitEnabled=e},mxGraph.prototype.isCellResizable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsResizable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_RESIZABLE]},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(e){this.cellsResizable=e},mxGraph.prototype.isTerminalPointMovable=function(e,t){return!0},mxGraph.prototype.isCellBendable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsBendable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_BENDABLE]},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(e){this.cellsBendable=e},mxGraph.prototype.isCellEditable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsEditable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(e){this.cellsEditable=e},mxGraph.prototype.isCellDisconnectable=function(e,t,n){return this.isCellsDisconnectable()&&!this.isCellLocked(e)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(e){this.cellsDisconnectable=e},mxGraph.prototype.isValidSource=function(e){return null==e&&this.allowDanglingEdges||null!=e&&(!this.model.isEdge(e)||this.connectableEdges)&&this.isCellConnectable(e)},mxGraph.prototype.isValidTarget=function(e){return this.isValidSource(e)},mxGraph.prototype.isValidConnection=function(e,t){return this.isValidSource(e)&&this.isValidTarget(t)},mxGraph.prototype.setConnectable=function(e){this.connectionHandler.setEnabled(e)},mxGraph.prototype.isConnectable=function(e){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(e){this.tooltipHandler.setEnabled(e)},mxGraph.prototype.setPanning=function(e){this.panningHandler.panningEnabled=e},mxGraph.prototype.isEditing=function(e){if(null!=this.cellEditor){var t=this.cellEditor.getEditingCell();return null==e?null!=t:e==t}return!1},mxGraph.prototype.isAutoSizeCell=function(e){var t=this.view.getState(e);return e=null!=t?t.style:this.getCellStyle(e),this.isAutoSizeCells()||1==e[mxConstants.STYLE_AUTOSIZE]},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(e){this.autoSizeCells=e},mxGraph.prototype.isExtendParent=function(e){return!this.getModel().isEdge(e)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(e){this.extendParents=e},mxGraph.prototype.isExtendParentsOnAdd=function(){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(e){this.extendParentsOnAdd=e},mxGraph.prototype.isConstrainChild=function(e){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(e))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(e){this.constrainChildren=e},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(e){this.allowNegativeCoordinates=e},mxGraph.prototype.getOverlap=function(e){return this.isAllowOverlapParent(e)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(e){return!1},mxGraph.prototype.getFoldableCells=function(e,t){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellFoldable(e,t)}))},mxGraph.prototype.isCellFoldable=function(e,t){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return 0<this.model.getChildCount(e)&&0!=n[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(e,t,n){return null!=e&&(this.isSplitEnabled()&&this.isSplitTarget(e,t,n)||!this.model.isEdge(e)&&(this.isSwimlane(e)||0<this.model.getChildCount(e)&&!this.isCellCollapsed(e)))},mxGraph.prototype.isSplitTarget=function(e,t,n){return!(!this.model.isEdge(e)||null==t||1!=t.length||!this.isCellConnectable(t[0])||null!=this.getEdgeValidationError(e,this.model.getTerminal(e,!0),t[0]))&&(n=this.model.getTerminal(e,!0),e=this.model.getTerminal(e,!1),!this.model.isAncestor(t[0],n)&&!this.model.isAncestor(t[0],e))},mxGraph.prototype.getDropTarget=function(e,t,n){if(!this.isSwimlaneNesting())for(var a=0;a<e.length;a++)if(this.isSwimlane(e[a]))return null;if((a=mxUtils.convertPoint(this.container,mxEvent.getClientX(t),mxEvent.getClientY(t))).x-=this.panDx,a.y-=this.panDy,a=this.getSwimlaneAt(a.x,a.y),null==n)n=a;else if(null!=a){for(var i=this.model.getParent(a);null!=i&&this.isSwimlane(i)&&i!=n;)i=this.model.getParent(i);i==n&&(n=a)}for(;null!=n&&!this.isValidDropTarget(n,e,t)&&!this.model.isLayer(n);)n=this.model.getParent(n);return!this.model.isLayer(n)&&mxUtils.indexOf(e,n)<0?n:null},mxGraph.prototype.getDefaultParent=function(){var e=this.defaultParent;return null==e&&(null==(e=this.getCurrentRoot())&&(e=this.model.getRoot(),e=this.model.getChildAt(e,0))),e},mxGraph.prototype.setDefaultParent=function(e){this.defaultParent=e},mxGraph.prototype.getSwimlane=function(e){for(;null!=e&&!this.isSwimlane(e);)e=this.model.getParent(e);return e},mxGraph.prototype.getSwimlaneAt=function(e,t,n){if(null!=(n=n||this.getDefaultParent()))for(var a=this.model.getChildCount(n),i=0;i<a;i++){var o=this.model.getChildAt(n,i),s=this.getSwimlaneAt(e,t,o);if(null!=s)return s;if(this.isSwimlane(o)&&(s=this.view.getState(o),this.intersects(s,e,t)))return o}return null},mxGraph.prototype.getCellAt=function(e,t,n,a,i){if(a=null==a||a,i=null==i||i,null!=(n=null!=n?n:this.getDefaultParent()))for(var o=this.model.getChildCount(n)-1;0<=o;o--){var s=this.model.getChildAt(n,o),r=this.getCellAt(e,t,s,a,i);if(null!=r)return r;if(this.isCellVisible(s)&&(i&&this.model.isEdge(s)||a&&this.model.isVertex(s))&&(r=this.view.getState(s),this.intersects(r,e,t)))return s}return null},mxGraph.prototype.intersects=function(e,t,n){if(null!=e){var a=e.absolutePoints;if(null!=a){e=this.tolerance*this.tolerance;for(var i=a[0],o=1;o<a.length;o++){var s=a[o];if(mxUtils.ptSegDistSq(i.x,i.y,s.x,s.y,t,n)<=e)return!0;i=s}}else if(0!=(i=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(a=Math.cos(-i),i=Math.sin(-i),o=new mxPoint(e.getCenterX(),e.getCenterY()),t=(i=mxUtils.getRotatedPoint(new mxPoint(t,n),a,i,o)).x,n=i.y),mxUtils.contains(e,t,n))return!0}return!1},mxGraph.prototype.hitsSwimlaneContent=function(e,t,n){var a=this.getView().getState(e);if(e=this.getStartSize(e),null!=a){var i=this.getView().getScale();if(t-=a.x,n-=a.y,0<e.width&&0<t&&t>e.width*i||0<e.height&&0<n&&n>e.height*i)return!0}return!1},mxGraph.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraph.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraph.prototype.getChildCells=function(e,t,n){for(e=null!=e?e:this.getDefaultParent(),e=this.model.getChildCells(e,null!=t&&t,null!=n&&n),t=[],n=0;n<e.length;n++)this.isCellVisible(e[n])&&t.push(e[n]);return t},mxGraph.prototype.getConnections=function(e,t){return this.getEdges(e,t,!0,!0,!1)},mxGraph.prototype.getIncomingEdges=function(e,t){return this.getEdges(e,t,!0,!1,!1)},mxGraph.prototype.getOutgoingEdges=function(e,t){return this.getEdges(e,t,!1,!0,!1)},mxGraph.prototype.getEdges=function(e,t,n,a,i,o){n=null==n||n,a=null==a||a,i=null==i||i,o=null!=o&&o;for(var s=[],r=this.isCellCollapsed(e),l=this.model.getChildCount(e),d=0;d<l;d++){var c=this.model.getChildAt(e,d);!r&&this.isCellVisible(c)||(s=s.concat(this.model.getEdges(c,n,a)))}for(s=s.concat(this.model.getEdges(e,n,a)),r=[],d=0;d<s.length;d++)l=null!=(c=this.view.getState(s[d]))?c.getVisibleTerminal(!0):this.view.getVisibleTerminal(s[d],!0),c=null!=c?c.getVisibleTerminal(!1):this.view.getVisibleTerminal(s[d],!1),(i&&l==c||l!=c&&(n&&c==e&&(null==t||this.isValidAncestor(l,t,o))||a&&l==e&&(null==t||this.isValidAncestor(c,t,o))))&&r.push(s[d]);return r},mxGraph.prototype.isValidAncestor=function(e,t,n){return n?this.model.isAncestor(t,e):this.model.getParent(e)==t},mxGraph.prototype.getOpposites=function(e,t,n,a){n=null==n||n,a=null==a||a;var i=[],o={};if(null!=e)for(var s=0;s<e.length;s++){var r=null!=(l=this.view.getState(e[s]))?l.getVisibleTerminal(!0):this.view.getVisibleTerminal(e[s],!0),l=null!=l?l.getVisibleTerminal(!1):this.view.getVisibleTerminal(e[s],!1);if(r==t&&null!=l&&l!=t&&a){var d=mxCellPath.create(l);null==o[d]&&(o[d]=l,i.push(l))}else l==t&&null!=r&&r!=t&&n&&(null==o[d=mxCellPath.create(r)]&&(o[d]=r,i.push(r)))}return i},mxGraph.prototype.getEdgesBetween=function(e,t,n){n=null!=n&&n;for(var a=this.getEdges(e),i=[],o=0;o<a.length;o++){var s=null!=(r=this.view.getState(a[o]))?r.getVisibleTerminal(!0):this.view.getVisibleTerminal(a[o],!0),r=null!=r?r.getVisibleTerminal(!1):this.view.getVisibleTerminal(a[o],!1);(s==e&&r==t||!n&&s==t&&r==e)&&i.push(a[o])}return i},mxGraph.prototype.getPointForEvent=function(e,t){var n=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a=this.view.scale,i=this.view.translate,o=0!=t?this.gridSize/2:0;return n.x=this.snap(n.x/a-i.x-o),n.y=this.snap(n.y/a-i.y-o),n},mxGraph.prototype.getCells=function(e,t,n,a,i,o){if(o=null!=o?o:[],0<n||0<a){var s=e+n,r=t+a;if(null!=(i=i||this.getDefaultParent()))for(var l=this.model.getChildCount(i),d=0;d<l;d++){var c=this.model.getChildAt(i,d),m=this.view.getState(c);if(this.isCellVisible(c)&&null!=m){var u=m;0!=(m=mxUtils.getValue(m.style,mxConstants.STYLE_ROTATION)||0)&&(u=mxUtils.getBoundingBox(u,m)),u.x>=e&&u.y+u.height<=r&&u.y>=t&&u.x+u.width<=s?o.push(c):this.getCells(e,t,n,a,c,o)}}}return o},mxGraph.prototype.getCellsBeyond=function(e,t,n,a,i){var o=[];if((a||i)&&(null==n&&(n=this.getDefaultParent()),null!=n))for(var s=this.model.getChildCount(n),r=0;r<s;r++){var l=this.model.getChildAt(n,r),d=this.view.getState(l);this.isCellVisible(l)&&null!=d&&(!a||d.x>=e)&&(!i||d.y>=t)&&o.push(l)}return o},mxGraph.prototype.findTreeRoots=function(e,t,n){t=null!=t&&t,n=null!=n&&n;var a=[];if(null!=e){for(var i=this.getModel(),o=i.getChildCount(e),s=null,r=0,l=0;l<o;l++){var d=i.getChildAt(e,l);if(this.model.isVertex(d)&&this.isCellVisible(d)){for(var c=this.getConnections(d,t?e:null),m=0,u=0,p=0;p<c.length;p++)this.view.getVisibleTerminal(c[p],!0)==d?m++:u++;(n&&0==m&&0<u||!n&&0==u&&0<m)&&a.push(d),r<(c=n?u-m:m-u)&&(r=c,s=d)}}0==a.length&&null!=s&&a.push(s)}return a},mxGraph.prototype.traverse=function(e,t,n,a,i){if(null!=n&&null!=e){t=null==t||t,i=i||[];var o=mxCellPath.create(e);if(null==i[o]&&(null==(a=n(i[o]=e,a))||a)&&0<(a=this.model.getEdgeCount(e)))for(o=0;o<a;o++){var s=this.model.getEdgeAt(e,o),r=this.model.getTerminal(s,!0)==e;t&&!r||(r=this.model.getTerminal(s,!r),this.traverse(r,t,n,s,i))}}},mxGraph.prototype.isCellSelected=function(e){return this.getSelectionModel().isSelected(e)},mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()},mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()},mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length},mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]},mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()},mxGraph.prototype.setSelectionCell=function(e){this.getSelectionModel().setCell(e)},mxGraph.prototype.setSelectionCells=function(e){this.getSelectionModel().setCells(e)},mxGraph.prototype.addSelectionCell=function(e){this.getSelectionModel().addCell(e)},mxGraph.prototype.addSelectionCells=function(e){this.getSelectionModel().addCells(e)},mxGraph.prototype.removeSelectionCell=function(e){this.getSelectionModel().removeCell(e)},mxGraph.prototype.removeSelectionCells=function(e){this.getSelectionModel().removeCells(e)},mxGraph.prototype.selectRegion=function(e,t){var n=this.getCells(e.x,e.y,e.width,e.height);return this.selectCellsForEvent(n,t),n},mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)},mxGraph.prototype.selectPreviousCell=function(){this.selectCell()},mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)},mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)},mxGraph.prototype.selectCell=function(e,t,n){var a=0<(i=this.selectionModel).cells.length?i.cells[0]:null;1<i.cells.length&&i.clear();var i=null!=a?this.model.getParent(a):this.getDefaultParent(),o=this.model.getChildCount(i);null==a&&0<o?(e=this.model.getChildAt(i,0),this.setSelectionCell(e)):null!=a&&!t||null==this.view.getState(i)||null==this.model.getGeometry(i)?null!=a&&n?0<this.model.getChildCount(a)&&(e=this.model.getChildAt(a,0),this.setSelectionCell(e)):0<o&&(t=i.getIndex(a),e?(t++,e=this.model.getChildAt(i,t%o)):(t--,e=this.model.getChildAt(i,t<0?o-1:t)),this.setSelectionCell(e)):this.getCurrentRoot()!=i&&this.setSelectionCell(i)},mxGraph.prototype.selectAll=function(e){e=e||this.getDefaultParent(),null!=(e=this.model.getChildren(e))&&this.setSelectionCells(e)},mxGraph.prototype.selectVertices=function(e){this.selectCells(!0,!1,e)},mxGraph.prototype.selectEdges=function(e){this.selectCells(!1,!0,e)},mxGraph.prototype.selectCells=function(t,n,e){e=e||this.getDefaultParent();var a=mxUtils.bind(this,function(e){return null!=this.view.getState(e)&&0==this.model.getChildCount(e)&&(this.model.isVertex(e)&&t||this.model.isEdge(e)&&n)});e=this.model.filterDescendants(a,e),this.setSelectionCells(e)},mxGraph.prototype.selectCellForEvent=function(e,t){var n=this.isCellSelected(e);this.isToggleEvent(t)?n?this.removeSelectionCell(e):this.addSelectionCell(e):(!n||1!=this.getSelectionCount())&&this.setSelectionCell(e)},mxGraph.prototype.selectCellsForEvent=function(e,t){this.isToggleEvent(t)?this.addSelectionCells(e):this.setSelectionCells(e)},mxGraph.prototype.createHandler=function(e){var t=null;return null!=e&&(this.model.isEdge(e.cell)?(t=this.view.getEdgeStyle(e),t=this.isLoop(e)||t==mxEdgeStyle.ElbowConnector||t==mxEdgeStyle.SideToSide||t==mxEdgeStyle.TopToBottom?new mxElbowEdgeHandler(e):t==mxEdgeStyle.SegmentConnector||t==mxEdgeStyle.OrthConnector?new mxEdgeSegmentHandler(e):new mxEdgeHandler(e)):t=new mxVertexHandler(e)),t},mxGraph.prototype.addMouseListener=function(e){null==this.mouseListeners&&(this.mouseListeners=[]),this.mouseListeners.push(e)},mxGraph.prototype.removeMouseListener=function(e){if(null!=this.mouseListeners)for(var t=0;t<this.mouseListeners.length;t++)if(this.mouseListeners[t]==e){this.mouseListeners.splice(t,1);break}},mxGraph.prototype.updateMouseEvent=function(e){if(null==e.graphX||null==e.graphY){var t=mxUtils.convertPoint(this.container,e.getX(),e.getY());e.graphX=t.x-this.panDx,e.graphY=t.y-this.panDy}},mxGraph.prototype.fireMouseEvent=function(e,t,n){if(null==n&&(n=this),this.updateMouseEvent(t),e==mxEvent.MOUSE_DOWN&&(this.isMouseDown=!0),mxClient.IS_TOUCH&&this.doubleTapEnabled&&e==mxEvent.MOUSE_DOWN){var a=(new Date).getTime();a-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-t.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-t.getY())<this.doubleTapTolerance?(this.lastTouchTime=0,this.dblClick(t.getEvent(),t.getCell()),t.getEvent().cancelBubble=!0):(this.lastTouchX=t.getX(),this.lastTouchY=t.getY(),this.lastTouchTime=a)}if(a=2!=t.getEvent().detail,mxClient.IS_IE&&"CSS1Compat"==document.compatMode&&((null!=this.lastMouseX&&Math.abs(this.lastMouseX-t.getX())>this.doubleTapTolerance||null!=this.lastMouseY&&Math.abs(this.lastMouseY-t.getY())>this.doubleTapTolerance)&&(a=!0),e==mxEvent.MOUSE_UP&&(this.lastMouseX=t.getX(),this.lastMouseY=t.getY())),(e!=mxEvent.MOUSE_UP||this.isMouseDown)&&a){if(e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1),!this.isEditing()&&(mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||mxClient.IS_IE&&mxClient.IS_SVG||t.getEvent().target!=this.container)){if(e==mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&this.scrollPointToVisible(t.getGraphX(),t.getGraphY(),this.autoExtend),null!=this.mouseListeners)for(n=[n,t],t.getEvent().returnValue=!0,a=0;a<this.mouseListeners.length;a++){var i=this.mouseListeners[a];e==mxEvent.MOUSE_DOWN?i.mouseDown.apply(i,n):e==mxEvent.MOUSE_MOVE?i.mouseMove.apply(i,n):e==mxEvent.MOUSE_UP&&i.mouseUp.apply(i,n)}e==mxEvent.MOUSE_UP&&this.click(t)}}else e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1)},mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&this.cellEditor.destroy(),null!=this.view&&this.view.destroy(),null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)},mxCellOverlay.prototype=new mxEventSource,mxCellOverlay.prototype.constructor=mxCellOverlay,mxCellOverlay.prototype.image=null,mxCellOverlay.prototype.tooltip=null,mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT,mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM,mxCellOverlay.prototype.offset=null,mxCellOverlay.prototype.cursor=null,mxCellOverlay.prototype.defaultOverlap=.5,mxCellOverlay.prototype.getBounds=function(e){var t=e.view.graph.getModel().isEdge(e.cell),n=e.view.scale,a=null,i=this.image.width,o=this.image.height;return t?1==(t=e.absolutePoints).length%2?a=t[Math.floor(t.length/2)]:(e=t[(a=t.length/2)-1],t=t[a],a=new mxPoint(e.x+(t.x-e.x)/2,e.y+(t.y-e.y)/2)):((a=new mxPoint).x=this.align==mxConstants.ALIGN_LEFT?e.x:this.align==mxConstants.ALIGN_CENTER?e.x+e.width/2:e.x+e.width,a.y=this.verticalAlign==mxConstants.ALIGN_TOP?e.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE?e.y+e.height/2:e.y+e.height),new mxRectangle(Math.round(a.x-(i*this.defaultOverlap-this.offset.x)*n),Math.round(a.y-(o*this.defaultOverlap-this.offset.y)*n),i*n,o*n)},mxCellOverlay.prototype.toString=function(){return this.tooltip},mxOutline.prototype.source=null,mxOutline.prototype.outline=null,mxOutline.prototype.graphRenderHint=mxConstants.RENDERING_HINT_FASTER,mxOutline.prototype.enabled=!0,mxOutline.prototype.showViewport=!0,mxOutline.prototype.border=10,mxOutline.prototype.sizerSize=8,mxOutline.prototype.updateOnPan=!1,mxOutline.prototype.sizerImage=null,mxOutline.prototype.suspended=!1,mxOutline.prototype.init=function(e){this.outline=new mxGraph(e,this.source.getModel(),this.graphRenderHint,this.source.getStylesheet()),this.outline.foldingEnabled=!1,this.outline.autoScroll=!1;var t=this.outline.graphModelChanged;this.outline.graphModelChanged=mxUtils.bind(this,function(e){!this.suspended&&null!=this.outline&&t.apply(this.outline,arguments)}),mxClient.IS_SVG&&((e=this.outline.getView().getCanvas().parentNode).setAttribute("shape-rendering","optimizeSpeed"),e.setAttribute("image-rendering","optimizeSpeed")),this.outline.labelsVisible=!1,this.outline.setEnabled(!1),this.updateHandler=mxUtils.bind(this,function(e,t){!this.suspended&&!this.active&&this.update()}),this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler),this.outline.addMouseListener(this),(e=this.source.getView()).addListener(mxEvent.SCALE,this.updateHandler),e.addListener(mxEvent.TRANSLATE,this.updateHandler),e.addListener(mxEvent.SCALE_AND_TRANSLATE,this.updateHandler),e.addListener(mxEvent.DOWN,this.updateHandler),e.addListener(mxEvent.UP,this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.panHandler=mxUtils.bind(this,function(e){this.updateOnPan&&this.updateHandler.apply(this,arguments)}),this.source.addListener(mxEvent.PAN,this.panHandler),this.refreshHandler=mxUtils.bind(this,function(e){this.outline.setStylesheet(this.source.getStylesheet()),this.outline.refresh()}),this.source.addListener(mxEvent.REFRESH,this.refreshHandler),this.bounds=new mxRectangle(0,0,0,0),this.selectionBorder=new mxRectangleShape(this.bounds,null,mxConstants.OUTLINE_COLOR,mxConstants.OUTLINE_STROKEWIDTH),this.selectionBorder.dialect=this.outline.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.init(this.outline.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.outline),this.selectionBorder.node.style.background="",this.sizer=this.createSizer(),this.sizer.init(this.outline.getView().getOverlayPane()),this.enabled&&(this.sizer.node.style.cursor="pointer"),mxEvent.addListener(this.sizer.node,mxClient.IS_TOUCH?"touchstart":"mousedown",mxUtils.bind(this,function(e){this.outline.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))})),this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display,this.selectionBorder.node.style.cursor="move",this.update(!1)},mxOutline.prototype.isEnabled=function(){return this.enabled},mxOutline.prototype.setEnabled=function(e){this.enabled=e},mxOutline.prototype.setZoomEnabled=function(e){this.sizer.node.style.visibility=e?"visible":"hidden"},mxOutline.prototype.refresh=function(){this.update(!0)},mxOutline.prototype.createSizer=function(){var e=null!=this.sizerImage?new mxImageShape(new mxRectangle(0,0,this.sizerImage.width,this.sizerImage.height),this.sizerImage.src):new mxRectangleShape(new mxRectangle(0,0,this.sizerSize,this.sizerSize),mxConstants.OUTLINE_HANDLE_FILLCOLOR,mxConstants.OUTLINE_HANDLE_STROKECOLOR);return e.dialect=this.outline.dialect,e},mxOutline.prototype.getSourceContainerSize=function(){return new mxRectangle(0,0,this.source.container.scrollWidth,this.source.container.scrollHeight)},mxOutline.prototype.getOutlineOffset=function(e){return null},mxOutline.prototype.update=function(e){if(null!=this.source){var t=this.source.view.scale,n=new mxRectangle((n=this.source.getGraphBounds()).x/t+this.source.panDx,n.y/t+this.source.panDy,n.width/t,n.height/t),a=new mxRectangle(0,0,this.source.container.clientWidth/t,this.source.container.clientHeight/t);(o=n.clone()).add(a);var i=this.getSourceContainerSize(),o=(a=Math.max(i.width/t,o.width),t=Math.max(i.height/t,o.height),Math.max(0,this.outline.container.clientWidth-this.border));i=Math.max(0,this.outline.container.clientHeight-this.border);if(0<(o=Math.min(o/a,i/t))){this.outline.getView().scale!=o&&(this.outline.getView().scale=o,e=!0),(a=this.outline.getView()).currentRoot!=this.source.getView().currentRoot&&a.setCurrentRoot(this.source.getView().currentRoot);i=(t=this.source.view.translate).x+this.source.panDx;var s=t.y+this.source.panDy;null!=(o=this.getOutlineOffset(o))&&(i+=o.x,s+=o.y),n.x<0&&(i-=n.x),n.y<0&&(s-=n.y),a.translate.x==i&&a.translate.y==s||(a.translate.x=i,a.translate.y=s,e=!0);n=a.translate,i=(o=this.source.getView().scale)/a.scale,s=1/a.scale;var r=this.source.container;this.bounds=new mxRectangle((n.x-t.x-this.source.panDx)/s,(n.y-t.y-this.source.panDy)/s,r.clientWidth/i,r.clientHeight/i),this.bounds.x+=this.source.container.scrollLeft*a.scale/o,this.bounds.y+=this.source.container.scrollTop*a.scale/o,(n=this.selectionBorder.bounds).x==this.bounds.x&&n.y==this.bounds.y&&n.width==this.bounds.width&&n.height==this.bounds.height||(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()),n=this.sizer.bounds,a=new mxRectangle(this.bounds.x+this.bounds.width-n.width/2,this.bounds.y+this.bounds.height-n.height/2,n.width,n.height),n.x==a.x&&n.y==a.y&&n.width==a.width&&n.height==a.height||(this.sizer.bounds=a,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw()),e&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(e,t){this.enabled&&this.showViewport&&(this.zoom=t.isSource(this.sizer),this.startX=t.getX(),this.startY=t.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):this.dy0=this.dx0=0),t.consume()},mxOutline.prototype.mouseMove=function(e,t){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var n=t.getX()-this.startX,a=t.getY()-this.startY,i=null;if(this.zoom)a=n/((i=this.source.container).clientWidth/i.clientHeight),i=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+n),Math.max(1,this.bounds.height+a)),this.selectionBorder.bounds=i,this.selectionBorder.redraw();else{var o=this.outline.getView().scale;i=new mxRectangle(this.bounds.x+n,this.bounds.y+a,this.bounds.width,this.bounds.height);this.selectionBorder.bounds=i,this.selectionBorder.redraw(),n=n/o*this.source.getView().scale,a=a/o*this.source.getView().scale,this.source.panGraph(-n-this.dx0,-a-this.dy0)}n=this.sizer.bounds,this.sizer.bounds=new mxRectangle(i.x+i.width-n.width/2,i.y+i.height-n.height/2,n.width,n.height),"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw(),t.consume()}},mxOutline.prototype.mouseUp=function(e,t){if(this.active){var n=t.getX()-this.startX,a=t.getY()-this.startY;if(0<Math.abs(n)||0<Math.abs(a)){if(this.zoom){a=this.selectionBorder.bounds.width;var i=this.source.getView().scale;this.source.zoomTo(i-n*i/a,!1)}else this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)||(this.source.panGraph(0,0),n/=this.outline.getView().scale,a/=this.outline.getView().scale,i=this.source.getView().translate,this.source.getView().setTranslate(i.x-n,i.y-a));this.update(),t.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){null!=this.source&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.source=null),null!=this.outline&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),null!=this.sizer&&(this.sizer.destroy(),this.sizer=null)},mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(e,t,n,a,i,o){var s="";return(this.source&&this.checkTerminal(e,n,t)||!this.source&&this.checkTerminal(e,a,t))&&(null!=this.countError&&(this.source&&(0==this.max||i>=this.max)||!this.source&&(0==this.max||o>=this.max))&&(s+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&0<this.validNeighbors.length&&(this.checkNeighbors(e,t,n,a)||(s+=this.typeError+"\n"))),0<s.length?s:null},mxMultiplicity.prototype.checkNeighbors=function(e,t,n,a){t=e.model.getValue(n),a=e.model.getValue(a),n=!this.validNeighborsAllowed;for(var i=this.validNeighbors,o=0;o<i.length;o++){if(this.source&&this.checkType(e,a,i[o])){n=this.validNeighborsAllowed;break}if(!this.source&&this.checkType(e,t,i[o])){n=this.validNeighborsAllowed;break}}return n},mxMultiplicity.prototype.checkTerminal=function(e,t,n){return t=e.model.getValue(t),this.checkType(e,t,this.type,this.attr,this.value)},mxMultiplicity.prototype.checkType=function(e,t,n,a,i){return null!=t&&(isNaN(t.nodeType)?t==n:mxUtils.isNode(t,n,a,i))},mxLayoutManager.prototype=new mxEventSource,mxLayoutManager.prototype.constructor=mxLayoutManager,mxLayoutManager.prototype.graph=null,mxLayoutManager.prototype.bubbling=!0,mxLayoutManager.prototype.enabled=!0,mxLayoutManager.prototype.updateHandler=null,mxLayoutManager.prototype.moveHandler=null,mxLayoutManager.prototype.isEnabled=function(){return this.enabled},mxLayoutManager.prototype.setEnabled=function(e){this.enabled=e},mxLayoutManager.prototype.isBubbling=function(){return this.bubbling},mxLayoutManager.prototype.setBubbling=function(e){this.bubbling=e},mxLayoutManager.prototype.getGraph=function(){return this.graph},mxLayoutManager.prototype.setGraph=function(e){if(null!=this.graph){var t=this.graph.getModel();t.removeListener(this.undoHandler),this.graph.removeListener(this.moveHandler)}this.graph=e,null!=this.graph&&((t=this.graph.getModel()).addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler))},mxLayoutManager.prototype.getLayout=function(e){return null},mxLayoutManager.prototype.beforeUndo=function(e){e=this.getCellsForChanges(e.changes);var t=this.getGraph().getModel();if(this.isBubbling())for(var n=t.getParents(e);0<n.length;)e=e.concat(n),n=t.getParents(n);this.layoutCells(mxUtils.sortCells(e,!1))},mxLayoutManager.prototype.cellsMoved=function(e,t){if(null!=e&&null!=t)for(var n=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(t),mxEvent.getClientY(t)),a=this.getGraph().getModel(),i=0;i<e.length;i++){var o=this.getLayout(a.getParent(e[i]));null!=o&&o.moveCell(e[i],n.x,n.y)}},mxLayoutManager.prototype.getCellsForChanges=function(e){for(var t=[],n={},a=0;a<e.length;a++){if((i=e[a])instanceof mxRootChange)return[];for(var i=this.getCellsForChange(i),o=0;o<i.length;o++)if(null!=i[o]){var s=mxCellPath.create(i[o]);null==n[s]&&(n[s]=i[o],t.push(i[o]))}}return t},mxLayoutManager.prototype.getCellsForChange=function(e){var t=this.getGraph().getModel();return e instanceof mxChildChange?[e.child,e.previous,t.getParent(e.child)]:e instanceof mxTerminalChange||e instanceof mxGeometryChange?[e.cell,t.getParent(e.cell)]:[]},mxLayoutManager.prototype.layoutCells=function(e){if(0<e.length){var t=this.getGraph().getModel();t.beginUpdate();try{for(var n=null,a=0;a<e.length;a++)e[a]!=t.getRoot()&&e[a]!=n&&(n=e[a],this.executeLayout(this.getLayout(n),n));this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",e))}finally{t.endUpdate()}}},mxLayoutManager.prototype.executeLayout=function(e,t){null!=e&&null!=t&&e.execute(t)},mxLayoutManager.prototype.destroy=function(){this.setGraph(null)},mxSpaceManager.prototype=new mxEventSource,mxSpaceManager.prototype.constructor=mxSpaceManager,mxSpaceManager.prototype.graph=null,mxSpaceManager.prototype.enabled=!0,mxSpaceManager.prototype.shiftRightwards=!0,mxSpaceManager.prototype.shiftDownwards=!0,mxSpaceManager.prototype.extendParents=!0,mxSpaceManager.prototype.resizeHandler=null,mxSpaceManager.prototype.foldHandler=null,mxSpaceManager.prototype.isCellIgnored=function(e){return!this.getGraph().getModel().isVertex(e)},mxSpaceManager.prototype.isCellShiftable=function(e){return this.getGraph().getModel().isVertex(e)&&this.getGraph().isCellMovable(e)},mxSpaceManager.prototype.isEnabled=function(){return this.enabled},mxSpaceManager.prototype.setEnabled=function(e){this.enabled=e},mxSpaceManager.prototype.isShiftRightwards=function(){return this.shiftRightwards},mxSpaceManager.prototype.setShiftRightwards=function(e){this.shiftRightwards=e},mxSpaceManager.prototype.isShiftDownwards=function(){return this.shiftDownwards},mxSpaceManager.prototype.setShiftDownwards=function(e){this.shiftDownwards=e},mxSpaceManager.prototype.isExtendParents=function(){return this.extendParents},mxSpaceManager.prototype.setExtendParents=function(e){this.extendParents=e},mxSpaceManager.prototype.getGraph=function(){return this.graph},mxSpaceManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.resizeHandler),this.graph.removeListener(this.foldHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.RESIZE_CELLS,this.resizeHandler),this.graph.addListener(mxEvent.FOLD_CELLS,this.foldHandler))},mxSpaceManager.prototype.cellsResized=function(e){if(null!=e){var t=this.graph.getModel();t.beginUpdate();try{for(var n=0;n<e.length;n++)if(!this.isCellIgnored(e[n])){this.cellResized(e[n]);break}}finally{t.endUpdate()}}},mxSpaceManager.prototype.cellResized=function(e){var t=this.getGraph(),n=t.getView(),a=t.getModel(),i=n.getState(e),o=n.getState(a.getParent(e));if(null!=i&&null!=o){var s=this.getCellsToShift(i),r=a.getGeometry(e);if(null!=s&&null!=r){var l=n.translate,d=n.scale,c=(n=i.x-o.origin.x-l.x*d,o=i.y-o.origin.y-l.y*d,l=i.x+i.width,i.y+i.height),m=i.width-r.width*d+n-r.x*d,u=i.height-r.height*d+o-r.y*d,p=1-r.width*d/i.width;i=1-r.height*d/i.height;a.beginUpdate();try{for(r=0;r<s.length;r++)s[r]!=e&&this.isCellShiftable(s[r])&&this.shiftCell(s[r],m,u,n,o,l,c,p,i,this.isExtendParents()&&t.isExtendParent(s[r]))}finally{a.endUpdate()}}}},mxSpaceManager.prototype.shiftCell=function(e,t,n,a,i,o,s,r,l,d){var c=(a=this.getGraph()).getView().getState(e);if(null!=c){var m=a.getModel();if(null!=(p=m.getGeometry(e))){m.beginUpdate();try{if(this.isShiftRightwards())if(c.x>=o)(p=p.clone()).translate(-t,0);else{var u=Math.max(0,c.x-x0);(p=p.clone()).translate(-r*u,0)}if(this.isShiftDownwards())if(c.y>=s)(p=p.clone()).translate(0,-n);else{var p,g=Math.max(0,c.y-i);(p=p.clone()).translate(0,-l*g)}p!=m.getGeometry(e)&&(m.setGeometry(e,p),d&&a.extendParent(e))}finally{m.endUpdate()}}}},mxSpaceManager.prototype.getCellsToShift=function(e){var t=this.getGraph(),n=t.getModel().getParent(e.cell),a=this.isShiftDownwards(),i=this.isShiftRightwards();return t.getCellsBeyond(e.x+(a?0:e.width),e.y+(a&&i?0:e.height),n,i,a)},mxSpaceManager.prototype.destroy=function(){this.setGraph(null)},mxSwimlaneManager.prototype=new mxEventSource,mxSwimlaneManager.prototype.constructor=mxSwimlaneManager,mxSwimlaneManager.prototype.graph=null,mxSwimlaneManager.prototype.enabled=!0,mxSwimlaneManager.prototype.horizontal=!0,mxSwimlaneManager.prototype.addEnabled=!0,mxSwimlaneManager.prototype.resizeEnabled=!0,mxSwimlaneManager.prototype.addHandler=null,mxSwimlaneManager.prototype.resizeHandler=null,mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled},mxSwimlaneManager.prototype.setEnabled=function(e){this.enabled=e},mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal},mxSwimlaneManager.prototype.setHorizontal=function(e){this.horizontal=e},mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled},mxSwimlaneManager.prototype.setAddEnabled=function(e){this.addEnabled=e},mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled},mxSwimlaneManager.prototype.setResizeEnabled=function(e){this.resizeEnabled=e},mxSwimlaneManager.prototype.getGraph=function(){return this.graph},mxSwimlaneManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler),this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler))},mxSwimlaneManager.prototype.isSwimlaneIgnored=function(e){return!this.getGraph().isSwimlane(e)},mxSwimlaneManager.prototype.isCellHorizontal=function(e){if(this.graph.isSwimlane(e)){var t=this.graph.view.getState(e);return e=null!=t?t.style:this.graph.getCellStyle(e),1==mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,1)}return!this.isHorizontal()},mxSwimlaneManager.prototype.cellsAdded=function(e){if(null!=e){var t=this.getGraph().getModel();t.beginUpdate();try{for(var n=0;n<e.length;n++)this.isSwimlaneIgnored(e[n])||this.swimlaneAdded(e[n])}finally{t.endUpdate()}}},mxSwimlaneManager.prototype.swimlaneAdded=function(e){for(var t=this.getGraph().getModel(),n=t.getParent(e),a=t.getChildCount(n),i=null,o=0;o<a;o++){var s=t.getChildAt(n,o);if(s!=e&&!this.isSwimlaneIgnored(s)&&null!=(i=t.getGeometry(s)))break}null!=i&&this.resizeSwimlane(e,i.width,i.height)},mxSwimlaneManager.prototype.cellsResized=function(e){if(null!=e){var t=this.getGraph().getModel();t.beginUpdate();try{for(var n=0;n<e.length;n++)if(!this.isSwimlaneIgnored(e[n])){var a=t.getGeometry(e[n]);if(null!=a){for(var i=new mxRectangle(0,0,a.width,a.height),o=s=e[n];null!=o;){var s=o,r=(o=t.getParent(o),this.graph.isSwimlane(o)?this.graph.getStartSize(o):new mxRectangle);i.width+=r.width,i.height+=r.height}this.resizeSwimlane(s,i.width,i.height)}}}finally{t.endUpdate()}}},mxSwimlaneManager.prototype.resizeSwimlane=function(e,t,n){var a=this.getGraph().getModel();a.beginUpdate();try{if(!this.isSwimlaneIgnored(e))if(null!=(r=a.getGeometry(e))){var i=this.isCellHorizontal(e);(i&&r.height!=n||!i&&r.width!=t)&&(r=r.clone(),i?r.height=n:r.width=t,a.setGeometry(e,r))}var o=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle;t-=o.width,n-=o.height;for(var s=a.getChildCount(e),r=0;r<s;r++){var l=a.getChildAt(e,r);this.resizeSwimlane(l,t,n)}}finally{a.endUpdate()}},mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)},mxTemporaryCellStates.prototype.view=null,mxTemporaryCellStates.prototype.oldStates=null,mxTemporaryCellStates.prototype.oldBounds=null,mxTemporaryCellStates.prototype.oldScale=null,mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale),this.view.setStates(this.oldStates),this.view.setGraphBounds(this.oldBounds)},mxCellStatePreview.prototype.graph=null,mxCellStatePreview.prototype.deltas=null,mxCellStatePreview.prototype.count=0,mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count},mxCellStatePreview.prototype.moveState=function(e,t,n,a,i){a=null==a||a,i=null==i||i;var o=mxCellPath.create(e.cell),s=this.deltas[o];return null==s?(s=new mxPoint(t,n),this.deltas[o]=s,this.count++):a?(s.X+=t,s.Y+=n):(s.X=t,s.Y=n),i&&this.addEdges(e),s},mxCellStatePreview.prototype.show=function(e){var t,n=this.graph.getModel(),a=n.getRoot();for(t in this.deltas){var i=mxCellPath.resolve(a,t),o=this.graph.view.getState(i),s=this.deltas[t];i=this.graph.view.getState(n.getParent(i));this.translateState(i,o,s.x,s.y)}for(t in this.deltas)i=mxCellPath.resolve(a,t),o=this.graph.view.getState(i),s=this.deltas[t],i=this.graph.view.getState(n.getParent(i)),this.revalidateState(i,o,s.x,s.y,e)},mxCellStatePreview.prototype.translateState=function(e,t,n,a){if(null!=t){var i=this.graph.getModel();if(i.isVertex(t.cell)){t.invalid=!0,this.graph.view.validateBounds(e,t.cell),e=i.getGeometry(t.cell);var o=mxCellPath.create(t.cell);0==n&&0==a||null==e||e.relative&&null==this.deltas[o]||(t.x+=n,t.y+=a)}for(e=i.getChildCount(t.cell),o=0;o<e;o++)this.translateState(t,this.graph.view.getState(i.getChildAt(t.cell,o)),n,a)}},mxCellStatePreview.prototype.revalidateState=function(e,t,n,a,i){if(null!=t){t.invalid=!0,this.graph.view.validatePoints(e,t.cell);var o=mxCellPath.create(t.cell),s=this.graph.getModel(),r=this.graph.getCellGeometry(t.cell);for(0==n&&0==a||null==r||!r.relative||!s.isVertex(t.cell)||null!=e&&!s.isVertex(e.cell)&&null==this.deltas[o]||(t.x+=n,t.y+=a,this.graph.cellRenderer.redraw(t)),null!=i&&i(t),e=s.getChildCount(t.cell),o=0;o<e;o++)this.revalidateState(t,this.graph.view.getState(s.getChildAt(t.cell,o)),n,a,i)}},mxCellStatePreview.prototype.addEdges=function(e){for(var t=this.graph.getModel(),n=t.getEdgeCount(e.cell),a=0;a<n;a++){var i=this.graph.view.getState(t.getEdgeAt(e.cell,a));null!=i&&this.moveState(i,0,0)}},mxConnectionConstraint.prototype.point=null,mxConnectionConstraint.prototype.perimeter=null,mxGraphHandler.prototype.graph=null,mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50,mxGraphHandler.prototype.enabled=!0,mxGraphHandler.prototype.highlightEnabled=!0,mxGraphHandler.prototype.cloneEnabled=!0,mxGraphHandler.prototype.moveEnabled=!0,mxGraphHandler.prototype.guidesEnabled=!1,mxGraphHandler.prototype.guide=null,mxGraphHandler.prototype.currentDx=null,mxGraphHandler.prototype.currentDy=null,mxGraphHandler.prototype.updateCursor=!0,mxGraphHandler.prototype.selectEnabled=!0,mxGraphHandler.prototype.removeCellsFromParent=!0,mxGraphHandler.prototype.connectOnDrop=!1,mxGraphHandler.prototype.scrollOnMove=!0,mxGraphHandler.prototype.minimumSize=6,mxGraphHandler.prototype.previewColor="black",mxGraphHandler.prototype.htmlPreview=!1,mxGraphHandler.prototype.shape=null,mxGraphHandler.prototype.scaleGrid=!1,mxGraphHandler.prototype.rotationEnabled=!0,mxGraphHandler.prototype.isEnabled=function(){return this.enabled},mxGraphHandler.prototype.setEnabled=function(e){this.enabled=e},mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled},mxGraphHandler.prototype.setCloneEnabled=function(e){this.cloneEnabled=e},mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled},mxGraphHandler.prototype.setMoveEnabled=function(e){this.moveEnabled=e},mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled},mxGraphHandler.prototype.setSelectEnabled=function(e){this.selectEnabled=e},mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent},mxGraphHandler.prototype.setRemoveCellsFromParent=function(e){this.removeCellsFromParent=e},mxGraphHandler.prototype.getInitialCellForEvent=function(e){return e.getCell()},mxGraphHandler.prototype.isDelayedSelection=function(e){return this.graph.isCellSelected(e)},mxGraphHandler.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(t.getEvent())&&null!=t.getState()){var n=this.getInitialCellForEvent(t);if(this.cell=null,this.delayedSelection=this.isDelayedSelection(n),this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(n,t.getEvent()),this.isMoveEnabled()){var a=this.graph.model,i=a.getGeometry(n);this.graph.isCellMovable(n)&&(!a.isEdge(n)||1<this.graph.getSelectionCount()||null!=i.points&&0<i.points.length||null==a.getTerminal(n,!0)||null==a.getTerminal(n,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(t.getEvent())&&this.graph.isCellsCloneable())&&this.start(n,t.getX(),t.getY()),this.cellWasClicked=!0,!mxClient.IS_SF&&!mxClient.IS_GC||"SELECT"!=t.getSource().nodeName?t.consume():mxClient.IS_SF&&"SELECT"==t.getSource().nodeName&&(this.cellWasClicked=!1,this.first=null)}}},mxGraphHandler.prototype.getGuideStates=function(){var e=this.graph.getDefaultParent(),t=this.graph.getModel(),n=mxUtils.bind(this,function(e){return null!=this.graph.view.getState(e)&&t.isVertex(e)&&null!=t.getGeometry(e)&&!t.getGeometry(e).relative});return this.graph.view.getCellStates(t.filterDescendants(n,e))},mxGraphHandler.prototype.getCells=function(e){return!this.delayedSelection&&this.graph.isCellMovable(e)?[e]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(e){return null!=(e=this.getBoundingBox(e))&&(e.grow(-1,-1),e.width<this.minimumSize&&(e.x-=(this.minimumSize-e.width)/2,e.width=this.minimumSize),e.height<this.minimumSize&&(e.y-=(this.minimumSize-e.height)/2,e.height=this.minimumSize)),e},mxGraphHandler.prototype.getBoundingBox=function(e){var t=null;if(null!=e&&0<e.length)for(var n=this.graph.getModel(),a=0;a<e.length;a++)if(n.isVertex(e[a])||n.isEdge(e[a])){var i=this.graph.view.getState(e[a]);if(null!=i){var o=i;n.isVertex(e[a])&&null!=i.shape&&null!=i.shape.boundingBox&&(o=i.shape.boundingBox),null==t?t=new mxRectangle(o.x,o.y,o.width,o.height):t.add(o)}}return t},mxGraphHandler.prototype.createPreviewShape=function(e){return(e=new mxRectangleShape(e,null,this.previewColor)).isDashed=!0,this.htmlPreview?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.pointerEvents=!1),e},mxGraphHandler.prototype.start=function(e,t,n){this.cell=e,this.first=mxUtils.convertPoint(this.graph.container,t,n),this.cells=this.getCells(this.cell),this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),this.guidesEnabled&&(this.guide=new mxGuide(this.graph,this.getGuideStates()))},mxGraphHandler.prototype.useGuidesForEvent=function(e){return null==this.guide||this.guide.isEnabledForEvent(e.getEvent())},mxGraphHandler.prototype.snap=function(e){var t=this.scaleGrid?this.graph.view.scale:1;return e.x=this.graph.snap(e.x/t)*t,e.y=this.graph.snap(e.y/t)*t,e},mxGraphHandler.prototype.mouseMove=function(e,t){var n=this.graph;if(!t.isConsumed()&&n.isMouseDown&&null!=this.cell&&null!=this.first&&null!=this.bounds){var a=(o=mxUtils.convertPoint(n.container,t.getX(),t.getY())).x-this.first.x,i=o.y-this.first.y,o=n.tolerance;if(null!=this.shape||Math.abs(a)>o||Math.abs(i)>o){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3)),null==this.shape&&(this.shape=this.createPreviewShape(this.bounds));var s=n.isGridEnabledEvent(t.getEvent());o=!0;if(null!=this.guide&&this.useGuidesForEvent(t))o=!1,a=(i=this.guide.move(this.bounds,new mxPoint(a,i),s)).x,i=i.y;else if(s){var r=n.getView().translate,l=n.getView().scale;s=this.bounds.x-(n.snap(this.bounds.x/l-r.x)+r.x)*l,r=this.bounds.y-(n.snap(this.bounds.y/l-r.y)+r.y)*l,a=(i=this.snap(new mxPoint(a,i))).x-s,i=i.y-r}for(null!=this.guide&&o&&this.guide.hide(),n.isConstrainedEvent(t.getEvent())&&(Math.abs(a)>Math.abs(i)?i=0:a=0),this.currentDx=a,this.currentDy=i,this.updatePreviewShape(),o=null,i=t.getCell(),n.isDropEnabled()&&this.highlightEnabled&&(o=n.getDropTarget(this.cells,t.getEvent(),i)),s=o,r=n.getModel();null!=s&&s!=this.cells[0];)s=r.getParent(s);l=n.isCloneEvent(t.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled();var d=!1;null==(a=n.getView().getState(o))||null!=s||r.getParent(this.cell)==o&&!l?(this.target=null,this.connectOnDrop&&null!=i&&1==this.cells.length&&n.getModel().isVertex(i)&&n.isCellConnectable(i)&&(null!=(a=n.getView().getState(i))&&(n=null==n.getEdgeValidationError(null,this.cell,i)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,this.setHighlightColor(n),d=!0))):(this.target!=o&&(this.target=o,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),d=!0),null!=a&&d?this.highlight.highlight(a):this.highlight.hide()}t.consume(),mxEvent.consume(t.getEvent())}else!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||t.isConsumed()||null==t.getState()||n.isMouseDown||(null==(a=n.getCursorForCell(t.getCell()))&&n.isEnabled()&&n.isCellMovable(t.getCell())&&(a=n.getModel().isEdge(t.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),t.getState().setCursor(a),t.consume())},mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx-this.graph.panDx),Math.round(this.pBounds.y+this.currentDy-this.graph.panDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())},mxGraphHandler.prototype.setHighlightColor=function(e){null!=this.highlight&&this.highlight.setHighlightColor(e)},mxGraphHandler.prototype.mouseUp=function(e,t){if(!t.isConsumed()){var n=this.graph;if(null!=this.cell&&null!=this.first&&null!=this.shape&&null!=this.currentDx&&null!=this.currentDy){var a=n.getView().scale,i=n.isCloneEvent(t.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled(),o=this.currentDx/a,s=(a=this.currentDy/a,t.getCell());this.connectOnDrop&&null==this.target&&null!=s&&n.getModel().isVertex(s)&&n.isCellConnectable(s)&&n.isEdgeValid(null,this.cell,s)?n.connectionHandler.connect(this.cell,s,t.getEvent()):(s=this.target,n.isSplitEnabled()&&n.isSplitTarget(s,this.cells,t.getEvent())?n.splitEdge(s,this.cells,null,o,a):this.moveCells(this.cells,o,a,i,this.target,t.getEvent()))}else this.isSelectEnabled()&&this.delayedSelection&&null!=this.cell&&this.selectDelayed(t)}this.cellWasClicked&&t.consume(),this.reset()},mxGraphHandler.prototype.selectDelayed=function(e){this.graph.selectCellForEvent(this.cell,e.getEvent())},mxGraphHandler.prototype.reset=function(){this.destroyShapes(),this.delayedSelection=this.cellWasClicked=!1,this.target=this.cell=this.first=this.guides=this.currentDy=this.currentDx=null},mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,t,n){if(this.graph.getModel().isVertex(e)){if(e=this.graph.getView().getState(e),n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(n),mxEvent.getClientY(n)),0!=(a=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))){t=Math.cos(-a);var a=Math.sin(-a),i=new mxPoint(e.getCenterX(),e.getCenterY());n=mxUtils.getRotatedPoint(n,t,a,i)}return null!=e&&!mxUtils.contains(e,n.x,n.y)}return!1},mxGraphHandler.prototype.moveCells=function(e,t,n,a,i,o){a&&(e=this.graph.getCloneableCells(e)),null==i&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(this.graph.getModel().getParent(this.cell),e,o)&&(i=this.graph.getDefaultParent()),e=this.graph.moveCells(e,t-this.graph.panDx/this.graph.view.scale,n-this.graph.panDy/this.graph.view.scale,a,i,o),this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(e[0]),a&&this.graph.setSelectionCells(e)},mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.guide&&(this.guide.destroy(),this.guide=null),null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)},mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.destroyShapes()},mxPanningHandler.prototype=new mxPopupMenu,mxPanningHandler.prototype.constructor=mxPanningHandler,mxPanningHandler.prototype.graph=null,mxPanningHandler.prototype.triggerX=null,mxPanningHandler.prototype.triggerY=null,mxPanningHandler.prototype.usePopupTrigger=!0,mxPanningHandler.prototype.useLeftButtonForPanning=!1,mxPanningHandler.prototype.selectOnPopup=!0,mxPanningHandler.prototype.clearSelectionOnBackground=!0,mxPanningHandler.prototype.ignoreCell=!1,mxPanningHandler.prototype.previewEnabled=!0,mxPanningHandler.prototype.useGrid=!1,mxPanningHandler.prototype.panningEnabled=!0,mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled},mxPanningHandler.prototype.setPanningEnabled=function(e){this.panningEnabled=e},mxPanningHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this),mxEvent.addListener(this.div,mxClient.IS_TOUCH?"touchmove":"mousemove",mxUtils.bind(this,function(e){this.graph.tooltipHandler.hide()}))},mxPanningHandler.prototype.isPanningTrigger=function(e){var t=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())&&mxEvent.isLeftMouseButton(t)||mxEvent.isControlDown(t)&&mxEvent.isShiftDown(t)||this.usePopupTrigger&&mxEvent.isPopupTrigger(t)},mxPanningHandler.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.isEnabled()){this.hideMenu(),this.dx0=-this.graph.container.scrollLeft,this.dy0=-this.graph.container.scrollTop;var n=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY());this.triggerX=n.x,this.triggerY=n.y,this.popupTrigger=this.isPopupTrigger(t),this.panningTrigger=this.isPanningEnabled()&&this.isPanningTrigger(t),this.startX=t.getX(),this.startY=t.getY(),this.panningTrigger&&this.consumePanningTrigger(t)}},mxPanningHandler.prototype.consumePanningTrigger=function(e){e.consume()},mxPanningHandler.prototype.mouseMove=function(e,t){var n=t.getX()-this.startX,a=t.getY()-this.startY;if(this.active)this.previewEnabled&&(this.useGrid&&(n=this.graph.snap(n),a=this.graph.snap(a)),this.graph.panGraph(n+this.dx0,a+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",t)),t.consume();else if(this.panningTrigger){var i=this.active;this.active=Math.abs(n)>this.graph.tolerance||Math.abs(a)>this.graph.tolerance,!i&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",t))}},mxPanningHandler.prototype.mouseUp=function(e,t){var n=Math.abs(t.getX()-this.startX),a=Math.abs(t.getY()-this.startY);if(this.active){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){n=t.getX()-this.startX,a=t.getY()-this.startY,this.useGrid&&(n=this.graph.snap(n),a=this.graph.snap(a));var i=this.graph.getView().scale,o=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(o.x+n/i,o.y+a/i)}this.active=!1,this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",t)),t.consume()}else this.popupTrigger&&n<this.graph.tolerance&&a<this.graph.tolerance&&(n=this.getCellForPopupEvent(t),this.graph.isEnabled()&&this.selectOnPopup&&null!=n&&!this.graph.isCellSelected(n)?this.graph.setSelectionCell(n):this.clearSelectionOnBackground&&null==n&&this.graph.clearSelection(),this.graph.tooltipHandler.hide(),a=mxUtils.getScrollOrigin(),a=new mxPoint(t.getX()+a.x,t.getY()+a.y),this.popup(a.x+1,a.y+1,n,t.getEvent()),t.consume());this.popupTrigger=this.panningTrigger=!1},mxPanningHandler.prototype.getCellForPopupEvent=function(e){return e.getCell()},mxPanningHandler.prototype.panGraph=function(e,t){this.graph.getView().setTranslate(e,t)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxPopupMenu.prototype.destroy.apply(this)},mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,mxCellMarker.prototype.validColor=null,mxCellMarker.prototype.invalidColor=null,mxCellMarker.prototype.currentColor=null,mxCellMarker.prototype.validState=null,mxCellMarker.prototype.markedState=null,mxCellMarker.prototype.setEnabled=function(e){this.enabled=e},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(e){this.hotspot=e},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(e){this.hotspotEnabled=e},mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled},mxCellMarker.prototype.hasValidState=function(){return null!=this.validState},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){(this.validState=null)!=this.markedState&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(e){var t=null;if(this.isEnabled()){var n=null!=(t=this.getState(e))&&this.isValidState(t);e=this.getMarkerColor(e.getEvent(),t,n),this.validState=n?t:null,t==this.markedState&&e==this.currentColor||(this.currentColor=e,null!=t&&null!=this.currentColor?(this.markedState=t,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark()))}return t},mxCellMarker.prototype.markCell=function(e,t){var n=this.graph.getView().getState(e);null!=n&&(this.currentColor=null!=t?t:this.validColor,this.markedState=n,this.mark())},mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor),this.highlight.highlight(this.markedState),this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))},mxCellMarker.prototype.unmark=function(){this.mark()},mxCellMarker.prototype.isValidState=function(e){return!0},mxCellMarker.prototype.getMarkerColor=function(e,t,n){return n?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(e){var t=this.graph.getView();return cell=this.getCell(e),null!=(t=this.getStateToMark(t.getState(cell)))&&this.intersects(t,e)?t:null},mxCellMarker.prototype.getCell=function(e){return e.getCell()},mxCellMarker.prototype.getStateToMark=function(e){return e},mxCellMarker.prototype.intersects=function(e,t){return!this.hotspotEnabled||mxUtils.intersectsHotspot(e,t.getGraphX(),t.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,mxSelectionCellsHandler.prototype.refreshHandler=null,mxSelectionCellsHandler.prototype.maxHandlers=100,mxSelectionCellsHandler.prototype.handlers=null,mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled},mxSelectionCellsHandler.prototype.setEnabled=function(e){this.enabled=e},mxSelectionCellsHandler.prototype.getHandler=function(e){return this.handlers.get(e)},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(e,t){t.reset.apply(t)})},mxSelectionCellsHandler.prototype.refresh=function(){var e=this.handlers;this.handlers=new mxDictionary;for(var t=this.graph.getSelectionCells(),n=0;n<t.length;n++){var a=this.graph.view.getState(t[n]);if(null!=a){var i=e.remove(t[n]);null!=i&&(i.state!=a?(i.destroy(),i=null):i.redraw()),null==i&&(i=this.graph.createHandler(a),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",a))),null!=i&&this.handlers.put(t[n],i)}}e.visit(mxUtils.bind(this,function(e,t){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",t.state)),t.destroy()}))},mxSelectionCellsHandler.prototype.mouseDown=function(e,t){if(this.graph.isEnabled()&&this.isEnabled()){var n=[e,t];this.handlers.visit(function(e,t){t.mouseDown.apply(t,n)})}},mxSelectionCellsHandler.prototype.mouseMove=function(e,t){if(this.graph.isEnabled()&&this.isEnabled()){var n=[e,t];this.handlers.visit(function(e,t){t.mouseMove.apply(t,n)})}},mxSelectionCellsHandler.prototype.mouseUp=function(e,t){if(this.graph.isEnabled()&&this.isEnabled()){var n=[e,t];this.handlers.visit(function(e,t){t.mouseUp.apply(t,n)})}},mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.refreshHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.refreshHandler=null)},mxUtils.extend(mxConnectionHandler,mxEventSource),mxConnectionHandler.prototype.graph=null,mxConnectionHandler.prototype.factoryMethod=!0,mxConnectionHandler.prototype.moveIconFront=!1,mxConnectionHandler.prototype.moveIconBack=!1,mxConnectionHandler.prototype.connectImage=null,mxConnectionHandler.prototype.targetConnectImage=!1,mxConnectionHandler.prototype.enabled=!0,mxConnectionHandler.prototype.select=!0,mxConnectionHandler.prototype.createTarget=!1;mxConnectionHandler.prototype.marker=null,mxConnectionHandler.prototype.constraintHandler=null,mxConnectionHandler.prototype.error=null,mxConnectionHandler.prototype.waypointsEnabled=!1,mxConnectionHandler.prototype.tapAndHoldEnabled=!0,mxConnectionHandler.prototype.tapAndHoldDelay=500,mxConnectionHandler.prototype.tapAndHoldInProgress=!1,mxConnectionHandler.prototype.tapAndHoldValid=!1,mxConnectionHandler.prototype.tapAndHoldTolerance=4,mxConnectionHandler.prototype.initialTouchX=0,mxConnectionHandler.prototype.initialTouchY=0,mxConnectionHandler.prototype.ignoreMouseDown=!1,mxConnectionHandler.prototype.first=null,mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET),mxConnectionHandler.prototype.edgeState=null,mxConnectionHandler.prototype.changeHandler=null,mxConnectionHandler.prototype.drillHandler=null,mxConnectionHandler.prototype.mouseDownCounter=0,mxConnectionHandler.prototype.movePreviewAway=mxClient.IS_VML,mxConnectionHandler.prototype.isEnabled=function(){return this.enabled},mxConnectionHandler.prototype.setEnabled=function(e){this.enabled=e},mxConnectionHandler.prototype.isCreateTarget=function(){return this.createTarget},mxConnectionHandler.prototype.setCreateTarget=function(e){this.createTarget=e},mxConnectionHandler.prototype.createShape=function(){var e=new mxPolyline([],mxConstants.INVALID_COLOR);if(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=!0,this.graph.dialect==mxConstants.DIALECT_SVG)e.node.setAttribute("pointer-events","none");else{var t=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(e.node,this.graph,t)}return e},mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this),this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.changeHandler=mxUtils.bind(this,function(e){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell)),null!=this.iconState?this.redrawIcons(this.icons,this.iconState):(this.destroyIcons(this.icons),this.previous=null),this.constraintHandler.reset()}),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler),this.drillHandler=mxUtils.bind(this,function(e){this.destroyIcons(this.icons)}),this.graph.addListener(mxEvent.START_EDITING,this.drillHandler),this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler),this.graph.getView().addListener(mxEvent.UP,this.drillHandler)},mxConnectionHandler.prototype.isConnectableCell=function(e){return!0},mxConnectionHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph);return a.hotspotEnabled=!0,a.getCell=mxUtils.bind(this,function(e,t){return t=mxCellMarker.prototype.getCell.apply(a,arguments),this.error=null,this.isConnectableCell(t)?(null!=t?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,t),null!=this.error&&0==this.error.length&&(t=null,this.isCreateTarget()&&(this.error=null))):this.isValidSource(t)||(t=null):this.isConnecting()&&!this.isCreateTarget()&&!this.graph.allowDanglingEdges&&(this.error=""),t):null}),a.isValidState=mxUtils.bind(this,function(e){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(a,arguments)}),a.getMarkerColor=mxUtils.bind(this,function(e,t,n){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(a,arguments):null}),a.intersects=mxUtils.bind(this,function(e,t){return!(null==this.connectImage&&!this.isConnecting())||mxCellMarker.prototype.intersects.apply(a,arguments)}),a},mxConnectionHandler.prototype.start=function(e,t,n,a){this.previous=e,this.first=new mxPoint(t,n),this.edgeState=null!=a?a:this.createEdgeState(null),this.marker.currentColor=this.marker.validColor,this.marker.markedState=e,this.marker.mark(),this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))},mxConnectionHandler.prototype.isConnecting=function(){return null!=this.first&&null!=this.shape},mxConnectionHandler.prototype.isValidSource=function(e){return this.graph.isValidSource(e)},mxConnectionHandler.prototype.isValidTarget=function(e){return!0},mxConnectionHandler.prototype.validateConnection=function(e,t){return this.isValidTarget(t)?this.graph.getEdgeValidationError(null,e,t):""},mxConnectionHandler.prototype.getConnectImage=function(e){return this.connectImage},mxConnectionHandler.prototype.isMoveIconToFrontForState=function(e){return null!=e.text&&e.text.node.parentNode==this.graph.container||this.moveIconFront},mxConnectionHandler.prototype.createIcons=function(e){if(null!=(i=this.getConnectImage(e))&&null!=e){this.iconState=e;var t=[],n=new mxImageShape(new mxRectangle(0,0,i.width,i.height),i.src,null,null,0);n.preserveImageAspect=!1,this.isMoveIconToFrontForState(e)?(n.dialect=mxConstants.DIALECT_STRICTHTML,n.init(this.graph.container)):(n.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,n.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=n.node.previousSibling&&n.node.parentNode.insertBefore(n.node,n.node.parentNode.firstChild)),n.node.style.cursor=mxConstants.CURSOR_CONNECT;var a=mxUtils.bind(this,function(){return null!=this.currentState?this.currentState:e}),i=mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(this.icon=n,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,a())))});return mxEvent.redirectMouseEvents(n.node,this.graph,a,i),t.push(n),this.redrawIcons(t,this.iconState),t}return null},mxConnectionHandler.prototype.redrawIcons=function(e,t){if(null!=e&&null!=e[0]&&null!=t){var n=this.getIconPosition(e[0],t);e[0].bounds.x=n.x,e[0].bounds.y=n.y,e[0].redraw()}},mxConnectionHandler.prototype.getIconPosition=function(e,t){var n=this.graph.getView().scale,a=t.getCenterX(),i=t.getCenterY();if(this.graph.isSwimlane(t.cell)){a=0!=(o=this.graph.getStartSize(t.cell)).width?t.x+o.width*n/2:a,i=0!=o.height?t.y+o.height*n/2:i;if(0!=(o=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0))){n=Math.cos(o);var o=Math.sin(o),s=new mxPoint(t.getCenterX(),t.getCenterY());a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),n,o,s)).x,i=i.y}}return new mxPoint(a-e.bounds.width/2,i-e.bounds.height/2)},mxConnectionHandler.prototype.destroyIcons=function(e){if(null!=e){this.iconState=null;for(var t=0;t<e.length;t++)e[t].destroy()}},mxConnectionHandler.prototype.isStartEvent=function(e){return!this.graph.isForceMarqueeEvent(e.getEvent())&&(null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon))},mxConnectionHandler.prototype.mouseDown=function(e,t){if(this.mouseDownCounter++,this.isEnabled()&&this.graph.isEnabled()&&!t.isConsumed()&&!this.isConnecting()&&this.isStartEvent(t)){if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(t.getGraphX(),t.getGraphY()),this.edgeState=this.createEdgeState(t),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape()),null==this.previous&&null!=this.edgeState){var n=this.graph.getPointForEvent(t.getEvent());this.edgeState.cell.geometry.setTerminalPoint(n,!0)}this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)),t.consume()}else if(mxClient.IS_TOUCH&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress&&this.isEnabled()&&this.graph.isEnabled()&&!this.isConnecting()){this.tapAndHoldInProgress=!0,this.initialTouchX=t.getX(),this.initialTouchY=t.getY();var a=this.graph.view.getState(this.marker.getCell(t));this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,function(){this.tapAndHoldValid&&this.tapAndHold(t,a),this.tapAndHoldValid=this.tapAndHoldInProgress=!1}),this.tapAndHoldDelay),this.tapAndHoldValid=!0}this.selectedIcon=this.icon,this.icon=null},mxConnectionHandler.prototype.tapAndHold=function(e,t){null!=t&&(this.marker.currentColor=this.marker.validColor,this.marker.markedState=t,this.marker.mark(),this.first=new mxPoint(e.getGraphX(),e.getGraphY()),this.edgeState=this.createEdgeState(e),this.previous=t,this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)))},mxConnectionHandler.prototype.isImmediateConnectSource=function(e){return!this.graph.isCellMovable(e.cell)},mxConnectionHandler.prototype.createEdgeState=function(e){return null},mxConnectionHandler.prototype.updateCurrentState=function(e){var t=this.marker.process(e);this.constraintHandler.update(e,null==this.first),this.currentState=t},mxConnectionHandler.prototype.convertWaypoint=function(e){var t=this.graph.getView().getScale(),n=this.graph.getView().getTranslate();e.x=e.x/t-n.x,e.y=e.y/t-n.y},mxConnectionHandler.prototype.mouseMove=function(e,t){if(this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-t.getX())<this.tapAndHoldTolerance&&Math.abs(this.initialTouchY-t.getY())<this.tapAndHoldTolerance),t.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{if(!this.isEnabled()&&null!=this.currentState&&(this.destroyIcons(this.icons),this.currentState=null),(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&this.updateCurrentState(t),null!=this.first){var n=this.graph.getView().scale,a=null,i=n=new mxPoint(this.graph.snap(t.getGraphX()/n)*n,this.graph.snap(t.getGraphY()/n)*n);null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint&&(a=this.constraintHandler.currentConstraint,i=this.constraintHandler.currentPoint.clone());var o=this.first;if(null!=this.selectedIcon){var s=this.selectedIcon.bounds.width,r=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(s=this.getIconPosition(this.selectedIcon,this.currentState),this.selectedIcon.bounds.x=s.x,this.selectedIcon.bounds.y=s.y):(s=new mxRectangle(t.getGraphX()+this.connectIconOffset.x,t.getGraphY()+this.connectIconOffset.y,s,r),this.selectedIcon.bounds=s),this.selectedIcon.redraw()}if(null!=this.edgeState){if(this.edgeState.absolutePoints=[null,null!=this.currentState?null:i],this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint),null!=this.currentState&&(null==a&&(a=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,a)),(o=null)!=this.waypoints)for(o=[],i=0;i<this.waypoints.length;i++)a=this.waypoints[i].clone(),this.convertWaypoint(a),o[i]=a;this.graph.view.updatePoints(this.edgeState,o,this.previous,this.currentState),this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState),i=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],o=this.edgeState.absolutePoints[0]}else null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(null!=(s=this.getTargetPerimeterPoint(this.currentState,t))&&(i=s)),null==this.sourceConstraint&&null!=this.previous&&(null!=(s=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:i,t))&&(o=s));if(null==this.currentState&&this.movePreviewAway){if(s=o,null!=this.edgeState&&2<this.edgeState.absolutePoints.length&&(null!=(a=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2])&&(s=a)),a=i.x-s.x,s=i.y-s.y,0==(r=Math.sqrt(a*a+s*s)))return;i.x-=4*a/r,i.y-=4*s/r}null==this.shape&&(a=Math.abs(n.x-this.first.x),s=Math.abs(n.y-this.first.y),a>this.graph.tolerance||s>this.graph.tolerance)&&(this.shape=this.createShape(),this.updateCurrentState(t)),null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(n=[o],null!=this.waypoints&&(n=n.concat(this.waypoints)),n.push(i),this.shape.points=n),this.drawPreview()),mxEvent.consume(t.getEvent()),t.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(this.icons),(this.icons=null)!=this.currentState&&null==this.error&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),t.consume())),this.previous=this.currentState):this.previous==this.currentState&&null!=this.currentState&&null==this.icons&&!this.graph.isMouseDown&&t.consume():this.constraintHandler.reset();if(null!=this.constraintHandler.currentConstraint&&this.marker.reset(),!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){for(n=!1,o=t.getSource(),i=0;i<this.icons.length&&!n;i++)n=o==this.icons[i].node||o.parentNode==this.icons[i].node;n||this.updateIcons(this.currentState,this.icons,t)}}},mxConnectionHandler.prototype.getTargetPerimeterPoint=function(e,t){var n=null,a=(i=e.view).getPerimeterFunction(e);if(null!=a){var i,o=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());null!=(i=a(i.getPerimeterBounds(e),this.edgeState,o,!1))&&(n=i)}else n=new mxPoint(e.getCenterX(),e.getCenterY());return n},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(e,t,n){n=null;var a=e.view,i=a.getPerimeterFunction(e),o=new mxPoint(e.getCenterX(),e.getCenterY());if(null!=i){var s=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0),r=-s*(Math.PI/180);0!=s&&(t=mxUtils.getRotatedPoint(new mxPoint(t.x,t.y),Math.cos(r),Math.sin(r),o)),null!=(e=i(a.getPerimeterBounds(e),e,t,!1))&&(0!=s&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(-r),Math.sin(-r),o)),n=e)}else n=o;return n},mxConnectionHandler.prototype.updateIcons=function(e,t,n){},mxConnectionHandler.prototype.isStopEvent=function(e){return null!=e.getState()},mxConnectionHandler.prototype.addWaypointForEvent=function(e){var t=mxUtils.convertPoint(this.graph.container,e.getX(),e.getY()),n=Math.abs(t.x-this.first.x);t=Math.abs(t.y-this.first.y);(null!=this.waypoints||1<this.mouseDownCounter&&(n>this.graph.tolerance||t>this.graph.tolerance))&&(null==this.waypoints&&(this.waypoints=[]),n=this.graph.view.scale,t=new mxPoint(this.graph.snap(e.getGraphX()/n)*n,this.graph.snap(e.getGraphY()/n)*n),this.waypoints.push(t))},mxConnectionHandler.prototype.mouseUp=function(e,t){if(!t.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(t))return this.addWaypointForEvent(t),void t.consume();if(null==this.error){var n=null!=this.previous?this.previous.cell:null,a=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),this.connect(n,a,t.getEvent(),t.getCell())}else null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,evt),0<this.error.length&&this.graph.validationAlert(this.error);this.destroyIcons(this.icons),t.consume()}null!=this.first&&this.reset(),this.tapAndHoldValid=this.tapAndHoldInProgress=!1},mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),this.destroyIcons(this.icons),this.icons=null,this.marker.reset(),this.constraintHandler.reset(),this.sourceConstraint=this.error=this.previous=this.edgeState=this.selectedIcon=null,this.mouseDownCounter=0,this.icon=this.first=null,this.fireEvent(new mxEventObject(mxEvent.RESET))},mxConnectionHandler.prototype.drawPreview=function(){var e=null==this.error;this.shape.strokewidth=this.getEdgeWidth(e),e=this.getEdgeColor(e),this.shape.stroke=e,this.shape.redraw()},mxConnectionHandler.prototype.getEdgeColor=function(e){return e?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(e){return e?3:1},mxConnectionHandler.prototype.connect=function(e,t,n,a){if(null!=t||this.isCreateTarget()||this.graph.allowDanglingEdges){var i=this.graph.getModel(),o=null;i.beginUpdate();try{if(null!=e&&null==t&&this.isCreateTarget()&&null!=(t=this.createTargetVertex(n,e))){if(null!=(a=this.graph.getDropTarget([t],n,a))&&this.graph.getModel().isEdge(a))a=this.graph.getDefaultParent();else{var s=this.graph.getView().getState(a);if(null!=s){var r=i.getGeometry(t);r.x-=s.origin.x,r.y-=s.origin.y}}this.graph.addCell(t,a)}var l=this.graph.getDefaultParent();if(null!=e&&null!=t&&i.getParent(e)==i.getParent(t)&&i.getParent(i.getParent(e))!=i.getRoot()&&(l=i.getParent(e),null!=e.geometry&&e.geometry.relative&&null!=t.geometry&&t.geometry.relative&&(l=i.getParent(l))),r=s=null,null!=this.edgeState&&(s=this.edgeState.cell.value,r=this.edgeState.cell.style),null!=(o=this.insertEdge(l,null,s,e,t,r))){this.graph.setConnectionConstraint(o,e,!0,this.sourceConstraint),this.graph.setConnectionConstraint(o,t,!1,this.constraintHandler.currentConstraint),null!=this.edgeState&&i.setGeometry(o,this.edgeState.cell.geometry);var d=i.getGeometry(o);if(null==d&&((d=new mxGeometry).relative=!0,i.setGeometry(o,d)),null!=this.waypoints&&0<this.waypoints.length){var c=this.graph.view.scale,m=this.graph.view.translate;for(d.points=[],e=0;e<this.waypoints.length;e++){var u=this.waypoints[e];d.points.push(new mxPoint(u.x/c-m.x,u.y/c-m.y))}}null==t&&((u=this.graph.getPointForEvent(n,!1)).x-=this.graph.panDx/this.graph.view.scale,u.y-=this.graph.panDy/this.graph.view.scale,d.setTerminalPoint(u,!1)),this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",o,"event",n,"target",a))}}catch(e){mxLog.show(),mxLog.debug(e.message)}finally{i.endUpdate()}this.select&&this.selectCells(o,t)}},mxConnectionHandler.prototype.selectCells=function(e,t){this.graph.setSelectionCell(e)},mxConnectionHandler.prototype.insertEdge=function(e,t,n,a,i,o){return null==this.factoryMethod?this.graph.insertEdge(e,t,n,a,i,o):(t=this.createEdge(n,a,i,o),this.graph.addEdge(t,e,a,i))},mxConnectionHandler.prototype.createTargetVertex=function(e,t){for(var n=this.graph.getCellGeometry(t);null!=n&&n.relative;)t=this.graph.getModel().getParent(t),n=this.graph.getCellGeometry(t);var a=this.graph.cloneCells([t])[0];if(null!=(n=this.graph.getModel().getGeometry(a))){var i=this.graph.getPointForEvent(e);if(n.x=this.graph.snap(i.x-n.width/2)-this.graph.panDx/this.graph.view.scale,n.y=this.graph.snap(i.y-n.height/2)-this.graph.panDy/this.graph.view.scale,null!=this.first){var o=this.graph.view.getState(t);if(null!=o){var s=this.getAlignmentTolerance();Math.abs(this.graph.snap(this.first.x)-this.graph.snap(i.x))<=s?n.x=o.x:Math.abs(this.graph.snap(this.first.y)-this.graph.snap(i.y))<=s&&(n.y=o.y)}}}return a},mxConnectionHandler.prototype.getAlignmentTolerance=function(){return this.graph.isGridEnabled()?this.graph.gridSize:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(e,t,n,a){var i=null;return null!=this.factoryMethod&&(i=this.factoryMethod(t,n,a)),null==i&&((i=new mxCell(e||"")).setEdge(!0),i.setStyle(a),(e=new mxGeometry).relative=!0,i.setGeometry(e)),i},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null)},mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR,mxConstraintHandler.prototype.isEnabled=function(){return this.enabled},mxConstraintHandler.prototype.setEnabled=function(e){this.enabled=e},mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var e=0;e<this.focusIcons.length;e++)this.focusIcons[e].destroy();this.focusIcons=null}null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),this.focusPoints=this.currentFocus=this.currentPoint=this.currentFocusArea=this.currentConstraint=null},mxConstraintHandler.prototype.getTolerance=function(){return this.graph.getTolerance()},mxConstraintHandler.prototype.getImageForConstraint=function(e,t,n){return this.pointImage},mxConstraintHandler.prototype.isEventIgnored=function(e,t){return!1},mxConstraintHandler.prototype.update=function(e,t){if(this.isEnabled()&&!this.isEventIgnored(e)){var n=this.getTolerance(),a=new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n),i=null!=e.getCell()&&this.graph.isCellConnectable(e.getCell());if((null==this.currentFocusArea||!mxUtils.intersects(this.currentFocusArea,a)||null!=e.getState()&&null!=this.currentFocus&&i)&&(this.currentFocusArea=null,e.getState()!=this.currentFocus))if(this.currentFocus=null,this.constraints=null!=e.getState()&&i?this.graph.getAllConnectionConstraints(e.getState(),t):null,null!=this.constraints){if(this.currentFocus=e.getState(),this.currentFocusArea=new mxRectangle(e.getState().x,e.getState().y,e.getState().width,e.getState().height),null!=this.focusIcons){for(i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}for(this.focusIcons=[],this.focusPoints=[],i=0;i<this.constraints.length;i++){var o,s=this.graph.getConnectionPoint(e.getState(),this.constraints[i]),r=(o=this.getImageForConstraint(e.getState(),this.constraints[i],s)).src;(o=new mxImageShape(o=new mxRectangle(s.x-o.width/2,s.y-o.height/2,o.width,o.height),r)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,o.preserveImageAspect=!1,o.init(this.graph.getView().getOverlayPane()),null!=o.node.previousSibling&&o.node.parentNode.insertBefore(o.node,o.node.parentNode.firstChild),r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),o.redraw(),mxEvent.redirectMouseEvents(o.node,this.graph,r),this.currentFocusArea.add(o.bounds),this.focusIcons.push(o),this.focusPoints.push(s)}this.currentFocusArea.grow(n)}else if(null!=this.focusIcons){for(null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}if(this.currentPoint=this.currentConstraint=null,null!=this.focusIcons&&null!=this.constraints&&(null==e.getState()||this.currentFocus==e.getState()))for(i=0;i<this.focusIcons.length;i++)if(mxUtils.intersects(this.focusIcons[i].bounds,a)){this.currentConstraint=this.constraints[i],this.currentPoint=this.focusPoints[i],(n=this.focusIcons[i].bounds.clone()).grow(mxClient.IS_IE?3:2),mxClient.IS_IE&&(n.width-=1,n.height-=1),null==this.focusHighlight?((n=new mxRectangleShape(n,null,this.highlightColor,3)).dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,n.init(this.graph.getView().getOverlayPane()),this.focusHighlight=n,r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),mxEvent.redirectMouseEvents(n.node,this.graph,r)):(this.focusHighlight.bounds=n,this.focusHighlight.redraw());break}null==this.currentConstraint&&null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)}},mxConstraintHandler.prototype.destroy=function(){this.reset()},mxRubberband.prototype.defaultOpacity=20,mxRubberband.prototype.enabled=!0,mxRubberband.prototype.div=null,mxRubberband.prototype.sharedDiv=null,mxRubberband.prototype.currentX=0,mxRubberband.prototype.currentY=0,mxRubberband.prototype.isEnabled=function(){return this.enabled},mxRubberband.prototype.setEnabled=function(e){this.enabled=e},mxRubberband.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&(this.graph.isForceMarqueeEvent(t.getEvent())||null==t.getState())){var n=mxUtils.getOffset(this.graph.container),a=mxUtils.getScrollOrigin(this.graph.container);if(a.x-=n.x,a.y-=n.y,this.start(t.getX()+a.x,t.getY()+a.y),mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC){var i=this.graph.container,o=function(e){e=new mxMouseEvent(e);var t=mxUtils.convertPoint(i,e.getX(),e.getY());return e.graphX=t.x,e.graphY=t.y,e};this.dragHandler=mxUtils.bind(this,function(e){this.mouseMove(this.graph,o(e))}),this.dropHandler=mxUtils.bind(this,function(e){this.mouseUp(this.graph,o(e))}),mxEvent.addListener(document,"mousemove",this.dragHandler),mxEvent.addListener(document,"mouseup",this.dropHandler)}t.consume(!1)}},mxRubberband.prototype.start=function(e,t){this.first=new mxPoint(e,t)},mxRubberband.prototype.mouseMove=function(e,t){if(!t.isConsumed()&&null!=this.first){var n=mxUtils.getScrollOrigin(this.graph.container),a=mxUtils.getOffset(this.graph.container);n.x-=a.x,n.y-=a.y;a=t.getX()+n.x,n=t.getY()+n.y;var i=this.first.x-a,o=this.first.y-n,s=this.graph.tolerance;(null!=this.div||Math.abs(i)>s||Math.abs(o)>s)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(a,n),t.consume())}},mxRubberband.prototype.createShape=function(){return null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv),this.sharedDiv},mxRubberband.prototype.mouseUp=function(e,t){var n=null!=this.div;this.reset(),n&&(n=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(n,t.getEvent()),t.consume())},mxRubberband.prototype.reset=function(){null!=this.div&&this.div.parentNode.removeChild(this.div),null!=this.dragHandler&&(mxEvent.removeListener(document,"mousemove",this.dragHandler),this.dragHandler=null),null!=this.dropHandler&&(mxEvent.removeListener(document,"mouseup",this.dropHandler),this.dropHandler=null),this.currentY=this.currentX=0,this.div=this.first=null},mxRubberband.prototype.update=function(e,t){this.currentX=e,this.currentY=t,this.repaint()},mxRubberband.prototype.repaint=function(){if(null!=this.div){var e=this.currentX-this.graph.panDx,t=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,e),this.y=Math.min(this.first.y,t),this.width=Math.max(this.first.x,e)-this.x,this.height=Math.max(this.first.y,t)-this.y,e=mxClient.IS_VML?this.graph.panDy:0,this.div.style.left=this.x+(mxClient.IS_VML?this.graph.panDx:0)+"px",this.div.style.top=this.y+e+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px"}},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))},mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.init(this.graph.getView().getOverlayPane()),this.graph.isCellMovable(this.state.cell)&&(this.selectionBorder.node.style.cursor=mxConstants.CURSOR_MOVABLE_VERTEX),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells){var e=this.graph.isCellResizable(this.state.cell);if(this.sizers=[],e||this.graph.isLabelMovable(this.state.cell)&&2<=this.state.width&&2<=this.state.height){var t=0;e&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",t++)),this.sizers.push(this.createSizer("n-resize",t++)),this.sizers.push(this.createSizer("ne-resize",t++)),this.sizers.push(this.createSizer("w-resize",t++)),this.sizers.push(this.createSizer("e-resize",t++)),this.sizers.push(this.createSizer("sw-resize",t++)),this.sizers.push(this.createSizer("s-resize",t++))),this.sizers.push(this.createSizer("se-resize",t++))),null!=(e=this.graph.model.getGeometry(this.state.cell))&&!e.relative&&!this.graph.isSwimlane(this.state.cell)&&this.graph.isLabelMovable(this.state.cell)&&(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,null,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.rotationEnabled&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)&&(this.rotationShape=this.createSizer("pointer",mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape)),this.redraw()},mxVertexHandler.prototype.getSelectionBounds=function(e){return new mxRectangle(Math.round(e.x),Math.round(e.y),Math.round(e.width),Math.round(e.height))},mxVertexHandler.prototype.createSelectionShape=function(e){return(e=new mxRectangleShape(e,null,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(e,t,n,a){return n=new mxRectangle(0,0,n=n||mxConstants.HANDLE_SIZE,n),(a=this.createSizerShape(n,t,a)).isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(a.bounds.height-=1,a.bounds.width-=1,a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(a.node,this.graph,this.state),this.graph.isEnabled()&&(a.node.style.cursor=e),this.isSizerVisible(t)||(a.node.style.visibility="hidden"),a},mxVertexHandler.prototype.isSizerVisible=function(e){return!0},mxVertexHandler.prototype.createSizerShape=function(e,t,n){return null!=this.handleImage?(e.width=this.handleImage.width,e.height=this.handleImage.height,new mxImageShape(e,this.handleImage.src)):t==mxEvent.ROTATION_HANDLE?new mxEllipse(e,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(e,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(e,t,n){null!=e&&(e.bounds.x=Math.round(t-e.bounds.width/2),e.bounds.y=Math.round(n-e.bounds.height/2),e.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(e){if(e.isSource(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(e.isSource(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(var t=this.tolerance,n=(t=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<t)?new mxRectangle(e.getGraphX()-t,e.getGraphY()-t,2*t,2*t):null,0);n<this.sizers.length;n++)if(e.isSource(this.sizers[n])||null!=t&&mxUtils.intersects(this.sizers[n].bounds,t))return n;return null},mxVertexHandler.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(t.getEvent())&&(0<this.tolerance||t.getState()==this.state)){var n=this.getHandleForEvent(t);null!=n&&(this.start(t.getX(),t.getY(),n),t.consume())}},mxVertexHandler.prototype.start=function(e,t,n){e=mxUtils.convertPoint(this.graph.container,e,t),this.startX=e.x,this.startY=e.y,this.index=n,this.selectionBorder.node.style.display=n==mxEvent.ROTATION_HANDLE?"inline":"none",this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container))},mxVertexHandler.prototype.mouseMove=function(e,t){if(t.isConsumed()||null==this.index)null!=this.getHandleForEvent(t)&&t.consume(!1);else{var n=new mxPoint(t.getGraphX(),t.getGraphY()),a=this.graph.isGridEnabledEvent(t.getEvent()),i=this.graph.getView().scale;if(this.index==mxEvent.LABEL_HANDLE)a&&(n.x=this.graph.snap(n.x/i)*i,n.y=this.graph.snap(n.y/i)*i),this.moveSizerTo(this.sizers[this.sizers.length-1],n.x,n.y);else if(this.index==mxEvent.ROTATION_HANDLE){var o=this.state.x+this.state.width/2-n.x,s=this.state.y+this.state.height/2-n.y;this.currentAlpha=0!=o?180*Math.atan(s/o)/Math.PI+90:s<0?180:0,0<o&&(this.currentAlpha-=180),this.rotationRaster&&(o=n.x-this.state.getCenterX(),s=n.y-this.state.getCenterY(),o=Math.abs(Math.sqrt(o*o+s*s)-this.state.height/2-20),o=Math.max(1,5*Math.min(3,Math.max(0,Math.round(80/Math.abs(o))))),this.currentAlpha=Math.round(this.currentAlpha/o)*o),this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw()}else{var r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),l=Math.cos(-r),d=Math.sin(-r),c=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),m=(o=n.x-this.startX,s=n.y-this.startY,n=this.graph.view.translate,d*o+l*s);o=l*o-d*s;this.bounds=this.union(this.selectionBounds,o,m,this.index,a,i,n),l=Math.cos(r),c=(d=Math.sin(r))*(o=(s=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY())).x-c.x)+l*(s=s.y-c.y)-s,this.bounds.x+=l*o-d*s-o,this.bounds.y+=c,this.drawPreview()}t.consume()}},mxVertexHandler.prototype.mouseUp=function(e,t){if(!t.isConsumed()&&null!=this.index&&null!=this.state){var n=new mxPoint(t.getGraphX(),t.getGraphY());this.graph.getModel().beginUpdate();try{if(this.index==mxEvent.ROTATION_HANDLE)null!=this.currentAlpha&&this.rotateCell(this.state.cell,this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0));else{var a=this.graph.isGridEnabledEvent(t.getEvent()),i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(-i),s=Math.sin(-i),r=(n=s*(r=n.x-this.startX)+o*(l=n.y-this.startY),o*r-s*l),l=n,d=this.graph.view.scale;this.resizeCell(this.state.cell,r/d,l/d,this.index,a)}}finally{this.graph.getModel().endUpdate()}this.reset(),t.consume()}},mxVertexHandler.prototype.rotateCell=function(e,t){var n=this.graph.getModel();if(n.isVertex(e)){if(null!=(o=e==this.state?this.state:this.graph.view.getState(e))&&this.graph.setCellStyles(mxConstants.STYLE_ROTATION,(o.style[mxConstants.STYLE_ROTATION]||0)+t,[e]),this.state.cell!=e&&(null!=(o=this.graph.getCellGeometry(e))&&!o.relative))if(0!=t){var a=this.graph.getModel().getParent(e),i=this.graph.getCellGeometry(a);if(!o.relative&&null!=i){var o,s=mxUtils.toRadians(t),r=(a=Math.cos(s),s=Math.sin(s),new mxPoint(o.getCenterX(),o.getCenterY()));i=new mxPoint(i.width/2,i.height/2),a=mxUtils.getRotatedPoint(r,a,s,i);(o=o.clone()).x=a.x-o.width/2,o.y=a.y-o.height/2,n.setGeometry(e,o)}}else(o=o.clone()).x+=dx,o.y+=dy,n.setGeometry(e,o);for(o=n.getChildCount(e),a=0;a<o;a++)this.rotateCell(n.getChildAt(e,a),t)}},mxVertexHandler.prototype.reset=function(){this.index=this.currentAlpha=null,null!=this.preview&&(this.preview.destroy(),this.preview=null),null!=this.selectionBorder&&(this.selectionBorder.node.style.display="inline",this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview())},mxVertexHandler.prototype.resizeCell=function(e,t,n,a,i){var o=this.graph.model.getGeometry(e);if(null!=o)if(a==mxEvent.LABEL_HANDLE)a=this.graph.view.scale,t=(this.labelShape.bounds.getCenterX()-this.startX)/a,n=(this.labelShape.bounds.getCenterY()-this.startY)/a,null==(o=o.clone()).offset?o.offset=new mxPoint(t,n):(o.offset.x+=t,o.offset.y+=n),this.graph.model.setGeometry(e,o);else{if(a=this.union(o,t,n,a,i,1,new mxPoint(0,0)),0!=(r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"))){t=a.getCenterX()-o.getCenterX(),n=a.getCenterY()-o.getCenterY(),i=Math.cos(r);var s=Math.sin(r),r=i*t-s*n-t;t=s*t+i*n-n,n=a.x-o.x;var l=a.y-o.y,d=i*n-s*l;i=s*n+i*l,a.x+=r,a.y+=t,this.graph.isCellCollapsed(e)||0==r&&0==t||(n=o.x-a.x+d,l=o.y-a.y+i,this.moveChildren(e,n,l))}this.graph.resizeCell(e,a)}},mxVertexHandler.prototype.moveChildren=function(e,t,n){for(var a=this.graph.getModel(),i=a.getChildCount(e),o=0;o<i;o++){var s=a.getChildAt(e,o);if(a.isVertex(s)){var r=this.graph.getCellGeometry(s);null!=r&&!r.relative&&((r=r.clone()).x+=t,r.y+=n,a.setGeometry(s,r))}}},mxVertexHandler.prototype.union=function(e,t,n,a,i,o,s){if(this.singleSizer){s=e.x+e.width+t;var r=e.y+e.height+n;return i&&(s=this.graph.snap(s/o)*o,r=this.graph.snap(r/o)*o),(o=new mxRectangle(e.x,e.y,0,0)).add(new mxRectangle(s,r,0,0)),o}var l=(r=e.x-s.x*o)+e.width,d=e.y-s.y*o;return e=d+e.height,4<a?(e+=n,i&&(e=this.graph.snap(e/o)*o)):a<3&&(d+=n,i&&(d=this.graph.snap(d/o)*o)),0==a||3==a||5==a?(r+=t,i&&(r=this.graph.snap(r/o)*o)):2!=a&&4!=a&&7!=a||(l+=t,i&&(l=this.graph.snap(l/o)*o)),e-=d,(i=l-r)<0&&(r+=i,i=Math.abs(i)),e<0&&(d+=e,e=Math.abs(e)),new mxRectangle(r+s.x*o,d+s.y*o,i,e)},mxVertexHandler.prototype.redraw=function(){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.state.x,this.state.y,this.state.width,this.state.height);var e=this.state;if(null!=this.sizers){var t=e.x+e.width,n=e.y+e.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],t,n);else{var a=e.x+e.width/2,i=e.y+e.height/2;if(1<this.sizers.length){var o=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"),s=Math.cos(o),r=(o=Math.sin(o),new mxPoint(e.getCenterX(),e.getCenterY())),l=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),s,o,r);this.moveSizerTo(this.sizers[0],l.x,l.y),l.x=a,l.y=e.y,l=mxUtils.getRotatedPoint(l,s,o,r),this.moveSizerTo(this.sizers[1],l.x,l.y),l.x=t,l.y=e.y,l=mxUtils.getRotatedPoint(l,s,o,r),this.moveSizerTo(this.sizers[2],l.x,l.y),l.x=e.x,l.y=i,l=mxUtils.getRotatedPoint(l,s,o,r),this.moveSizerTo(this.sizers[3],l.x,l.y),l.x=t,l.y=i,l=mxUtils.getRotatedPoint(l,s,o,r),this.moveSizerTo(this.sizers[4],l.x,l.y),l.x=e.x,l.y=n,l=mxUtils.getRotatedPoint(l,s,o,r),this.moveSizerTo(this.sizers[5],l.x,l.y),l.x=a,l.y=n,l=mxUtils.getRotatedPoint(l,s,o,r),this.moveSizerTo(this.sizers[6],l.x,l.y),l.x=t,l.y=n,l=mxUtils.getRotatedPoint(l,s,o,r),this.moveSizerTo(this.sizers[7],l.x,l.y),this.moveSizerTo(this.sizers[8],a+e.absoluteOffset.x,i+e.absoluteOffset.y)}else 2<=this.state.width&&2<=this.state.height?this.moveSizerTo(this.sizers[0],a+e.absoluteOffset.x,i+e.absoluteOffset.y):this.moveSizerTo(this.sizers[0],e.x,e.y)}}null!=this.rotationShape&&(o=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),s=Math.cos(o),o=Math.sin(o),r=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),l=mxUtils.getRotatedPoint(new mxPoint(e.x+e.width/2,e.y-16),s,o,r),this.moveSizerTo(this.rotationShape,l.x,l.y)),this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.drawPreview()},mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw()),this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()},mxVertexHandler.prototype.destroy=function(){if(null!=this.preview&&(this.preview.destroy(),this.preview=null),this.selectionBorder.destroy(),this.labelShape=this.selectionBorder=null,null!=this.sizers)for(var e=0;e<this.sizers.length;e++)this.sizers[e].destroy(),this.sizers[e]=null},mxEdgeHandler.prototype.graph=null,mxEdgeHandler.prototype.state=null,mxEdgeHandler.prototype.marker=null,mxEdgeHandler.prototype.constraintHandler=null,mxEdgeHandler.prototype.error=null,mxEdgeHandler.prototype.shape=null,mxEdgeHandler.prototype.bends=null,mxEdgeHandler.prototype.labelShape=null,mxEdgeHandler.prototype.cloneEnabled=!0,mxEdgeHandler.prototype.addEnabled=!1,mxEdgeHandler.prototype.removeEnabled=!1,mxEdgeHandler.prototype.preferHtml=!1,mxEdgeHandler.prototype.allowHandleBoundsCheck=!0,mxEdgeHandler.prototype.snapToTerminals=!1,mxEdgeHandler.prototype.handleImage=null,mxEdgeHandler.prototype.tolerance=0,mxEdgeHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.points=[],this.abspoints=this.getSelectionPoints(this.state),this.shape=this.createSelectionShape(this.abspoints),this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,this.shape.init(this.graph.getView().getOverlayPane()),this.shape.svgStrokeTolerance=0,this.shape.node.style.cursor=mxConstants.CURSOR_MOVABLE_EDGE,mxEvent.addListener(this.shape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e,this.state.cell)})),mxEvent.addGestureListeners(this.shape.node,mxUtils.bind(this,function(e){this.addEnabled&&this.isAddPointEvent(e)?this.addPoint(this.state,e):this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,this.state))}),mxUtils.bind(this,function(e){var t=this.state.cell;if(null!=this.index){var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));t=this.graph.getCellAt(n.x,n.y);this.graph.isSwimlane(t)&&this.graph.hitsSwimlaneContent(t,n.x,n.y)&&(t=null)}this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,this.graph.getView().getState(t)))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,this.state))})),this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container,!this.preferHtml){var e=this.state.getVisibleTerminalState(!0);null!=e&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container),this.preferHtml||null!=(e=this.state.getVisibleTerminalState(!1))&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container)}(this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells||mxGraphHandler.prototype.maxCells<=0)&&(this.bends=this.createBends()),this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape=new mxRectangleShape(new mxRectangle,mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR),this.labelShape.pointerEvents=!1,this.initBend(this.labelShape),this.labelShape.node.style.cursor=mxConstants.CURSOR_LABEL_HANDLE,mxEvent.redirectMouseEvents(this.labelShape.node,this.graph,this.state),this.redraw()},mxEdgeHandler.prototype.isAddPointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.isRemovePointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.getSelectionPoints=function(e){return e.absolutePoints},mxEdgeHandler.prototype.createSelectionShape=function(e){return(e=new mxPolyline(e,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxEdgeHandler.prototype.getSelectionColor=function(){return mxConstants.EDGE_SELECTION_COLOR},mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH},mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED},mxEdgeHandler.prototype.isConnectableCell=function(e){return!0},mxEdgeHandler.prototype.createMarker=function(){var e=new mxCellMarker(this.graph),a=this;return e.getCell=function(e){var t=mxCellMarker.prototype.getCell.apply(this,arguments);if(!a.isConnectableCell(t))return null;var n=a.graph.getModel();return(t==a.state.cell||null!=t&&!a.graph.connectableEdges&&n.isEdge(t))&&(t=null),t},e.isValidState=function(e){var t=a.graph.getModel();t=null!=(t=a.graph.view.getTerminalPort(e,a.graph.view.getState(t.getTerminal(a.state.cell,!a.isSource)),!a.isSource))?t.cell:null;return a.error=a.validateConnection(a.isSource?e.cell:t,a.isSource?t:e.cell),null==a.error},e},mxEdgeHandler.prototype.validateConnection=function(e,t){return this.graph.getEdgeValidationError(this.state.cell,e,t)},mxEdgeHandler.prototype.createBends=function(){for(var e=this.state.cell,t=[],n=0;n<this.abspoints.length;n++)if(this.isHandleVisible(n)){var a=n==this.abspoints.length-1;if((a=0==n||a)||this.graph.isCellBendable(e)){var i=this.createHandleShape(n);if(this.initBend(i),mxClient.IS_TOUCH&&i.node.setAttribute("pointer-events","none"),this.isHandleEnabled(n))if(mxClient.IS_TOUCH){var o=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(i.node,this.graph,o)}else i.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(i.node,this.graph,this.state);t.push(i),a||(this.points.push(new mxPoint(0,0)),i.node.style.visibility="hidden")}}return t},mxEdgeHandler.prototype.isHandleEnabled=function(e){return!0},mxEdgeHandler.prototype.isHandleVisible=function(e){return!0},mxEdgeHandler.prototype.createHandleShape=function(e){return null!=this.handleImage?new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src):(e=mxConstants.HANDLE_SIZE,this.preferHtml&&(e-=1),new mxRectangleShape(new mxRectangle(0,0,e,e),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR))},mxEdgeHandler.prototype.initBend=function(e){this.preferHtml?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()))},mxEdgeHandler.prototype.getHandleForEvent=function(e){if(null!=this.bends)for(var t=this.tolerance,n=(t=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<t)?new mxRectangle(e.getGraphX()-t,e.getGraphY()-t,2*t,2*t):null,0);n<this.bends.length;n++)if((e.isSource(this.bends[n])||null!=t&&mxUtils.intersects(this.bends[n].bounds,t))&&"hidden"!=this.bends[n].node.style.visibility)return n;return!(e.isSource(this.labelShape)&&"hidden"!=this.labelShape.node.style.visibility||e.isSource(this.state.text))||(mxClient.IS_SF||mxClient.IS_GC)&&"SELECT"==e.getSource().nodeName?null:mxEvent.LABEL_HANDLE},mxEdgeHandler.prototype.mouseDown=function(e,t){var n=null;null!=(n=this.getHandleForEvent(t))&&!t.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(t.getEvent())&&(this.removeEnabled&&this.isRemovePointEvent(t.getEvent())?this.removePoint(this.state,n):(n!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(t.getCell()))&&this.start(t.getX(),t.getY(),n),t.consume())},mxEdgeHandler.prototype.start=function(e,t,n){this.startX=e,this.startY=t,this.isSource=null!=this.bends&&0==n,this.isTarget=null!=this.bends&&n==this.bends.length-1,this.isLabel=n==mxEvent.LABEL_HANDLE,this.isSource||this.isTarget?(e=this.state.cell,(null==(t=this.graph.model.getTerminal(e,this.isSource))&&this.graph.isTerminalPointMovable(e,this.isSource)||null!=t&&this.graph.isCellDisconnectable(e,t,this.isSource))&&(this.index=n)):this.index=n},mxEdgeHandler.prototype.clonePreviewState=function(e,t){return this.state.clone()},mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxEdgeHandler.prototype.getPointForEvent=function(e){var n=new mxPoint(e.getGraphX(),e.getGraphY()),a=this.getSnapToTerminalTolerance(),t=this.graph.getView(),i=!1,o=!1;if(this.snapToTerminals&&0<a){var s=function(e){if(null!=e){var t=e.x;Math.abs(n.x-t)<a&&(n.x=t,i=!0),e=e.y,Math.abs(n.y-e)<a&&(n.y=e,o=!0)}},r=function(e){null!=e&&s.call(this,new mxPoint(t.getRoutingCenterX(e),t.getRoutingCenterY(e)))};if(r.call(this,this.state.getVisibleTerminalState(!0)),r.call(this,this.state.getVisibleTerminalState(!1)),null!=this.abspoints)for(r=0;r<this.abspoints;r++)r!=this.index&&s.call(this,this.abspoints[r])}return this.graph.isGridEnabledEvent(e.getEvent())&&(e=t.scale,r=t.translate,i||(n.x=(this.graph.snap(n.x/e-r.x)+r.x)*e),o||(n.y=(this.graph.snap(n.y/e-r.y)+r.y)*e)),n},mxEdgeHandler.prototype.getPreviewTerminalState=function(e){this.constraintHandler.update(e,this.isSource),this.marker.process(e),e=this.marker.getValidState();var t=null;return null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint&&this.marker.reset(),null!=e?t=e:null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(t=this.constraintHandler.currentFocus),t},mxEdgeHandler.prototype.getPreviewPoints=function(e){var t=null!=(t=this.graph.getCellGeometry(this.state.cell)).points?t.points.slice():null;return this.isSource||this.isTarget?this.graph.resetEdgesOnConnect&&(t=null):(this.convertPoint(e,!1),null==t?t=[e]:t[this.index-1]=e),t},mxEdgeHandler.prototype.updatePreviewState=function(e,t,n){var a=this.isSource?n:this.state.getVisibleTerminalState(!0),i=this.isTarget?n:this.state.getVisibleTerminalState(!1),o=this.graph.getConnectionConstraint(e,a,!0),s=this.graph.getConnectionConstraint(e,i,!1),r=this.constraintHandler.currentConstraint;null==r&&(r=new mxConnectionConstraint),this.isSource?o=r:this.isTarget&&(s=r),(!this.isSource||null!=a)&&e.view.updateFixedTerminalPoint(e,a,!0,o),(!this.isTarget||null!=i)&&e.view.updateFixedTerminalPoint(e,i,!1,s),(this.isSource||this.isTarget)&&null==n&&(e.setAbsoluteTerminalPoint(t,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:"")),e.view.updatePoints(e,this.points,a,i),e.view.updateFloatingTerminalPoints(e,a,i)},mxEdgeHandler.prototype.mouseMove=function(e,t){if(null!=this.index&&null!=this.marker){var n=this.getPointForEvent(t);if(this.isLabel)this.label.x=n.x,this.label.y=n.y;else{this.points=this.getPreviewPoints(n);var a=this.isSource||this.isTarget?this.getPreviewTerminalState(t):null,i=this.clonePreviewState(n,null!=a?a.cell:null);this.updatePreviewState(i,n,a),this.setPreviewColor(null==this.error?this.marker.validColor:this.marker.invalidColor),this.abspoints=i.absolutePoints,this.active=!0}this.drawPreview(),mxEvent.consume(t.getEvent()),t.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(t)&&t.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(e,t){if(null!=this.index&&null!=this.marker){var n=this.state.cell;if(t.getX()!=this.startX||t.getY()!=this.startY)if(null!=this.error)0<this.error.length&&this.graph.validationAlert(this.error);else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var a=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),null!=a)n=this.connect(n,a,this.isSource,this.graph.isCloneEvent(t.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable(),t);else if(this.graph.isAllowDanglingEdges()){(a=this.abspoints[this.isSource?0:this.abspoints.length-1]).x=a.x/this.graph.view.scale-this.graph.view.translate.x,a.y=a.y/this.graph.view.scale-this.graph.view.translate.y;var i=this.graph.getView().getState(this.graph.getModel().getParent(n));null!=i&&(a.x-=i.origin.x,a.y-=i.origin.y),a.x-=this.graph.panDx/this.graph.view.scale,a.y-=this.graph.panDy/this.graph.view.scale,this.changeTerminalPoint(n,a,this.isSource)}}else this.active?this.changePoints(n,this.points):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().revalidate(this.state.cell));null!=this.marker&&(this.reset(),n!=this.state.cell&&this.graph.setSelectionCell(n)),t.consume()}},mxEdgeHandler.prototype.reset=function(){this.points=this.label=this.index=this.error=null,this.isTarget=this.isSource=this.isLabel=this.active=!1,this.marker.reset(),this.constraintHandler.reset(),this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR),this.redraw()},mxEdgeHandler.prototype.setPreviewColor=function(e){null!=this.shape&&(this.shape.stroke=e)},mxEdgeHandler.prototype.convertPoint=function(e,t){var n=this.graph.getView().getScale(),a=this.graph.getView().getTranslate();return t&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/n-a.x),e.y=Math.round(e.y/n-a.y),null!=(n=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell)))&&(e.x-=n.origin.x,e.y-=n.origin.y),e},mxEdgeHandler.prototype.moveLabel=function(e,t,n){var a=this.graph.getModel();if(null!=(i=a.getGeometry(e.cell))){var i=i.clone(),o=this.graph.getView().getRelativePoint(e,t,n);i.x=o.x,i.y=o.y;var s=this.graph.getView().scale;i.offset=new mxPoint(0,0),o=this.graph.view.getPoint(e,i),i.offset=new mxPoint((t-o.x)/s,(n-o.y)/s),a.setGeometry(e.cell,i)}},mxEdgeHandler.prototype.connect=function(e,t,n,a,i){var o=(i=this.graph.getModel()).getParent(e);i.beginUpdate();try{if(a){var s=e.clone();i.add(o,s,i.getChildCount(o));var r=i.getTerminal(e,!n);this.graph.connectCell(s,r,!n),e=s}var l=this.constraintHandler.currentConstraint;null==l&&(l=new mxConnectionConstraint),this.graph.connectCell(e,t,n,l)}finally{i.endUpdate()}return e},mxEdgeHandler.prototype.changeTerminalPoint=function(e,t,n){var a=this.graph.getModel(),i=a.getGeometry(e);if(null!=i){a.beginUpdate();try{(i=i.clone()).setTerminalPoint(t,n),a.setGeometry(e,i),this.graph.connectCell(e,null,n,new mxConnectionConstraint)}finally{a.endUpdate()}}},mxEdgeHandler.prototype.changePoints=function(e,t){var n=this.graph.getModel(),a=n.getGeometry(e);null!=a&&((a=a.clone()).points=t,n.setGeometry(e,a))},mxEdgeHandler.prototype.addPoint=function(e,t){var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),a=this.graph.isGridEnabledEvent(t);this.convertPoint(n,a),this.addPointAt(e,n.x,n.y),mxEvent.consume(t)},mxEdgeHandler.prototype.addPointAt=function(e,t,n){var a=this.graph.getCellGeometry(e.cell);if(t=new mxPoint(t,n),null!=a){a=a.clone(),n=this.graph.view.translate;var i=this.graph.view.scale;n=mxUtils.findNearestSegment(e,(t.x+n.x)*i,(t.y+n.y)*i),null==a.points?a.points=[t]:a.points.splice(n,0,t),this.graph.getModel().setGeometry(e.cell,a),this.destroy(),this.init()}},mxEdgeHandler.prototype.removePoint=function(e,t){if(0<t&&t<this.abspoints.length-1){var n=this.graph.getCellGeometry(this.state.cell);null!=n&&null!=n.points&&((n=n.clone()).points.splice(t-1,1),this.graph.getModel().setGeometry(e.cell,n),this.destroy(),this.init())}},mxEdgeHandler.prototype.getHandleFillColor=function(e){e=0==e;var t=this.state.cell,n=this.graph.getModel().getTerminal(t,e),a=mxConstants.HANDLE_FILLCOLOR;return null!=n&&!this.graph.isCellDisconnectable(t,n,e)||null==n&&!this.graph.isTerminalPointMovable(t,e)?a=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=n&&this.graph.isCellDisconnectable(t,n,e)&&(a=mxConstants.CONNECT_HANDLE_FILLCOLOR),a},mxEdgeHandler.prototype.redraw=function(){this.abspoints=this.state.absolutePoints.slice();var e=this.state.cell,t=mxConstants.LABEL_HANDLE_SIZE;if(this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-t/2),Math.round(this.label.y-t/2),t,t),this.labelShape.redraw(),null!=(t=this.graph.getLabel(e))&&0<t.length&&this.graph.isLabelMovable(e)?this.labelShape.node.style.visibility="visible":this.labelShape.node.style.visibility="hidden",null!=this.bends&&0<this.bends.length){var n=this.abspoints.length-1,a=(e=this.abspoints[0],this.abspoints[0].y);t=this.bends[0].bounds;this.bends[0].bounds=new mxRectangle(Math.round(this.abspoints[0].x-t.width/2),Math.round(a-t.height/2),t.width,t.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw();a=this.abspoints[n];var i=this.abspoints[n].x,o=(n=this.abspoints[n].y,this.bends.length-1);t=this.bends[o].bounds;this.bends[o].bounds=new mxRectangle(Math.round(i-t.width/2),Math.round(n-t.height/2),t.width,t.height),this.bends[o].fill=this.getHandleFillColor(o),this.bends[o].redraw(),this.redrawInnerBends(e,a)}this.drawPreview()},mxEdgeHandler.prototype.redrawInnerBends=function(e,t){var n=this.graph.getModel().getGeometry(this.state.cell).points;if(null!=n){null==this.points&&(this.points=[]);for(var a=1;a<this.bends.length-1;a++)if(null!=this.bends[a])if(null!=this.abspoints[a]){var i=this.abspoints[a].x,o=this.abspoints[a].y,s=this.bends[a].bounds;this.bends[a].node.style.visibility="visible",this.bends[a].bounds=new mxRectangle(Math.round(i-s.width/2),Math.round(o-s.height/2),s.width,s.height),this.bends[a].redraw(),this.points[a-1]=n[a-1]}else this.bends[a].destroy(),this.bends[a]=null}},mxEdgeHandler.prototype.drawPreview=function(){if(this.isLabel){var e=mxConstants.LABEL_HANDLE_SIZE;e=new mxRectangle(Math.round(this.label.x-e/2),Math.round(this.label.y-e/2),e,e);this.labelShape.bounds=e,this.labelShape.redraw()}else this.shape.points=this.abspoints,this.shape.redraw()},mxEdgeHandler.prototype.destroy=function(){if(null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.bends)for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null)},mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler),mxElbowEdgeHandler.prototype=new mxEdgeHandler,mxElbowEdgeHandler.prototype.constructor=mxElbowEdgeHandler,mxElbowEdgeHandler.prototype.flipEnabled=!0,mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":"",mxElbowEdgeHandler.prototype.createBends=function(){var e=[],t=this.createHandleShape(0);return this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none"),e.push(this.createVirtualBend()),this.points.push(new mxPoint(0,0)),t=this.createHandleShape(2),this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none"),e},mxElbowEdgeHandler.prototype.createVirtualBend=function(){var e=this.createHandleShape();this.initBend(e);var t=this.getCursorForBend();return e.node.style.cursor=t,t=mxUtils.bind(this,function(e){!mxEvent.isConsumed(e)&&this.flipEnabled&&(this.graph.flipEdge(this.state.cell,e),mxEvent.consume(e))}),mxEvent.redirectMouseEvents(e.node,this.graph,this.state,null,null,null,t),this.graph.isCellBendable(this.state.cell)||(e.node.style.display="none"),e},mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"},mxElbowEdgeHandler.prototype.getTooltipForNode=function(e){var t=null;return null==this.bends||null==this.bends[1]||e!=this.bends[1].node&&e.parentNode!=this.bends[1].node||(t=this.doubleClickOrientationResource,t=mxResources.get(t)||t),t},mxElbowEdgeHandler.prototype.convertPoint=function(e,t){var n=this.graph.getView().getScale(),a=this.graph.getView().getTranslate(),i=this.state.origin;t&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/n-a.x-i.x),e.y=Math.round(e.y/n-a.y-i.y)},mxElbowEdgeHandler.prototype.redrawInnerBends=function(e,t){var n=null==(n=null!=(n=this.graph.getModel().getGeometry(this.state.cell).points)?n[0]:null)?new mxPoint(e.x+(t.x-e.x)/2,e.y+(t.y-e.y)/2):new mxPoint(this.graph.getView().scale*(n.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(n.y+this.graph.getView().translate.y+this.state.origin.y)),a=(i=this.bends[1].bounds).width,i=i.height;null==this.handleImage&&(i=a=mxConstants.HANDLE_SIZE);var o=new mxRectangle(Math.round(n.x-a/2),Math.round(n.y-i/2),a,i);null==this.handleImage&&"hidden"!=this.labelShape.node.style.visibility&&mxUtils.intersects(o,this.labelShape.bounds)&&(a+=3,i+=3,o=new mxRectangle(Math.round(n.x-a/2),Math.round(n.y-i/2),a,i)),this.bends[1].bounds=o,this.bends[1].redraw()},mxUtils.extend(mxEdgeSegmentHandler,mxEdgeHandler),mxEdgeSegmentHandler.prototype=new mxElbowEdgeHandler,mxEdgeSegmentHandler.prototype.constructor=mxEdgeSegmentHandler,mxEdgeSegmentHandler.prototype.getPreviewPoints=function(e){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);this.convertPoint(e,!1);var t=this.state.absolutePoints,n=t[0].clone();this.convertPoint(n,!1);for(var a=[],i=1;i<t.length;i++){var o=t[i].clone();this.convertPoint(o,!1),i==this.index&&(n.x==o.x?(n.x=e.x,o.x=e.x):(n.y=e.y,o.y=e.y)),i<t.length-1&&a.push(o),n=o}if(1==a.length){if(n=this.state.view,i=this.state.getVisibleTerminalState(!0),null!=(o=this.state.getVisibleTerminalState(!1))&null!=i){var s=this.state.origin.x,r=this.state.origin.y;mxUtils.contains(o,a[0].x+s,a[0].y+r)?t[1].y==t[2].y?a[0].y=n.getRoutingCenterY(i)-r:a[0].x=n.getRoutingCenterX(i)-s:mxUtils.contains(i,a[0].x+s,a[0].y+r)&&(t[1].y==t[0].y?a[0].y=n.getRoutingCenterY(o)-r:a[0].x=n.getRoutingCenterX(o)-s)}}else 0==a.length&&(a=[e]);return a},mxEdgeSegmentHandler.prototype.createBends=function(){var e=[],t=this.createHandleShape(0);this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none");var n=this.state.absolutePoints;if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var a=0;a<n.length-1;a++)t=this.createVirtualBend(),e.push(t),t.node.style.cursor=0==n[a].x-n[a+1].x?"col-resize":"row-resize",this.points.push(new mxPoint(0,0)),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none")}return t=this.createHandleShape(n.length),this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none"),e},mxEdgeSegmentHandler.prototype.redraw=function(){this.refresh(),mxEdgeHandler.prototype.redraw.apply(this,arguments)},mxEdgeSegmentHandler.prototype.refresh=function(){if(null!=this.bends){for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null);this.bends=this.createBends()}},mxEdgeSegmentHandler.prototype.redrawInnerBends=function(e,t){if(this.graph.isCellBendable(this.state.cell)){var n=mxConstants.HANDLE_SIZE,a=this.state.absolutePoints;if(null!=a&&1<a.length)for(var i=0;i<this.state.absolutePoints.length-1;i++)if(null!=this.bends[i+1]){e=a[i],t=a[i+1];var o=new mxPoint(e.x+(t.x-e.x)/2,e.y+(t.y-e.y)/2);this.bends[i+1].bounds=new mxRectangle(Math.round(o.x-n/2),Math.round(o.y-n/2),n,n),this.bends[i+1].redraw()}}},mxEdgeSegmentHandler.prototype.changePoints=function(e,t){t=[];var n=this.abspoints;if(1<n.length)for(var a=n[0],i=n[1],o=2;o<n.length;o++){var s=n[o];Math.round(a.x)==Math.round(i.x)&&Math.round(i.x)==Math.round(s.x)||Math.round(a.y)==Math.round(i.y)&&Math.round(i.y)==Math.round(s.y)||(i=(a=i).clone(),this.convertPoint(i,!1),t.push(i)),i=s}mxElbowEdgeHandler.prototype.changePoints.apply(this,arguments)},mxKeyHandler.prototype.graph=null,mxKeyHandler.prototype.target=null,mxKeyHandler.prototype.normalKeys=null,mxKeyHandler.prototype.shiftKeys=null,mxKeyHandler.prototype.controlKeys=null,mxKeyHandler.prototype.controlShiftKeys=null,mxKeyHandler.prototype.enabled=!0,mxKeyHandler.prototype.isEnabled=function(){return this.enabled},mxKeyHandler.prototype.setEnabled=function(e){this.enabled=e},mxKeyHandler.prototype.bindKey=function(e,t){this.normalKeys[e]=t},mxKeyHandler.prototype.bindShiftKey=function(e,t){this.shiftKeys[e]=t},mxKeyHandler.prototype.bindControlKey=function(e,t){this.controlKeys[e]=t},mxKeyHandler.prototype.bindControlShiftKey=function(e,t){this.controlShiftKeys[e]=t},mxKeyHandler.prototype.isControlDown=function(e){return mxEvent.isControlDown(e)},mxKeyHandler.prototype.getFunction=function(e){return null!=e?this.isControlDown(e)?mxEvent.isShiftDown(e)?this.controlShiftKeys[e.keyCode]:this.controlKeys[e.keyCode]:mxEvent.isShiftDown(e)?this.shiftKeys[e.keyCode]:this.normalKeys[e.keyCode]:null},mxKeyHandler.prototype.isGraphEvent=function(e){if((e=mxEvent.getSource(e))==this.target||e.parentNode==this.target||null!=this.graph.cellEditor&&e==this.graph.cellEditor.textarea)return!0;for(;null!=e;){if(e==this.graph.container)return!0;e=e.parentNode}return!1},mxKeyHandler.prototype.keyDown=function(e){if(this.graph.isEnabled()&&!mxEvent.isConsumed(e)&&this.isGraphEvent(e)&&this.isEnabled())if(27==e.keyCode)this.escape(e);else if(!this.graph.isEditing()){var t=this.getFunction(e);null!=t&&(t(e),mxEvent.consume(e))}},mxKeyHandler.prototype.escape=function(e){this.graph.isEscapeEnabled()&&this.graph.escape(e)},mxKeyHandler.prototype.destroy=function(){this.target=null},mxTooltipHandler.prototype.zIndex=10005,mxTooltipHandler.prototype.graph=null,mxTooltipHandler.prototype.delay=null,mxTooltipHandler.prototype.hideOnHover=!1,mxTooltipHandler.prototype.enabled=!0,mxTooltipHandler.prototype.isEnabled=function(){return this.enabled},mxTooltipHandler.prototype.setEnabled=function(e){this.enabled=e},mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover},mxTooltipHandler.prototype.setHideOnHover=function(e){this.hideOnHover=e},mxTooltipHandler.prototype.init=function(){null!=document.body&&(this.div=document.createElement("div"),this.div.className="mxTooltip",this.div.style.visibility="hidden",this.div.style.zIndex=this.zIndex,document.body.appendChild(this.div),mxEvent.addListener(this.div,"mousedown",mxUtils.bind(this,function(e){this.hideTooltip()})))},mxTooltipHandler.prototype.mouseDown=function(e,t){this.reset(t,!1),this.hideTooltip()},mxTooltipHandler.prototype.mouseMove=function(e,t){t.getX()==this.lastX&&t.getY()==this.lastY||(this.reset(t,!0),(this.isHideOnHover()||t.getState()!=this.state||t.getSource()!=this.node&&(!this.stateSource||null!=t.getState()&&this.stateSource==(t.isSource(t.getState().shape)||!t.isSource(t.getState().text))))&&this.hideTooltip()),this.lastX=t.getX(),this.lastY=t.getY()},mxTooltipHandler.prototype.mouseUp=function(e,t){this.reset(t,!0),this.hideTooltip()},mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)},mxTooltipHandler.prototype.reset=function(e,t){if(this.resetTimer(),t&&this.isEnabled()&&null!=e.getState()&&(null==this.div||"hidden"==this.div.style.visibility)){var n=e.getState(),a=e.getSource(),i=e.getX(),o=e.getY(),s=e.isSource(n.shape)||e.isSource(n.text);this.thread=window.setTimeout(mxUtils.bind(this,function(){if(!this.graph.isEditing()&&!this.graph.panningHandler.isMenuShowing()){var e=this.graph.getTooltip(n,a,i,o);this.show(e,i,o),this.state=n,this.node=a,this.stateSource=s}}),this.delay)}},mxTooltipHandler.prototype.hide=function(){this.resetTimer(),this.hideTooltip()},mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden")},mxTooltipHandler.prototype.show=function(e,t,n){if(null!=e&&0<e.length){null==this.div&&this.init();var a=mxUtils.getScrollOrigin();this.div.style.left=t+a.x+"px",this.div.style.top=n+mxConstants.TOOLTIP_VERTICAL_OFFSET+a.y+"px",mxUtils.isNode(e)?(this.div.innerHTML="",this.div.appendChild(e)):this.div.innerHTML=e.replace(/\n/g,"<br>"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null},mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(e,t){},mxCellTracker.prototype.mouseMove=function(e,t){this.isEnabled()&&this.process(t)},mxCellTracker.prototype.mouseUp=function(e,t){this.reset()},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=!0,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(e){this.highlightColor=e,null!=this.shape&&(this.shape.stroke=e)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),!this.keepOnTop&&this.shape.node.parentNode.firstChild!=this.shape.node&&this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)},mxCellHighlight.prototype.createShape=function(){var e=null;return(e=this.graph.model.isEdge(this.state.cell)?new mxPolyline(this.state.absolutePoints,this.highlightColor,this.strokeWidth):new mxRectangleShape(new mxRectangle,null,this.highlightColor,this.strokeWidth)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(e.node,this.graph,this.state),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=this.dashed,e},mxCellHighlight.prototype.repaint=function(){if(null!=this.state&&null!=this.shape){var e=0;this.graph.model.isEdge(this.state.cell)?this.shape.points=this.state.absolutePoints:(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),e=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),0!=e&&(this.shape.rotation=e),this.shape.redraw()}},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(e){this.state!=e&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=e,null!=this.state&&this.drawHighlight())},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),null!=this.shape&&(this.shape.destroy(),this.shape=null)},mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(e,t,n){var a=mxUtils.bind(this,function(){this.editor.execute(t)});n?this.handler.bindControlKey(e,a):this.handler.bindKey(e,a)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(e,t,n,a){if(null!=this.config){var i=this.createConditions(e,n,a);this.addItems(e,t,n,a,i,this.config.firstChild,null)}},mxDefaultPopupMenu.prototype.addItems=function(e,t,n,a,i,o,s){for(var r=!1;null!=o;){if("add"==o.nodeName){if(null==(l=o.getAttribute("if"))||i[l]){var l=o.getAttribute("as"),d=(l=mxResources.get(l)||l,mxUtils.eval(mxUtils.getTextContent(o))),c=o.getAttribute("action"),m=o.getAttribute("icon"),u=o.getAttribute("iconCls");r&&(t.addSeparator(s),r=!1),null!=m&&this.imageBasePath&&(m=this.imageBasePath+m),l=this.addAction(t,e,l,m,d,c,n,s,u),this.addItems(e,t,n,a,i,o.firstChild,l)}}else"separator"==o.nodeName&&(r=!0);o=o.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(e,t,n,a,i,o,s,r,l){return e.addItem(n,a,function(e){"function"==typeof i&&i.call(t,t,s,e),null!=o&&t.execute(o,s,e)},r,l)},mxDefaultPopupMenu.prototype.createConditions=function(e,t,n){var a=e.graph.getModel(),i=a.getChildCount(t),o=[];for(o.nocell=null==t,o.ncells=1<e.graph.getSelectionCount(),o.notRoot=a.getRoot()!=a.getParent(e.graph.getDefaultParent()),o.cell=null!=t,a=null!=t&&1==e.graph.getSelectionCount(),o.nonEmpty=a&&0<i,o.expandable=a&&e.graph.isCellFoldable(t,!1),o.collapsable=a&&e.graph.isCellFoldable(t,!0),o.validRoot=a&&e.graph.isValidRoot(t),o.emptyValidRoot=o.validRoot&&0==i,o.swimlane=a&&e.graph.isSwimlane(t),i=this.config.getElementsByTagName("condition"),a=0;a<i.length;a++){var s=mxUtils.eval(mxUtils.getTextContent(i[a])),r=i[a].getAttribute("name");null!=r&&"function"==typeof s&&(o[r]=s(e,t,n))}return o},mxDefaultToolbar.prototype.editor=null,mxDefaultToolbar.prototype.toolbar=null,mxDefaultToolbar.prototype.resetHandler=null,mxDefaultToolbar.prototype.spacing=4,mxDefaultToolbar.prototype.connectOnDrop=!1,mxDefaultToolbar.prototype.init=function(e){null!=e&&(this.toolbar=new mxToolbar(e),this.toolbar.addListener(mxEvent.SELECT,mxUtils.bind(this,function(e,t){var n=t.getProperty("function");this.editor.insertFunction=null!=n?mxUtils.bind(this,function(){n.apply(this,arguments),this.toolbar.resetMode()}):null})),this.resetHandler=mxUtils.bind(this,function(){null!=this.toolbar&&this.toolbar.resetMode(!0)}),this.editor.graph.addListener(mxEvent.DOUBLE_CLICK,this.resetHandler),this.editor.addListener(mxEvent.ESCAPE,this.resetHandler))},mxDefaultToolbar.prototype.addItem=function(e,t,n,a){var i=mxUtils.bind(this,function(){null!=n&&0<n.length&&this.editor.execute(n)});return this.toolbar.addItem(e,t,i,a)},mxDefaultToolbar.prototype.addSeparator=function(e){e=e||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(e)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(e){return this.toolbar.addActionCombo(e)},mxDefaultToolbar.prototype.addActionOption=function(e,t,n){var a=mxUtils.bind(this,function(){this.editor.execute(n)});this.addOption(e,t,a)},mxDefaultToolbar.prototype.addOption=function(e,t,n){return this.toolbar.addOption(e,t,n)},mxDefaultToolbar.prototype.addMode=function(e,t,n,a,i){var o=mxUtils.bind(this,function(){this.editor.setMode(n),null!=i&&i(this.editor)});return this.toolbar.addSwitchMode(e,t,o,a)},mxDefaultToolbar.prototype.addPrototype=function(e,t,n,a,i,o){var s=function(){return"function"==typeof n?n():null!=n?n.clone():null},r=mxUtils.bind(this,function(e,t){"function"==typeof i?i(this.editor,s(),e,t):this.drop(s(),e,t),this.toolbar.resetMode(),mxEvent.consume(e)});return e=this.toolbar.addMode(e,t,r,a,null,o),this.installDropHandler(e,function(e,t,n){r(t,n)}),e},mxDefaultToolbar.prototype.drop=function(e,t,n){var a=this.editor.graph,i=a.getModel();if(null!=n&&!i.isEdge(n)&&this.connectOnDrop&&a.isCellConnectable(n))this.connect(e,t,n);else{for(;null!=n&&!a.isValidDropTarget(n,[e],t);)n=i.getParent(n);this.insert(e,t,n)}},mxDefaultToolbar.prototype.insert=function(e,t,n){var a=this.editor.graph;if(a.canImportCell(e)){var i=mxEvent.getClientX(t),o=mxEvent.getClientY(t);i=mxUtils.convertPoint(a.container,i,o);return a.isSplitEnabled()&&a.isSplitTarget(n,[e],t)?a.splitEdge(n,[e],null,i.x,i.y):this.editor.addVertex(n,e,i.x,i.y)}return null},mxDefaultToolbar.prototype.connect=function(e,t,n){var a=(t=this.editor.graph).getModel();if(null!=n&&t.isCellConnectable(e)&&t.isEdgeValid(null,n,e)){var i=null;a.beginUpdate();try{var o=a.getGeometry(n),s=a.getGeometry(e).clone();s.x=o.x+(o.width-s.width)/2,s.y=o.y+(o.height-s.height)/2;var r=this.spacing*t.gridSize,l=20*a.getDirectedEdgeCount(n,!0);this.editor.horizontalFlow?s.x+=(s.width+o.width)/2+r+l:s.y+=(s.height+o.height)/2+r+l,e.setGeometry(s);var d=a.getParent(n);if(t.addCell(e,d),t.constrainChild(e),i=this.editor.createEdge(n,e),null==a.getGeometry(i)){var c=new mxGeometry;c.relative=!0,a.setGeometry(i,c)}t.addEdge(i,d,n,e)}finally{a.endUpdate()}t.setSelectionCells([e,i]),t.scrollCellToVisible(e)}},mxDefaultToolbar.prototype.installDropHandler=function(t,n){var a=document.createElement("img");a.setAttribute("src",t.getAttribute("src"));var i=mxUtils.bind(this,function(e){a.style.width=2*t.offsetWidth+"px",a.style.height=2*t.offsetHeight+"px",mxUtils.makeDraggable(t,this.editor.graph,n,a),mxEvent.removeListener(a,"load",i)});mxClient.IS_IE?i():mxEvent.addListener(a,"load",i)},mxDefaultToolbar.prototype.destroy=function(){null!=this.resetHandler&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null)},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource="none"!=mxClient.language?"askZoom":"",mxEditor.prototype.lastSavedResource="none"!=mxClient.language?"lastSaved":"",mxEditor.prototype.currentFileResource="none"!=mxClient.language?"currentFile":"",mxEditor.prototype.propertiesResource="none"!=mxClient.language?"properties":"",mxEditor.prototype.tasksResource="none"!=mxClient.language?"tasks":"",mxEditor.prototype.helpResource="none"!=mxClient.language?"help":"",mxEditor.prototype.outlineResource="none"!=mxClient.language?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.session=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed="
",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.urlInit=null,mxEditor.prototype.urlNotify=null,mxEditor.prototype.urlPoll=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(e){this.modified=e},mxEditor.prototype.addActions=function(){this.addAction("save",function(e){e.save()}),this.addAction("print",function(e){new mxPrintPreview(e.graph,1).open()}),this.addAction("show",function(e){mxUtils.show(e.graph,null,10,10)}),this.addAction("exportImage",function(e){var t=e.getUrlImage();if(null==t||mxClient.IS_LOCAL)e.execute("show");else{var n=mxUtils.getViewXml(e.graph,1);n=mxUtils.getXml(n,"\n");mxUtils.submit(t,e.postParameterName+"="+encodeURIComponent(n),document,"_blank")}}),this.addAction("refresh",function(e){e.graph.refresh()}),this.addAction("cut",function(e){e.graph.isEnabled()&&mxClipboard.cut(e.graph)}),this.addAction("copy",function(e){e.graph.isEnabled()&&mxClipboard.copy(e.graph)}),this.addAction("paste",function(e){e.graph.isEnabled()&&mxClipboard.paste(e.graph)}),this.addAction("delete",function(e){e.graph.isEnabled()&&e.graph.removeCells()}),this.addAction("group",function(e){e.graph.isEnabled()&&e.graph.setSelectionCell(e.groupCells())}),this.addAction("ungroup",function(e){e.graph.isEnabled()&&e.graph.setSelectionCells(e.graph.ungroupCells())}),this.addAction("removeFromParent",function(e){e.graph.isEnabled()&&e.graph.removeCellsFromParent()}),this.addAction("undo",function(e){e.graph.isEnabled()&&e.undo()}),this.addAction("redo",function(e){e.graph.isEnabled()&&e.redo()}),this.addAction("zoomIn",function(e){e.graph.zoomIn()}),this.addAction("zoomOut",function(e){e.graph.zoomOut()}),this.addAction("actualSize",function(e){e.graph.zoomActual()}),this.addAction("fit",function(e){e.graph.fit()}),this.addAction("showProperties",function(e,t){e.showProperties(t)}),this.addAction("selectAll",function(e){e.graph.isEnabled()&&e.graph.selectAll()}),this.addAction("selectNone",function(e){e.graph.isEnabled()&&e.graph.clearSelection()}),this.addAction("selectVertices",function(e){e.graph.isEnabled()&&e.graph.selectVertices()}),this.addAction("selectEdges",function(e){e.graph.isEnabled()&&e.graph.selectEdges()}),this.addAction("edit",function(e,t){e.graph.isEnabled()&&e.graph.isCellEditable(t)&&e.graph.startEditingAtCell(t)}),this.addAction("toBack",function(e,t){e.graph.isEnabled()&&e.graph.orderCells(!0)}),this.addAction("toFront",function(e,t){e.graph.isEnabled()&&e.graph.orderCells(!1)}),this.addAction("enterGroup",function(e,t){e.graph.enterGroup(t)}),this.addAction("exitGroup",function(e){e.graph.exitGroup()}),this.addAction("home",function(e){e.graph.home()}),this.addAction("selectPrevious",function(e){e.graph.isEnabled()&&e.graph.selectPreviousCell()}),this.addAction("selectNext",function(e){e.graph.isEnabled()&&e.graph.selectNextCell()}),this.addAction("selectParent",function(e){e.graph.isEnabled()&&e.graph.selectParentCell()}),this.addAction("selectChild",function(e){e.graph.isEnabled()&&e.graph.selectChildCell()}),this.addAction("collapse",function(e){e.graph.isEnabled()&&e.graph.foldCells(!0)}),this.addAction("collapseAll",function(e){if(e.graph.isEnabled()){var t=e.graph.getChildVertices();e.graph.foldCells(!0,!1,t)}}),this.addAction("expand",function(e){e.graph.isEnabled()&&e.graph.foldCells(!1)}),this.addAction("expandAll",function(e){if(e.graph.isEnabled()){var t=e.graph.getChildVertices();e.graph.foldCells(!1,!1,t)}}),this.addAction("bold",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)}),this.addAction("italic",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)}),this.addAction("underline",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)}),this.addAction("shadow",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_SHADOW)}),this.addAction("alignCellsLeft",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_LEFT)}),this.addAction("alignCellsCenter",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_CENTER)}),this.addAction("alignCellsRight",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_RIGHT)}),this.addAction("alignCellsTop",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_TOP)}),this.addAction("alignCellsMiddle",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_MIDDLE)}),this.addAction("alignCellsBottom",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_BOTTOM)}),this.addAction("alignFontLeft",function(e){e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)}),this.addAction("alignFontCenter",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)}),this.addAction("alignFontRight",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)}),this.addAction("alignFontTop",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)}),this.addAction("alignFontMiddle",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)}),this.addAction("alignFontBottom",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)}),this.addAction("zoom",function(e){var t=100*e.graph.getView().scale;t=parseFloat(mxUtils.prompt(mxResources.get(e.askZoomResource)||e.askZoomResource,t))/100;isNaN(t)||e.graph.getView().setScale(t)}),this.addAction("toggleTasks",function(e){null!=e.tasks?e.tasks.setVisible(!e.tasks.isVisible()):e.showTasks()}),this.addAction("toggleHelp",function(e){null!=e.help?e.help.setVisible(!e.help.isVisible()):e.showHelp()}),this.addAction("toggleOutline",function(e){null==e.outline?e.showOutline():e.outline.setVisible(!e.outline.isVisible())}),this.addAction("toggleConsole",function(e){mxLog.setVisible(!mxLog.isVisible())})},mxEditor.prototype.createSession=function(){var e=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.SESSION,"session",e))});return this.connect(this.urlInit,this.urlPoll,this.urlNotify,e)},mxEditor.prototype.configure=function(e){null!=e&&(new mxCodec(e.ownerDocument).decode(e,this),this.resetHistory())},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=(new Date).getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(e,t){this.actions[e]=t},mxEditor.prototype.execute=function(t,e,n){var a=this.actions[t];if(null!=a)try{var i=arguments;i[0]=this,a.apply(this,i)}catch(e){throw mxUtils.error("Cannot execute "+t+": "+e.message,280,!0),e}else mxUtils.error("Cannot find action "+t,280,!0)},mxEditor.prototype.addTemplate=function(e,t){this.templates[e]=t},mxEditor.prototype.getTemplate=function(e){return this.templates[e]},mxEditor.prototype.createGraph=function(){var e=new mxGraph(null,null,this.graphRenderHint);return e.setTooltips(!0),e.setPanning(!0),this.installDblClickHandler(e),this.installUndoHandler(e),this.installDrillHandler(e),this.installChangeHandler(e),this.installInsertHandler(e),e.panningHandler.factoryMethod=mxUtils.bind(this,function(e,t,n){return this.createPopupMenu(e,t,n)}),e.connectionHandler.factoryMethod=mxUtils.bind(this,function(e,t){return this.createEdge(e,t)}),this.createSwimlaneManager(e),this.createLayoutManager(e),e},mxEditor.prototype.createSwimlaneManager=function(e){return(e=new mxSwimlaneManager(e,!1)).isHorizontal=mxUtils.bind(this,function(){return this.horizontalFlow}),e.isEnabled=mxUtils.bind(this,function(){return this.maintainSwimlanes}),e},mxEditor.prototype.createLayoutManager=function(a){var e=new mxLayoutManager(a),i=this;return e.getLayout=function(e){var t=null,n=i.graph.getModel();return null!=n.getParent(e)&&(i.layoutSwimlanes&&a.isSwimlane(e)?(null==i.swimlaneLayout&&(i.swimlaneLayout=i.createSwimlaneLayout()),t=i.swimlaneLayout):i.layoutDiagram&&(a.isValidRoot(e)||null==n.getParent(n.getParent(e)))&&(null==i.diagramLayout&&(i.diagramLayout=i.createDiagramLayout()),t=i.diagramLayout)),t},e},mxEditor.prototype.setGraphContainer=function(e){null==this.graph.container&&(this.graph.init(e),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(e),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.installDblClickHandler=function(a){a.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,function(e,t){var n=t.getProperty("cell");null!=n&&a.isEnabled()&&null!=this.dblClickAction&&(this.execute(this.dblClickAction,n),t.consume())}))},mxEditor.prototype.installUndoHandler=function(a){var e=mxUtils.bind(this,function(e,t){var n=t.getProperty("edit");this.undoManager.undoableEditHappened(n)});a.getModel().addListener(mxEvent.UNDO,e),a.getView().addListener(mxEvent.UNDO,e),e=function(e,t){var n=t.getProperty("edit").changes;a.setSelectionCells(a.getSelectionCellsForChanges(n))},this.undoManager.addListener(mxEvent.UNDO,e),this.undoManager.addListener(mxEvent.REDO,e)},mxEditor.prototype.installDrillHandler=function(e){var t=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.ROOT))});e.getView().addListener(mxEvent.DOWN,t),e.getView().addListener(mxEvent.UP,t)},mxEditor.prototype.installChangeHandler=function(o){var e=mxUtils.bind(this,function(e,t){this.setModified(!0),1==this.validating&&o.validateGraph();for(var n=t.getProperty("edit").changes,a=0;a<n.length;a++){var i=n[a];if(i instanceof mxRootChange||i instanceof mxValueChange&&i.cell==this.graph.model.root||i instanceof mxCellAttributeChange&&i.cell==this.graph.model.root){this.fireEvent(new mxEventObject(mxEvent.ROOT));break}}});o.getModel().addListener(mxEvent.CHANGE,e)},mxEditor.prototype.installInsertHandler=function(e){var n=this;e.addMouseListener({mouseDown:function(e,t){null==n.insertFunction||t.isPopupTrigger()||!n.forcedInserting&&null!=t.getState()||(n.graph.clearSelection(),n.insertFunction(t.getEvent(),t.getCell()),this.isActive=!0,t.consume())},mouseMove:function(e,t){this.isActive&&t.consume()},mouseUp:function(e,t){this.isActive&&(this.isActive=!1,t.consume())}})},mxEditor.prototype.createDiagramLayout=function(){var e=this.graph.gridSize,t=new mxStackLayout(this.graph,!this.horizontalFlow,this.swimlaneSpacing,2*e,2*e);return t.isVertexIgnored=function(e){return!t.graph.isSwimlane(e)},t},mxEditor.prototype.createSwimlaneLayout=function(){return new mxCompactTreeLayout(this.graph,this.horizontalFlow)},mxEditor.prototype.createToolbar=function(){return new mxDefaultToolbar(null,this)},mxEditor.prototype.setToolbarContainer=function(e){this.toolbar.init(e),mxClient.IS_QUIRKS&&new mxDivResizer(e)},mxEditor.prototype.setStatusContainer=function(e){null==this.status&&(this.status=e,this.addListener(mxEvent.SAVE,mxUtils.bind(this,function(){var e=(new Date).toLocaleString();this.setStatus((mxResources.get(this.lastSavedResource)||this.lastSavedResource)+": "+e)})),this.addListener(mxEvent.OPEN,mxUtils.bind(this,function(){this.setStatus((mxResources.get(this.currentFileResource)||this.currentFileResource)+": "+this.filename)})),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.setStatus=function(e){null!=this.status&&null!=e&&(this.status.innerHTML=e)},mxEditor.prototype.setTitleContainer=function(t){this.addListener(mxEvent.ROOT,mxUtils.bind(this,function(e){t.innerHTML=this.getTitle()})),mxClient.IS_QUIRKS&&new mxDivResizer(t)},mxEditor.prototype.treeLayout=function(e,t){null!=e&&new mxCompactTreeLayout(this.graph,t).execute(e)},mxEditor.prototype.getTitle=function(){for(var e="",t=this.graph,n=t.getCurrentRoot();null!=n&&null!=t.getModel().getParent(t.getModel().getParent(n));)t.isValidRoot(n)&&(e=" > "+t.convertValueToString(n)+e),n=t.getModel().getParent(n);return this.getRootTitle()+e},mxEditor.prototype.getRootTitle=function(){var e=this.graph.getModel().getRoot();return this.graph.convertValueToString(e)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var e=null!=this.groupBorderSize?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),e)},mxEditor.prototype.createGroup=function(){return this.graph.getModel().cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(e){if(null!=e){var t=mxUtils.load(e).getXml();this.readGraphModel(t.documentElement),this.filename=e,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",e))}},mxEditor.prototype.readGraphModel=function(e){new mxCodec(e.ownerDocument).decode(e,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(e,t){if(null!=(e=e||this.getUrlPost())&&0<e.length){var n=this.writeGraphModel(t);this.postDiagram(e,n),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",e))},mxEditor.prototype.postDiagram=function(t,n){this.escapePostData&&(n=encodeURIComponent(n)),mxUtils.post(t,this.postParameterName+"="+n,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.POST,"request",e,"url",t,"data",n))}))},mxEditor.prototype.writeGraphModel=function(e){e=null!=e?e:this.linefeed;var t=(new mxCodec).encode(this.graph.getModel());return mxUtils.getXml(t,e)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.connect=function(e,t,n,a){var i=null;return mxClient.IS_LOCAL||((i=new mxSession(this.graph.getModel(),e,t,n)).addListener(mxEvent.RECEIVE,mxUtils.bind(this,function(e,t){null!=t.getProperty("node").getAttribute("namespace")&&this.resetHistory()})),i.addListener(mxEvent.DISCONNECT,a),i.addListener(mxEvent.CONNECT,a),i.addListener(mxEvent.NOTIFY,a),i.addListener(mxEvent.GET,a),i.start()),i},mxEditor.prototype.swapStyles=function(e,t){var n=this.graph.getStylesheet().styles[t];this.graph.getView().getStylesheet().putCellStyle(t,this.graph.getStylesheet().styles[e]),this.graph.getStylesheet().putCellStyle(e,n),this.graph.refresh()},mxEditor.prototype.showProperties=function(e){if(null==(e=e||this.graph.getSelectionCell())&&(null==(e=this.graph.getCurrentRoot())&&(e=this.graph.getModel().getRoot())),null!=e){this.graph.stopEditing(!0);var t=(n=mxUtils.getOffset(this.graph.container)).x+10,n=n.y;if(null==this.properties||this.movePropertiesDialog){var a=this.graph.getCellBounds(e);null!=a&&(t+=a.x+Math.min(200,a.width),n+=a.y)}else t=this.properties.getX(),n=this.properties.getY();this.hideProperties(),null!=(e=this.createProperties(e))&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,e,t,n,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return null!=this.properties},mxEditor.prototype.createProperties=function(n){var a=this.graph.getModel(),e=a.getValue(n);if(mxUtils.isNode(e)){var t=new mxForm("properties");t.addText("ID",n.getId()).setAttribute("readonly","true");var i=null,o=null,s=null,r=null,l=null;a.isVertex(n)&&(null!=(i=a.getGeometry(n))&&(o=t.addText("top",i.y),s=t.addText("left",i.x),r=t.addText("width",i.width),l=t.addText("height",i.height)));var d=a.getStyle(n),c=t.addText("Style",d||""),m=e.attributes,u=[];for(e=0;e<m.length;e++)u[e]=t.addTextarea(m[e].nodeName,m[e].nodeValue,"label"==m[e].nodeName?4:2);return e=mxUtils.bind(this,function(){this.hideProperties(),a.beginUpdate();try{null!=i&&((i=i.clone()).x=parseFloat(s.value),i.y=parseFloat(o.value),i.width=parseFloat(r.value),i.height=parseFloat(l.value),a.setGeometry(n,i)),0<c.value.length?a.setStyle(n,c.value):a.setStyle(n,null);for(var e=0;e<m.length;e++){var t=new mxCellAttributeChange(n,m[e].nodeName,u[e].value);a.execute(t)}this.graph.isAutoSizeCell(n)&&this.graph.updateCellSize(n)}finally{a.endUpdate()}}),d=mxUtils.bind(this,function(){this.hideProperties()}),t.addButtons(e,d),t.table}return null},mxEditor.prototype.hideProperties=function(){null!=this.properties&&(this.properties.destroy(),this.properties=null)},mxEditor.prototype.showTasks=function(){if(null==this.tasks){var t=document.createElement("div");t.style.padding="4px",t.style.paddingLeft="20px";var e=document.body.clientWidth;(e=new mxWindow(mxResources.get(this.tasksResource)||this.tasksResource,t,e-220,this.tasksTop,200)).setClosable(!0),e.destroyOnClose=!1;var n=mxUtils.bind(this,function(e){mxEvent.release(t),t.innerHTML="",this.createTasks(t)});this.graph.getModel().addListener(mxEvent.CHANGE,n),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,n),this.graph.addListener(mxEvent.ROOT,n),null!=this.tasksWindowImage&&e.setImage(this.tasksWindowImage),this.tasks=e,this.createTasks(t)}this.tasks.setVisible(!0)},mxEditor.prototype.refreshTasks=function(e){null!=this.tasks&&(e=this.tasks.content,mxEvent.release(e),e.innerHTML="",this.createTasks(e))},mxEditor.prototype.createTasks=function(e){},mxEditor.prototype.showHelp=function(e){if(null==this.help){var t=document.createElement("iframe");t.setAttribute("src",mxResources.get("urlHelp")||this.urlHelp),t.setAttribute("height","100%"),t.setAttribute("width","100%"),t.setAttribute("frameBorder","0"),t.style.backgroundColor="white",e=document.body.clientWidth;var n=document.body.clientHeight||document.documentElement.clientHeight,a=new mxWindow(mxResources.get(this.helpResource)||this.helpResource,t,(e-this.helpWidth)/2,(n-this.helpHeight)/3,this.helpWidth,this.helpHeight);a.setMaximizable(!0),a.setClosable(!0),a.destroyOnClose=!1,a.setResizable(!0),null!=this.helpWindowImage&&a.setImage(this.helpWindowImage),mxClient.IS_NS&&(e=function(e){t.setAttribute("height",a.div.offsetHeight-26+"px")},a.addListener(mxEvent.RESIZE_END,e),a.addListener(mxEvent.MAXIMIZE,e),a.addListener(mxEvent.NORMALIZE,e),a.addListener(mxEvent.SHOW,e)),this.help=a}this.help.setVisible(!0)},mxEditor.prototype.showOutline=function(){if(null==this.outline){var e=document.createElement("div");e.style.overflow="hidden",e.style.width="100%",e.style.height="100%",e.style.background="white",e.style.cursor="move";var t=new mxWindow(mxResources.get(this.outlineResource)||this.outlineResource,e,600,480,200,200,!1),n=new mxOutline(this.graph,e);t.setClosable(!0),t.setResizable(!0),t.destroyOnClose=!1,t.addListener(mxEvent.RESIZE_END,function(){n.update()}),this.outline=t,this.outline.outline=n}this.outline.setVisible(!0),this.outline.outline.update(!0)},mxEditor.prototype.setMode=function(e){"select"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!1)):"connect"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!0)):"pan"==e&&(this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.setConnectable(!1))},mxEditor.prototype.createPopupMenu=function(e,t,n){this.popupHandler.createMenu(this,e,t,n)},mxEditor.prototype.createEdge=function(e,t){var n=null;if(null!=this.defaultEdge)n=this.graph.getModel().cloneCell(this.defaultEdge);else{(n=new mxCell("")).setEdge(!0);var a=new mxGeometry;a.relative=!0,n.setGeometry(a)}return null!=(a=this.getEdgeStyle())&&n.setStyle(a),n},mxEditor.prototype.getEdgeStyle=function(){return this.defaultEdgeStyle},mxEditor.prototype.consumeCycleAttribute=function(e){return null!=this.cycleAttributeValues&&0<this.cycleAttributeValues.length&&this.graph.isSwimlane(e)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(e){if(null!=this.cycleAttributeName){var t=this.consumeCycleAttribute(e);null!=t&&e.setStyle(e.getStyle()+";"+this.cycleAttributeName+"="+t)}},mxEditor.prototype.addVertex=function(e,t,n,a){for(var i=this.graph.getModel();null!=e&&!this.graph.isValidDropTarget(e);)e=i.getParent(e);e=null!=e?e:this.graph.getSwimlaneAt(n,a);var o=this.graph.getView().scale,s=i.getGeometry(t),r=i.getGeometry(e);if(this.graph.isSwimlane(t)&&!this.graph.swimlaneNesting)e=null;else{if(null==e&&this.swimlaneRequired)return null;if(null!=e&&null!=r){var l=this.graph.getView().getState(e);if(null!=l){if(n-=l.origin.x*o,a-=l.origin.y*o,this.graph.isConstrainedMoving){r=s.width;var d=s.height,c=l.x+l.width;c<n+r&&(n-=n+r-c),(c=l.y+l.height)<a+d&&(a-=a+d-c)}}else null!=r&&(n-=r.x*o,a-=r.y*o)}}(s=s.clone()).x=this.graph.snap(n/o-this.graph.getView().translate.x-this.graph.gridSize/2),s.y=this.graph.snap(a/o-this.graph.getView().translate.y-this.graph.gridSize/2),t.setGeometry(s),null==e&&(e=this.graph.getDefaultParent()),this.cycleAttribute(t),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",t,"parent",e)),i.beginUpdate();try{null!=(t=this.graph.addCell(t,e))&&(this.graph.constrainChild(t),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",t)))}finally{i.endUpdate()}return null!=t&&(this.graph.setSelectionCell(t),this.graph.scrollCellToVisible(t),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",t))),t},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.templates=this.status=null)};var mxCodecRegistry={codecs:[],aliases:[],register:function(e){if(null!=e){var t=e.getName();mxCodecRegistry.codecs[t]=e;var n=mxUtils.getFunctionName(e.template.constructor);n!=t&&mxCodecRegistry.addAlias(n,t)}return e},addAlias:function(e,t){mxCodecRegistry.aliases[e]=t},getCodec:function(e){var t=null;if(null!=e){t=mxUtils.getFunctionName(e);var n=mxCodecRegistry.aliases[t];if(null!=n&&(t=n),null==(t=mxCodecRegistry.codecs[t]))try{t=new mxObjectCodec(new e),mxCodecRegistry.register(t)}catch(e){}}return t}};function mxCodec(e){this.document=e||mxUtils.createXmlDocument(),this.objects=[]}function mxObjectCodec(e,t,n,a){for(var i in this.template=e,this.exclude=null!=t?t:[],this.idrefs=null!=n?n:[],this.mapping=null!=a?a:[],this.reverse={},this.mapping)this.reverse[this.mapping[i]]=i}mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(e,t){return this.objects[e]=t},mxCodec.prototype.getObject=function(e){var t=null;return null!=e&&(null==(t=this.objects[e])&&(null==(t=this.lookup(e))&&(null!=(e=this.getElementById(e))&&(t=this.decode(e))))),t},mxCodec.prototype.lookup=function(e){return null},mxCodec.prototype.getElementById=function(e,t){return mxUtils.findNodeByAttribute(this.document.documentElement,null!=t?t:"id",e)},mxCodec.prototype.getId=function(e){var t=null;return null!=e&&(null==(t=this.reference(e))&&e instanceof mxCell&&(null==(t=e.getId())&&(0==(t=mxCellPath.create(e)).length&&(t="root")))),t},mxCodec.prototype.reference=function(e){return null},mxCodec.prototype.encode=function(e){var t=null;if(null!=e&&null!=e.constructor){var n=mxCodecRegistry.getCodec(e.constructor);null!=n?t=n.encode(this,e):mxUtils.isNode(e)?t=mxClient.IS_IE?e.cloneNode(!0):this.document.importNode(e,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(e.constructor))}return t},mxCodec.prototype.decode=function(a,b){var c=null;if(null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){var d=null;try{d=eval(a.nodeName)}catch(e){}try{var f=mxCodecRegistry.getCodec(d);null!=f?c=f.decode(this,a,b):(c=a.cloneNode(!0),c.removeAttribute("as"))}catch(e){mxLog.debug("Cannot decode "+a.nodeName+": "+e.message)}}return c},mxCodec.prototype.encodeCell=function(e,t,n){if(t.appendChild(this.encode(e)),null==n||n){n=e.getChildCount();for(var a=0;a<n;a++)this.encodeCell(e.getChildAt(a),t)}},mxCodec.prototype.isCellCodec=function(e){return null!=e&&"function"==typeof e.isCellCodec&&e.isCellCodec()},mxCodec.prototype.decodeCell=function(e,t){t=null==t||t;var n=null;if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){if(n=mxCodecRegistry.getCodec(e.nodeName),!this.isCellCodec(n))for(var a=e.firstChild;null!=a&&!this.isCellCodec(n);)n=mxCodecRegistry.getCodec(a.nodeName),a=a.nextSibling;this.isCellCodec(n)||(n=mxCodecRegistry.getCodec(mxCell)),n=n.decode(this,e),t&&this.insertIntoGraph(n)}return n},mxCodec.prototype.insertIntoGraph=function(e){var t=e.parent,n=e.getTerminal(!0),a=e.getTerminal(!1);e.setTerminal(null,!1),e.setTerminal(null,!0),(e.parent=null)!=t&&t.insert(e),null!=n&&n.insertEdge(e,!0),null!=a&&a.insertEdge(e,!1)},mxCodec.prototype.setAttribute=function(e,t,n){null!=t&&null!=n&&e.setAttribute(t,n)},mxObjectCodec.prototype.template=null,mxObjectCodec.prototype.exclude=null,mxObjectCodec.prototype.idrefs=null,mxObjectCodec.prototype.mapping=null,mxObjectCodec.prototype.reverse=null,mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)},mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor},mxObjectCodec.prototype.getFieldName=function(e){if(null!=e){var t=this.reverse[e];null!=t&&(e=t)}return e},mxObjectCodec.prototype.getAttributeName=function(e){if(null!=e){var t=this.mapping[e];null!=t&&(e=t)}return e},mxObjectCodec.prototype.isExcluded=function(e,t,n,a){return t==mxObjectIdentity.FIELD_NAME||0<=mxUtils.indexOf(this.exclude,t)},mxObjectCodec.prototype.isReference=function(e,t,n,a){return 0<=mxUtils.indexOf(this.idrefs,t)},mxObjectCodec.prototype.encode=function(e,t){var n=e.document.createElement(this.getName());return t=this.beforeEncode(e,t,n),this.encodeObject(e,t,n),this.afterEncode(e,t,n)},mxObjectCodec.prototype.encodeObject=function(e,t,n){for(var a in e.setAttribute(n,"id",e.getId(t)),t){var i=a,o=t[i];null!=o&&!this.isExcluded(t,i,o,!0)&&(mxUtils.isNumeric(i)&&(i=null),this.encodeValue(e,t,i,o,n))}},mxObjectCodec.prototype.encodeValue=function(e,t,n,a,i){if(null!=a){if(this.isReference(t,n,a,!0)){var o=e.getId(a);if(null==o)return void mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+n+"="+a);a=o}o=this.template[n],(null==n||e.encodeDefaults||o!=a)&&(n=this.getAttributeName(n),this.writeAttribute(e,t,n,a,i))}},mxObjectCodec.prototype.writeAttribute=function(e,t,n,a,i){"object"!=typeof a?this.writePrimitiveAttribute(e,t,n,a,i):this.writeComplexAttribute(e,t,n,a,i)},mxObjectCodec.prototype.writePrimitiveAttribute=function(e,t,n,a,i){a=this.convertValueToXml(a),null==n?(t=e.document.createElement("add"),"function"==typeof a?t.appendChild(e.document.createTextNode(a)):e.setAttribute(t,"value",a),i.appendChild(t)):"function"!=typeof a&&e.setAttribute(i,n,a)},mxObjectCodec.prototype.writeComplexAttribute=function(e,t,n,a,i){null!=(e=e.encode(a))?(null!=n&&e.setAttribute("as",n),i.appendChild(e)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+n+": "+a)},mxObjectCodec.prototype.convertValueToXml=function(e){return void 0!==e.length||1!=e&&0!=e||(e=1==e?"1":"0"),e},mxObjectCodec.prototype.convertValueFromXml=function(e){return mxUtils.isNumeric(e)&&(e=parseFloat(e)),e},mxObjectCodec.prototype.beforeEncode=function(e,t,n){return t},mxObjectCodec.prototype.afterEncode=function(e,t,n){return n},mxObjectCodec.prototype.decode=function(e,t,n){var a=t.getAttribute("id"),i=e.objects[a];return null==i&&(i=n||this.cloneTemplate(),null!=a&&e.putObject(a,i)),t=this.beforeDecode(e,t,i),this.decodeNode(e,t,i),this.afterDecode(e,t,i)},mxObjectCodec.prototype.decodeNode=function(e,t,n){null!=t&&(this.decodeAttributes(e,t,n),this.decodeChildren(e,t,n))},mxObjectCodec.prototype.decodeAttributes=function(e,t,n){if(null!=(t=t.attributes))for(var a=0;a<t.length;a++)this.decodeAttribute(e,t[a],n)},mxObjectCodec.prototype.decodeAttribute=function(e,t,n){var a=t.nodeName;if("as"!=a&&"id"!=a){t=this.convertValueFromXml(t.nodeValue);var i=this.getFieldName(a);if(this.isReference(n,i,t,!1)){if(null==(e=e.getObject(t)))return void mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+a+"="+t);t=e}this.isExcluded(n,a,t,!1)||(n[a]=t)}},mxObjectCodec.prototype.decodeChildren=function(e,t,n){for(t=t.firstChild;null!=t;){var a=t.nextSibling;t.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,t,n)&&this.decodeChild(e,t,n),t=a}},mxObjectCodec.prototype.decodeChild=function(e,t,n){var a=this.getFieldName(t.getAttribute("as"));if(null==a||!this.isExcluded(n,a,t,!1)){var i=this.getFieldTemplate(n,a,t),o=null;"add"==t.nodeName?null==(o=t.getAttribute("value"))&&(o=mxUtils.eval(mxUtils.getTextContent(t))):o=e.decode(t,i),this.addObjectValue(n,a,o,i)}},mxObjectCodec.prototype.getFieldTemplate=function(e,t,n){return(e=e[t])instanceof Array&&0<e.length&&(e=null),e},mxObjectCodec.prototype.addObjectValue=function(e,t,n,a){null!=n&&n!=a&&(null!=t&&0<t.length?e[t]=n:e.push(n))},mxObjectCodec.prototype.processInclude=function(e,t,n){if("include"==t.nodeName){if(null!=(t=t.getAttribute("name")))try{var a=mxUtils.load(t).getDocumentElement();null!=a&&e.decode(a,n)}catch(e){}return!0}return!1},mxObjectCodec.prototype.beforeDecode=function(e,t,n){return t},mxObjectCodec.prototype.afterDecode=function(e,t,n){return n},mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);return e.isCellCodec=function(){return!0},e.isExcluded=function(e,t,n,a){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||a&&"value"==t&&n.nodeType==mxConstants.NODETYPE_ELEMENT},e.afterEncode=function(e,t,n){if(null!=t.value&&t.value.nodeType==mxConstants.NODETYPE_ELEMENT){var a=n;(n=mxClient.IS_IE?t.value.cloneNode(!0):e.document.importNode(t.value,!0)).appendChild(a),e=a.getAttribute("id"),n.setAttribute("id",e),a.removeAttribute("id")}return n},e.beforeDecode=function(e,t,n){var a=t,i=this.getName();if(t.nodeName!=i?(null!=(a=t.getElementsByTagName(i)[0])&&a.parentNode==t?(mxUtils.removeWhitespace(a,!0),mxUtils.removeWhitespace(a,!1),a.parentNode.removeChild(a)):a=null,n.value=t.cloneNode(!0),null!=(t=n.value.getAttribute("id"))&&(n.setId(t),n.value.removeAttribute("id"))):n.setId(t.getAttribute("id")),null!=a)for(t=0;t<this.idrefs.length;t++){i=this.idrefs[t];var o=a.getAttribute(i);if(null!=o){a.removeAttribute(i);var s=e.objects[o]||e.lookup(o);null==s&&(null!=(o=e.getElementById(o))&&(s=(mxCodecRegistry.codecs[o.nodeName]||this).decode(e,o))),n[i]=s}}return a},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphModel);return e.encodeObject=function(e,t,n){var a=e.document.createElement("root");e.encodeCell(t.getRoot(),a),n.appendChild(a)},e.decodeChild=function(e,t,n){"root"==t.nodeName?this.decodeRoot(e,t,n):mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeRoot=function(e,t,n){var a=null;for(t=t.firstChild;null!=t;){var i=e.decodeCell(t);null!=i&&null==i.getParent()&&(a=i),t=t.nextSibling}null!=a&&n.setRoot(a)},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxRootChange,["model","previous","root"]);return e.afterEncode=function(e,t,n){return e.encodeCell(t.root,n),n},e.beforeDecode=function(e,t,n){if(null!=t.firstChild&&t.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(t=t.cloneNode(!0)).firstChild;for(n.root=e.decodeCell(a,!1),n=a.nextSibling,a.parentNode.removeChild(a),a=n;null!=a;)n=a.nextSibling,e.decodeCell(a),a.parentNode.removeChild(a),a=n}return t},e.afterDecode=function(e,t,n){return n.previous=n.root,n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);return e.isReference=function(e,t,n,a){return!("child"!=t||null==e.previous&&a)||0<=mxUtils.indexOf(this.idrefs,t)},e.afterEncode=function(e,t,n){return this.isReference(t,"child",t.child,!0)?n.setAttribute("child",e.getId(t.child)):e.encodeCell(t.child,n),n},e.beforeDecode=function(e,t,n){if(null!=t.firstChild&&t.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(t=t.cloneNode(!0)).firstChild;for(n.child=e.decodeCell(a,!1),n=a.nextSibling,a.parentNode.removeChild(a),a=n;null!=a;){if(n=a.nextSibling,a.nodeType==mxConstants.NODETYPE_ELEMENT){var i=a.getAttribute("id");null==e.lookup(i)&&e.decodeCell(a)}a.parentNode.removeChild(a),a=n}}else a=t.getAttribute("child"),n.child=e.getObject(a);return t},e.afterDecode=function(e,t,n){return n.child.parent=n.previous,n.previous=n.parent,n.previousIndex=n.index,n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return e.afterDecode=function(e,t,n){return n.previous=n.terminal,n},e}());var mxGenericChangeCodec=function(e,a){var t=new mxObjectCodec(e,["model","previous"],["cell"]);return t.afterDecode=function(e,t,n){return mxUtils.isNode(n.cell)&&(n.cell=e.decodeCell(n.cell,!1)),n.previous=n[a],n},t};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),mxCodecRegistry.register(new mxObjectCodec(new mxGraph,"graphListeners eventListeners view container cellRenderer editor selection".split(" "))),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphView);return e.encode=function(e,t){return this.encodeCell(e,t,t.graph.getModel().getRoot())},e.encodeCell=function(e,t,n){var a=t.graph.getModel(),i=t.getState(n),o=a.getParent(n);if(null==o||null!=i){var s=a.getChildCount(n),r=t.graph.getCellGeometry(n),l=null;if(o==a.getRoot()?l="layer":null==o?l="graph":a.isEdge(n)?l="edge":0<s&&null!=r?l="group":a.isVertex(n)&&(l="vertex"),null!=l){var d=e.document.createElement(l);if(null!=t.graph.getLabel(n)&&(d.setAttribute("label",t.graph.getLabel(n)),t.graph.isHtmlLabel(n)&&d.setAttribute("html",!0)),null==o){var c=t.getGraphBounds();null!=c&&(d.setAttribute("x",Math.round(c.x)),d.setAttribute("y",Math.round(c.y)),d.setAttribute("width",Math.round(c.width)),d.setAttribute("height",Math.round(c.height))),d.setAttribute("scale",t.scale)}else if(null!=i&&null!=r){for(c in i.style)"function"==typeof(o=i.style[c])&&"object"==typeof o&&(o=mxStyleRegistry.getName(o)),null!=o&&"function"!=typeof o&&"object"!=typeof o&&d.setAttribute(c,o);if(null!=(o=i.absolutePoints)&&0<o.length){for(r=Math.round(o[0].x)+","+Math.round(o[0].y),c=1;c<o.length;c++)r+=" "+Math.round(o[c].x)+","+Math.round(o[c].y);d.setAttribute("points",r)}else d.setAttribute("x",Math.round(i.x)),d.setAttribute("y",Math.round(i.y)),d.setAttribute("width",Math.round(i.width)),d.setAttribute("height",Math.round(i.height));null!=(c=i.absoluteOffset)&&(0!=c.x&&d.setAttribute("dx",Math.round(c.x)),0!=c.y&&d.setAttribute("dy",Math.round(c.y)))}for(c=0;c<s;c++)null!=(i=this.encodeCell(e,t,a.getChildAt(n,c)))&&d.appendChild(i)}}return d},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxStylesheet);return e.encode=function(e,t){var n,a=e.document.createElement(this.getName());for(n in t.styles){var i=t.styles[n],o=e.document.createElement("add");if(null!=n){for(var s in o.setAttribute("as",n),i){var r=this.getStringValue(s,i[s]);if(null!=r){var l=e.document.createElement("add");l.setAttribute("value",r),l.setAttribute("as",s),o.appendChild(l)}}0<o.childNodes.length&&a.appendChild(o)}}return a},e.getStringValue=function(e,t){var n=typeof t;return"function"==n?t=mxStyleRegistry.getName(style[j]):"object"==n&&(t=null),t},e.decode=function(e,t,n){n=n||new this.template.constructor;var a=t.getAttribute("id");for(null!=a&&(e.objects[a]=n),t=t.firstChild;null!=t;){if(!this.processInclude(e,t,n)&&"add"==t.nodeName&&null!=(a=t.getAttribute("as"))){var i=t.getAttribute("extend"),o=null!=i?mxUtils.clone(n.styles[i]):null;for(null==o&&(null!=i&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+i+" not found to extend"),o={}),i=t.firstChild;null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT){var s=i.getAttribute("as");if("add"==i.nodeName){var r=mxUtils.getTextContent(i),l=null;null!=r&&0<r.length?l=mxUtils.eval(r):(l=i.getAttribute("value"),mxUtils.isNumeric(l)&&(l=parseFloat(l))),null!=l&&(o[s]=l)}else"remove"==i.nodeName&&delete o[s]}i=i.nextSibling}n.putCellStyle(a,o)}t=t.nextSibling}return n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultKeyHandler);return e.encode=function(e,t){return null},e.decode=function(e,t,n){if(null!=n)for(t=t.firstChild;null!=t;){if(!this.processInclude(e,t,n)&&"add"==t.nodeName){var a=t.getAttribute("as"),i=t.getAttribute("action"),o=t.getAttribute("control");n.bindAction(a,i,o)}t=t.nextSibling}return n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultToolbar);return e.encode=function(e,t){return null},e.decode=function(e,t,n){if(null!=n){var a=n.editor;for(t=t.firstChild;null!=t;){if(t.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,t,n))if("separator"==t.nodeName)n.addSeparator();else if("br"==t.nodeName)n.toolbar.addBreak();else if("hr"==t.nodeName)n.toolbar.addLine();else if("add"==t.nodeName){var i=t.getAttribute("as"),o=(i=mxResources.get(i)||i,t.getAttribute("icon")),s=t.getAttribute("pressedIcon"),r=t.getAttribute("action"),l=t.getAttribute("mode"),d=t.getAttribute("template"),c="0"!=t.getAttribute("toggle"),m=mxUtils.getTextContent(t),u=null;if(null!=r)u=n.addItem(i,o,r,s);else if(null!=l){var p=mxUtils.eval(m);u=n.addMode(i,o,l,s,p)}else if(null!=d||null!=m&&0<m.length)u=a.templates[d],d=t.getAttribute("style"),null!=u&&null!=d&&(u=u.clone()).setStyle(d),(d=null)!=m&&0<m.length&&(d=mxUtils.eval(m)),u=n.addPrototype(i,o,u,s,d,c);else if(0<(s=mxUtils.getChildNodes(t)).length)if(null==o)for(d=n.addActionCombo(i),i=0;i<s.length;i++)"separator"==(c=s[i]).nodeName?n.addOption(d,"---"):"add"==c.nodeName&&(o=c.getAttribute("as"),c=c.getAttribute("action"),n.addActionOption(d,o,c));else{var g=null,v=n.addPrototype(i,o,function(){if(null!=(e=a.templates[g.value])){var e=e.clone(),t=g.options[g.selectedIndex].cellStyle;return null!=t&&e.setStyle(t),e}return mxLog.warn("Template "+e+" not found"),null},null,null,c);g=n.addCombo();for(mxEvent.addListener(g,"change",function(){n.toolbar.selectMode(v,function(e){return e=mxUtils.convertPoint(a.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a.addVertex(null,p(),e.x,e.y)}),n.toolbar.noReset=!1}),i=0;i<s.length;i++)"separator"==(c=s[i]).nodeName?n.addOption(g,"---"):"add"==c.nodeName&&(o=c.getAttribute("as"),m=c.getAttribute("template"),n.addOption(g,o,m||d).cellStyle=c.getAttribute("style"))}null!=u&&(null!=(d=t.getAttribute("id"))&&0<d.length&&u.setAttribute("id",d))}t=t.nextSibling}}return n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultPopupMenu);return e.encode=function(e,t){return null},e.decode=function(e,t,n){var a=t.getElementsByTagName("include")[0];return null!=a?this.processInclude(e,a,n):null!=n&&(n.config=t),n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxEditor,"modified lastSnapshot ignoredChanges undoManager graphContainer toolbarContainer".split(" "));return e.afterDecode=function(e,t,n){return null!=(e=t.getAttribute("defaultEdge"))&&(t.removeAttribute("defaultEdge"),n.defaultEdge=n.templates[e]),null!=(e=t.getAttribute("defaultGroup"))&&(t.removeAttribute("defaultGroup"),n.defaultGroup=n.templates[e]),n},e.decodeChild=function(e,t,n){if("Array"==t.nodeName){if("templates"==t.getAttribute("as"))return void this.decodeTemplates(e,t,n)}else if("ui"==t.nodeName)return void this.decodeUi(e,t,n);mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeUi=function(e,t,n){for(e=t.firstChild;null!=e;){if("add"==e.nodeName){t=e.getAttribute("as");var a=e.getAttribute("element"),i=e.getAttribute("style"),o=null;if(null!=a)null!=(o=document.getElementById(a))&&null!=i&&(o.style.cssText+=";"+i);else{a=parseInt(e.getAttribute("x"));var s=parseInt(e.getAttribute("y")),r=e.getAttribute("width"),l=e.getAttribute("height");(o=document.createElement("div")).style.cssText=i,new mxWindow(mxResources.get(t)||t,o,a,s,r,l,!1,!0).setVisible(!0)}"graph"==t?n.setGraphContainer(o):"toolbar"==t?n.setToolbarContainer(o):"title"==t?n.setTitleContainer(o):"status"==t?n.setStatusContainer(o):"map"==t&&n.setMapContainer(o)}else"resource"==e.nodeName?mxResources.add(e.getAttribute("basename")):"stylesheet"==e.nodeName&&mxClient.link("stylesheet",e.getAttribute("name"));e=e.nextSibling}},e.decodeTemplates=function(e,t,n){null==n.templates&&(n.templates=[]),t=mxUtils.getChildNodes(t);for(var a=0;a<t.length;a++){for(var i=t[a].getAttribute("as"),o=t[a].firstChild;null!=o&&1!=o.nodeType;)o=o.nextSibling;null!=o&&(n.templates[i]=e.decodeCell(o))}},e}()),EditorUi=function(e,t,n){this.projectDesignController=e,this.editor=t||new Editor,this.container=n||document.body;var a=t.graph,i=this;this.container.style.overflow="hidden",(new Image).src=mxPopupMenu.prototype.submenuImage,null!=mxConnectionHandler.prototype.connectImage&&((new Image).src=mxConnectionHandler.prototype.connectImage.src),this.actions=new Actions(this),this.menus=new Menus(this),this.createDivs(),this.refresh(),this.createUi();var o=mxUtils.bind(this,function(e){return null==e&&(e=window.event),!!this.isSelectionAllowed(e)||a.isEditing()});this.container==document.body&&(this.menubarContainer.onselectstart=o,this.menubarContainer.onmousedown=o,this.toolbarContainer.onselectstart=o,this.toolbarContainer.onmousedown=o,this.diagramContainer.onselectstart=o,this.diagramContainer.onmousedown=o,this.sidebarContainer.onselectstart=o,this.sidebarContainer.onmousedown=o,this.footerContainer.onselectstart=o,this.footerContainer.onmousedown=o),mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?(mxEvent.addListener(this.diagramContainer,"contextmenu",o),mxEvent.addListener(this.sidebarContainer,"contextmenu",o)):(this.diagramContainer.oncontextmenu=o,this.sidebarContainer.oncontextmenu=o),a.init(this.diagramContainer),a.refresh(),a.container.setAttribute("tabindex","0"),a.container.style.cursor="default",a.container.style.backgroundImage="url("+t.gridImage+")",a.container.style.backgroundPosition="-1px -1px",a.container.focus();var s=a.fireMouseEvent;a.fireMouseEvent=function(e,t,n){e==mxEvent.MOUSE_DOWN&&this.container.focus(),s.apply(this,arguments)},this.createMultiplicities(a.multiplicities,["start","finally","end"],[[1,1],[1,1],[0,0]],[[0,0],[0,0],[1,"n"]]),this.createMultiplicities(a.multiplicities,["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[[1,1],[0,0],[0,1],[0,1],[0,1],[1,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["login","pause","unpause","logout"],[[1,2],[1,2],[1,2],[1,2]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["set","math"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["background","playback","menu","saydigits","saynumber","sayphonetic","tts","ispeechtts","awspolly","getdigits","getsecretdigits","lumenvoxtts"],[[1,"n"],[1,1],[1,"n"],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,"n"],[1,"n"],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["record"],[[1,1]],[[1,"n"]]),this.createMultiplicities(a.multiplicities,["database","ispeechasr","sendSMS","sendMail","sendFax","googleasr","lumenvoxasr","tildeasr"],[[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["gotoc","gotoif","gotoiftime","vswitch"],[[0,0],[1,2],[1,2],[1,"n"]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["queuelog","goal"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["noop","system","agi","subproject","custom_app"],[[1,1],[1,1],[0,1],[0,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),a.dblClick=function(e,n){var t=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",n);this.fireEvent(t),!this.isEnabled()||mxEvent.isConsumed(e)||t.isConsumed()||(this.getModel().isEdge(n)?0<=["background","gotoif","gotoiftime","menu","getdigits","getsecretdigits","vswitch","login","pause","unpause","logout"].indexOf(n.source.value.tagName)&&this.startEditingAtCell(n):this.getModel().isVertex(n)&&i.projectDesignController.openDialog(n.getValue(),function(e){for(var t=0;t<e.length;t+=1)n.setAttribute(e[t].name,e[t].value);a.refresh(n)}),t.consume())},a.panningHandler.autoExpand=!0,a.panningHandler.factoryMethod=mxUtils.bind(this,function(e,t,n){this.menus.createPopupMenu(e,t,n)}),t.outline.init(this.outlineContainer),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){a.panningHandler.hideMenu()})),mxClient.IS_TOUCH&&(mxEvent.addListener(a.container,"gesturechange",mxUtils.bind(this,function(e){a.view.getDrawPane().setAttribute("transform","scale("+e.scale+")"),a.view.getOverlayPane().style.visibility="hidden"})),mxEvent.addListener(a.container,"gestureend",mxUtils.bind(this,function(e){a.view.getDrawPane().removeAttribute("transform"),a.zoomToCenter=!0,a.zoom(e.scale),a.view.getOverlayPane().style.visibility="visible"})));var r=this.createKeyHandler(t);this.getKeyHandler=function(){return r},mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.refresh(),a.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.init(),this.open(),this.refresh()},EditorUi.prototype.splitSize=mxClient.IS_TOUCH?16:8,EditorUi.prototype.menubarHeight=33,EditorUi.prototype.toolbarHeight=36,EditorUi.prototype.footerHeight=0,EditorUi.prototype.hsplitPosition=204,EditorUi.prototype.vsplitPosition=190,EditorUi.prototype.init=function(){this.addUndoListener(),this.addSelectionListener();var e=this.actions.get("paste"),t=function(){e.setEnabled(!mxClipboard.isEmpty())},n=mxClipboard.cut;mxClipboard.cut=function(){n.apply(this,arguments),t()};var a=mxClipboard.copy;mxClipboard.copy=function(){a.apply(this,arguments),t()}},EditorUi.prototype.isSelectionAllowed=function(e){return!1},EditorUi.prototype.exportXML=function(e){var t=window.document.createElement("a");t.href="data:attachment/text;charset=utf-8,"+encodeURI(e),t.download=this.editor.filename+".xml",t.target="_self",t.click()},EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(e,t){try{var n=mxUtils.parseXml(e);this.editor.setGraphXml(n.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=t&&(this.editor.filename=t)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}}))}catch(e){}},EditorUi.prototype.openString=function(e,t,n){try{var a=mxUtils.parseXml(e);this.editor.setGraphXml(a.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=t&&(this.editor.filename=t),null!=n&&(this.editor.data=n)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}},EditorUi.prototype.validate=function(e,t){for(var n=this.editor.graph,a=(e=null!=e?e:n.model.getRoot(),t=null!=t?t:{},!0),i=n.model.getChildCount(e),o=0;o<i;o++){var s=n.model.getChildAt(e,o),r=t;n.isValidRoot(s)&&(r={}),null!=(r=this.validate(s,r))?n.setCellWarning(s,r.replace(/\n/g,"<br>")):n.setCellWarning(s,null),a=a&&null==r}if(i="",n.model.isVertex(e))switch(e.value.nodeName){case"start":i=this.validateBlock("start")?"":"Only one Start block is allowed\n";break;case"finally":i=this.validateBlock("finally")?"":"Only one Finally block is allowed\n";break;case"playback":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n";break;case"answer":i=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"menu":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("digit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("response")?"":mxResources.get("invalidTimeout")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getsecretdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("hiddendigitsnum")?"":mxResources.get("wrongHiddenDigitsnum")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"vswitch":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"database":i=0<e.value.getAttribute("odbc_id")?"":mxResources.get("noDatabaseSelected")+"\n",i+=""!==e.value.getAttribute("query")?"":mxResources.get("missingQuery")+"\n";break;case"set":case"math":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"gotoc":i=""!==e.value.getAttribute("context")?"":mxResources.get("noContextSelected")+"\n",i+=""!==e.value.getAttribute("extension")?"":mxResources.get("noExtensionSelected")+"\n",i+=1<=e.value.getAttribute("priority")?"":mxResources.get("invalidPriority")+"\n";break;case"system":case"agi":i=""!==e.value.getAttribute("command")?"":mxResources.get("noCommandSelected")+"\n";break;case"gotoif":i=""!==e.value.getAttribute("condition")?"":mxResources.get("noConditionSelected")+"\n";break;case"saydigits":i=""!==e.value.getAttribute("digits")?"":mxResources.get("noDigitsSelected")+"\n";break;case"saynumber":i=""!==e.value.getAttribute("number")?"":mxResources.get("noNumberSelected")+"\n";break;case"sayphonetic":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"record":i=""!==e.value.getAttribute("file")?"":mxResources.get("noFileSelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"goal":i=""!==e.value.getAttribute("goalname")?"":mxResources.get("noGoalSelected")+"\n";break;case"ext_dial":i="-1"!==e.value.getAttribute("trunk_name")?"":mxResources.get("noTrunkSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"dial":i=0<e.value.getAttribute("sip_id")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"queue":i="-1"!==e.value.getAttribute("queue_id")?"":mxResources.get("noQueueSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"callback":i="-1"!==e.value.getAttribute("list_id")?"":mxResources.get("noListSelected")+"\n",i+=""!==e.value.getAttribute("name")?"":mxResources.get("noFirstNameSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noPhoneSelected")+"\n",i+=0<=e.value.getAttribute("delay")?"":mxResources.get("invalidDelay")+"\n";break;case"gotoiftime":i=0<e.value.getAttribute("interval_id")?"":mxResources.get("noIntervalSelected")+"\n";break;case"voicemail":i=""!==e.value.getAttribute("mailbox")?"":mxResources.get("noBoxNumberSelected")+"\n";break;case"subproject":i=0<e.value.getAttribute("project_id")?"":mxResources.get("noProjectSelected")+"\n";break;case"sendSMS":i=0<e.value.getAttribute("sms_account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("sms_text")?"":mxResources.get("noTextSelected")+"\n";break;case"sendMail":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n";break;case"sendFax":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("attachment_path")?"":mxResources.get("noAttachmentSelected")+"\n";break;case"tts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"awspolly":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i=""!==e.value.getAttribute("aws_access_key_id")?"":mxResources.get("noAccessKeySelected")+"\n",i=""!==e.value.getAttribute("aws_secret_access_key")?"":mxResources.get("noSecretAccessKeySelected")+"\n";break;case"ispeechtts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-10<=e.value.getAttribute("speed")&&e.value.getAttribute("speed")<=10?"":mxResources.get("invalidSpeed")+"\n";break;case"lumenvoxtts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"lumenvoxasr":i=""!==e.value.getAttribute("grammar")?"":mxResources.get("noGrammarSelected")+"\n";break;case"ispeechasr":case"googleasr":i=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"tildeasr":i=""!==e.value.getAttribute("appid")?"":mxResources.get("noAppIdInserted")+"\n",i+=""!==e.value.getAttribute("appsecret")?"":mxResources.get("noAppSecretInserted")+"\n",i+=""!==e.value.getAttribute("uri")?"":mxResources.get("noUriInserted")+"\n";break;case"custom_app":i=""!==e.value.getAttribute("application")?"":mxResources.get("noApplicationSelected")+"\n";break;case"login":case"pause":case"unpause":case"logout":i=""!==e.value.getAttribute("findBy")?"":mxResources.get("noFindBySelected")+"\n"}if(n.model.isEdge(e))switch(n.model.getCell(e.source.getId()).value.nodeName){case"background":i+=(l=/^[0-9]{1,45}$|^[i]{1}$|^[t]{1}$|^[*]{1}$|^[#]{1}$/).test(String(e.getValue()))?"":mxResources.get("numberOrInvalidOrTimeout")+"\n";break;case"menu":if(e.getValue()){var l=/^[0-9]+$|^[-]{1}$|^[i]{1}$|^[t]{1}$|^[*]{1}$|^[#]{1}$/;String(e.getValue()).split(",").forEach(function(e){i+=l.test(e)?"":mxResources.get("numberOrAll")+"\n"})}else i=i+mxResources.get("numberOrAll")+"\n";break;case"getsecretdigits":case"getdigits":if(e.getValue())i+=(l=/^(x|i|-)$/).test(String(e.getValue()))?"":mxResources.get("numberOrInvalidOrDefault")+"\n";else i=i+mxResources.get("numberOrInvalidOrDefault")+"\n";break;case"gotoif":case"gotoiftime":if(e.getValue())i+=(l=/^(true){1}$|^(false){1}$/).test(String(e.getValue()))?"":mxResources.get("trueOrFalse")+"\n";else i=i+mxResources.get("trueOrFalse")+"\n";break;case"login":case"pause":case"unpause":case"logout":if(e.getValue())i+=(l=/^(success){1}$|^(failure){1}$/).test(String(e.getValue()))?"":mxResources.get("successOrFailure")+"\n";else i=i+mxResources.get("successOrFailure")+"\n"}return n.isCellCollapsed(e)&&!a&&(i+=(mxResources.get(n.containsValidationErrorsResource)||n.containsValidationErrorsResource)+"\n"),i=n.model.isEdge(e)?i+(n.getEdgeValidationError(e,n.model.getTerminal(e,!0),n.model.getTerminal(e,!1))||""):i+(n.getCellValidationError(e)||""),null!=(o=n.validateCell(e,t))&&(i+=o),null==n.model.getParent(e)&&n.view.validate(),0<i.length||!a?i:null},EditorUi.prototype.validateBlock=function(t){var n=this.editor.graph,e=n.getDefaultParent(),a=0;return e.children.forEach(function(e){n.model.isVertex(e)&&e.value.nodeName==t&&a++}),!(1<a)},EditorUi.prototype.getUrl=function(e){var t=null!=e?e:window.location.pathname,n=0<t.indexOf("?")?1:0;for(var a in urlParams)t+=0==n?"?":"&",t+=a+"="+urlParams[a],n++;return t},EditorUi.prototype.addUndoListener=function(){var e=this.actions.get("undo"),t=this.actions.get("redo"),n=this.editor.undoManager,a=function(){e.setEnabled(n.canUndo()),t.setEnabled(n.canRedo())};n.addListener(mxEvent.ADD,a),n.addListener(mxEvent.UNDO,a),n.addListener(mxEvent.REDO,a),n.addListener(mxEvent.CLEAR,a),a()},EditorUi.prototype.addSelectionListener=function(){var e=mxUtils.bind(this,function(){var e=this.editor.graph,t=!e.isSelectionEmpty(),n=!1,a=!1,i=e.getSelectionCells();if(null!=i)for(var o=0;o<i.length;o++){var s=i[o];if(e.getModel().isEdge(s)&&(a=!0),e.getModel().isVertex(s)&&(n=!0),a&&n)break}var r=["cut","copy","delete","duplicate","bold","italic","style","underline","toFront","toBack","dashed","rounded","shadow","tilt","autosize"];for(o=0;o<r.length;o++)this.actions.get(r[o]).setEnabled(t);this.actions.get("curved").setEnabled(a),this.actions.get("rotation").setEnabled(n),this.actions.get("wordWrap").setEnabled(n),this.actions.get("group").setEnabled(1<e.getSelectionCount()),this.actions.get("ungroup").setEnabled(1==e.getSelectionCount()&&0<e.getModel().getChildCount(e.getSelectionCell()));var l=n&&1==e.getSelectionCount();this.actions.get("removeFromGroup").setEnabled(l&&e.getModel().isVertex(e.getModel().getParent(e.getSelectionCell())));var d=["fontFamily","fontSize","alignment","position","text","format","arrange","linewidth","spacing"];for(o=0;o<d.length;o++)this.menus.get(d[o]).setEnabled(t);d=["line","lineend","linestart"];for(o=0;o<d.length;o++)this.menus.get(d[o]).setEnabled(a);this.actions.get("setAsDefaultEdge").setEnabled(a),this.menus.get("align").setEnabled(1<e.getSelectionCount()),this.menus.get("direction").setEnabled(n||a&&e.isLoop(e.view.getState(e.getSelectionCell()))),this.menus.get("navigation").setEnabled(e.foldingEnabled&&(null!=e.view.currentRoot||1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell()))),this.actions.get("home").setEnabled(null!=e.view.currentRoot),this.actions.get("exitGroup").setEnabled(null!=e.view.currentRoot);var c=1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell());this.actions.get("enterGroup").setEnabled(c),this.actions.get("expand").setEnabled(c),this.actions.get("collapse").setEnabled(c),this.actions.get("editLink").setEnabled(1==e.getSelectionCount()),this.actions.get("openLink").setEnabled(1==e.getSelectionCount()&&null!=e.getLinkForCell(e.getSelectionCell()))});this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},EditorUi.prototype.refresh=function(){var e=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),t=this.container.clientWidth+390,n=this.container.clientHeight+190;this.container==document.body&&(t=document.body.clientWidth||document.documentElement.clientWidth,n=e&&document.body.clientHeight||document.documentElement.clientHeight);var a=Math.max(0,Math.min(this.hsplitPosition,t-this.splitSize-20)),i=Math.max(0,Math.min(this.vsplitPosition,n-this.menubarHeight-this.toolbarHeight-this.splitSize-1));this.menubarContainer.style.height=this.menubarHeight+"px",this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px";var o=this.menubarHeight+this.toolbarHeight;if(mxClient.IS_QUIRKS||(o+=1),this.sidebarContainer.style.top=o+"px",this.sidebarContainer.style.width=a+"px",this.outlineContainer.style.width=a+"px",this.outlineContainer.style.height=i+"px",this.diagramContainer.style.left=a+this.splitSize+"px",this.diagramContainer.style.top=this.sidebarContainer.style.top,this.hsplit.style.top=this.sidebarContainer.style.top,this.hsplit.style.bottom=this.outlineContainer.style.bottom,this.hsplit.style.left=a+"px",this.vsplit.style.width=this.sidebarContainer.style.width,this.vsplit.style.bottom=i+this.footerHeight+"px",e){this.menubarContainer.style.width=t+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width;var s=n-i-this.splitSize-this.menubarHeight-this.toolbarHeight;this.sidebarContainer.style.height=s+"px",this.diagramContainer.style.width=t-a-this.splitSize+"px";var r=n-this.menubarHeight-this.toolbarHeight;this.diagramContainer.style.height=r+"px",this.hsplit.style.height=r+"px"}else this.sidebarContainer.style.bottom=i+this.splitSize+"px",this.diagramContainer.style.bottom=this.outlineContainer.style.bottom},EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer"),this.toolbarContainer=this.createDiv("geToolbarContainer"),this.sidebarContainer=this.createDiv("geSidebarContainer"),this.outlineContainer=this.createDiv("geOutlineContainer"),this.diagramContainer=this.createDiv("geDiagramContainer"),this.footerContainer=this.createDiv("geFooterContainer"),this.hsplit=this.createDiv("geHsplit"),this.vsplit=this.createDiv("geVsplit"),this.menubarContainer.style.top="0px",this.menubarContainer.style.left="0px",this.menubarContainer.style.right="0px",this.toolbarContainer.style.left="0px",this.toolbarContainer.style.right="0px",this.sidebarContainer.style.left="0px",this.outlineContainer.style.bottom="0px",this.outlineContainer.style.left="0px",this.diagramContainer.style.overflow="scroll",this.diagramContainer.style.right="0px",this.footerContainer.style.left="0px",this.footerContainer.style.right="0px",this.footerContainer.style.bottom="0px",this.vsplit.style.left="0px",this.vsplit.style.height=this.splitSize+"px",this.hsplit.style.width=this.splitSize+"px"},EditorUi.prototype.createUi=function(){this.menubar=this.menus.createMenubar(this.createDiv("geMenubar")),this.menubarContainer.appendChild(this.menubar.container),this.toolbar=this.createToolbar(this.createDiv("geToolbar")),this.toolbarContainer.appendChild(this.toolbar.container),this.sidebar=this.createSidebar(this.sidebarContainer),this.footerContainer.appendChild(this.createFooter()),this.statusContainer=this.createStatusContainer(),this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.container.appendChild(this.menubarContainer),this.container.appendChild(this.toolbarContainer),this.container.appendChild(this.sidebarContainer),this.container.appendChild(this.outlineContainer),this.container.appendChild(this.diagramContainer),this.container.appendChild(this.footerContainer),this.container.appendChild(this.hsplit),this.container.appendChild(this.vsplit),this.addSplitHandler(this.hsplit,!0,0,mxUtils.bind(this,function(e){this.hsplitPosition=e,this.refresh(),this.editor.graph.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.addSplitHandler(this.vsplit,!1,this.footerHeight,mxUtils.bind(this,function(e){this.vsplitPosition=e,this.refresh(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()}))},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.setStatusText=function(e){this.statusContainer.innerHTML=e},EditorUi.prototype.createToolbar=function(e){return new Toolbar(this,e)},EditorUi.prototype.createSidebar=function(e){return new Sidebar(this,e)},EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")},EditorUi.prototype.createDiv=function(e){var t=document.createElement("div");return t.className=e,t},EditorUi.prototype.createHeader=function(e){return document.createElement(e)},EditorUi.prototype.createForm=function(e){var t=document.createElement("form");return t.className=e,t},EditorUi.prototype.addSplitHandler=function(t,n,a,i){var o=null,s=null;function r(e){if(null!=o){var t=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e));i(Math.max(0,s+(n?t.x-o.x:o.y-t.y)-a)),mxEvent.consume(e)}}function e(e){r(e),s=o=null}mxEvent.addGestureListeners(t,function(e){o=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e)),s=parseInt(n?t.style.left:t.style.bottom),mxEvent.consume(e)}),mxEvent.addListener(document,"mousemove",r),mxEvent.addListener(document,"touchmove",r),mxEvent.addListener(document,"mouseup",e),mxEvent.addListener(document,"touchend",e)},EditorUi.prototype.executeLayout=function(e,t,n){var a=this.editor.graph,i=a.getSelectionCell();t=null!=this.animate?this.animate:t,a.getModel().beginUpdate();try{e.execute(a.getDefaultParent(),i)}catch(e){throw e}finally{if(t&&navigator.userAgent.indexOf("Camino")<0){var o=new mxMorphing(a);o.addListener(mxEvent.DONE,mxUtils.bind(this,function(){a.getModel().endUpdate()})),o.startAnimation()}else a.getModel().endUpdate()}},EditorUi.prototype.createKeyHandler=function(e){var a=this.editor.graph,s=new mxKeyHandler(a);function t(e){if(!a.isSelectionEmpty()){var t=0,n=0;37==e?t=-1:38==e?n=-1:39==e?t=1:40==e&&(n=1),a.moveCells(a.getSelectionCells(),t,n),a.scrollCellToVisible(a.getSelectionCell())}}s.isControlDown=function(e){return mxEvent.isControlDown(e)||mxClient.IS_MAC&&e.metaKey};var n=mxUtils.bind(this,function(e,t,n,a){var i=this.actions.get(n);if(null!=i){var o=function(){i.enabled&&i.funct()};t?a?s.bindControlShiftKey(e,o):s.bindControlKey(e,o):a?s.bindShiftKey(e,o):s.bindKey(e,o)}});return s.enter=function(){},s.bindKey(8,function(){a.foldCells(!0)}),s.bindKey(13,function(){a.foldCells(!1)}),s.bindKey(33,function(){a.exitGroup()}),s.bindKey(34,function(){a.enterGroup()}),s.bindKey(36,function(){a.home()}),s.bindKey(35,function(){a.refresh()}),s.bindKey(37,function(){t(37)}),s.bindKey(38,function(){t(38)}),s.bindKey(39,function(){t(39)}),s.bindKey(40,function(){t(40)}),s.bindKey(113,function(){a.startEditingAtCell()}),n(46,!1,"delete"),n(82,!0,"tilt"),n(83,!0,"save"),n(83,!0,"saveAs",!0),n(107,!1,"zoomIn"),n(109,!1,"zoomOut"),n(65,!0,"selectAll"),n(86,!0,"selectVertices",!0),n(69,!0,"selectEdges",!0),n(69,!0,"export"),n(66,!0,"toBack"),n(70,!0,"toFront"),n(68,!0,"duplicate"),n(90,!0,"undo"),n(89,!0,"redo"),n(88,!0,"cut"),n(67,!0,"copy"),n(81,!0,"connect"),n(86,!0,"paste"),n(71,!0,"group"),n(71,!0,"grid",!0),n(85,!0,"ungroup"),n(112,!1,"about"),n(80,!0,"publish",!0),s},EditorUi.prototype.createMultiplicities=function(e,t,n,a){for(var i=0;i<t.length;i++)e.push(new mxMultiplicity(!0,t[i],null,null,n[i][0],n[i][1],null,mxResources.get(t[i])+mxResources.get("musthave")+n[i][0]+mxResources.get("outgoingedge"),null)),e.push(new mxMultiplicity(!1,t[i],null,null,a[i][0],a[i][1],null,mxResources.get(t[i])+mxResources.get("musthave")+a[i][0]+mxResources.get("incomingedge"),null))};var useLocalStorage=(mxClient.IS_TOUCH||"local"==urlParams.storage)&&"undefined"!=typeof localStorage,fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList,touchStyle=mxClient.IS_TOUCH||"1"==urlParams.touch,counter=0;try{for(var op=window;null!=op.opener&&!isNaN(op.opener.counter);)op=op.opener;null!=op&&(op.counter++,counter=op.counter)}catch(e){}function Sidebar(e,t){this.editorUi=e,this.container=t,this.palettes=new Object,this.taglist=new Object,this.showTooltips=!0,this.graph=new Graph(document.createElement("div"),null,null,this.editorUi.editor.graph.getStylesheet()),this.graph.resetViewOnRootChange=!1,this.graph.foldingEnabled=!1,this.graph.setConnectable(!1),this.graph.autoScroll=!1,this.graph.setTooltips(!1),this.graph.setEnabled(!1),this.graph.container.style.visibility="hidden",this.graph.container.style.position="absolute",this.graph.container.style.overflow="hidden",this.graph.container.style.height="1px",this.graph.container.style.width="1px",mxClient.IS_IE||mxClient.IS_IE11||(this.graph.container.style.display="none"),document.body.appendChild(this.graph.container),this.pointerUpHandler=mxUtils.bind(this,function(){this.showTooltips=!0}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),this.pointerDownHandler=mxUtils.bind(this,function(){this.showTooltips=!1,this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler),this.pointerMoveHandler=mxUtils.bind(this,function(e){for(var t=mxEvent.getSource(e);null!=t;){if(t==this.currentElt)return;t=t.parentNode}this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler),this.pointerOutHandler=mxUtils.bind(this,function(e){null==e.toElement&&null==e.relatedTarget&&this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler),mxEvent.addListener(t,"scroll",mxUtils.bind(this,function(){this.showTooltips=!0})),this.init(),mxClient.IS_SVG||((new Image).src=IMAGE_PATH+"/tooltip.png")}function Actions(e){this.editorUi=e,this.actions=new Object,this.init()}function Action(e,t,n,a,i){mxEventSource.call(this),this.label=e,this.funct=t,this.enabled=null==n||n,this.iconCls=a,this.shortcut=i}function Menubar(e,t){this.editorUi=e,this.container=t,mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function Menu(e,t){mxEventSource.call(this),this.funct=e,this.enabled=null==t||t}function Toolbar(e,t){this.editorUi=e,this.container=t,this.init(),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function createCheckbox(e){var t=document.createElement("input");return t.setAttribute("type","checkbox"),e&&t.setAttribute("checked",!0),t}function createDropdownFromApi(e,n,a,i,t,o,s,r){var l=new XMLHttpRequest;l.open("GET",e,!1),l.setRequestHeader("Authorization","Bearer "+t.editor.data.token),l.send(null);var d=[];200===l.status&&(d=JSON.parse(l.response));var c=document.createElement("select"),m=document.createElement("option");return m.text="-- None --",m.value="-1",c.appendChild(m),d.rows.forEach(function(t){r&&t[a]==r||((m=document.createElement("option")).text=t[a],o&&s?(m.value=s,o.forEach(function(e){m.value=m.value.replace("%"+e+"%",t[e])}),m.selected=m.value==n):(m.value=t[i],m.selected=t[i]==n),c.appendChild(m))}),c.className="form-control select2",c}function createDropdownWithOptgroupFromApi(e,t,n,a,i,o){var s=new XMLHttpRequest;s.open("GET",e,!1),s.setRequestHeader("Authorization","Bearer "+i.editor.data.token),s.send(null);var r=[];200===s.status&&(r=JSON.parse(s.response));var l=document.createElement("select"),d=document.createElement("option");d.text="-- None --",d.value="-1",l.appendChild(d);var c=_.groupBy(r.rows,o);for(var m in c)if(c.hasOwnProperty(m)){var u=document.createElement("optgroup");u.label=_.capitalize(m),c[m].forEach(function(e){(d=document.createElement("option")).text=e[n],d.value=e[a],d.selected=e[a]==t,u.appendChild(d)}),l.appendChild(u)}return l.className="form-control select2",l}function createGroupedDropdownFromApi(e,t,n,a,i,o){var s=new XMLHttpRequest;s.open("GET",e,!1),s.setRequestHeader("Authorization","Bearer "+i.editor.data.token),s.send(null);var r=[];200===s.status&&(r=JSON.parse(s.response));var l=document.createElement("select"),d=document.createElement("option");return d.text="-- None --",d.value="0",l.appendChild(d),r.rows.forEach(function(e){(d=document.createElement("option")).className="select-group-father",d.text=e[n].toUpperCase(),d.value=e[a],d.selected=e[a]==t,l.appendChild(d),e[o].forEach(function(e){(d=document.createElement("option")).className="select-group-son",d.text="-"+_.capitalize(e[n]),d.value=e[a],d.selected=e[a]==t,l.appendChild(d)})}),l.className="form-control select2",l}function createDropdownFromArray(e,t){var n=document.createElement("select");for(var a in e){var i=document.createElement("option");i.text=e[a],i.value=a,(0<t||""!=t)&&(i.selected=t===a),n.appendChild(i)}return n.className="form-control select2",n}function createDropdownFromTigerDialList(e){var t=document.createElement("select"),n=[],a=new XMLHttpRequest;try{if(a.open("POST","/api/rest/list/list",!1),a.send(JSON.stringify({page:1,size:6e5})),200===a.status){var i=JSON.parse(a.response);if(0<i.status){var o=i.response.RMI.rows;for(var s in o)n[o[s].id]=o[s].name}}}catch(e){console.log(e)}for(var r in n){var l=document.createElement("option");l.text=n[r],l.value=r,(0<e||""!=e)&&(l.selected=e===r),t.appendChild(l)}return t.className="form-control select2",t}function Dialog(e,t,n,a,i,o,s){var r=0;mxClient.IS_IE&&9!=document.documentMode&&(r=60),n+=r,a+=r;Math.max(0,Math.round((document.body.scrollWidth-n)/2)),Math.max(0,Math.round((Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)-a)/3));var l=e.createDiv("geDialog");l.className="modal fade in center",l.style.display="block",l.style.paddingRight="12px";var d=e.createDiv("geModalDialog");d.className="modal-dialog",d.appendChild(t),l.appendChild(d),null==this.bg&&(this.bg=e.createDiv("background"),this.bg.className="modal-backdrop fade in",mxClient.IS_QUIRKS&&new mxDivResizer(this.bg)),i&&document.body.appendChild(this.bg),document.body.appendChild(l),this.onDialogClose=s,this.container=l}function ImportDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body"),i=n.createDiv("modal-footer"),o=n.createHeader("h4");mxUtils.write(o,mxResources.get("import")+" XML");var s=mxUtils.button("",function(){n.hideDialog()});s.className="close",t.appendChild(s),t.appendChild(o);var r=n.createDiv("row"),l=n.createDiv("col-md-12"),d=document.createElement("textarea");d.style.width="100%",d.style.height="374px";var c=document.createElement("input");c.type="file",c.setAttribute("accept","text/xml"),c.addEventListener("change",function(e){var t=e.target.files[0];if(console.log(t),t)if("text/xml"===t.type){var n=new FileReader;n.onload=function(e){var t=e.target.result;mxUtils.write(d,t)},n.readAsText(t)}else alert("Failed to load format file");else alert("Failed to load file")},!1),l.appendChild(c),l.appendChild(d),r.appendChild(l),a.appendChild(r);var m=mxUtils.button(mxResources.get("import"),mxUtils.bind(this,function(e){var t=mxUtils.parseXml(d.value);n.editor.setGraphXml(t.documentElement),n.hideDialog()}));m.className="btn blue";var u=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});u.className="btn default",i.appendChild(m),i.appendChild(u),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function AboutDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),o=e.createHeader("h4");mxUtils.write(o,mxResources.get("about")+" Cally Square");var s=mxUtils.button("",function(){e.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=document.createElement("img");r.style.border="0px",r.setAttribute("width","176"),r.setAttribute("width","151"),r.setAttribute("src",IMAGE_PATH+"/logo.png"),a.appendChild(r),mxUtils.br(a),mxUtils.write(a,"Powered by Xenialab "+mxClient.VERSION),mxUtils.br(a);var l=document.createElement("a");l.setAttribute("href","http://www.callysquare.com/"),l.setAttribute("target","_blank"),mxUtils.write(l,"www.callysquare.com"),a.appendChild(l),mxUtils.br(a),mxUtils.br(a);var d=mxUtils.button(mxResources.get("close"),function(){e.hideDialog()});d.className="btn default",i.appendChild(d),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function SaveDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),o=e.createHeader("h4");mxUtils.write(o,mxResources.get("saveAs"));var s=mxUtils.button("",function(){e.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_copy"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("save"),function(){e.saveAs(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function NewDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),o=e.createHeader("h4");mxUtils.write(o,mxResources.get("new"));var s=mxUtils.button("",function(){e.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_new"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("new"),function(){e.new(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function DescriptionDialog(e){console.log(e.editor.data);var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),o=e.createHeader("h4");mxUtils.write(o,mxResources.get("description"));var s=mxUtils.button("",function(){e.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=e.createDiv("form-horizontal form-row-seperated"),l="description",d=e.editor.data.description||"",c=e.createDiv("form-group"),m=document.createElement("label");m.className="col-sm-4 control-label",mxUtils.write(m,mxResources.get(l)),c.appendChild(m);var u=document.createElement("input");u.setAttribute("value",d),u.className="form-control",u.setAttribute("id","_description");var p=e.createDiv("col-sm-8");p.appendChild(u),c.appendChild(p),r.appendChild(c),a.appendChild(r);var g=mxUtils.button(mxResources.get("update"),function(){e.description(u.value),e.hideDialog()});g.className="btn blue";var v=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});v.className="btn default",i.appendChild(g),i.appendChild(v),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function VariableDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),o=e.createHeader("h4");mxUtils.write(o,mxResources.get("variable"));var s=mxUtils.button("",function(){e.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=e.createDiv("form-horizontal form-row-seperated"),l="name",d="_"+l,c="variable name",m=e.createDiv("form-group"),u=document.createElement("label");u.className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var p=document.createElement("input");p.setAttribute("value",c),p.className="form-control",p.setAttribute("id",d);var g=e.createDiv("col-sm-8");g.appendChild(p),m.appendChild(g),r.appendChild(m),d="_"+(l="description"),c="variable description",m=e.createDiv("form-group last"),(u=document.createElement("label")).className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var v=document.createElement("input");v.setAttribute("value",c),v.className="form-control",v.setAttribute("id",d),(g=e.createDiv("col-sm-8")).appendChild(v),m.appendChild(g),r.appendChild(m),a.appendChild(r);var h=mxUtils.button(mxResources.get("new"),function(){e.variable(p.value,v.value),e.hideDialog()});h.className="btn blue";var b=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});b.className="btn default",i.appendChild(h),i.appendChild(b),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function OpenDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),o=e.createHeader("h4");mxUtils.write(o,mxResources.get("open"));var s=mxUtils.button("",function(){e.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=e.createDiv("row"),l=e.createDiv("col-md-4"),d=e.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=new XMLHttpRequest;m.open("GET","/api/square/projects",!1),m.setRequestHeader("Authorization","Bearer "+e.editor.data.token),m.send(null);var u=[];200===m.status&&(u=JSON.parse(m.response));for(var p=document.createElement("select"),g=0;g<u.length;g++){var v=document.createElement("option");v.text=u[g].name,v.value=u[g].id,p.appendChild(v)}p.className="form-control",d.appendChild(p),r.appendChild(l),r.appendChild(d),a.appendChild(r);var h=mxUtils.button(mxResources.get("open"),function(){console.log(p),console.log(p.value),window.open("square/project/"+p.value,"_blank"),e.hideDialog()});h.className="btn blue";var b=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});b.className="btn default",i.appendChild(h),i.appendChild(b),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function RenameDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body"),i=n.createDiv("modal-footer"),o=n.createHeader("h4");mxUtils.write(o,mxResources.get("rename"));var s=mxUtils.button("",function(){n.hideDialog()});s.className="close",t.appendChild(s),t.appendChild(o);var r=n.createDiv("row"),l=n.createDiv("col-md-4"),d=n.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=n.editor.filename,u=document.createElement("input");u.setAttribute("value",m),u.className="form-control",d.appendChild(u),r.appendChild(l),r.appendChild(d),a.appendChild(r);var p=mxUtils.button(mxResources.get("save"),function(){var t=new XMLHttpRequest;t.open("PUT",SAVE_URL+n.editor.data.id,!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.setRequestHeader("Authorization","Bearer "+n.editor.data.token),t.send("name="+u.value),t.onload=function(e){200===t.status?(n.editor.setStatus("Project successfully renamed"),n.editor.filename=u.value):(console.log(t.response),n.editor.setStatus(JSON.parse(t.response).errors[0].message))},t.onerror=function(e){mxUtils.alert(t.statusText)},n.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function EditFileDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body"),i=t.createDiv("modal-footer"),o=t.createHeader("h4");mxUtils.write(o,mxResources.get("edit"));var s=mxUtils.button("",function(){t.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=t.createDiv("row"),l=t.createDiv("col-md-12"),d=document.createElement("textarea");if(d.style.width="100%",d.style.height="374px",d.value=mxUtils.getPrettyXml(t.editor.getGraphXml()),fileSupport){d.addEventListener("dragover",function(e){e.stopPropagation(),e.preventDefault()},!1),d.addEventListener("drop",function(e){if(e.stopPropagation(),e.preventDefault(),0<e.dataTransfer.files.length){var t=e.dataTransfer.files[0],n=new FileReader;n.onload=function(e){d.value=e.target.result},n.readAsText(t)}},!1)}l.appendChild(d),r.appendChild(l),a.appendChild(r);var c=mxUtils.button(mxResources.get("save"),function(){var e=mxUtils.parseXml(d.value);t.editor.setGraphXml(e.documentElement),t.hideDialog()});c.className="btn blue";var m=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});m.className="btn default",i.appendChild(c),i.appendChild(m),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function ExportDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body form"),i=t.createDiv("modal-footer"),o=t.createHeader("h4");mxUtils.write(o,mxResources.get("export")+" XML");var s=mxUtils.button("",function(){t.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=t.createDiv("form-horizontal form-row-seperated"),l=t.createDiv("form-group last"),d=document.createElement("label");d.className="col-sm-4 control-label",mxUtils.write(d,mxResources.get("filename"));var c=document.createElement("input");c.setAttribute("value",t.editor.getOrCreateFilename()),c.className="form-control";var m=t.createDiv("col-sm-8");m.appendChild(c),l.appendChild(d),l.appendChild(m),r.appendChild(l),a.appendChild(r);var u=mxUtils.button(mxResources.get("export"),mxUtils.bind(this,function(e){t.save(!1);encodeURIComponent(mxUtils.getXml(t.editor.getGraphXml()));new mxXmlRequest(SAVE_URL+t.editor.data.id+"/download","filename="+c.value,"GET").simulate(document,"_blank"),t.hideDialog()}));u.className="btn blue";var p=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});p.className="btn default",i.appendChild(u),i.appendChild(p),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function GeneralDialog(i,o){console.log("general");var s=i.editor.graph,e=i.createDiv("md-dialog"),t=i.createDiv("md-toolbar"),n=i.createDiv("md-dialog-content"),a=i.createDiv("md-dialog-actions"),r=i.createHeader("h4");mxUtils.write(r,mxResources.get("edit")+" "+mxResources.get(o.value.nodeName));var l=mxUtils.button("",function(){i.hideDialog()});l.className="close",t.appendChild(l),t.appendChild(r);for(var d=o.value.attributes.length,c=i.createDiv("form-horizontal form-row-seperated"),m=0;m<d;m++){var u,p=o.value.attributes[m].name,g="_"+p,v=o.value.attributes[m].value,h=i.createDiv(m==d-1?"form-group last":"form-group"),b=document.createElement("label");switch(b.className="col-sm-4 control-label",mxUtils.write(b,mxResources.get(p)),h.appendChild(b),p){case"sip_id":u=createDropdownWithOptgroupFromApi("/api/users/all",v,"fullname","id",i,"role");break;case"queue_id":u=createDropdownFromApi("/api/voice/queues",v,"name","name",i);break;case"trunk_name":u=createDropdownFromApi("/api/trunks",v,"name","name",i);break;case"variable_id":u=createDropdownFromApi("/api/variables",v,"name","id",i);break;case"account_id":u="sendMail"==o.value.nodeName?createDropdownFromApi("/api/mail/servers/out",v,"username","id",i):createDropdownFromApi("/api/sms/accounts",v,"name","id",i);break;case"template_id":u=createDropdownFromApi("/api/templates",v,"name","id",i);break;case"context":u=createDropdownFromApi("/api/voice/contexts",v,"name","name",i);break;case"mailbox":u=createDropdownFromApi("/api/voice/voicemails",v,"mailbox","id",i,["mailbox","context"],"%mailbox%@%context%");break;case"model":u=createDropdownFromArray(ISPEECHASRMODEL,v);break;case"ispeech_asr_language":u=createDropdownFromArray(ISPEECHASRLANG,v);break;case"beep":u=createDropdownFromArray(ISPEECHBEEP,v);break;case"hiddendigitspos":u=createDropdownFromArray(SECRETDIGITSPOS,v);break;case"ispeech_tts_language":u=createDropdownFromArray(ISPEECHLANG,v);break;case"google_tts_language":u=createDropdownFromArray(GOOGLETTSLANG,v);break;case"intKey":u=createDropdownFromArray(ASRINTKEYS,v);break;case"recordingFormat":u=createDropdownFromArray(RECORDINGFORMAT,v);break;case"answer":u=createDropdownFromArray(BOOLSELECT,v);break;case"list_id":u=createDropdownFromTigerDialList(v);break;case"interval_id":u=createGroupedDropdownFromApi("/api/intervals",v,"name","id",i,"SubIntervals");break;case"project_id":u=createDropdownFromApi("/api/square/projects",v,"name","id",i,null,null,i.editor.getOrCreateFilename());break;case"odbc_id":u=createDropdownFromApi("/api/square/odbc",v,"name","id",i);break;case"file_id":u=createDropdownFromApi("/api/sounds",v,"display_name","id",i);break;case"timeout":case"digit":case"mindigit":case"maxdigit":case"response":case"retry":case"speed":(u=document.createElement("input")).setAttribute("type","number"),u.setAttribute("min",0),u.setAttribute("max",1e3),u.setAttribute("value",v),u.className="form-control";break;case"text":case"key":case"query":case"condition":case"command":case"body":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control";break;case"sms_text":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control",u.setAttribute("maxlength","160");break;default:(u=document.createElement("input")).setAttribute("value",v),u.className="form-control"}u.setAttribute("id",g);var f=i.createDiv("col-sm-8");if(f.appendChild(u),mxResources.get("help_"+p)){var A=i.createDiv("p");A.className="help-block",mxUtils.write(A,mxResources.get("help_"+p)),f.appendChild(A)}h.appendChild(f),c.appendChild(h)}n.appendChild(c);var E=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(e){for(var t=0;t<o.value.attributes.length;t++){var n="_"+o.value.attributes[t].name,a=o.value.attributes[t].name;o.setAttribute(a,document.getElementById(n).value)}s.refresh(o),i.hideDialog()}));E.className="btn blue";var y=mxUtils.button(mxResources.get("cancel"),function(){i.hideDialog()});y.className="btn default",a.appendChild(E),a.appendChild(y),e.appendChild(t),e.appendChild(n),e.appendChild(a),this.container=e}Editor=function(){mxEventSource.call(this),this.init(),this.initStencilRegistry(),this.graph=new Graph,this.outline=new mxOutline(this.graph),this.outline.updateOnPan=!0,this.undoManager=this.createUndoManager(),this.status="",this.filename=null,this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[counter])+".xml"},this.getFilename=function(){return this.filename},this.setStatus=function(e){this.status=e,this.fireEvent(new mxEventObject("statusChanged"))},this.getStatus=function(){return this.status},this.modified=!1,this.graphChangeListener=function(){this.modified=!0},this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)})),window.onbeforeunload=mxUtils.bind(this,function(){if(this.modified)return mxResources.get("allChangesLost")}),this.graph.resetViewOnRootChange=!1,this.graph.scrollbars=!0,this.graph.background=null},mxUtils.extend(Editor,mxEventSource),Editor.prototype.gridImage=IMAGE_PATH+"/grid.gif",Editor.prototype.transparentImage=IMAGE_PATH+"/transparent.gif",Editor.prototype.setGraphXml=function(e){var t=new mxCodec(e.ownerDocument);if("mxGraphModel"==e.nodeName){this.graph.view.scale=Number(e.getAttribute("scale")||1),this.graph.gridEnabled="0"!=e.getAttribute("grid"),this.graph.graphHandler.guidesEnabled="0"!=e.getAttribute("guides"),this.graph.setTooltips("0"!=e.getAttribute("tooltips")),this.graph.setConnectable("0"!=e.getAttribute("connect")),this.graph.foldingEnabled="0"!=e.getAttribute("fold"),this.graph.scrollbars="0"!=e.getAttribute("scrollbars"),this.graph.scrollbars||(this.graph.container.scrollLeft=0,this.graph.container.scrollTop=0,this.graph.view.translate.x=Number(e.getAttribute("dx")||0),this.graph.view.translate.y=Number(e.getAttribute("dy")||0)),this.graph.pageVisible="1"==e.getAttribute("page"),this.graph.pageBreaksVisible=this.graph.pageVisible,this.graph.preferPageSize=this.graph.pageBreaksVisible;var n=e.getAttribute("pageScale");this.graph.pageScale=null!=n?n:1.5;var a=e.getAttribute("pageWidth"),i=e.getAttribute("pageHeight");null!=a&&null!=i&&(this.graph.pageFormat=new mxRectangle(0,0,parseFloat(a),parseFloat(i)),this.outline.outline.pageFormat=this.graph.pageFormat);var o=e.getAttribute("background");null!=o&&0<o.length&&(this.graph.background=o),t.decode(e,this.graph.getModel()),this.updateGraphComponents()}},Editor.prototype.getGraphXml=function(){var e=new mxCodec(mxUtils.createXmlDocument()).encode(this.graph.getModel());return 0==this.graph.view.translate.x&&0==this.graph.view.translate.y||(e.setAttribute("dx",Math.round(100*this.graph.view.translate.x)/100),e.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100)),1!=this.graph.view.scale&&e.setAttribute("scale",Math.round(1e3*this.graph.view.scale)/1e3),e.setAttribute("grid",this.graph.isGridEnabled()?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0"),e.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0"),e.setAttribute("fold",this.graph.foldingEnabled?"1":"0"),e.setAttribute("page",this.graph.pageVisible?"1":"0"),e.setAttribute("pageScale",this.graph.pageScale),e.setAttribute("pageWidth",this.graph.pageFormat.width),e.setAttribute("pageHeight",this.graph.pageFormat.height),this.graph.scrollbars||e.setAttribute("scrollbars","0"),null!=this.graph.background&&e.setAttribute("background",this.graph.background),e},Editor.prototype.updateGraphComponents=function(){var e=this.graph,t=this.outline;if(null!=e.container&&null!=t.outline.container){null!=e.background?"none"==e.background?e.container.style.backgroundColor="transparent":(null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=e.background,e.view.backgroundPageShape.reconfigure()),e.container.style.backgroundColor=e.background):e.container.style.backgroundColor="",e.pageVisible?(e.container.style.backgroundColor="#ebebeb",e.container.style.borderStyle="solid",e.container.style.borderColor="#e5e5e5",e.container.style.borderTopWidth="1px",e.container.style.borderLeftWidth="1px",e.container.style.borderRightWidth="0px",e.container.style.borderBottomWidth="0px"):e.container.style.border="",t.outline.container.style.backgroundColor=e.container.style.backgroundColor,t.outline.pageVisible==e.pageVisible&&t.outline.pageScale==e.pageScale||(t.outline.pageScale=e.pageScale,t.outline.pageVisible=e.pageVisible,t.outline.view.validate()),e.scrollbars&&"hidden"==e.container.style.overflow&&!touchStyle?e.container.style.overflow="auto":e.scrollbars&&!touchStyle||(e.container.style.overflow="hidden");var n=mxClient.IS_IE&&9<=document.documentMode?"url("+this.transparentImage+")":"none";e.container.style.backgroundImage=!e.pageVisible&&e.isGridEnabled()?"url("+this.gridImage+")":n,null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+this.gridImage+")":"none")}},Editor.prototype.init=function(){mxClient.IS_IE6&&mxClient.link("stylesheet",CSS_PATH+"/grapheditor-ie6.css"),mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE),mxConstants.DEFAULT_HOTSPOT=.3;var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var n=e.apply(this,arguments);return n.intersects=mxUtils.bind(this,function(e,t){return!!this.isConnecting()||mxCellMarker.prototype.intersects.apply(n,arguments)}),n},mxConstants.SHADOWCOLOR="#d0d0d0",mxConstants.HANDLE_FILLCOLOR="#99ccff",mxConstants.HANDLE_STROKECOLOR="#0088cf",mxConstants.VERTEX_SELECTION_COLOR="#00a8ff",mxConstants.OUTLINE_COLOR="#00a8ff",mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff",mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff",mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff",mxConstants.EDGE_SELECTION_COLOR="#00a8ff",mxConstants.DEFAULT_VALID_COLOR="#00a8ff",mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff",mxConstants.GUIDE_COLOR="#0088cf",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,mxRubberband.prototype.defaultOpacity=30,mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,this.graph.background||"white","#cacaca")},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.getGraphBounds(),t=0<e.width?e.x/this.scale-this.translate.x:0,n=0<e.height?e.y/this.scale-this.translate.y:0,a=e.width/this.scale,i=e.height/this.scale,o=this.graph.pageFormat,s=this.graph.pageScale,r=o.width*s,l=o.height*s,d=Math.floor(Math.min(0,t)/r),c=Math.floor(Math.min(0,n)/l),m=Math.ceil(Math.max(1,t+a)/r)-d,u=Math.ceil(Math.max(1,n+i)/l)-c;return new mxRectangle(this.scale*(this.translate.x+d*r),this.scale*(this.translate.y+c*l),this.scale*m*r,this.scale*u*l)};var n=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(e,t){n.apply(this,arguments),this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=e+"px",this.view.backgroundPageShape.node.style.marginTop=t+"px")};var a=this;mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var t=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(t,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);if(this.graph.pageVisible){t=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(t),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(this.graph.container),this.graph.container.firstChild.style.position="absolute",this.graph.container.insertBefore(this.backgroundPageShape.node,this.graph.container.firstChild),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",this.backgroundPageShape.node.style.backgroundPosition="-1px -1px",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=t,this.backgroundPageShape.redraw()),this.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+a.gridImage+")":"none"}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraph.prototype.updatePageBreaks=function(e,t,n){var a=this.view.scale,i=this.view.translate,o=this.pageFormat,s=a*this.pageScale,r=this.view.getBackgroundPageBounds();t=r.width,n=r.height;var l=new mxRectangle(a*i.x,a*i.y,o.width*s,o.height*s),d=(e=e&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(t/l.width)-1:0,c=e?Math.ceil(n/l.height)-1:0,m=r.x+t,u=r.y+n;if(null==this.horizontalPageBreaks&&0<d&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(var p=0;p<=d;p++){var g=[new mxPoint(r.x+(p+1)*l.width,r.y),new mxPoint(r.x+(p+1)*l.width,u)];if(null!=this.horizontalPageBreaks[p])this.horizontalPageBreaks[p].scale=1,this.horizontalPageBreaks[p].points=g,this.horizontalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,this.scale)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.horizontalPageBreaks[p]=v}for(p=d;p<this.horizontalPageBreaks.length;p++)this.horizontalPageBreaks[p].destroy();this.horizontalPageBreaks.splice(d,this.horizontalPageBreaks.length-d)}if(null==this.verticalPageBreaks&&0<c&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(p=0;p<=c;p++){var v;g=[new mxPoint(r.x,r.y+(p+1)*l.height),new mxPoint(m,r.y+(p+1)*l.height)];if(null!=this.verticalPageBreaks[p])this.verticalPageBreaks[p].scale=1,this.verticalPageBreaks[p].points=g,this.verticalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,a)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.verticalPageBreaks[p]=v}for(p=c;p<this.verticalPageBreaks.length;p++)this.verticalPageBreaks[p].destroy();this.verticalPageBreaks.splice(c,this.verticalPageBreaks.length-c)}},mxEdgeHandler.prototype.snapToTerminals=!0,mxGraphHandler.prototype.guidesEnabled=!0;var o=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,t,n){for(var a=0;a<t.length;a++)if(this.graph.getModel().isVertex(t[a])){var i=this.graph.getCellGeometry(t[a]);if(null!=i&&i.relative)return!1}return o.apply(this,arguments)},mxGuide.prototype.isEnabledForEvent=function(e){return!mxEvent.isAltDown(e)};var r=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(e,t,n,a,i,o){var s=r.apply(this,arguments);return null==o||o||mxEvent.addListener(s,"mousedown",function(e){mxEvent.consume(e)}),s};var s=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(e){var t=this.graph.getModel(),n=t.getParent(this.graph.getSelectionCell()),a=s.apply(this,arguments),i=t.getParent(a);if(null==n||n!=a&&n!=i)for(;!this.graph.isCellSelected(a)&&!this.graph.isCellSelected(i)&&t.isVertex(i)&&!this.graph.isValidRoot(i);)a=i,i=this.graph.getModel().getParent(a);return a};var l=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(e){var t=l.apply(this,arguments),n=this.graph.getModel(),a=n.getParent(this.graph.getSelectionCell()),i=n.getParent(e);return(null==a||a!=e&&a!=i)&&(this.graph.isCellSelected(e)||!n.isVertex(i)||this.graph.isValidRoot(i)||(t=!0)),t},mxGraphHandler.prototype.selectDelayed=function(e){var t=e.getCell();null==t&&(t=this.cell);for(var n=this.graph.getModel(),a=n.getParent(t);this.graph.isCellSelected(t)&&n.isVertex(a)&&!this.graph.isValidRoot(a);)t=a,a=n.getParent(t);this.graph.selectCellForEvent(t,e.getEvent())},mxPanningHandler.prototype.getCellForPopupEvent=function(e){for(var t=e.getCell(),n=this.graph.getModel(),a=n.getParent(t);n.isVertex(a)&&!this.graph.isValidRoot(a);)this.graph.isCellSelected(a)&&(t=a),a=n.getParent(a);return t}},Editor.prototype.createUndoManager=function(){var o=this.graph,n=new mxUndoManager,e=function(e,t){n.undoableEditHappened(t.getProperty("edit"))};o.getModel().addListener(mxEvent.UNDO,e),o.getView().addListener(mxEvent.UNDO,e);var t=function(e,t){for(var n=o.getSelectionCellsForChanges(t.getProperty("edit").changes),a=[],i=1;i<n.length;i++)null!=o.view.getState(n[i])&&a.push(n[i]);o.setSelectionCells(a)};return n.addListener(mxEvent.UNDO,t),n.addListener(mxEvent.REDO,t),n},Editor.prototype.initStencilRegistry=function(){mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/general.xml")},mxStencilRegistry.libraries={},mxStencilRegistry.packages=[],mxStencilRegistry.getStencil=function(e){var t=mxStencilRegistry.stencils[e];if(null==t){var n=mxStencilRegistry.getBasenameForStencil(e);if(null!=n){var a=mxStencilRegistry.libraries[n];if(null!=a){if(null==mxStencilRegistry.packages[n]){mxStencilRegistry.packages[n]=1;for(var i=0;i<a.length;i++){var o=a[i];if(".xml"==o.toLowerCase().substring(o.length-4,o.length))mxStencilRegistry.loadStencilSet(o,null);else if(".js"==o.toLowerCase().substring(o.length-3,o.length)){var s=mxUtils.load(o);null!=s&&eval.call(window,s.getText())}}}}else mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+n+".xml",null);t=mxStencilRegistry.stencils[e]}}return t},mxStencilRegistry.getBasenameForStencil=function(e){var t=e.split("."),n=null;if(0<t.length&&"mxgraph"==t[0]){n=t[1];for(var a=2;a<t.length-1;a++)n+="/"+t[a]}return n},mxStencilRegistry.loadStencilSet=function(e,t,n){n=null!=n&&n;var a=mxStencilRegistry.packages[e];if(n||null==a){var i=!1;null==a&&(a=mxUtils.load(e).getXml(),mxStencilRegistry.packages[e]=a,i=!0),mxStencilRegistry.parseStencilSet(a,t,i)}},mxStencilRegistry.parseStencilSet=function(e,t,n){n=null==n||n;var a=e.documentElement,i=a.firstChild,o="",s=a.getAttribute("name");for(null!=s&&(o=s+".");null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=(s=i.getAttribute("name"))){o=o.toLowerCase();var r=s.replace(/ /g,"_");if(n&&mxStencilRegistry.addStencil(o+r.toLowerCase(),new mxStencil(i)),null!=t){var l=i.getAttribute("w"),d=i.getAttribute("h");t(o,r,s,l=null==l?80:parseInt(l,10),d=null==d?80:parseInt(d,10))}}i=i.nextSibling}},OpenFile=function(e){this.producer=null,this.consumer=null,this.done=e},OpenFile.prototype.setConsumer=function(e){this.consumer=e,this.execute()},OpenFile.prototype.setData=function(e,t){this.data=e,this.filename=t,this.execute()},OpenFile.prototype.error=function(e){this.cancel(),mxUtils.alert(e)},OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.data&&(this.consumer(this.data,this.filename),this.cancel())},OpenFile.prototype.cancel=function(){null!=this.done&&this.done()},Sidebar.prototype.init=function(){var e=STENCIL_PATH;this.addSearchPalette(!0),this.addImagePalette("entry",mxResources.get("entry"),e+"/entry/","_128x128.png",["start","finally","end"],[mxResources.get("start"),mxResources.get("finally"),mxResources.get("end")]),this.addImagePalette("call_management",mxResources.get("call_management"),e+"/call_management/","_128x128.png",["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[mxResources.get("answer"),mxResources.get("hangup"),mxResources.get("dial"),mxResources.get("ext_dial"),mxResources.get("queue"),mxResources.get("voicemail"),mxResources.get("callback")]),this.addImagePalette("agent_management",mxResources.get("agent_management"),e+"/agent_management/","_128x128.png",["login","pause","unpause","logout"],[mxResources.get("login"),mxResources.get("pause"),mxResources.get("unpause"),mxResources.get("logout")]),this.addImagePalette("variable",mxResources.get("variable"),e+"/variable/","_128x128.png",["set","math"],[mxResources.get("set"),mxResources.get("math")]),this.addImagePalette("playback",mxResources.get("playback"),e+"/playback/","_128x128.png",["playback","menu","saydigits","saynumber","sayphonetic","getdigits","getsecretdigits"],[mxResources.get("playback"),mxResources.get("menu"),mxResources.get("saydigits"),mxResources.get("saynumber"),mxResources.get("sayphonetic"),mxResources.get("getdigits"),mxResources.get("getsecretdigits")]),this.addImagePalette("recording",mxResources.get("recording"),e+"/recording/","_128x128.png",["record"],[mxResources.get("record")]),this.addImagePalette("tts","TTS",e+"/tts/","_128x128.png",["tts","ispeechtts","awspolly","lumenvoxtts"],["GoogleTTS","ISpeechTTS","AWSPolly","LumenvoxTTS"]),this.addImagePalette("asr","ASR",e+"/asr/","_128x128.png",["googleasr","ispeechasr","lumenvoxasr","tildeasr"],["GoogleASR","ISpeechASR","LumenvoxASR","TildeASR"]),this.addImagePalette("integrationServer",mxResources.get("integrationServer"),e+"/integration_server/","_128x128.png",["database","sendMail","sendSMS"],[mxResources.get("database"),mxResources.get("sendMail"),mxResources.get("sendSMS")]),this.addImagePalette("callflow",mxResources.get("callflow"),e+"/callflow/","_128x128.png",["gotoc","gotoif","gotoiftime","vswitch"],[mxResources.get("gotoc"),mxResources.get("gotoif"),mxResources.get("gotoiftime"),mxResources.get("vswitch")]),this.addImagePalette("stats",mxResources.get("stats"),e+"/stats/","_128x128.png",["goal"],[mxResources.get("goal")]),this.addImagePalette("general",mxResources.get("general"),e+"/general/","_128x128.png",["noop","system","agi","subproject","custom_app"],[mxResources.get("noop"),mxResources.get("system"),mxResources.get("agi"),mxResources.get("subproject"),mxResources.get("custom_app")])},Sidebar.prototype.collapsedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNUQyRTJFNjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNUQyRTJFNzZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MEUxNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MEUyNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhSMj6lrwAjcC1GyahV+dcZJgeIIFgA7":IMAGE_PATH+"/collapsed.gif",Sidebar.prototype.expandedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxREY3NzBERjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxREY3NzBFMDZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MERENkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MERFNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhGMj6nL3QAjVHIu6azbvPtWAAA7":IMAGE_PATH+"/expanded.gif",Sidebar.prototype.tooltipImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAbCAMAAAB7jU7LAAAACVBMVEX///+ZmZn///9Y2COLAAAAA3RSTlP//wDXyg1BAAAAOElEQVR42mXQMQ4AMAgDsWv//+iutcJmIQSk+9dJpVKpVCqVSqVSqZTdncWzF8/NeP7FkxWenPEDOnUBiL3jWx0AAAAASUVORK5CYII=":IMAGE_PATH+"/tooltip.png",Sidebar.prototype.searchImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAEaSURBVHjabNGxS5VxFIfxz71XaWuQUJCG/gCHhgTD9VpEETg4aMOlQRp0EoezObgcd220KQiXmpretTAHQRBdojlQEJyukPdt+b1ywfvAGc7wnHP4nlZd1yKijQW8xzNc4Su+ZOYfQ3T6/f4YNvEJYzjELXp4VVXVz263+7cR2niBxAFeZ2YPi3iHR/gYERPDwhpOsd6sz8x/mfkNG3iOlWFhFj8y89J9KvzGXER0GuEaD42mgwHqUtoljbcRsTBCeINpfM/MgZLKPpaxFxGbOCqDXmILN7hoJrTKH+axhxmcYRxP0MIDnOBDZv5q1XUNIuJxifJp+UNV7t7BFM6xeic0RMQ4Bpl5W/ol7GISx/eEUUTECrbx+f8A8xhiZht9zsgAAAAASUVORK5CYII=":IMAGE_PATH+"/search.png",Sidebar.prototype.enableTooltips=!0,Sidebar.prototype.tooltipBorder=16,Sidebar.prototype.tooltipDelay=300,Sidebar.prototype.dropTargetDelay=200,Sidebar.prototype.thumbWidth=36,Sidebar.prototype.thumbHeight=36,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2,Sidebar.prototype.sidebarTitleSize=9,Sidebar.prototype.sidebarTitles=!1,Sidebar.prototype.tooltipTitles=!0,Sidebar.prototype.maxTooltipWidth=400,Sidebar.prototype.maxTooltipHeight=400,Sidebar.prototype.addStencilsToIndex=!0,Sidebar.prototype.defaultImageWidth=80,Sidebar.prototype.defaultImageHeight=80,Sidebar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Sidebar.prototype.showTooltip=function(c,m,u,p,g,v){if(this.enableTooltips&&this.showTooltips&&this.currentElt!=c){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null);var e=mxUtils.bind(this,function(){null==this.tooltip&&(this.tooltip=document.createElement("div"),this.tooltip.className="geSidebarTooltip",this.tooltip.style.zIndex=mxPopupMenu.prototype.zIndex-1,document.body.appendChild(this.tooltip),this.graph2=new Graph(this.tooltip,null,null,this.editorUi.editor.graph.getStylesheet()),this.graph2.resetViewOnRootChange=!1,this.graph2.foldingEnabled=!1,this.graph2.gridEnabled=!1,this.graph2.autoScroll=!1,this.graph2.setTooltips(!1),this.graph2.setConnectable(!1),this.graph2.setEnabled(!1),mxClient.IS_SVG||(this.graph2.view.canvas.style.position="relative"),this.tooltipImage=mxUtils.createImage(this.tooltipImage),this.tooltipImage.className="geSidebarTooltipImage",this.tooltipImage.style.zIndex=mxPopupMenu.prototype.zIndex-1,this.tooltipImage.style.position="absolute",this.tooltipImage.style.width="14px",this.tooltipImage.style.height="27px",document.body.appendChild(this.tooltipImage)),this.graph2.model.clear(),this.graph2.view.setTranslate(this.tooltipBorder,this.tooltipBorder),u>this.maxTooltipWidth||p>this.maxTooltipHeight?this.graph2.view.scale=Math.round(100*Math.min(this.maxTooltipWidth/u,this.maxTooltipHeight/p))/100:this.graph2.view.scale=1,this.tooltip.style.display="block",this.graph2.labelsVisible=null==v||v,this.graph2.addCells(m);var e=this.graph2.getGraphBounds(),t=e.width+2*this.tooltipBorder+4,n=e.height+2*this.tooltipBorder;if(mxClient.IS_QUIRKS?(n+=4,this.tooltip.style.overflow="hidden"):this.tooltip.style.overflow="visible",this.tooltipImage.style.visibility="visible",this.tooltip.style.width=t+"px",this.tooltipTitles&&null!=g&&0<g.length){null==this.tooltipTitle?(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.style.borderTop="1px solid gray",this.tooltipTitle.style.textAlign="center",this.tooltipTitle.style.width="100%",this.tooltipTitle.style.overflow="hidden",mxClient.IS_SVG||(this.tooltipTitle.style.position="absolute"),this.tooltipTitle.style.paddingTop="6px",this.tooltip.appendChild(this.tooltipTitle)):this.tooltipTitle.innerHTML="",this.tooltipTitle.style.display="",mxUtils.write(this.tooltipTitle,g);var a=this.tooltipTitle.offsetHeight+10;n+=a,mxClient.IS_SVG?this.tooltipTitle.style.marginTop=2-a+"px":(n-=6,this.tooltipTitle.style.top=n-a+"px")}else null!=this.tooltipTitle&&null!=this.tooltipTitle.parentNode&&(this.tooltipTitle.style.display="none");this.tooltip.style.height=n+"px";var i=-Math.round(e.x-this.tooltipBorder),o=-Math.round(e.y-this.tooltipBorder),s=document.body,r=document.documentElement,l=(s.clientHeight||r.clientHeight,document.getElementById("vertical-navigation").offsetWidth+this.container.clientWidth),d=Math.max(0,this.getOffset(c).top-this.container.scrollTop-n/2+16);mxClient.IS_SVG?0!=i||0!=o?this.graph2.view.canvas.setAttribute("transform","translate("+i+","+o+")"):this.graph2.view.canvas.removeAttribute("transform"):(this.graph2.view.drawPane.style.left=i+"px",this.graph2.view.drawPane.style.top=o+"px"),this.tooltip.style.position="absolute",this.tooltip.style.left=l+"px",this.tooltip.style.top=d+"px",this.tooltipImage.style.left=l-13+"px",this.tooltipImage.style.top=d+n/2-13+"px"});null!=this.tooltip&&"none"!=this.tooltip.style.display?e():this.thread=window.setTimeout(e,this.tooltipDelay),this.currentElt=c}},Sidebar.prototype.hideTooltip=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null),null!=this.tooltip&&(this.tooltip.style.display="none",this.tooltipImage.style.visibility="hidden",this.currentElt=null)},Sidebar.prototype.addEntry=function(e,t){if(null!=this.taglist&&null!=e&&0<e.length)for(var n=e.toLowerCase().replace(/[\/\,\(\)]/g," ").split(" "),a=0;a<n.length;a++)if(n[a]=n[a].replace(/\.*\d*$/,""),1<n[a].length){var i=this.taglist[n[a]];null==i&&(i={entries:[],dict:new mxDictionary},this.taglist[n[a]]=i),null==i.dict.get(t)&&(i.dict.put(t,t),i.entries.push(t))}return t},Sidebar.prototype.searchEntries=function(e,t,n,a,i){if(null!=this.taglist&&null!=e){for(var o=e.toLowerCase().split(" "),s=new mxDictionary,r=(n+1)*t,l=[],d=0,c=0;c<o.length;c++)if(0<o[c].length){var m=this.taglist[o[c]],u=new mxDictionary;if(null!=m){var p=m.entries;l=[];for(var g=0;g<p.length;g++){m=p[g];if(0==d==(null==s.get(m))&&(u.put(m,m),l.push(m),c==o.length-1&&l.length==r))return void a(l.slice(n*t,r),r,!0)}}else l=[];s=u,d++}var v=l.length;a(l.slice(n*t,(n+1)*t),v,!1)}else a([])},Sidebar.prototype.filterTags=function(e){if(null!=e){for(var t=e.split(" "),n=[],a={},i=0;i<t.length;i++)null==a[t[i]]&&(a[t[i]]="1",n.push(t[i]));return n.join(" ")}return null},Sidebar.prototype.cloneCell=function(e,t){var n=e.clone();return null!=t&&(n.value=t),n},Sidebar.prototype.addSearchPalette=function(e){var t=document.createElement("div");t.style.visibility="hidden",this.container.appendChild(t);var r=document.createElement("div");r.className="geSidebar",r.style.boxSizing="border-box",r.style.overflow="hidden",r.style.width="100%",r.style.padding="8px",r.style.paddingTop="14px",r.style.paddingBottom="0px",e||(r.style.display="none");var n=document.createElement("div");n.style.whiteSpace="nowrap",n.style.textOverflow="clip",n.style.paddingBottom="8px",n.style.cursor="default";var a=document.createElement("input");a.setAttribute("placeholder",mxResources.get("searchShapes")),a.setAttribute("type","text"),a.style.fontSize="12px",a.style.overflow="hidden",a.style.boxSizing="border-box",a.style.border="solid 1px #d5d5d5",a.style.borderRadius="4px",a.style.width="100%",a.style.outline="none",a.style.padding="6px",n.appendChild(a);var i,o=document.createElement("img");o.setAttribute("src",Sidebar.prototype.searchImage),o.setAttribute("title",mxResources.get("search")),o.style.position="relative",o.style.left="-18px",mxClient.IS_QUIRKS?(a.style.height="28px",o.style.top="-4px"):o.style.top="2px",o.style.background="url('"+this.editorUi.editor.transparentImage+"')",n.appendChild(o),r.appendChild(n);var l=document.createElement("center"),d=mxUtils.button(mxResources.get("moreResults"),function(){i()});d.style.display="none",d.style.lineHeight="normal",d.style.marginTop="4px",d.style.marginBottom="8px",l.style.paddingTop="4px",l.style.paddingBottom="8px",l.appendChild(d),r.appendChild(l);var c="",m=!1,u=!1,p=0,g=new Object,v=12,h=mxUtils.bind(this,function(){m=!1,this.currentSearch=null;for(var e=r.firstChild;null!=e;){var t=e.nextSibling;e!=n&&e!=l&&e.parentNode.removeChild(e),e=t}});i=mxUtils.bind(this,function(){if(v=4*Math.max(1,Math.floor(this.container.clientWidth/(this.thumbWidth+10))),this.hideTooltip(),""!=a.value){if(null!=l.parentNode&&(c!=a.value&&(h(),c=a.value,g=new Object,u=!1,p=0),!m&&!u)){d.setAttribute("disabled","true"),d.style.display="",d.style.cursor="wait",d.innerHTML=mxResources.get("loading")+"...",m=!0;var s=new Object;this.currentSearch=s,this.searchEntries(c,v,p,mxUtils.bind(this,function(e,t,n){if(this.currentSearch==s){e=null!=e?e:[],m=!1,p++,l.parentNode.removeChild(l);for(var a=0;a<e.length;a++){var i=e[a]();null==g[i.innerHTML]&&(g[i.innerHTML]="1",r.appendChild(e[a]()))}if(n?(d.removeAttribute("disabled"),d.innerHTML=mxResources.get("moreResults")):(d.innerHTML=mxResources.get("reset"),d.style.display="none",u=!0),d.style.cursor="",0==e.length&&1==p){var o=document.createElement("div");o.className="geTitle",o.style.backgroundColor="transparent",o.style.borderColor="transparent",o.style.color="gray",o.style.padding="0px",o.style.margin="0px 8px 0px 8px",o.style.paddingTop="6px",o.style.textAlign="center",o.style.cursor="default",mxUtils.write(o,mxResources.get("noResultsFor",[c])),r.appendChild(o)}r.appendChild(l)}}),mxUtils.bind(this,function(){d.style.cursor=""}))}}else h(),a.value="",c="",g=new Object,d.style.display="none",u=!1,a.focus()}),mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(e){13==e.keyCode&&i()})),mxEvent.addListener(a,"focus",function(){a.style.paddingRight="",o.style.display="none"}),mxEvent.addListener(a,"blur",function(){a.style.paddingRight="20px",o.style.display=""}),a.style.paddingRight="20px",mxEvent.addListener(a,"keyup",mxUtils.bind(this,function(e){""==a.value?(u=!0,d.style.display="none"):a.value!=c?(d.style.display="none",u=!1):m||(d.style.display=u?"none":"")})),mxEvent.addListener(a,"mousedown",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0}),mxEvent.addListener(a,"selectstart",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0});var s=document.createElement("div");s.appendChild(r),this.container.appendChild(s),this.palettes.search=[t,s]},Sidebar.prototype.createTitle=function(e){var t=document.createElement("a");return t.setAttribute("href","javascript:void(0);"),t.setAttribute("title",mxResources.get("sidebarTooltip")),t.className="geTitle",mxUtils.write(t,e),t},Sidebar.prototype.createThumb=function(e,t,n,a,i,o,s,r,l){this.graph.labelsVisible=null==o||o;var d=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,this.graph.view.scaleAndTranslate(1,0,0),this.graph.addCells(e);var c=this.graph.getGraphBounds(),m=Math.floor(100*Math.min((t-2*this.thumbBorder)/c.width,(n-2*this.thumbBorder)/c.height))/100;this.graph.view.scaleAndTranslate(m,Math.floor((t-c.width*m)/2/m-c.x),Math.floor((n-c.height*m)/2/m-c.y));var u=null;if(this.graph.dialect!=mxConstants.DIALECT_SVG||mxClient.NO_FO?(u=this.graph.container.cloneNode(!1)).innerHTML=this.graph.container.innerHTML:u=this.graph.view.getCanvas().ownerSVGElement.cloneNode(!0),this.graph.getModel().clear(),mxClient.NO_FO=d,mxClient.IS_IE6&&(a.style.backgroundImage="url("+this.editorUi.editor.transparentImage+")"),u.style.position="relative",u.style.overflow="hidden",u.style.cursor="move",u.style.left=this.thumbBorder+"px",u.style.top=this.thumbBorder+"px",u.style.width=t+"px",u.style.height=n+"px",u.style.visibility="",u.style.minWidth="",u.style.minHeight="",a.appendChild(u),this.sidebarTitles&&null!=i&&0!=s){var p=mxClient.IS_QUIRKS?2*this.thumbPadding+2:0;a.style.height=this.thumbHeight+p+this.sidebarTitleSize+8+"px";var g=document.createElement("div");g.style.fontSize=this.sidebarTitleSize+"px",g.style.color="#303030",g.style.textAlign="center",g.style.whiteSpace="nowrap",mxClient.IS_IE&&(g.style.height=this.sidebarTitleSize+12+"px"),g.style.paddingTop="4px",mxUtils.write(g,i),a.appendChild(g)}return c},Sidebar.prototype.createItem=function(t,n,a,e,i,o,s){var r=document.createElement("a");r.setAttribute("href","javascript:void(0);"),r.className="geItem",r.style.overflow="hidden";var l=mxClient.IS_QUIRKS?8+2*this.thumbPadding:2*this.thumbBorder;r.style.width=this.thumbWidth+l+"px",r.style.height=this.thumbHeight+l+"px",r.style.padding=this.thumbPadding+"px",mxEvent.addListener(r,"click",function(e){mxEvent.consume(e)}),this.createThumb(t,this.thumbWidth,this.thumbHeight,r,n,a,e,i,o);var d=new mxRectangle(0,0,i,o);if(1<t.length||t[0].vertex){var c=this.createDragSource(r,this.createDropHandler(t,!0,s,d),this.createDragPreview(i,o),t,d);this.addClickHandler(r,c,t),c.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})}else if(null!=t[0]&&t[0].edge){c=this.createDragSource(r,this.createDropHandler(t,!1,s,d),this.createDragPreview(i,o),t,d);this.addClickHandler(r,c,t)}return mxClient.IS_IOS||mxEvent.addGestureListeners(r,null,mxUtils.bind(this,function(e){this.showTooltip(r,t,d.width,d.height,n,a)})),r},Sidebar.prototype.createDropHandler=function(g,v,h,b){return h=null==h||h,mxUtils.bind(this,function(e,t,n,a,i){if(e.isEnabled()){if(0<(g=e.getImportableCells(g)).length){e.stopEditing();var o=null!=n&&e.isValidDropTarget(n,g,t),s=null;if(null==n||o||(n=null),!e.isCellLocked(n||e.getDefaultParent())){e.model.beginUpdate();try{if(a=Math.round(a),i=Math.round(i),v&&e.isSplitTarget(n,g,t)){var r=e.cloneCells(g);e.splitEdge(n,r,null,a-b.width/2,i-b.height/2),s=r}else 0<g.length&&(s=e.importCells(g,a,i,n));if(null!=e.layoutManager){var l=e.layoutManager.getLayout(n);if(null!=l)for(var d=e.view.scale,c=e.view.translate,m=(a+c.x)*d,u=(i+c.y)*d,p=0;p<s.length;p++)l.moveCell(s[p],m,u)}h&&e.fireEvent(new mxEventObject("cellsInserted","cells",s))}finally{e.model.endUpdate()}null!=s&&0<s.length&&(e.scrollCellToVisible(s[0]),e.setSelectionCells(s))}}mxEvent.consume(t)}})},Sidebar.prototype.createDragPreview=function(e,t){var n=document.createElement("div");return n.style.border="1px dashed black",n.style.width=e+"px",n.style.height=t+"px",n},Sidebar.prototype.createDragSource=function(e,t,n){var a=mxUtils.makeDraggable(e,this.editorUi.editor.graph,t,n,0,0,this.editorUi.editor.graph.autoscroll,!0,!0);return a.getDropTarget=function(e,t,n){var a=mxDragSource.prototype.getDropTarget.apply(this,arguments);return e.isValidRoot(a)||(a=null),a},a},Sidebar.prototype.addClickHandler=function(e,a){var i=this.editorUi.editor.graph,o=null;mxEvent.addGestureListeners(e,function(e){o=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e))});var s=a.mouseUp;a.mouseUp=function(e){if(!mxEvent.isPopupTrigger(e)&&null==this.currentGraph&&null!=o){var t=i.tolerance;if(Math.abs(o.x-mxEvent.getClientX(e))<=t&&Math.abs(o.y-mxEvent.getClientY(e))<=t){var n=i.getGridSize();a.drop(i,e,null,n,n)}}s.apply(this,arguments),o=null}},Sidebar.prototype.createVertexTemplateEntry=function(e,t,n,a,i,o,s,r){return r=null!=r&&0<r.length?r:i.toLowerCase(),this.addEntry(r,mxUtils.bind(this,function(){return this.createVertexTemplate(e,t,n,a,i,o,s)}))},Sidebar.prototype.createXmlDocument=function(e,t,n,a){var i=mxUtils.createXmlDocument().createElement(e);return i.setAttribute("label",t),n.forEach(function(e,t){i.setAttribute(e,a[t]?a[t]:"")}),i},Sidebar.prototype.createVertexTemplate=function(e,t,n,a,i,o,s,r){var l=[],d=[];switch(a){case"answer":l=["timeout"],d=["0"];break;case"start":l=["answer"],d=["yes"];break;case"googleasr":l=["key","google_asr_language","timeout","intKey","beep"],d=["","it-IT","10","#","BEEP"];break;case"tildeasr":l=["uri","appid","appsecret","timeout","intKey","beep"],d=["wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE","","","10","#","BEEP"];break;case"ispeechasr":l=["key","model","ispeech_asr_language","timeout","intKey","beep"],d=["","","it-IT","10","#","BEEP"];break;case"playback":l=["file_id","opts"],d=["0"];break;case"background":l=["file_id","response","digit"],d=["0","5","1"];break;case"menu":l=["file_id","response","digit","retry","variable_id"],d=["0","5","1","1","0"];break;case"getdigits":l=["file_id","response","mindigit","maxdigit","retry","variable_id"],d=["0","5","1","10","1","0"];break;case"getsecretdigits":l=["file_id","response","mindigit","maxdigit","retry","hiddendigitsnum","hiddendigitspos","variable_id"],d=["0","5","1","10","1","0","first","0"];break;case"custom_app":l=["application","options"],d=["",""];break;case"set":l=["variable_id","variable_value"],d=["0",""];break;case"database":l=["odbc_id","query","variable_id"],d=["0","",""];break;case"noop":l=["output"],d=[];break;case"gotoc":l=["context","extension","priority"],d=["","","1"];break;case"system":l=["variable_id","command"],d=[];break;case"agi":l=["command","args"],d=[];break;case"gotoif":l=["condition"],d=[];break;case"gotoiftime":l=["interval_id"],d=["0"];break;case"vswitch":l=["variable_id"],d=["0"];break;case"saydigits":l=["digits","escape_digits"],d=["","#"];break;case"saynumber":l=["number","escape_digits"],d=["","#"];break;case"sayphonetic":l=["text","escape_digits"],d=["","#"];break;case"record":l=["file","recordingFormat","timeout","escape_digits"],d=["","wav","-1","#"];break;case"dial":l=["sip_id","timeout","opts","url"],d=["0","60"];break;case"ext_dial":l=["phone","trunk_name","timeout","opts","url"],d=["","-1","60"];break;case"tts":l=["text","google_tts_language"],d=["","it"];break;case"ispeechtts":l=["text","key","ispeech_tts_language","speed","intKey"],d=["","","euritalianfemale","0","#"];break;case"lumenvoxtts":l=["text","options"],d=["",""];break;case"lumenvoxasr":l=["grammar","options"],d=["",""];break;case"awspolly":l=["aws_access_key_id","aws_secret_access_key","aws_polly_region","aws_polly_voice","text"],d=["","","eu-west-1","Amy",""];break;case"queue":l=["queue_id","opts","url","file_id","timeout","agi","macro","gosub","position"],d=["-1","xX","","","300"];break;case"voicemail":l=["mailbox","options"],d=["",""];break;case"subproject":l=["project_id"],d=["0"];break;case"math":l=["operation","variable_id"],d=["","0"];break;case"queuelog":l=["queuename","agent","queue_event","data1","data2","data3","data4","data5"],d=[];break;case"goal":l=["goalname"],d=[];break;case"callback":l=["name","lastName","phone","list_id","delay","callback_priority"],d=["{CALLERID(name)}","","{CALLERID(num)}","-1","5","2"];break;case"sendSMS":l=["sms_account_id","to","sms_text"],d=["0"];break;case"sendMail":l=["account_id","to","cc","bcc","subject","text"],d=["0"];break;case"sendFax":l=["account_id","to","choose_attachment","attachment_name","attachment_type","attachment_path"],d=["0"];break;case"login":case"unpause":case"logout":l=["findBy"],d=["internal"];break;case"pause":l=["findBy","pause_id"],d=["internal",""];break;default:l=[],d=[]}var c=[new mxCell(this.createXmlDocument(a,i,l,d),new mxGeometry(0,0,t,n),e)];return c[0].vertex=!0,this.createVertexTemplateFromCells(c,t,n,i,o,s,r)},Sidebar.prototype.createVertexTemplateFromCells=function(e,t,n,a,i,o,s){return this.createItem(e,a,i,o,t,n,s)},Sidebar.prototype.createEdgeTemplate=function(e,t,n,a,i,o,s){var r=new mxCell(null!=a?a:"",new mxGeometry(0,0,t,n),e);return r.geometry.setTerminalPoint(new mxPoint(0,n),!0),r.geometry.setTerminalPoint(new mxPoint(t,0),!1),r.geometry.relative=!0,r.edge=!0,this.createEdgeTemplateFromCells([r],t,n,i,o,s)},Sidebar.prototype.createEdgeTemplateFromCells=function(e,t,n,a,i,o){return this.createItem(e,a,i,!0,t,n,o)},Sidebar.prototype.addPaletteFunctions=function(e,t,n,a){this.addPalette(e,t,n,mxUtils.bind(this,function(e){for(var t=0;t<a.length;t++)e.appendChild(a[t](e))}))},Sidebar.prototype.addPalette=function(e,t,n,a){var i=this.createTitle(t);this.container.appendChild(i);var o=document.createElement("div");o.className="geSidebar",mxClient.IS_POINTER&&(o.style.touchAction="none"),mxEvent.addListener(o,"mousemove",mxUtils.bind(this,function(e){mxEvent.getSource(e)==o?o.setAttribute("title",mxResources.get("sidebarTooltip")):o.removeAttribute("title")})),n?(a(o),a=null):o.style.display="none",this.addFoldingHandler(i,o,a);var s=document.createElement("div");return s.appendChild(o),this.container.appendChild(s),null!=e&&(this.palettes[e]=[i,s]),o},Sidebar.prototype.addFoldingHandler=function(n,a,i){var o=!1;(!mxClient.IS_IE||8<=document.documentMode)&&(n.style.backgroundImage="none"==a.style.display?"url('"+this.collapsedImage+"')":"url('"+this.expandedImage+"')"),n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="0% 50%",mxEvent.addListener(n,"click",mxUtils.bind(this,function(e){if("none"==a.style.display){if(o)a.style.display="block";else if(o=!0,null!=i){n.style.cursor="wait";var t=n.innerHTML;n.innerHTML=mxResources.get("loading")+"...",window.setTimeout(function(){var e=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,i(a),mxClient.NO_FO=e,a.style.display="block",n.style.cursor="",n.innerHTML=t},0)}else a.style.display="block";n.style.backgroundImage="url('"+this.expandedImage+"')"}else n.style.backgroundImage="url('"+this.collapsedImage+"')",a.style.display="none";mxEvent.consume(e)}))},Sidebar.prototype.addImagePalette=function(e,t,o,s,r,n,a){for(var l=[],d=0;d<r.length;d++)mxUtils.bind(this,function(e,t,n){if(null==n){var a=e.lastIndexOf("/"),i=e.lastIndexOf(".");n=e.substring(0<=a?a+1:0,0<=i?i:e.length).replace(/[-_]/g," ")}l.push(this.createVertexTemplateEntry("image;html=1;labelBackgroundColor=#ffffff;image="+o+e+s,this.defaultImageWidth,this.defaultImageHeight,r[d],t,!1,!0,this.filterTags(n)))})(r[d],null!=n?n[d]:null,null!=a?a[r[d]]:null);this.addPaletteFunctions(e,t,!1,l)},"undefined"!=typeof html4&&(html4.ATTRIBS["a::target"]=0),mxConstants.SHADOW_OPACITY=.25,mxConstants.SHADOWCOLOR="#000000",mxConstants.VML_SHADOWCOLOR="#d0d0d0",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,function(){try{if(null!=navigator&&null!=navigator.language){var e=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===e||"en-ca"===e||"es-mx"===e?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(e){}}(),mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,mxGraphModel.prototype.ignoreRelativeEdgeParent=!1,mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif",mxGraphView.prototype.gridSteps=4,mxGraphView.prototype.minGridSize=4,mxGraphView.prototype.gridColor="#e0e0e0",mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]",Graph=function(e,t,n,a){mxGraph.call(this,e,t,n,a),this.setConnectable(!0),this.setDropEnabled(!1),this.setPanning(!0),this.setTooltips(!mxClient.IS_TOUCH),this.setAllowLoops(!1),this.setMultigraph(!1),this.allowAutoPanning=!0,this.resetEdgesOnConnect=!1,this.constrainChildren=!1,this.connectionHandler.targetConnectImage=!0,this.setAllowDanglingEdges(!1),this.connectionHandler.setCreateTarget(!1),this.connectionHandler.isValidSource=function(){return mxConnectionHandler.prototype.isValidSource.apply(this,arguments)&&"2"!=urlParams.connect},this.alternateEdgeStyle="vertical",null==a&&this.loadStylesheet();var i=new mxRubberband(this);this.getRubberband=function(){return i},this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.container.style.cursor="pointer"})),this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.container.style.cursor="default"})),this.isHtmlLabel=function(e){var t=this.view.getState(e),n=null!=t?t.style:this.getCellStyle(e);return"1"==n.html||"wrap"==n.whiteSpace},this.cellRenderer.getLabelValue=function(e){var t=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);return"wrap"==e.style.whiteSpace&&1!=e.style.html&&(t=mxUtils.htmlEntities(t,!1)),t},this.isCellLocked=function(e){return!1},this.connectionHandler.tapAndHoldTolerance=16;var o=this.connectionHandler.tapAndHold;this.connectionHandler.tapAndHold=function(e,t){null==t?this.graph.panningHandler.active||(i.start(e.getGraphX(),e.getGraphY()),this.graph.panningHandler.panningTrigger=!1):tapAndHoldStartsConnection?o.apply(this,arguments):this.graph.isCellSelected(t.cell)&&1<this.graph.getSelectionCount()&&this.graph.removeSelectionCell(t.cell)},touchStyle&&this.initTouch()},mxUtils.extend(Graph,mxGraph),Graph.prototype.minFitScale=null,Graph.prototype.maxFitScale=null,Graph.prototype.loadStylesheet=function(){var e=mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement();new mxCodec(e.ownerDocument).decode(e,this.getStylesheet())},Graph.prototype.flipEdge=function(e){if(null!=e){var t=this.view.getState(e),n=null!=t?t.style:this.getCellStyle(e);if(null!=n){var a=mxUtils.getValue(n,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,a,[e])}}},Graph.prototype.setDefaultEdge=function(e){if(null!=e&&this.getModel().isEdge(e)){var t=this.getModel().cloneCells([e])[0];null!=t.geometry&&(t.geometry.points=null);var n=t.getStyle();n=mxUtils.setStyle(n,mxConstants.STYLE_ENTRY_X,null),n=mxUtils.setStyle(n,mxConstants.STYLE_ENTRY_Y,null),n=mxUtils.setStyle(n,mxConstants.STYLE_EXIT_X,null),n=mxUtils.setStyle(n,mxConstants.STYLE_EXIT_Y,null),t.setStyle(n),this.connectionHandler.createEdgeState=function(e){return this.graph.view.createState(t)},this.connectionHandler.factoryMethod=function(){return this.graph.cloneCells([t])[0]}}},Graph.prototype.isCellFoldable=function(e){return this.foldingEnabled&&this.isSwimlane(e)},Graph.prototype.isValidRoot=function(e){return this.isSwimlane(e)},Graph.prototype.createGroupCell=function(){var e=mxGraph.prototype.createGroupCell.apply(this,arguments);return e.setStyle("group"),e},Graph.prototype.getTooltipForCell=function(e){var t="";return this.getModel().isVertex(e)?t+=mxResources.get("description_"+e.value.nodeName)||"":this.getModel().isEdge(e)&&(t=mxGraph.prototype.getTooltipForCell.apply(this,arguments)),t},Graph.prototype.convertValueToString=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("label"):mxGraph.prototype.convertValueToString.apply(this,arguments)},Graph.prototype.cellLabelChanged=function(e,t,n){if(null!=e.value&&"object"==typeof e.value){var a=e.value.cloneNode(!0);a.setAttribute("label",t),t=a}mxGraph.prototype.cellLabelChanged.apply(this,arguments)},Graph.prototype.setLinkForCell=function(e,t){var n=null;null!=e.value&&"object"==typeof e.value?n=e.value.cloneNode(!0):(n=mxUtils.createXmlDocument().createElement("UserObject")).setAttribute("label",e.value);null!=t&&0<t.length?n.setAttribute("link",t):n.removeAttribute("link"),this.model.setValue(e,n)},Graph.prototype.getLinkForCell=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("link"):null},Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first},this.addListener(mxEvent.START_EDITING,function(e,t){this.panningHandler.hideMenu()});var o=!1,s=null;this.updateMouseEvent=function(e){if(mxGraph.prototype.updateMouseEvent.apply(this,arguments),null==e.getState()){var t=this.getCellAt(e.graphX,e.graphY);this.getModel().isEdge(t)&&(e.state=this.view.getState(t),null!=e.state&&null!=e.state.shape&&(this.container.style.cursor=e.state.shape.node.style.cursor))}null==e.getState()&&(this.container.style.cursor="default")},this.fireMouseEvent=function(e,t,n){if(e==mxEvent.MOUSE_DOWN)this.panningHandler.isMenuShowing()?(o=!1,s=null):(s=t.getCell(),o=null!=s?this.isCellSelected(s):this.isSelectionEmpty());else if(e==mxEvent.MOUSE_UP){if(o&&!this.isEditing()){if(!this.panningHandler.isMenuShowing()){var a=mxEvent.getClientX(t.getEvent()),i=mxEvent.getClientY(t.getEvent());this.panningHandler.popup(a+16,i,s,t.getEvent())}return o=!1,s=null,void t.consume()}o=!1,s=null}mxGraph.prototype.fireMouseEvent.apply(this,arguments),e==mxEvent.MOUSE_MOVE&&t.isConsumed()&&(o=!1,s=null)}},function(){if(mxVertexHandler.prototype.rotationEnabled=!0,mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,touchStyle){mxConstants.HANDLE_SIZE=16,mxConstants.LABEL_HANDLE_SIZE=7,mxClient.IS_TOUCH&&(mxVertexHandler.prototype.tolerance=4,mxEdgeHandler.prototype.tolerance=6,Graph.prototype.tolerance=14,Graph.prototype.gridSize=20,mxPanningHandler.prototype.selectOnPopup=!1,mxPanningHandler.prototype.useLeftButtonForPanning=!0,mxPanningHandler.prototype.isPanningTrigger=function(e){var t=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())||mxEvent.isControlDown(t)&&mxEvent.isShiftDown(t)||this.usePopupTrigger&&mxEvent.isPopupTrigger(t)});var n=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(e,t){n.apply(this,arguments),this.graph.isCellSelected(t.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)},Graph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxConnectionHandler.prototype.selectCells=function(e,t){touchStyle&&null!=t?this.graph.setSelectionCell(t):this.graph.setSelectionCell(e)};var a=mxGraph.prototype.dblClick;Graph.prototype.dblClick=function(e,t){if(null==t){var n=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e));t=this.getCellAt(n.x,n.y)}a.call(this,e,t)};var e=new mxImage(IMAGE_PATH+"/touch-handle.png",16,16);mxVertexHandler.prototype.handleImage=e,mxEdgeHandler.prototype.handleImage=e,mxOutline.prototype.sizerImage=e,(new Image).src=e.src;var t=IMAGE_PATH+"/touch-connector.png",i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(this.connectorImg=mxUtils.createImage(t),this.connectorImg.style.cursor="pointer",this.connectorImg.style.width="29px",this.connectorImg.style.height="29px",this.connectorImg.style.position="absolute",mxClient.IS_TOUCH||(this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state)),this.connectorImg.style.padding="2px",mxEvent.addGestureListeners(this.connectorImg,mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,t.x,t.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};var o=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){o.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+4+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};var s=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,t){s.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)},(new Image).src=t}else{var r=new mxImage(IMAGE_PATH+"/connector.png",15,15);if(mxConnectionHandler.prototype.connectImage=r,(new Image).src=r.src,"2"==urlParams.connect){r=new mxImage(IMAGE_PATH+"/connector.png",15,15),i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(mxClient.IS_IE&&!mxClient.IS_SVG?(this.connectorImg=document.createElement("div"),this.connectorImg.style.backgroundImage="url("+r.src+")",this.connectorImg.style.backgroundPosition="center",this.connectorImg.style.backgroundRepeat="no-repeat",this.connectorImg.style.width=r.width+4+"px",this.connectorImg.style.height=r.height+4+"px",this.connectorImg.style.display=mxClient.IS_QUIRKS?"inline":"inline-block"):(this.connectorImg=mxUtils.createImage(r.src),this.connectorImg.style.width=r.width+"px",this.connectorImg.style.height=r.height+"px"),this.connectorImg.style.cursor="pointer",this.connectorImg.style.position="absolute",this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state),this.connectorImg.style.padding="2px",mxEvent.addListener(this.connectorImg,"mousedown",mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,t.x,t.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};o=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){o.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+2+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};s=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,t){s.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)}}}}(),Actions.prototype.init=function(){var t=this.editorUi,l=t.editor,d=l.graph;this.addAction("new",function(){t.projectDesignController.newProject()}),this.addAction("open",function(){t.projectDesignController.openProject()}),this.addAction("save",function(){t.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml())),t.editor.modified=!1},null,null,"Ctrl+S"),this.addAction("saveAs",function(){t.projectDesignController.saveProjectAs(mxUtils.getPrettyXml(l.getGraphXml()))},null,null,"Ctrl+Shift+S"),this.addAction("publish",function(){t.editor.setStatus(""),null===t.validate()?(t.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml()),!0),t.editor.modified=!1):(t.editor.setStatus("...Error publishing! Please check the project and try again!"),setTimeout(function(){t.editor.setStatus("")},3e3))},null,null,"Ctrl+Shift+P"),this.addAction("variable",function(){t.projectDesignController.newVariable()}),this.addAction("import",function(){t.projectDesignController.importXML(function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})}),this.addAction("export",function(){t.exportXML(mxUtils.getPrettyXml(l.getGraphXml()))},null,null,"Ctrl+E"),this.addAction("editFile",function(){t.projectDesignController.editXML(mxUtils.getPrettyXml(l.getGraphXml()),function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})}),this.addAction("print",function(){mxUtils.printScreen(d)},null,"sprite-print","Ctrl+P"),this.addAction("preview",function(){mxUtils.show(d,null,10,10)}),this.addAction("undo",function(){l.undoManager.undo()},null,"sprite-undo","Ctrl+Z"),this.addAction("redo",function(){l.undoManager.redo()},null,"sprite-redo","Ctrl+Y"),this.addAction("cut",function(){mxClipboard.cut(d)},null,"sprite-cut","Ctrl+X"),this.addAction("copy",function(){mxClipboard.copy(d)},null,"sprite-copy","Ctrl+C"),this.addAction("paste",function(){mxClipboard.paste(d)},!1,"sprite-paste","Ctrl+V"),this.addAction("delete",function(){d.removeCells()},null,null,"Delete"),this.addAction("duplicate",function(){var e=d.gridSize;d.setSelectionCells(d.moveCells(d.getSelectionCells(),e,e,!0))},null,null,"Ctrl+D"),this.addAction("selectVertices",function(){d.selectVertices()},null,null,"Ctrl+Shift+V"),this.addAction("selectEdges",function(){d.selectEdges()},null,null,"Ctrl+Shift+E"),this.addAction("selectAll",function(){d.selectAll()},null,null,"Ctrl+A"),this.addAction("home",function(){d.home()},null,null,"Home"),this.addAction("exitGroup",function(){d.exitGroup()},null,null,"Page Up"),this.addAction("enterGroup",function(){d.enterGroup()},null,null,"Page Down"),this.addAction("expand",function(){d.foldCells(!1)},null,null,"Enter"),this.addAction("collapse",function(){d.foldCells(!0)},null,null,"Backspace"),this.addAction("toFront",function(){d.orderCells(!1)},null,null,"Ctrl+F"),this.addAction("toBack",function(){d.orderCells(!0)},null,null,"Ctrl+B"),this.addAction("group",function(){d.setSelectionCell(d.groupCells(null,0))},null,null,"Ctrl+G"),this.addAction("ungroup",function(){d.setSelectionCells(d.ungroupCells())},null,null,"Ctrl+U"),this.addAction("removeFromGroup",function(){d.removeCellsFromParent()}),this.addAction("editLink",function(){var e=d.getSelectionCell(),t=d.getLinkForCell(e);null==t&&(t=""),null!=(t=mxUtils.prompt(mxResources.get("enterValue"),t))&&d.setLinkForCell(e,t)}),this.addAction("openLink",function(){var e=d.getSelectionCell(),t=d.getLinkForCell(e);null!=t&&window.open(t)}),this.addAction("autosize",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var t=0;t<e.length;t++){var n=e[t];d.getModel().getChildCount(n)?d.updateGroupBounds([n],20):d.updateCellSize(n)}}finally{d.getModel().endUpdate()}}}),this.addAction("wordWrap",function(){var e=d.getView().getState(d.getSelectionCell()),t="wrap";null!=e&&"wrap"==e.style[mxConstants.STYLE_WHITE_SPACE]&&(t=null),d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,t)}),this.addAction("rotation",function(){var e="0",t=d.getView().getState(d.getSelectionCell());null!=t&&(e=t.style[mxConstants.STYLE_ROTATION]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)",e))&&d.setCellStyles(mxConstants.STYLE_ROTATION,e)}),this.addAction("tilt",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var t=0;t<e.length;t++){var n=e[t];if(d.getModel().isVertex(n)&&0==d.getModel().getChildCount(n)){var a=d.getCellGeometry(n);if(null!=a){(a=a.clone()).x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var i=a.width;a.width=a.height,a.height=i,d.getModel().setGeometry(n,a);var o=d.view.getState(n);if(null!=o){var s=o.style[mxConstants.STYLE_DIRECTION]||"east";"east"==s?s="south":"south"==s?s="west":"west"==s?s="north":"north"==s&&(s="east"),d.setCellStyles(mxConstants.STYLE_DIRECTION,s,[n])}}}}}finally{d.getModel().endUpdate()}}},null,null,"Ctrl+R"),this.addAction("actualSize",function(){d.zoomTo(1)}),this.addAction("zoomIn",function(){d.zoomIn()},null,null,"Add"),this.addAction("zoomOut",function(){d.zoomOut()},null,null,"Subtract"),this.addAction("fitWindow",function(){d.fit()}),this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,t=d.pageScale,n=d.container.clientWidth-20,a=d.container.clientHeight-20,i=Math.floor(100*Math.min(n/e.width/t,a/e.height/t))/100;d.zoomTo(i),d.container.scrollLeft=Math.round(d.view.translate.x*i-Math.max(10,(d.container.clientWidth-e.width*t*i)/2)),d.container.scrollTop=Math.round(d.view.translate.y*i-Math.max(10,(d.container.clientHeight-e.height*t*i)/2))})),this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,t=d.pageScale,n=d.container.clientWidth-20,a=Math.floor(100*n/e.width/t)/100;d.zoomTo(a),d.container.scrollLeft=Math.round(d.view.translate.x*a-Math.max(10,(d.container.clientWidth-e.width*t*a)/2)),d.container.scrollTop=Math.round(d.view.translate.y*a-Math.max(10,(d.container.clientHeight-e.height*t*a)/2))})),this.put("customZoom",new Action(mxResources.get("custom"),function(){var e=mxUtils.prompt(mxResources.get("enterValue")+" (%)",parseInt(100*d.getView().getScale()));null!=e&&0<e.length&&!isNaN(parseInt(e))&&d.zoomTo(parseInt(e)/100)}));var e=null;(e=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled()),l.updateGraphComponents()},null,null,"Ctrl+Shift+G")).setToggleAction(!0),e.setSelectedCallback(function(){return d.isGridEnabled()}),(e=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled})).setToggleAction(!0),e.setSelectedCallback(function(){return d.graphHandler.guidesEnabled}),(e=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()}),(e=this.addAction("navigation",function(){d.foldingEnabled=!d.foldingEnabled,d.view.revalidate()})).setToggleAction(!0),e.setSelectedCallback(function(){return d.foldingEnabled}),(e=this.addAction("scrollbars",function(){if(d.scrollbars=!d.scrollbars,l.updateGraphComponents(),d.scrollbars){var e=d.view.translate.x,t=d.view.translate.y;d.view.translate.x=0,d.view.translate.y=0,d.sizeDidChange(),d.container.scrollLeft-=Math.round(e*d.view.scale),d.container.scrollTop-=Math.round(t*d.view.scale)}else{var n=d.view.translate;d.view.setTranslate(n.x-d.container.scrollLeft/d.view.scale,n.y-d.container.scrollTop/d.view.scale),d.container.scrollLeft=0,d.container.scrollTop=0,d.sizeDidChange()}},!mxClient.IS_TOUCH)).setToggleAction(!0),e.setSelectedCallback(function(){return"auto"==d.container.style.overflow}),(e=this.addAction("pageView",mxUtils.bind(this,function(){d.pageVisible=!d.pageVisible,d.pageBreaksVisible=d.pageVisible,d.preferPageSize=d.pageBreaksVisible,d.view.validate(),d.sizeDidChange(),l.updateGraphComponents(),l.outline.update(),mxUtils.hasScrollbars(d.container)&&(d.pageVisible?(d.container.scrollLeft-=20,d.container.scrollTop-=20):(d.container.scrollLeft+=20,d.container.scrollTop+=20))}))).setToggleAction(!0),e.setSelectedCallback(function(){return d.pageVisible}),(e=this.addAction("connect",function(){d.setConnectable(!d.connectionHandler.isEnabled())},null,null,"Ctrl+Q")).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isEnabled()}),(e=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()}),this.addAction("help",function(){window.open("https://wiki.xcallymotion.com/display/XMV/Cally+Square")}),this.put("about",new Action(mxResources.get("about")+" Cally Square",function(){window.open("http://callysquare.com/")},null,null,null));var n=mxUtils.bind(this,function(e,t){this.addAction(e,function(){d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,t)})});n("bold",mxConstants.FONT_BOLD),n("italic",mxConstants.FONT_ITALIC),n("underline",mxConstants.FONT_UNDERLINE),this.addAction("shadow",function(){d.toggleCellStyles(mxConstants.STYLE_SHADOW)}),this.addAction("dashed",function(){d.toggleCellStyles(mxConstants.STYLE_DASHED)}),this.addAction("rounded",function(){d.toggleCellStyles(mxConstants.STYLE_ROUNDED)}),this.addAction("curved",function(){d.toggleCellStyles(mxConstants.STYLE_CURVED)}),this.addAction("style",function(){var e=d.getSelectionCells();if(null!=e&&0<e.length){var t=d.getModel(),n=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("style")+")",t.getStyle(e[0])||"");null!=n&&d.setCellStyle(n,e)}}),this.addAction("setAsDefaultEdge",function(){d.setDefaultEdge(d.getSelectionCell())}),this.addAction("addWaypoint",function(){var e=d.getSelectionCell();if(null!=e&&d.getModel().isEdge(e)){var t=l.graph.selectionCellsHandler.getHandler(e);if(t instanceof mxEdgeHandler){var n=d.view.translate,a=d.view.scale,i=n.x,o=n.y,s=d.getModel().getParent(e),r=d.getCellGeometry(s);d.getModel().isVertex(s)&&null!=r&&(i+=r.x,o+=r.y),t.addPointAt(t.state,d.panningHandler.triggerX/a-i,d.panningHandler.triggerY/a-o)}}}),this.addAction("removeWaypoint",function(){var e=t.actions.get("removeWaypoint");null!=e.handler&&e.handler.removePoint(e.handler.state,e.index)}),this.addAction("image",function(){var e="",t=d.getView().getState(d.getSelectionCell());if(null!=t&&(e=t.style[mxConstants.STYLE_IMAGE]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("url")+")",e))&&0<e.length){var n=new Image;n.onload=function(){!function(e,t,n){var a=null,i=d.getSelectionCells();d.getModel().beginUpdate();try{if(0==i.length){var o=d.getGridSize();a=i=[d.insertVertex(d.getDefaultParent(),null,"",o,o,t,n)]}if(d.setCellStyles(mxConstants.STYLE_IMAGE,e,i),d.setCellStyles(mxConstants.STYLE_SHAPE,"image",i),1==d.getSelectionCount()&&null!=t&&null!=n){var s=i[0],r=d.getModel().getGeometry(s);null!=r&&((r=r.clone()).width=t,r.height=n,d.getModel().setGeometry(s,r))}}finally{d.getModel().endUpdate()}null!=a&&(d.setSelectionCells(a),d.scrollCellToVisible(a[0]))}(e,n.width,n.height)},n.onerror=function(){mxUtils.alert(mxResources.get("fileNotFound"))},n.src=e}})},Actions.prototype.addAction=function(e,t,n,a,i){return this.put(e,new Action(mxResources.get(e),t,n,a,i))},Actions.prototype.put=function(e,t){return this.actions[e]=t},Actions.prototype.get=function(e){return this.actions[e]},mxUtils.extend(Action,mxEventSource),Action.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Action.prototype.setToggleAction=function(e){this.toggleAction=e},Action.prototype.setSelectedCallback=function(e){this.selectedCallback=e},Action.prototype.isSelected=function(){return this.selectedCallback()},Menus=function(e){this.editorUi=e,this.menus=new Object,this.init(),(new Image).src=IMAGE_PATH+"/checkmark.gif"},Menus.prototype.init=function(){var i=this.editorUi.editor.graph;this.put("fontFamily",new Menu(mxUtils.bind(this,function(e,t){for(var n=["Helvetica","Verdana","Times New Roman","Garamond","Comic Sans MS","Courier New","Georgia","Lucida Console","Tahoma"],a=0;a<n.length;a++){this.styleChange(e,n[a],[mxConstants.STYLE_FONTFAMILY],[n[a]],null,t).firstChild.nextSibling.style.fontFamily=n[a]}e.addSeparator(t),this.promptChange(e,mxResources.get("custom"),"",mxConstants.DEFAULT_FONTFAMILY,mxConstants.STYLE_FONTFAMILY,t)}))),this.put("fontSize",new Menu(mxUtils.bind(this,function(e,t){for(var n=[6,8,9,10,11,12,14,18,24,36,48,72],a=0;a<n.length;a++)this.styleChange(e,n[a],[mxConstants.STYLE_FONTSIZE],[n[a]],null,t);e.addSeparator(t),this.promptChange(e,mxResources.get("custom"),"(pt)","12",mxConstants.STYLE_FONTSIZE,t)}))),this.put("linewidth",new Menu(mxUtils.bind(this,function(e,t){for(var n=[1,2,3,4,8,12,16,24],a=0;a<n.length;a++)this.styleChange(e,n[a]+"px",[mxConstants.STYLE_STROKEWIDTH],[n[a]],null,t);e.addSeparator(t),this.promptChange(e,mxResources.get("custom"),"(px)","1",mxConstants.STYLE_STROKEWIDTH,t)}))),this.put("line",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("straight"),[mxConstants.STYLE_EDGE],[null],null,t),this.styleChange(e,mxResources.get("entityRelation"),[mxConstants.STYLE_EDGE],["entityRelationEdgeStyle"],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("horizontal"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","horizontal"],null,t),this.styleChange(e,mxResources.get("vertical"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","vertical"],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("manual"),[mxConstants.STYLE_EDGE],["segmentEdgeStyle"],null,t),this.styleChange(e,mxResources.get("automatic"),[mxConstants.STYLE_EDGE],["orthogonalEdgeStyle"],null,t)}))),this.put("lineend",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_CLASSIC],null,t),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OPEN],null,t),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_BLOCK],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OVAL],null,t),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND],null,t),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND_THIN],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_ENDARROW],[mxConstants.NONE],null,t),e.addSeparator(t),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("endFill",!0)},t,null,!0),e.addSeparator(t),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_ENDSIZE,t)}))),this.put("linestart",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_CLASSIC],null,t),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OPEN],null,t),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_BLOCK],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OVAL],null,t),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND],null,t),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND_THIN],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_STARTARROW],[mxConstants.NONE],null,t),e.addSeparator(t),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("startFill",!0)},t,null,!0),e.addSeparator(t),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_STARTSIZE,t)}))),this.put("spacing",new Menu(mxUtils.bind(this,function(e,t){var n=this.editorUi.actions.get("shadow").enabled,a=this.get("line").enabled;(n||e.showDisabled)&&(this.promptChange(e,mxResources.get("top"),"(px)","0",mxConstants.STYLE_SPACING_TOP,t,n),this.promptChange(e,mxResources.get("right"),"(px)","0",mxConstants.STYLE_SPACING_RIGHT,t,n),this.promptChange(e,mxResources.get("bottom"),"(px)","0",mxConstants.STYLE_SPACING_BOTTOM,t,n),this.promptChange(e,mxResources.get("left"),"(px)","0",mxConstants.STYLE_SPACING_LEFT,t,n),e.addSeparator(t),this.promptChange(e,mxResources.get("global"),"(px)","0",mxConstants.STYLE_SPACING,t,n),this.promptChange(e,mxResources.get("perimeter"),"(px)","0",mxConstants.STYLE_PERIMETER_SPACING,t,n)),(a||e.showDisabled)&&(e.addSeparator(t),this.promptChange(e,mxResources.get("sourceSpacing"),"(px)","0",mxConstants.STYLE_SOURCE_PERIMETER_SPACING,t,a),this.promptChange(e,mxResources.get("targetSpacing"),"(px)","0",mxConstants.STYLE_TARGET_PERIMETER_SPACING,t,a))}))),this.put("format",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItem(e,"style",t)}))),this.put("text",new Menu(mxUtils.bind(this,function(e,t){var n=this.get("text").enabled;e.addSeparator(t),this.addSubmenu("fontFamily",e,t),this.addSubmenu("fontSize",e,t),this.addMenuItems(e,["-","bold","italic","underline","-"],t),this.addSubmenu("alignment",e,t),this.addMenuItem(e,"wordWrap",t),e.addSeparator(t),this.promptChange(e,mxResources.get("textOpacity"),"(%)","100",mxConstants.STYLE_TEXT_OPACITY,t,n),e.addItem(mxResources.get("hide"),null,function(){i.toggleCellStyles(mxConstants.STYLE_NOLABEL,!1)},t,null,n)}))),this.put("alignment",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("leftAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT],null,t),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER],null,t),this.styleChange(e,mxResources.get("rightAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("topAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP],null,t),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE],null,t),this.styleChange(e,mxResources.get("bottomAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM],null,t),e.addSeparator(t),this.addSubmenu("position",e,t),this.addSubmenu("spacing",e,t),e.addSeparator(t);var n=this.get("text").enabled;e.addItem(mxResources.get("vertical"),null,function(){i.toggleCellStyles(mxConstants.STYLE_HORIZONTAL,!0)},t,null,n)}))),this.put("position",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("left"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_RIGHT],null,t),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_CENTER],null,t),this.styleChange(e,mxResources.get("right"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_LEFT],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("top"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP,mxConstants.ALIGN_BOTTOM],null,t),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_MIDDLE],null,t),this.styleChange(e,mxResources.get("bottom"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_TOP],null,t)}))),this.put("direction",new Menu(mxUtils.bind(this,function(e,t){e.addItem(mxResources.get("flipH"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPH,!1)},t),e.addItem(mxResources.get("flipV"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPV,!1)},t),this.addMenuItems(e,["-","tilt","rotation"],t)}))),this.put("align",new Menu(mxUtils.bind(this,function(e,t){e.addItem(mxResources.get("leftAlign"),null,function(){i.alignCells(mxConstants.ALIGN_LEFT)},t),e.addItem(mxResources.get("center"),null,function(){i.alignCells(mxConstants.ALIGN_CENTER)},t),e.addItem(mxResources.get("rightAlign"),null,function(){i.alignCells(mxConstants.ALIGN_RIGHT)},t),e.addSeparator(t),e.addItem(mxResources.get("topAlign"),null,function(){i.alignCells(mxConstants.ALIGN_TOP)},t),e.addItem(mxResources.get("middle"),null,function(){i.alignCells(mxConstants.ALIGN_MIDDLE)},t),e.addItem(mxResources.get("bottomAlign"),null,function(){i.alignCells(mxConstants.ALIGN_BOTTOM)},t)}))),this.put("layout",new Menu(mxUtils.bind(this,function(e,t){e.addItem(mxResources.get("horizontalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_WEST);this.editorUi.executeLayout(e,!0,!0)}),t),e.addItem(mxResources.get("verticalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_NORTH);this.editorUi.executeLayout(e,!0,!0)}),t)}))),this.put("navigation",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["home","-","exitGroup","enterGroup","-","expand","collapse"],t)}))),this.put("arrange",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["toFront","toBack","-"],t),this.addSubmenu("layout",e,t),e.addSeparator(t),this.addMenuItems(e,["-","group","ungroup","removeFromGroup"],t)}))),this.put("view",new Menu(mxUtils.bind(this,function(t,n){this.addMenuItems(t,["actualSize"],n),t.addSeparator();for(var e=[.25,.5,.75,1,2,4],a=0;a<e.length;a++)!function(e){t.addItem(100*e+"%",null,function(){i.zoomTo(e)},n)}(e[a]);this.addMenuItems(t,["-","zoomIn","zoomOut","-","fitWindow","customZoom","-","fitPage","fitPageWidth"],n)}))),this.put("file",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["new","open","-","save","saveAs","publish","-","variable","-","import","export","-","editFile","description","-","print"],t)}))),this.put("edit",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["undo","redo","-","cut","copy","paste","delete","-","duplicate","-","selectVertices","selectEdges","selectAll"])}))),this.put("help",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["help","-","about"])})))},Menus.prototype.put=function(e,t){this.menus[e]=t},Menus.prototype.get=function(e){return this.menus[e]},Menus.prototype.addSubmenu=function(e,t,n){var a=this.get(e).enabled;if(t.showDisabled||a){var i=t.addItem(mxResources.get(e),null,null,n,null,a);this.addMenu(e,t,i)}},Menus.prototype.addMenu=function(e,t,n){var a=this.get(e);null!=a&&(t.showDisabled||a.enabled)&&this.get(e).execute(t,n)},Menus.prototype.styleChange=function(e,t,n,a,i,o){return e.addItem(t,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph;e.getModel().beginUpdate();try{for(var t=0;t<n.length;t++)e.setCellStyles(n[t],a[t])}finally{e.getModel().endUpdate()}}),o,i)},Menus.prototype.promptChange=function(e,t,a,i,o,n,s){return e.addItem(t,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph,t=i,n=e.getView().getState(e.getSelectionCell());null!=n&&(t=n.style[o]||t),null!=(t=mxUtils.prompt(mxResources.get("enterValue")+(0<a.length?" "+a:""),t))&&0<t.length&&e.setCellStyles(o,t)}),n,null,s)},Menus.prototype.addMenuItem=function(e,t,n){var a=this.editorUi.actions.get(t);if(null!=a&&(e.showDisabled||a.enabled)){var i=e.addItem(a.label,null,a.funct,n,null,a.enabled);return a.toggleAction&&a.isSelected()&&this.addCheckmark(i),this.addShortcut(i,a),i}return null},Menus.prototype.addShortcut=function(e,t){if(null!=t.shortcut){var n=e.firstChild.nextSibling.nextSibling,a=document.createElement("span");a.style.color="gray",mxUtils.write(a,t.shortcut),n.appendChild(a)}},Menus.prototype.addCheckmark=function(e){var t=e.firstChild.nextSibling;t.style.backgroundImage="url("+IMAGE_PATH+"/checkmark.gif)",t.style.backgroundRepeat="no-repeat",t.style.backgroundPosition="2px 50%"},Menus.prototype.addMenuItems=function(e,t,n){for(var a=0;a<t.length;a++)"-"==t[a]?e.addSeparator(n):this.addMenuItem(e,t[a],n)},Menus.prototype.createPopupMenu=function(e,t,n){var a=this.editorUi.editor.graph;if(e.smartSeparators=!0,a.isSelectionEmpty()?this.addMenuItems(e,["undo","redo","-","paste","-"]):(this.addMenuItems(e,["delete","-","cut","copy","-","duplicate"]),1==a.getSelectionCount()&&a.getModel().isEdge(a.getSelectionCell())&&this.addMenuItems(e,["setAsDefaultEdge"]),e.addSeparator()),0<a.getSelectionCount()){if(this.addMenuItems(e,["toFront","toBack","-"]),a.getModel().isEdge(a.getSelectionCell())){var i=!1;if(null!=(t=a.getSelectionCell())&&a.getModel().isEdge(t)){var o=a.selectionCellsHandler.getHandler(t);if(o instanceof mxEdgeHandler&&null!=o.bends&&2<o.bends.length){var s=o.getHandleForEvent(new mxMouseEvent(n)),r=this.editorUi.actions.get("removeWaypoint");r.handler=o,i=0<(r.index=s)&&s<o.bends.length}}this.addMenuItems(e,["-",i?"removeWaypoint":"addWaypoint"])}else 1<a.getSelectionCount()&&(e.addSeparator(),this.addMenuItems(e,["group"]));if(e.addSeparator(),1==a.getSelectionCount())null!=a.getLinkForCell(a.getSelectionCell())&&this.addMenuItems(e,["openLink"])}else this.addMenuItems(e,["-","selectVertices","selectEdges","-","selectAll"])},Menus.prototype.createMenubar=function(e){for(var t=new Menubar(this.editorUi,e),n=["file","edit","view","format","text","arrange","help"],a=0;a<n.length;a++)t.addMenu(mxResources.get(n[a]),this.get(n[a]).funct);return t},Menubar.prototype.hideMenu=function(){null!=this.currentMenu&&this.currentMenu.hideMenu()},Menubar.prototype.addMenu=function(e,t){var n=document.createElement("a");return n.setAttribute("href","javascript:void(0);"),n.className="geItem",mxUtils.write(n,e),this.addMenuHandler(n,t),this.container.appendChild(n),n},Menubar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Menubar.prototype.addMenuHandler=function(i,o){if(null!=o){var s=!0,t=mxUtils.bind(this,function(e){if(s&&null==i.enabled||i.enabled){this.editorUi.editor.graph.panningHandler.hideMenu();var t=new mxPopupMenu(o);t.div.className+=" geMenubarMenu",t.smartSeparators=!0,t.showDisabled=!0,t.autoExpand=!0,t.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(t,arguments),t.destroy(),this.currentMenu=null,this.currentElt=null});var n=this.getOffset(i).left,a=this.getOffset(i).top+i.offsetHeight;t.popup(n,a,null,e),this.currentMenu=t,this.currentElt=i}s=!0,mxEvent.consume(e)});mxEvent.addListener(i,"mousemove",mxUtils.bind(this,function(e){null!=this.currentMenu&&this.currentElt!=i&&(this.hideMenu(),t(e))})),mxEvent.addListener(i,"mousedown",mxUtils.bind(this,function(){s=this.currentElt!=i})),mxEvent.addListener(i,"click",t)}},mxUtils.extend(Menu,mxEventSource),Menu.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Menu.prototype.execute=function(e,t){this.funct(e,t)},Toolbar.prototype.init=function(){this.addItems(["save","publish","-","print","undo","redo","-","copy","cut","paste","delete","-","duplicate","-","actualSize","zoomIn","zoomOut","-"]);this.editorUi.editor.graph},Toolbar.prototype.hideMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.currentMenu.destroy(),this.currentMenu=null)},Toolbar.prototype.addMenu=function(e,t,n,a){var i=this.editorUi.menus.get(a),o=this.addMenuFunction(e,t,n,i.funct);return i.addListener("stateChanged",function(){o.setEnabled(i.enabled)}),o},Toolbar.prototype.addMenuFunction=function(e,t,n,a){var i=n?this.createLabel(e):this.createButton(e);return this.initElement(i,t),this.addMenuHandler(i,n,a),this.container.appendChild(i),i},Toolbar.prototype.addSeparator=function(){var e=document.createElement("div");return e.className="geSeparator",this.container.appendChild(e),e},Toolbar.prototype.addItems=function(e){for(var t=0;t<e.length;t++){var n=e[t];"-"==n?this.addSeparator():this.addItem("geSprite-"+n.toLowerCase(),n)}},Toolbar.prototype.addItem=function(e,t){var n=this.editorUi.actions.get(t),a=null;return null!=n&&((a=this.addButton(e,n.label,n.funct)).setEnabled(n.enabled),n.addListener("stateChanged",function(){a.setEnabled(n.enabled)})),a},Toolbar.prototype.addButton=function(e,t,n){var a=this.createButton(e);return this.initElement(a,t),this.addClickHandler(a,n),this.container.appendChild(a),a},Toolbar.prototype.addSelectionHandler=function(n){var a=this.editorUi.editor.graph,e=function(){for(var e=!a.isSelectionEmpty(),t=0;t<n.length;t++)n[t].setEnabled(e)};a.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.addEdgeSelectionHandler=function(a){var i=this.editorUi.editor.graph,e=function(){var e=!1;if(!i.isSelectionEmpty())for(var t=i.getSelectionCells(),n=0;n<t.length;n++)if(i.getModel().isEdge(t[n])){e=!0;break}for(n=0;n<a.length;n++)a[n].setEnabled(e)};i.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.initElement=function(e,t){e.setAttribute("tabindex","0"),null!=t&&e.setAttribute("title",t),this.addEnabledState(e)},Toolbar.prototype.addEnabledState=function(t){var n=t.className;t.setEnabled=function(e){t.enabled=e,t.className=e?n:n+" geDisabled"},t.setEnabled(!0)},Toolbar.prototype.addClickHandler=function(t,n){null!=n&&mxEvent.addListener(t,"click",function(e){t.enabled&&n(e),mxEvent.consume(e)})},Toolbar.prototype.createButton=function(e){var t=document.createElement("a");t.setAttribute("href","javascript:void(0);"),t.className="geButton";var n=document.createElement("div");return n.className="geSprite "+e,t.appendChild(n),t},Toolbar.prototype.createLabel=function(e,t){var n=document.createElement("a");return n.setAttribute("href","javascript:void(0);"),n.className="geLabel",mxUtils.write(n,e),n},Toolbar.prototype.addMenuHandler=function(t,n,a,i){if(null!=a){var o=this.editorUi.editor.graph,s=null;mxEvent.addListener(t,"click",mxUtils.bind(this,function(e){(null==t.enabled||t.enabled)&&(o.panningHandler.hideMenu(),(s=new mxPopupMenu(a)).div.className+=" geToolbarMenu",s.showDisabled=i,s.labels=n,s.autoExpand=!0,s.popup(t.offsetLeft,t.offsetTop+t.offsetHeight+34,null,e),this.currentMenu=s),mxEvent.consume(e)}))}},Dialog.prototype.close=function(){null!=this.onDialogClose&&(this.onDialogClose(),this.onDialogClose=null),this.container.parentNode.removeChild(this.container),this.bg.parentNode.removeChild(this.bg)},angular.module("motion").run(["$templateCache",function(e){"use strict";e.put("app/core/directives/ms-card/templates/template-1/template-1.html",'<div class="template-1">\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="content pv-24 ph-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="text pt-16" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-10/template-10.html",'<div class="template-10 p-16">\n <div class="pb-16" layout="row" layout-align="space-between center">\n <div class="info">\n <div class="title secondary-text" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h2" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n\n <div class="media ml-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n </div>\n\n <div class="text">\n {{card.text}}\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-2/template-2.html",'<div class="template-2">\n <div class="header p-16" layout="row" layout-align="start center">\n <div ng-if="card.avatar">\n <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n </div>\n\n <div class="info">\n <div class="title" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="text p-16" ng-if="card.text">\n {{card.text}}\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-3/template-3.html",'<div class="template-3 p-16 teal-bg white-fg" layout="row" layout-align="space-between">\n <div layout="column" layout-align="space-between">\n <div class="info">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h3 secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n\n <div class="cta">\n <md-button class="m-0">{{card.cta}}</md-button>\n </div>\n </div>\n\n <div class="media pl-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-4/template-4.html",'<div class="template-4">\n <div class="info white-fg ph-16 pv-24">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="text" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-5/template-5.html",'<div class="template-5 p-16" layout="row" layout-align="space-between start">\n <div class="info">\n <div class="title secondary-text" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="event h2" ng-if="card.event">\n {{card.event}}\n </div>\n </div>\n\n <div class="media ml-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-6/template-6.html",'<div class="template-6">\n <div class="content pv-24 ph-16">\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="title h2" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="text pt-8" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-7/template-7.html",'<div class="template-7" layout="row" layout-align="space-between">\n <div class="info" layout="column" layout-align="space-between" layout-fill flex>\n <div class="p-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h4 secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="text h4 pt-8" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n\n <div>\n <md-divider></md-divider>\n <div class="p-8" layout="row">\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n </div>\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-8/template-8.html",'<div class="template-8">\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="content pv-24 ph-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="buttons pt-16">\n <md-button class="m-0">{{card.button1}}</md-button>\n <md-button class="m-0 md-accent">{{card.button2}}</md-button>\n </div>\n\n <div class="text pt-16" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-9/template-9.html",'<div class="template-9">\n <div class="header p-16" layout="row" layout-align="start center">\n <div ng-if="card.avatar">\n <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n </div>\n\n <div class="info">\n <div class="title" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n </div>\n </div>\n\n <div class="text ph-16 pb-16" ng-if="card.text">\n {{card.text}}\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="buttons m-8">\n <md-button class="md-icon-button mr-16" aria-label="Favorite">\n <md-icon md-font-icon="icon-heart-outline" class="s24"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Share">\n <md-icon md-font-icon="icon-share" class="s24"></md-icon>\n </md-button>\n </div>\n\n</div>'),e.put("app/core/directives/ms-click-to-call/ms-click-to-call.html",'<section ng-if="type !== \'button\'">\n <span ng-if="!showMenu()">{{target}}</span>\n\n <md-menu ng-if="showMenu()">\n <a aria-label="Target" ng-click="$mdOpenMenu($event)">\n <span ng-if="prefix">{{prefix}}-</span>{{target}}\n </a>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="call(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{prefix ? prefix + \'-\' + target : target}})\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="transfer(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} ({{prefix ? prefix + \'-\' + target : target}})\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n</section>\n\n<section ng-if="type === \'button\'">\n <md-button ng-if="!showMenu()" ng-disabled="true" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" aria-label="NEW CALL">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <md-menu ng-if="showMenu()">\n <md-button class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" ng-click="$mdOpenMenu($event)" aria-label="NEW CALL">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="call(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{prefix ? prefix + \'-\' + target : target}})\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="transfer(target)">\n'+" {{'DASHBOARDS.TRANSFER_NUMBER' | translate}} ({{prefix ? prefix + '-' + target : target}})\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n</section>"),e.put("app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html",'<div ng-cloak layout-gt-sm="row" layout="column">\n <div flex-gt-sm="50" flex="45">\n <md-input-container class="md-icon-float md-block margin-0">\n <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n <input ng-model="query" type="text" placeholder="Search...">\n </md-input-container>\n <md-content class="border h-300">\n <md-list class="md-dense" layout-fill layout-align="center center">\n <md-list-item class="md-3-line" ng-repeat="item in options.items | filter: query | orderBy: options.orderBy" ng-click="transfer(options.items, options.selectedItems, options.items.indexOf(item), false)">\n <div class="md-list-item-text" layout="column">\n <h3 ng-if="options.line1">{{getLine(item, options.line1)}}</h3>\n <h4 ng-if="options.line2">{{getLine(item, options.line2)}}</h4>\n <p ng-if="options.line3">{{getLine(item, options.line3)}}</p>\n </div>\n <md-icon md-font-icon="icon-arrow-right-bold" aria-label="swap"></md-icon>\n <md-divider></md-divider>\n </md-list-item>\n </md-list>\n </md-content>\n <div class="margin-10" layout="row">\n <span class="h4" flex>{{options.labelAll || \'All Items\'}} ({{options.items.length}})</span>\n <md-icon ng-show="options.showSelectAndDeselectAll" md-font-icon="icon-chevron-double-right" aria-label="swap" ng-click="transfer(options.items, options.selectedItems, -1, false)"></md-icon>\n </div>\n </div>\n\n <div flex="10" layout="row" layout-align="center center">\n <md-icon md-font-icon="icon-swap-horizontal" aria-label="swap"></md-icon>\n </div>\n\n <div flex-gt-sm="50" flex="45">\n <md-input-container class="md-icon-float md-block margin-0">\n <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n <input ng-model="selectedQuery" type="text" placeholder="Search...">\n </md-input-container>\n <md-content class="border h-300">\n <md-list class="md-dense" layout-fill layout-align="center center">\n <md-list-item class="md-3-line" ng-repeat="item in options.selectedItems | filter: selectedQuery | orderBy: options.orderBy" ng-click="transfer(options.selectedItems, options.items, options.selectedItems.indexOf(item), true)">\n <md-icon md-font-icon="icon-arrow-left-bold" aria-label="swap"></md-icon>\n <div class="md-list-item-text" layout="column">\n <h3 ng-if="options.line1">{{getLine(item, options.line1)}}</h3>\n <h4 ng-if="options.line2">{{getLine(item, options.line2)}}</h4>\n <p ng-if="options.line3">{{getLine(item, options.line3)}}</p>\n </div>\n <md-divider></md-divider>\n </md-list-item>\n </md-list>\n </md-content>\n <div class="margin-10" layout="row">\n <md-icon ng-show="options.showSelectAndDeselectAll" md-font-icon="icon-chevron-double-left" aria-label="swap" flex ng-click="transfer(options.selectedItems, options.items, -1, true)"></md-icon>\n <span class="h4">{{options.labelSelected || \'Selected Items\'}} ({{options.selectedItems.length}})</span>\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-font-family/ms-font-family.html",'<md-select ng-model="ngModel" class="no-margin">\n <md-option ng-repeat="font in fonts" ng-value="font.value" <span ng-style="{\'font-family\': font.value}">{{font.option}}</span>\n </md-option>\n</md-select>'),e.put("app/core/directives/ms-info-bar/ms-info-bar.html",'<div id="ms-info-bar" layout="row" layout-align="start center" flex>\n <div id="ms-info-bar-message" ng-transclude flex></div>\n <md-button id="ms-info-bar-close" class="md-icon-button" aria-label="Close" ng-click="removeInfoBar()">\n <md-icon md-font-icon="icon-close s20"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-material-color-picker/ms-material-color-picker.html",'<md-menu md-position-mode="target-right target">\n\n <div ng-click="$mdOpenMenu($event)">\n <ms-color-picker-button>\n <md-button aria-label="Row Color" md-menu-origin ng-click="$mdOpenMenu($event)" ng-class="vm.selectedColor.class">\n\n <span ng-show="vm.selectedColor.palette">\n {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n </span>\n <span ng-show="!vm.selectedColor.palette">\n Select Color\n </span>\n </md-button>\n </ms-color-picker-button>\n </div>\n\n <md-menu-content class="ms-material-color-picker-menu-content" layout-column>\n\n <header ng-class="vm.selectedColor.class || \'md-accent-bg\'" class="md-whiteframe-4dp" layout="row" layout-align="space-between center">\n <md-button md-prevent-menu-close ng-click="vm.activateHueSelection(false,false)" class="md-icon-button" ng-class="{\'hidden\':!vm.selectedPalette}" aria-label="Palette">\n <md-icon md-font-icon="icon-arrow-left" class="s20"></md-icon>\n </md-button>\n\n <span ng-if="vm.selectedColor.palette">\n {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n </span>\n\n <span ng-if="!vm.selectedColor.palette">\n Select Color\n </span>\n\n <md-button class="remove-color-button md-icon-button" ng-click="vm.removeColor()" aria-label="Remove Color">\n <md-icon md-font-icon="icon-delete" class="s20"></md-icon>\n </md-button>\n </header>\n\n <div class="colors" ms-scroll>\n <div ng-show="!vm.selectedPalette" layout="row" layout-wrap>\n <div class="color" ng-class="\'md-\'+palette+\'-500-bg\'" ng-repeat="(palette, hues) in vm.palettes" ng-click="vm.activateHueSelection(palette,hues)" layout="row" layout-align="start end" md-prevent-menu-close md-ink-ripple>\n <span class="label">\n {{palette}}\n </span>\n </div>\n </div>\n\n <div ng-show="vm.selectedPalette" layout="row" layout-wrap>\n <div class="color" ng-class="\'md-\'+vm.selectedPalette+\'-\'+hue+\'-bg\'" ng-repeat="(hue, values) in vm.selectedHues" ng-click="vm.selectColor(vm.selectedPalette,hue)" layout="row" layout-align="start end" md-ink-ripple>\n <span class="label">\n {{hue}}\n </span>\n <i ng-if="vm.selectedPalette == vm.selectedColor.palette && hue == vm.selectedColor.hue" class="s16 icon-check">\n </i>\n </div>\n </div>\n\n </div>\n\n </md-menu-content>\n</md-menu>'),e.put("app/core/directives/ms-navigation/templates/horizontal.html",'<div class="navigation-toggle" hide-gt-sm>\n <md-button class="md-icon-button" ng-click="vm.toggleHorizontalMobileMenu()" aria-label="Toggle Mobile Navigation">\n <md-icon md-font-icon="icon-menu"></md-icon>\n </md-button>\n</div>\n\n<ul class="horizontal">\n <li ng-repeat="node in vm.navigation" ms-navigation-horizontal-node="node" ng-class="{\'has-children\': vm.hasChildren}" ng-include="\'navigation-horizontal-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested horizontal navigation template --\x3e\n<script type="text/ng-template" id="navigation-horizontal-nested.html">\n\n <div ms-navigation-horizontal-item layout="row" ng-if="!vm.isHidden()">\n\n <div class="ms-navigation-horizontal-button" ng-if="!node.uisref && node.title" ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}">\n <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n </div>\n\n <a class="ms-navigation-horizontal-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg" ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}" ng-if="node.uisref && node.title">\n <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n </a>\n\n </div>\n\n <ul ng-if="vm.hasChildren && !vm.isHidden()">\n <li ng-repeat="node in node.children" ms-navigation-horizontal-node="node" ng-class="{\'has-children\': vm.hasChildren}" ng-include="\'navigation-horizontal-nested.html\'"></li>\n </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("app/core/directives/ms-navigation/templates/vertical.html",'<ul>\n <li ng-repeat="node in vm.navigation" ms-navigation-node="node" ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}" ng-include="\'navigation-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested navigation template --\x3e\n<script type="text/ng-template" id="navigation-nested.html">\n\n <div ms-navigation-item layout="row" ng-if="!vm.isHidden()">\n\n <div class="ms-navigation-button" ng-if="!node.uisref && node.title">\n <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n </div>\n\n <a class="ms-navigation-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg" ng-if="node.uisref && node.title">\n <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n </a>\n\n </div>\n\n <ul ng-if="vm.hasChildren && !vm.isHidden()">\n <li ng-repeat="node in node.children" ms-navigation-node="node" ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}" ng-include="\'navigation-nested.html\'"></li>\n </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-dialpad.html",'\x3c!-- Dialpad --\x3e\n<md-content ng-if="vm_pb.showDialpad" class="num-pad" layout="column">\n <section layout="row" layout-align="start center">\n <span><img class="num-pad-logo" layout-padding src="/api/settings/1/logo" alt="logo" /></span>\n <span class="md-subhead">Dialpad</span>\n <div layout="row" layout-align="end center" flex>\n <md-button class="md-icon-button" ng-click="vm_pb.closeDialpad()">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </section>\n <md-divider></md-divider>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 1, l: []}, {n: 2, l: [\'a\', \'b\', \'c\']}, {n: 3, l: [\'d\', \'e\', \'f\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 4, l: [\'g\', \'h\', \'i\']}, {n: 5, l: [\'j\', \'k\', \'l\']}, {n: 6, l: [\'m\', \'n\', \'o\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 7, l: [\'p\', \'q\', \'r\', \'s\']}, {n: 8, l: [\'t\', \'u\', \'v\']}, {n: 9, l: [\'w\', \'x\', \'y\', \'z\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: \'*\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num" layout="column" layout-align="center center">\n <div class="txt" layout="column" layout-align="center center">\n {{item.n}}\n </div>\n </div>\n </div>\n <div class="span4" ng-repeat="item in ::[{n: 0, l: [\'+\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n <div class="span4" ng-repeat="item in ::[{n: \'#\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num" layout="column" layout-align="center center">\n <div class="txt" layout="column" layout-align="center center">\n {{item.n}}\n </div>\n </div>\n </div>\n </section>\n</md-content>\n\x3c!-- Dialpad --\x3e\n\n\x3c!-- Input Area --\x3e\n<div layout="row" layout-align="start center">\n <div layout="row" layout-align="center center">\n \x3c!-- START Ringing Tone--\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Ringing" ng-click="vm_pb.toggleVolume(\'ringing\')" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.ringingMute ? \'icon-bell-off\' : \'icon-bell-ring\'}}" class="icon s14" ng-class="vm_pb.conf.ringingMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.RINGING">Ringing</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Ringing Tone --\x3e\n\n \x3c!-- START Speaker --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Speaker" ng-click="vm_pb.toggleVolume(\'speaker\')" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.speakerMute ? \'icon-volume-off\' : \'icon-volume\'}}" class="icon s14" ng-class="vm_pb.conf.speakerMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.SPEAKER">Speaker</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Speaker --\x3e\n\n \x3c!-- START Microphone --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Microphone" ng-click="vm_pb.toggleVolume(\'microphone\')" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.microphoneMute ? \'icon-microphone-off\' : \'icon-microphone\'}}" class="icon s14" ng-class="vm_pb.conf.microphoneMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.MICROPHONE">Microphone</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Microphone --\x3e\n\n \x3c!-- START Registered --\x3e\n <span>\n <span class="quantity-indicator md-red-500-bg" ng-class="vm_pb.registered ? \'md-green-500-bg\' : \'md-red-500-bg\'"></span>\n <md-tooltip><span>{{vm_pb.conf.license ? (vm_pb.registered ? \'TOOLBAR.REGISTERED\' : \'TOOLBAR.NOT_REGISTERED\') : \'TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD\' | translate}} <timer ng-if="vm_pb.registered" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span></span>\n </md-tooltip>\n </span>\n \x3c!-- END Registered --\x3e\n </div>\n <div layout="column" layout-align="center start">\n <div layout="row" layout-align="start center">\n \x3c!-- START Target --\x3e\n <angucomplete-alt id="ms-target-wrap" pause="10" local-data="vm_pb.calls" search-fields="target" title-field="target" minlength="0" input-class="input-number" disable-input="!vm_pb.registered" match-class="highlight" template-url="assets/ms-phonebar/ms-phonebar-input.html"\n input-changed="vm_pb.targetChanged" selected-object="vm_pb.targetSelected" clear-selected="true" ng-keypress="vm_pb.typeWrapper($event)" focus-first="true" />\n \x3c!-- END Target --\x3e\n\n \x3c!-- Auto Answer --\x3e\n <div ng-if="vm_pb.conf.autoAnswer" class="red-fg" style="padding-left: 10px;">\n <span class="font-size-20">A<span class="font-size-16">A</span></span>\n </div>\n \x3c!-- Auto Answer --\x3e\n\n <md-button class="md-fab md-mini white-bg width-30 height-30" aria-label="Dialpad" ng-click="vm_pb.toggleDialpad()" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="icon-apps" class="icon grey-fg s16"></md-icon>\n </md-button>\n <md-button ng-if="vm_pb.target" class="md-fab md-mini white-bg width-25 height-25" aria-label="Call" style="margin-left: 0px;" ng-click="vm_pb.call()">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n </md-button>\n </div>\n </div>\n</div>\n\x3c!-- Input Area --\x3e\n\n<div class="toolbar-separator"></div>\n\n\x3c!-- Sessions Area --\x3e\n<div class="sessions" layout="row" layout-align="start center" flex>\n <div layout="row" layout-align="center center" ng-if="!vm_pb.conf.license">\n <md-icon md-font-icon="icon-account-alert" class="icon s36 red-fg"></md-icon>\n <span layout-margin translate="TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"></span>\n </div>\n\n <div ng-repeat="session in vm_pb.sessions" class="session" layout="row" ng-click="(vm_pb.sessions.length > 1) && vm_pb.selectSession(session)">\n <md-button ng-if="vm_pb.conf.recording && session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Record" ng-click="vm_pb.record(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-radiobox-marked" class="icon s14" ng-class="session.monitor ? \'red-fg\' : \'grey-fg\'"></md-icon>\n </md-button>\n <div layout="column" layout-align="center start">\n <span class="session-info">{{ (session.user == session.name) ? session.user : (session.name + \' \' + session.user) }}</span>\n <span class="session-info" layout="row" layout="start center"><timer interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span>\n </div>\n\n \x3c!-- START Answer --\x3e\n <md-button ng-if="session.incoming && !session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Hold" ng-click="vm_pb.answer(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Answer --\x3e\n\n \x3c!-- START Hangup --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Terminate" ng-click="vm_pb.terminate(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-hangup" class="icon red-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Hangup --\x3e\n\n \x3c!-- START Hold/Unhold --\x3e\n <md-button ng-if="session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Hold" ng-click="(session.localHold ? vm_pb.unhold(session) : vm_pb.hold(session)); $event.stopPropagation();">\n <md-icon md-font-icon="{{session.localHold ? \'icon-play\' : \'icon-pause\'}}" class="icon grey-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Hold/Unhold --\x3e\n\n \x3c!-- START Transfer --\x3e\n <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length == 1" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer" ng-click="vm_pb.refer(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n </md-button>\n \x3c!-- END transfer --\x3e\n\n \x3c!-- START Attended Transfer --\x3e\n <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length > 1" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer Attended" ng-click="vm_pb.referAttended(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Attended Transfer --\x3e\n </div>\n</div>\n\x3c!-- Sessions Area --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-input.html",'<div class="angucomplete-holder" ng-class="{\'angucomplete-dropdown-visible\': showDropdown}">\n <input id="ms-target" ng-model="searchStr" ng-disabled="disableInput" type="text" placeholder="{{placeholder}}" ng-focus="onFocusHandler()" class="{{inputClass}}" ng-focus="resetHideResults()" ng-blur="hideResults($event)" autocapitalize="off" autocorrect="off"\n autocomplete="off" ng-change="inputChangeHandler(searchStr)" />\n <div class="angucomplete-dropdown" ng-show="showDropdown && !(!searching && (!results || results.length == 0))">\n <div class="angucomplete-row" ng-repeat="result in results" ng-click="selectResult(result)" ng-mouseenter="hoverRow($index)" ng-class="{\'angucomplete-selected-row\': $index == currentIndex}">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="{{result.originalObject.inbound ? \'icon-arrow-bottom-left\' : \'icon-arrow-top-right\'}}" class="icon no-margin s22"></md-icon>\n <span style="margin-left: 8px;">({{result.originalObject.time}}) - <span class="angucomplete-title" ng-if="matchClass" ng-bind-html="result.title"></span></span>\n </div>\n </div>\n </div>\n</div>'),e.put("assets/ms-phonebar/ms-phonebar.html",'<div layout="row" layout-align="start center" flex>\n \x3c!-- Audio stream --\x3e\n <audio id="remote-audio" autoplay hidden=true></audio>\n \x3c!-- Audio stream --\x3e\n\n \x3c!-- WebRtc PhoneBar --\x3e\n <div class="phonebar-container" ng-include="\'assets/ms-phonebar/ms-phonebar-dialpad.html\'" layout="row" layout-align="start center" flex></div>\n \x3c!-- WebRtc PhoneBar --\x3e\n</div>'),e.put("assets/ms-phonebar/record/dialog.html",'<md-dialog aria-label="Recording" ng-init="vm.onInit()">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.RECORDING">Recording</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding">\n <md-icon class="no-margin" md-font-icon="icon-plus" aria-label="Add" ng-click="vm.addRecording()"></md-icon>\n </md-button>\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-table-container>\n <table md-table layout-padding>\n <thead md-head>\n <tr md-row>\n <th md-column><span translate="TOOLBAR.FILENAME">File name</span></th>\n <th md-column><span translate="TOOLBAR.STATUS">Status</span></th>\n <th md-column><span translate="TOOLBAR.ACTIONS">Actions</span></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.session.monitors.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLBAR.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="monitor in vm.session.monitors">\n <td md-cell>{{monitor.filename}}</td>\n <td md-cell class="no-padding">\n <md-icon md-font-icon="icon-radiobox-marked" class="icon s16" ng-class="(monitor.status == \'rec\') ? \'red-fg ms-blink\' : \'grey-fg\'"></md-icon>\n </td>\n <td md-cell class="no-padding">\n <md-button class="md-fab md-mini white-bg width-35 height-35 margin-5" aria-label="Record" ng-click="(monitor.status == \'rec\') ? vm.stop(monitor) : vm.start(monitor)">\n'+" <md-icon md-font-icon=\"{{monitor.status == 'rec' ? 'icon-stop' : 'icon-play'}}\" class=\"icon s16\" ng-class=\"monitor.status == 'rec' ? 'grey-fg' : 'red-fg'\"></md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n </form>\n</md-dialog>"),e.put("assets/ms-phonebar/referAttended/dialog.html",'<md-dialog aria-label="Transfer">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.ATTENDED_TRANSFER">Transfer</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <label translate="TOOLBAR.TARGET">Target</label>\n <md-input-container class="md-block">\n <md-select ng-model="vm.target">\n <md-option ng-repeat="session in vm.sessions" ng-value="session.user">\n {{ session.name }}\n </md-option>\n </md-select>\n </md-input-container>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button ng-click="vm.transfer()" class="send-button md-accent md-raised" aria-label="transfer" ng-disabled="!vm.target && !vm.sessionId">\n <span translate="TOOLBAR.TRANSFER">TRANSFER</span>\n </md-button>\n <md-button ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="cancel">\n <span translate="TOOLBAR.CANCEL">Cancel</span>\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("assets/ms-phonebar/settings/settings.html",'<md-dialog class="md-phonebar-dialog" aria-label="{{vm.name}}">\n <form name="settingsForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="TOOLBAR.SETTINGS">Settings</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content class="no-padding" ms-scroll>\n <md-tabs md-no-pagination md-stretch-tabs="always">\n <md-tab label="{{ \'TOOLBAR.PROFILE\' | translate}}">\n <md-content layout-padding layout="column">\n <span><span translate="TOOLBAR.FULLNAME">Fullname</span>: {{vm.conf.fullname}}</span>\n <span><span translate="TOOLBAR.NAME">Name</span>: {{vm.conf.name}}</span>\n <span><span translate="TOOLBAR.INTERNAL">Internal</span>: {{vm.conf.internal}}</span>\n <span><span translate="TOOLBAR.BROWSER">Browser</span>: {{vm.conf.browserName}} {{vm.conf.browserVersion}}</span>\n <span><span translate="TOOLBAR.OS">OS</span>: {{vm.conf.osName}} {{vm.conf.osVersion}}</span>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.SERVICES\' | translate}}">\n <md-content layout-padding>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.conf.autoAnswer" aria-label="Auto Answer">\n <span translate="TOOLBAR.AUTOANSWER">Auto Answer</span>\n <span>{{ vm.conf.autoAnswerDelay }} [s]</span>\n </md-switch>\n </md-input-container>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.AUDIO\' | translate}}">\n <md-content layout-padding>\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\', deviceId: \'!default\' }).length">\n <label translate="TOOLBAR.RINGINGDEVICE">Ringing Device</label>\n <md-select name="ringingDevice" ng-model="vm.conf.ringingId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\', deviceId: \'!default\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'ringingDevice\'].$error" ng-show="settingsForm[\'ringingDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.conf.ringingMute" aria-label="Mute">\n Mute\n </md-switch>\n\n <md-slider-container flex="80">\n <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.ringingVolume" aria-label="volume"></md-slider>\n </md-slider-container>\n </div>\n </div>\n\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\', deviceId: \'!default\' }).length">\n <label translate="TOOLBAR.SPEAKERDEVICE">Speaker Device</label>\n <md-select name="speakerDevice" ng-model="vm.conf.speakerId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\', deviceId: \'!default\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'speakerDevice\'].$error" ng-show="settingsForm[\'speakerDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between cetner">\n <md-switch ng-model="vm.conf.speakerMute" aria-label="Mute">\n Mute\n </md-switch>\n\n <md-slider-container flex="80">\n <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.speakerVolume" aria-label="volume"></md-slider>\n </md-slider-container>\n </div>\n </div>\n\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audioinput\', deviceId: \'!default\' }).length">\n <label translate="TOOLBAR.MICROPHONEDEVICE">Microphone Device</label>\n <md-select name="microphoneDevice" ng-model="vm.conf.microphoneId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audioinput\', deviceId: \'!default\' }">{{ device.label || (\'Microphone \' + ($index + 1))}}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'microphoneDevice\'].$error" ng-show="settingsForm[\'microphoneDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.conf.microphoneMute" aria-label="Mute">\n Mute\n </md-switch>\n </div>\n </div>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.REQUIREMENTS\' | translate}}">\n <md-content layout-padding>\n <md-list>\n <md-list-item>\n <h3 translate="TOOLBAR.LICENSE">License</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.license ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.license ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.BROWSER_COMPATIBILITY">Browser Compatibility</h3>\n <md-icon class="md-secondary" ng-class="vm.isCompatibleBrowser() ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.isCompatibleBrowser() ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.HTTPS">HTTPS</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.protocol === \'https\' ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.protocol === \'https\' ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.WEBRTCSUPPORT">WebRTC Support</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.isWebRTCSupported ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.isWebRTCSupported ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.MICROPHONE">Microphone</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.hasMicrophone ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasMicrophone ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.SPEAKER">Speaker</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.hasSpeakers ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasSpeakers ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n </md-list>\n </md-content>\n </md-tab>\n </md-tabs>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSettings()" class="send-button md-accent md-raised" ng-disabled="settingsForm.$invalid || settingsForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/core/directives/ms-search-bar/ms-search-bar.html",'<div flex layout="row" layout-align="start center">\n <label for="ms-search-bar-input">\n <md-button class="ms-search-bar-expander md-icon-button" aria-label="Expand Search Bar"\n ng-click="MsSearchBar.expand()"\n ng-if="!MsSearchBar.resultsLoading || MsSearchBar.collapsed">\n <md-icon md-font-icon="icon-magnify" class="icon s24"></md-icon>\n </md-button>\n <div class="ms-search-bar-loader" layout="row" layout-align="center center"\n ng-if="MsSearchBar.resultsLoading && !MsSearchBar.collapsed">\n <md-progress-circular class="md-accent" md-diameter="32" md-mode="indeterminate"></md-progress-circular>\n </div>\n </label>\n <input id="ms-search-bar-input" type="text" placeholder="Search" flex ng-model="MsSearchBar.query" ng-model-options="MsSearchBar.queryOptions" ng-blur="MsSearchBar.blurCollapse()" ng-keydown="MsSearchBar.handleKeydown($event)">\n <md-button class="ms-search-bar-collapser md-icon-button" ng-click="MsSearchBar.collapse()" aria-label="Collapse Search Bar">\n <md-icon md-font-icon="icon-close" class="icon s24"></md-icon>\n </md-button>\n\n <div class="ms-search-bar-results" ng-if="MsSearchBar.results" ms-scroll>\n <div class="no-results" ng-if="MsSearchBar.results.length === 0">No Results!</div>\n\n <div class="result" ng-repeat="result in MsSearchBar.results" ng-click="MsSearchBar.handleResultClick(result)" ng-mouseenter="MsSearchBar.handleMouseenter($index)" ng-mousedown="MsSearchBar.absorbEvent($event)" ng-class="{\'selected\': $index == MsSearchBar.selectedResultIndex}"\n md-ink-ripple>\n <div layout="row" layout-align="start center">\n <div class="icon-container" layout="row" layout-align="center center">\n <i ng-if="result.icon" class="icon {{result.icon}}"></i>\n <div ng-if="!result.icon" class="square md-accent-bg"></div>\n </div>\n <div>\n <div class="title">{{result.title}}</div>\n <div class="description" ng-if="result.description">{{result.description}}</div>\n </div>\n </div>\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-shortcuts/ms-shortcuts.html",'<div class="shortcuts-container" layout="row" layout-align="space-between center" flex ng-class="{\'mobile-bar-active\': MsShortcuts.mobileBarActive}">\n\n <div class="flex-noshrink" layout="row" layout-align="start center" flex>\n <div class="shortcuts hide show-gt-xs" layout="row" layout-align="start center" ms-scroll ng-if="MsShortcuts.shortcuts.length > 0" ng-sortable="MsShortcuts.sortableOptions">\n <div ng-repeat="shortcut in MsShortcuts.shortcuts" layout="row" layout-align="center center">\n <md-button class="md-icon-button shortcut" aria-label="{{shortcut.title}}" ui-sref="{{shortcut.uisref}}">\n <md-icon ng-if="shortcut.icon" md-font-icon="{{shortcut.icon}}" class="icon s24"></md-icon>\n <div ng-if="!shortcut.icon" class="first-letter">{{shortcut.title.charAt(0)}}</div>\n <md-tooltip md-direction="bottom">{{shortcut.title}}</md-tooltip>\n </md-button>\n </div>\n </div>\n\n \x3c!-- <md-menu md-offset="8 56" class="shortcut-menu hide show-gt-xs">\n <md-button class="md-icon-button add-shortcut-button" aria-label="Add shortcut"\n ng-click="$mdOpenMenu($event)">\n <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24"></md-icon>\n <md-tooltip md-direction="bottom">Click to add/remove shortcut</md-tooltip>\n </md-button>\n\n <md-menu-content>\n <div id="ms-shortcut-add-menu">\n <div class="shortcut-search" layout="row" layout-align="start center">\n <div class="search-icon" layout="row" layout-align="center center"\n ng-if="!MsShortcuts.resultsLoading">\n <md-icon md-menu-align-target md-font-icon="icon-magnify" class="icon s24"></md-icon>\n </div>\n <div class="shortcut-loader" layout="row" layout-align="center center"\n ng-if="MsShortcuts.resultsLoading">\n <md-progress-circular class="md-accent" md-diameter="20" md-mode="indeterminate">\n </md-progress-circular>\n </div>\n\n <input type="text" placeholder="Search" flex\n ng-model="MsShortcuts.query"\n ng-model-options="MsShortcuts.queryOptions"\n ng-keydown="MsShortcuts.handleKeydown($event)">\n </div>\n\n <div class="results" ng-if="MsShortcuts.results" ms-scroll>\n <div class="no-results" ng-if="MsShortcuts.results.length === 0">No Results!</div>\n\n <div class="result" ng-repeat="result in MsShortcuts.results"\n ng-click="MsShortcuts.handleResultClick(result)"\n ng-mouseenter="MsShortcuts.handleMouseenter($index)"\n ng-mousedown="MsShortcuts.absorbEvent($event)"\n ng-class="{\'selected\': $index == MsShortcuts.selectedResultIndex}"\n md-prevent-menu-close="md-prevent-menu-close"\n md-ink-ripple>\n <div layout="row" layout-align="start space-between">\n <div layout="row" layout-align="start center" flex>\n <div class="icon icon-container" layout="row" layout-align="center center">\n <i ng-if="result.icon" class="{{result.icon}}"></i>\n <div ng-if="!result.icon" class="square md-accent-bg"></div>\n </div>\n <div>\n <div class="title">{{result.title}}</div>\n </div>\n </div>\n <md-icon md-font-icon="icon-pin" class="icon s18"\n ng-class="{\'fade-text\': !result.hasShortcut}"></md-icon>\n </div>\n </div>\n </div>\n </div>\n </md-menu-content>\n </md-menu> --\x3e\n </div>\n\n <md-button class="md-icon-button toggle-mobile-menu hide-gt-xs" aria-label="Add shortcut" ng-click="MsShortcuts.toggleMobileBar()">\n <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24" ng-hide="MsShortcuts.mobileBarActive"></md-icon>\n <md-icon md-menu-origin md-font-icon="icon-close" class="icon s24" ng-hide="!MsShortcuts.mobileBarActive"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/horizontal/horizontal.html",'<div class="ms-stepper-horizontal">\n <div class="ms-stepper-navigation-wrapper">\n <div class="ms-stepper-navigation" layout="row" layout-align="center center">\n <md-button class="ms-stepper-navigation-item" ng-class="{\'current\': MsStepper.isStepCurrent(step.stepNumber), \'valid\': MsStepper.isStepValid(step.stepNumber), \'disabled\': MsStepper.isStepDisabled(step.stepNumber), \'optional\': MsStepper.isStepOptional(step.stepNumber)}"\n ng-click="MsStepper.gotoStep(step.stepNumber)" ng-disabled="MsStepper.isStepDisabled(step.stepNumber)" ng-repeat="step in MsStepper.steps | filter:MsStepper.filterHiddenStep" layout="row" layout-align="start center">\n\n <div class="step md-accent-bg" layout="row" layout-align="center center">\n <span ng-if="!MsStepper.isStepValid(step.stepNumber) || MsStepper.isStepOptional(step.stepNumber)">\n {{$index + 1}}\n </span>\n <span ng-if="MsStepper.isStepValid(step.stepNumber) && !MsStepper.isStepOptional(step.stepNumber)">\n <i class="icon icon-check s18"></i>\n </span>\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="title" translate="{{step.stepTitleTranslate}}">{{step.stepTitle}}</div>\n <div class="subtitle" ng-if="MsStepper.isStepOptional(step.stepNumber)">Optional</div>\n </div>\n </md-button>\n </div>\n </div>\n\n <div class="ms-stepper-steps" ng-transclude></div>\n\n <div class="ms-stepper-controls" layout="row" layout-align="center center">\n <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n Back\n </md-button>\n\n <div class="ms-stepper-dots">\n <span ng-repeat="step in MsStepper.steps" ng-hide="MsStepper.isStepHidden(step.stepNumber)" ng-class="{\'selected md-accent-bg\':MsStepper.currentStepNumber === $index + 1}">\n </span>\n </div>\n\n <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n Next\n </md-button>\n\n <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n Submit\n </md-button>\n </div>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html","<md-button class=\"ms-stepper-navigation-item\" ng-class=\"{'current': MsStepper.isStepCurrent(stepInfo.stepNumber), 'valid': MsStepper.isStepValid(stepInfo.stepNumber), 'disabled': MsStepper.isStepDisabled(stepInfo.stepNumber), 'optional': MsStepper.isStepOptional(stepInfo.stepNumber)}\"\n"+' ng-click="MsStepper.gotoStep(stepInfo.stepNumber)" ng-disabled="MsStepper.isStepDisabled(stepInfo.stepNumber)" ng-hide="MsStepper.isStepHidden(stepInfo.stepNumber)" aria-label="Stepper navigation button" layout="row" layout-align="start center">\n\n <div class="step" layout="row" layout-align="center center">\n <span ng-if="!MsStepper.isStepValid(stepInfo.stepNumber) || MsStepper.isStepOptional(stepInfo.stepNumber)">\n <i class="icon icon-checkbox-blank-circle-outline s18 md-accent-fg"></i>\n </span>\n <span ng-if="MsStepper.isStepValid(stepInfo.stepNumber) && !MsStepper.isStepOptional(stepInfo.stepNumber)">\n <i class="icon icon-check-circle s18 md-accent-fg"></i>\n </span>\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="title" ng-if="stepInfo.stepTitleTranslate">{{stepInfo.stepTitleTranslate | translate }}</div>\n <div class="title" ng-if="!stepInfo.stepTitleTranslate">{{stepInfo.stepTitle}}</div>\n <div class="subtitle" ng-if="MsStepper.isStepOptional(stepInfo.stepNumber)">Optional</div>\n </div>\n</md-button>\n\n<div class="ms-stepper-step-content" ng-transclude></div>\n\n<div class="ms-stepper-controls" layout="row" layout-align="start center" ng-show="MsStepper.isStepCurrent(stepInfo.stepNumber)">\n <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n Back\n </md-button>\n\n <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n Next\n </md-button>\n\n <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n Submit\n </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/vertical.html",'<div class="ms-stepper-vertical">\n <div class="ms-stepper-vertical-line"></div>\n <div class="ms-stepper-steps" ng-transclude></div>\n</div>'),e.put("app/core/directives/ms-timezone/ms-timezone.html",'<md-select ng-model="ngModel" class="no-margin">\n <md-option ng-value="null">NONE</md-option>\n <md-option ng-repeat="t in timezone | orderBy:\'utcOffset\'" value="{{t.name}}">{{t.name}} ({{t.offsetStr}})</md-option>\n</md-select>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-counter/ms-widget-engine.counter.html",'<div class="pt-8 pb-32" layout="column" layout-align="center center" layout-fill ng-controller="MsWidgetEngineCounterController as vm">\n <div ng-class="\'font-size-\' + (vm.fontSize * 3)" ng-style="{\'color\': widget.foreground}">\n {{ vm.getCount(widget) }}\n </div>\n <div ng-class="\'font-size-\' + vm.fontSize" ng-style="{\'color\': widget.foreground}">{{ \'TOOLS.\' + widget.attrs[0].value | uppercase | translate }}<span ng-if="vm.filtered">*</span></div>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-multibar-chart/ms-widget-engine.multibar-chart.html",'<div ng-controller="MsWidgetEngineMultibarChartController as vm" ng-init="vm.getMultiBarChart(widget)" layout="column" layout-fill>\n\n <span ng-show="false">{{ vm.getMultiBarChart(widget)}}</span>\n\n <canvas style="overflow:scroll" id="bar" class="chart-horizontal-bar" chart-data="vm.multiBarChart.data" chart-options="vm.multiBarChart.options" chart-series="vm.multiBarChart.series" chart-labels="vm.multiBarChart.labels">\n </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-pie-chart/ms-widget-engine.pie-chart.html",'<div ng-controller="MsWidgetEnginePieChartController as vm" ng-init="vm.getPieChart(widget)" layout="column" layout-fill>\n\n <span ng-show="false">{{ vm.getPieChart(widget)}}</span>\n\n <canvas style="overflow:scroll" id="pie" class="chart-pie" chart-data="vm.pieChart.data" chart-labels="vm.pieChart.labels" chart-options="vm.pieChart.options">\n </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-web-report/ms-widget-engine.web-report.html",'<div ng-controller="MsWidgetEngineWebReportController as vm" ng-init="vm.onInit(widget)">\n <dl ng-if="vm.error">\n <dt class="text-bold">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt>Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.title}}</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm.onInit(widget)" aria-label="refresh">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <span ng-if="vm.refresh && vm.countDown" class="md-subhead blue-fg">{{vm.countDown}}</span>\n </div>\n </md-toolbar>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.results.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.results.rows.length">\n <td md-cell colspan="{{vm.columns.length}}">\n <div layout="row" layout-align="center center">\n <span>No Data</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine.html",'<div gridster="vm.config">\n <ul>\n <li gridster-item="widget" ng-repeat="widget in vm.config.widgets">\n <md-card layout-fill>\n <md-toolbar class="height-40" ng-style="{\'background-color\': widget.background, \'color\': widget.foreground }">\n <div class="md-toolbar-tools height-40 no-margin" layout="row" layout-align="start center">\n <a ng-href="{{widget.link ? widget.link : \'javascript:void(0)\'}}" ng-style="{\'color\': widget.foreground}" class="text-truncate" flex>\n {{ widget.title || \'No Title\' }}\n </a>\n <md-button ng-if="!vm.config.preview" class="draggable md-icon-button width-30 no-margin no-padding" aria-label="Move">\n <md-tooltip><span translate="TOOLS.MOVE_WIDGET">Move</span></md-tooltip>\n <md-icon md-font-icon="icon-cursor-move" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n </md-button>\n <md-menu ng-if="!vm.config.preview">\n <md-button ng-click="$mdOpenMenu($event)" class="md-icon-button width-30 no-margin no-padding" aria-label="More">\n <md-icon md-font-icon="icon-dots-vertical" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-click="vm.onEdit({widget: widget})" translate="TOOLS.EDIT_WIDGET">Edit</md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.onDelete({widget: widget})" translate="TOOLS.DELETE_WIDGET">Delete</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n\n </div>\n </md-toolbar>\n <md-card-content class="resizable" layout="column" layout-align="center center" flex ng-style="{\'background-color\': widget.background, \'color\': widget.foreground}">\n <div ng-switch="widget.type" layout-fill>\n <iframe ng-switch-when="iframe|custom" ng-switch-when-separator="|" ng-src="{{vm.getTrustedURL(widget.attrs[0].value)}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n <ds-widget-clock ng-class="\'font-size-\' + (widget.attrs[2].value || 12)" ng-switch-when="clock" digital-format="widget.attrs[0].value" gmt-offset="widget.attrs[1].value" data-show-digital show-gmt-info></ds-widget-clock>\n <div ng-switch-default layout-fill>\n <div ng-include="widget.templateUrl" layout-fill></div>\n </div>\n </div>\n </md-card-content>\n </md-card>\n </li>\n </ul>\n</div>'),e.put("app/core/layouts/content-only.html",'<div id="layout-content-only" class="template-layout" layout="column" flex>\n <md-content id="content" class="animate-slide-up md-hue-2" ui-view="content" flex></md-content>\n</div>'),e.put("app/core/layouts/content-with-toolbar.html",'<div id="layout-content-with-toolbar" class="template-layout" layout="column" flex>\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n <md-content id="content" class="animate-slide-up md-hue-2" ui-view="content" flex></md-content>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n</div>'),e.put("app/core/layouts/horizontal-navigation.html",'<div id="layout-horizontal-navigation" class="template-layout" layout="column" flex>\n\n <div id="toolbar-navigation-container" class="md-whiteframe-1dp" layout="column" layout-align="space-between start">\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n <div id="horizontal-navigation" ui-view="navigation" layout="row" layout-align="start end" flex></div>\n </div>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",'<div id="layout-vertical-navigation-fullwidth-toolbar-2" class="template-layout" layout="column" flex>\n\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n <div id="main-container" layout="row" flex>\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ms-scroll ui-view="navigation"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar.html",'<div id="layout-vertical-navigation-fullwidth-toolbar" class="template-layout" layout="column" flex>\n\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n <div id="main-container" layout="row" flex>\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ms-scroll ui-view="navigation"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation.html",'<div id="header" ui-view="header"></div>\n\n<div id="layout-vertical-navigation" class="template-layout" layout="row" flex>\n\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ms-scroll ui-view="navigation" ng-if="!vm.isAgent()"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n\n</div>\n\n<div id="footer" ui-view="footer"></div>'),e.put("app/core/theme-options/theme-options.html",'<div class="ms-theme-options-button md-primary-bg" ng-click="toggleOptionsSidenav()">\n <md-icon md-font-icon="icon-cog" class="white-text"></md-icon>\n</div>\n\n<md-sidenav md-component-id="motion-theme-options" class="md-sidenav-right">\n\n <div class="ms-theme-options-list" layout="column">\n <div class="theme-option layout-options">\n <div class="option-title">Layout Style:</div>\n <md-radio-group layout="row" layout-align="start start" layout-wrap ng-model="vm.layoutStyle" ng-change="vm.updateLayoutStyle()">\n <md-radio-button ng-repeat="layoutStyle in vm.layoutStyles" ng-value="layoutStyle.value">\n <div layout="column" layout-align="center center">\n <img ng-src="{{layoutStyle.figure}}">\n <span class="text-center font-size-12 mt-8">{{layoutStyle.label}}</span>\n </div>\n </md-radio-button>\n </md-radio-group>\n </div>\n\n <md-divider></md-divider>\n\n <div class="theme-option">\n <div class="option-title">Layout Mode:</div>\n <md-radio-group layout="row" layout-align="start center" ng-model="vm.layoutMode" ng-change="vm.updateLayoutMode()">\n <md-radio-button ng-repeat="layoutMode in vm.layoutModes" ng-value="layoutMode.value">\n {{layoutMode.label}}\n </md-radio-button>\n </md-radio-group>\n </div>\n\n <md-divider></md-divider>\n\n <div class="theme-option color-palettes">\n <div class="option-title">Color Palette:</div>\n <div layout="row" layout-align="start start" layout-wrap>\n <md-button ng-repeat="(themeName, theme) in vm.themes.list" class="md-raised theme-button" layout="row" layout-align="center center" aria-label="{{themeName}}" ng-click="vm.setActiveTheme(themeName)" ng-style="{\'background-color\': theme.primary.color,\'border-color\': theme.accent.color,\'color\': theme.primary.contrast1}"\n ng-class="{active: vm.getActiveTheme().name === themeName}">\n <md-icon ng-style="{\'color\': theme.primary.contrast1}" md-font-icon="icon-palette" class="icon s32"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n</md-sidenav>'),e.put("app/errors/404/error-404.html",'<div id="error-404" layout="column" layout-align="center center">\n <div class="content" layout="column" layout-align="center center">\n <div class="error-code" translate="ERROR404.CODE">404</div>\n\n <div class="message" translate="ERROR404.MESSAGE">Sorry but we couldn’t find the page you are looking for</div>\n <ms-search-bar on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300">Search for anything</ms-search-bar>\n\n \x3c!-- <div class="search md-whiteframe-1dp" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-magnify" class="icon s24"></md-icon>\n <input ng-model="vm.search" type="text" placeholder="Search for anything" translate translate-attr-placeholder="ERROR404.SEARCH" flex>\n </div> --\x3e\n\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR404.GO_BACK">Go back to dashboard</a>\n </div>\n</div>'),e.put("app/errors/500/error-500.html",'<div id="error-500" layout="column" layout-align="center center">\n <div ng-if="!vm.send" class="content" layout="column" layout-align="center center">\n <div class="error-code" translate="ERROR500.CODE">500</div>\n <div class="message" translate="ERROR500.MESSAGE">Well, you broke the internet!</div>\n <div class="sub-message" translate="ERROR500.SUBMESSAGE">Just kidding, looks like we have an internal issue, please try again in couple minutes\n </div>\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n <md-button class="md-raised md-warn" ng-click="vm.sendReport()" translate="ERROR500.REPORT">Report this problem</md-button>\n </div>\n <pre ng-if="!vm.send">\n {{vm.error}}\n </pre>\n <div ng-if="vm.send" class="content" layout="column" layout-align="center center">\n <div class="error-code">#{{vm.code}}</div>\n <div class="message" translate="ERROR500.JIRA_MESSAGE">Your request has been received and will be processed shortly.</div>\n <div class="sub-message" translate="ERROR500.JIRA_SUBMESSAGE">Sorry for the inconvenience. If you have any questions or concerns, please do not hesitate to contact us.</div>\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n </div>\n</div>'),e.put("app/footer/layouts/vertical-navigation/footer.html",'<div layout="row" layout-align="start center">\n <ms-info-bar ng-if="!vm.cookieAlertHide" on-close="vm.cookieAlertOnClose()" class="grey-100-bg">\n <div layout="row" layout-align="start center">\n <span translate="FOOTER.COOKIE_LAW" flex class="text-center grey-600-fg"></span>\n </div>\n </ms-info-bar>\n</div>'),e.put("app/forgot/forgot.html",'<div id="forgot-password" class="flex-scrollable" layout="column" ms-scroll ng-init="vm.onInit()">\n <div id="forgot-password-form-wrapper" layout="column" layout-align="center center">\n <div id="forgot-password-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n <div class="title" translate="FORGOTPASSWORD.TITLE">Recover your password</div>\n\n <form name="forgotPasswordForm" novalidate>\n <md-input-container class="md-block" md-no-float>\n <input type="email" name="email" ng-model="vm.form.email" placeholder="Email address" translate translate-attr-placeholder="FORGOTPASSWORD.EMAIL_ADRESS" ng-pattern="/^.+@.+\\..+$/" required>\n <div ng-messages="forgotPasswordForm.email.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="FORGOTPASSWORD.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FORGOTPASSWORD.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n\n <md-button type="button" ng-click="vm.forgotPassword()" class="md-raised md-accent submit-button" aria-label="RESET MY PASSWORD" ng-disabled="forgotPasswordForm.$invalid || forgotPasswordForm.$pristine" translate="FORGOTPASSWORD.SEND_RESET_LINK" translate-attr-aria-label="FORGOTPASSWORD.SEND_RESET_LINK">\n SEND RESET LINK\n </md-button>\n </form>\n\n <div class="login" layout="row" layout-align="center center">\n <a class="link" ui-sref="app.login" translate="FORGOTPASSWORD.GO_BACK">Go back to login</a>\n </div>\n </div>\n </div>\n</div>'),e.put("app/header/layouts/vertical-navigation/header.html",'\x3c!-- <div layout="row" layout-align="start center">\n <ms-info-bar ng-if="vm.currentUser.role == \'admin\' && !vm.newsAlertHide" on-close="vm.newsAlertOnClose()" class="green-600-bg white-fg">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-message-text-outline" class="icon margin-right-10 s20"></md-icon>\n <div flex hide-xs translate="HEADER.NEWS"></div>\n </div>\n </ms-info-bar>\n</div> --\x3e'),e.put("app/login/login.html",'<div id="login" class="flex-scrollable" layout="column" ms-scroll>\n <div id="login-form-wrapper" layout="column" layout-align="center center">\n <div id="login-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n \x3c!-- <img src="assets/images/logos/login.png" alt="motion_logo_login" /> --\x3e\n\n <div class="md-subhead padding-top-45" translate="LOGIN.TITLE">Log in to your account</div>\n\n <form name="loginForm" novalidate ng-if="!vm.progressLogin">\n <md-input-container class="md-block" md-no-float>\n <input type="input" name="name" ng-model="vm.form.name" autofocus aria-label="username" translate translate-attr-placeholder="LOGIN.USERNAME" required>\n <div ng-messages="loginForm.name.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="LOGIN.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="password" ng-model="vm.form.password" aria-label="password" translate translate-attr-placeholder="LOGIN.PASSWORD" required>\n <div ng-messages="loginForm.password.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="LOGIN.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="remember-forgot-password" layout="row" layout-xs="column" layout-align="end center">\n \x3c!-- <md-checkbox class="remember-me" ng-model="data.cb1" aria-label="Remember Me">\n <span translate="LOGIN.REMEMBER_ME">Remember Me</span>\n </md-checkbox> --\x3e\n <a ui-sref="app.forgot" class="forgot-password md-accent-color" style="cursor:pointer;" translate="LOGIN.FORGOT_PASSWORD">Forgot Password?</a>\n </div>\n\n <b layout="row" layout-align="center center" class="md-padding" ng-if="vm.message"><font color="red">{{vm.message}}</font></b>\n <md-button type="submit" ng-click="vm.login()" class="md-raised md-accent submit-button" aria-label="LOGIN" translate="LOGIN.LOG_IN" translate-attr-aria-label="LOGIN.LOG_IN">\n LOG IN\n </md-button>\n </form>\n\n <md-progress-circular ng-if="vm.progressLogin" md-diameter="96"></md-progress-circular>\n\n <div class="separator">\n <span class="text" translate="LOGIN.OR">OR</span>\n </div>\n\n <md-button ng-click="vm.loginOauth(\'google\')" class="md-raised google">\n <div layout="row" layout-align="center center">\n <span>\n <md-icon md-font-icon="icon-google-plus" class="s16"></md-icon>\n <span translate="LOGIN.WITH_GOOGLE">Log in with Google</span>\n </span>\n </div>\n </md-button>\n </div>\n </div>\n</div>'),e.put("app/main/apps/analytics/views/extractedReports/create/dialog.html",'<md-dialog class="extractedReport-dialog" aria-label="New ExtractedReport">\n <form name="extractedReportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.REPORTNAME">ReportName</label>\n <input type="" name="name" ng-model="vm.extractedReport.name" ng-required="true" autofocus>\n <div ng-messages="extractedReportForm[\'name\'].$error" ng-show="extractedReportForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.REPORTNAME_REQUIRED">ReportName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="" name="basename" ng-model="vm.extractedReport.basename" ng-required="true">\n <div ng-messages="extractedReportForm[\'basename\'].$error" ng-show="extractedReportForm[\'basename\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newExtractedReport" ng-click="vm.saveExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid || extractedReportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE"\n translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newExtractedReport" ng-click="vm.addNewExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_EXTRACTEDREPORT" translate-attr-aria-label="ANALYTICS.ADD_EXTRACTEDREPORT">\n ADD EXTRACTEDREPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newExtractedReport" ng-click="vm.deleteExtractedReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/extractedReports/extractedReports.html",'<div id="extractedReports" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.EXTRACTEDREPORTS">ExtractedReports</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedExtractedReports.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedExtractedReports =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-extractedReports-count">\n <span>{{vm.selectedExtractedReports.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="EXTRACTEDREPORTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllExtractedReports()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectExtractedReports()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedExtractedReports" csv-label="true" filename="extractedReports.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedExtractedReports($event)" aria-label="delete selected" translate translate-attr-label="EXTRACTEDREPORTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- EXTRACTEDREPORT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedExtractedReports" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getExtractedReports">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.REPORTNAME\' | translate }}</th>\n <th md-column md-order-by="basename">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'ANALYTICS.TYPE\' | translate }}</th>\n <th md-column md-order-by="startDate">{{ \'ANALYTICS.DATE_RANGE_FROM\' | translate }}</th>\n <th md-column md-order-by="endDate">{{ \'ANALYTICS.DATE_RANGE_TO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'ANALYTICS.GENERATED_AT\' | translate }}</th>\n <th md-column md-order-by="status">{{ \'ANALYTICS.STATUS\' | translate }}</th>\n <th md-column md-order-by="output">{{ \'ANALYTICS.OUTPUT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.extractedReports.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="extractedReport" md-select-id="id" ng-repeat="extractedReport in vm.extractedReports.rows">\n <td md-cell ng-if="extractedReport.userpic"><img class="avatar" alt="{{extractedReport.name}}" ng-src="api/users/{{extractedReport.id}}/avatar" /></td>\n <td md-cell ng-if="!extractedReport.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{extractedReport.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="id ">{{extractedReport.id}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="name ">{{extractedReport.name}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="basename ">{{extractedReport.basename}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="type ">{{extractedReport.type}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="startDate ">{{extractedReport.startDate | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="endDate ">{{extractedReport.endDate | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="createdAt ">{{extractedReport.createdAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="status ">{{extractedReport.status}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="output ">{{extractedReport.output}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(extractedReport, $event)" translate="ANALYTICS.EDIT_EXTRACTEDREPORT">\n Edit ExtractedReport\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="extractedReport.status == \'Completed\'">\n <md-button ng-click="vm.downloadfile2(extractedReport, $event)" translate="ANALYTICS.DOWNLOAD_EXTRACTEDREPORT">\n Download ExtractedReport\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(extractedReport, $event)" translate="ANALYTICS.DELETE_EXTRACTEDREPORT">\n Delete ExtractedReport\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.extractedReports.count}}" md-on-paginate="vm.getExtractedReports" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / EXTRACTEDREPORT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/metrics/create/dialog.html",'<md-dialog class="metric-dialog" aria-label="New Metric">\n <form name="metricForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.metric.name" ng-required="true" autofocus>\n <div ng-messages="metricForm[\'name\'].$error" ng-show="metricForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.TABLE">Table</label>\n <md-select name="table" ng-model="vm.metric.table" required>\n <md-option ng-value="\'report_agent\'">Agent Report</md-option>\n <md-option ng-value="\'report_call\'">Call Report</md-option>\n <md-option ng-value="\'cm_contacts\'">Contacts</md-option>\n <md-option ng-value="\'report_square\'">CSquare Report</md-option>\n <md-option ng-value="\'report_square_details\'">CSquare Details Report</md-option>\n <md-option ng-value="\'cm_hopper\'">Dialer Hopper Processing</md-option>\n <md-option ng-value="\'cm_hopper_history\'">Dialer Hopper Logs</md-option>\n <md-option ng-value="\'cm_hopper_final\'">Dialer Hopper Final</md-option>\n <md-option ng-value="\'report_integration\'">Integration Report</md-option>\n <md-option ng-value="\'report_jscripty_sessions\'">Jscripty Sessions</md-option>\n <md-option ng-value="\'report_jscripty_questions\'">Jscripty Questions</md-option>\n <md-option ng-value="\'report_jscripty_answers\'">Jscripty Answers</md-option>\n <md-option ng-value="\'report_member\'">Member Report</md-option>\n <md-option ng-value="\'report_queue\'">Queue Report</md-option>\n <md-option ng-value="\'users\'">Users</md-option>\n <md-option ng-value="\'voice_recordings\'">Voice Recordings</md-option>\n </md-select>\n <div ng-messages="metricForm[\'table\'].$error" ng-show="metricForm[\'table\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.METRIC">Metric</label>\n <input type="text" name="metric" ng-model="vm.metric.metric" ng-required="true">\n <div ng-messages="metricForm[\'metric\'].$error" ng-show="metricForm[\'metric\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.metric.description">\n <div ng-messages="metricForm[\'description\'].$error" ng-show="metricForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMetric" ng-click="vm.saveMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid || metricForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMetric" ng-click="vm.addNewMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_METRIC" translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n ADD METRIC\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMetric" ng-click="vm.deleteMetric($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/metrics/metrics.html",'<div id="metrics" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.METRICS">Metrics</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMetrics.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMetrics =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-metrics-count">\n <span>{{vm.selectedMetrics.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="METRICS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMetrics()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMetrics()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMetrics" csv-label="true" filename="metrics.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedMetrics($event)" aria-label="delete selected" translate translate-attr-label="METRICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- METRIC TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMetrics" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMetrics">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="table">{{ \'ANALYTICS.TABLE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.metrics.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="metric" md-select-id="id" ng-repeat="metric in vm.metrics.rows">\n <td md-cell ng-if="metric.userpic"><img class="avatar" alt="{{metric.name}}" ng-src="api/users/{{metric.id}}/avatar" /></td>\n <td md-cell ng-if="!metric.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{metric.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="id ">{{metric.id}}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="name ">{{metric.name}}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="table ">{{ vm.arraytable[metric.table].option }}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="description ">{{metric.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(metric, $event)" translate="ANALYTICS.EDIT_METRIC">\n Edit Metric\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(metric, $event)" translate="ANALYTICS.DELETE_METRIC">\n Delete Metric\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.metrics.count}}" md-on-paginate="vm.getMetrics" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / METRIC TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD METRIC BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-metric-button" ng-click="vm.createOrEditMetric($event)" aria-label="add metric" translate translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD METRIC BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/copy/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.COPY_REPORT">Copy Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input name="name" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label translate="ANALYTICS.SELECT_NODE">Select Node</label>\n <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.copyReport()" class="send-button md-accent md-raised" ng-disabled="!vm.currentNode" aria-label="COPY" translate="ANALYTICS.COPY_REPORT" translate-attr-aria-label="ANALYTICS.COPY_REPORT">\n COPY REPORT\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/create/dialog.html",'<md-dialog class="report-dialog" aria-label="New Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newReport">\n <label translate="ANALYTICS.TABLE">Table</label>\n <md-select ng-model="vm.report.table" required>\n <md-option ng-repeat="table in vm.tables | orderBy:\'name\'" ng-value="table.name">{{table.name}}</md-option>\n </md-select>\n <div ng-messages="reportForm.table.$error" ng-show="reportForm.table.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.report.description">\n <div ng-messages="reportForm.description.$error" ng-show="reportForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-autocomplete ng-if="vm.newReport" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="table in vm.tables | filter:vm.searchText" md-item-text="table.name" md-min-length="0" md-selected-item-change="vm.selectedTableChange(table)"\n placeholder="Select the table to Join">\n <md-item-template>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{table.name}}</span>\n </md-item-template>\n <md-not-found>\n No states matching "{{vm.searchText}}" were found.\n </md-not-found>\n </md-autocomplete>\n\n <md-card ng-if="vm.newReport" md-theme="default" md-theme-watch ng-repeat="table in vm.joinTables">\n <md-card-title>\n <md-card-title-text layout="row">\n <div layout="row" flex="50">\n <span class="md-subhead">{{table.name}}</span>\n </div>\n <div layout="row" layout-align="end center" flex>\n <md-button class="md-icon-button" ng-click="vm.removeJoin($index)">\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n <md-select ng-model="table.parentKey" placeholder="Select the parent key" ng-init="table.parentFields = []; vm.getFields(table, \'parentFields\', vm.report.table)" required>\n <md-option ng-repeat="field in table.parentFields" ng-value="field">{{field}}</md-option>\n </md-select>\n <md-select ng-model="table.foreignKey" placeholder="Select the foreign key" ng-init="table.foreignFields = []; vm.getFields(table, \'foreignFields\', table.name)" required>\n <md-option ng-repeat="field in table.foreignFields" ng-value="field">{{field}}</md-option>\n </md-select>\n <md-select ng-model="table.type" placeholder="Select join type" required>\n <md-option ng-repeat="join in vm.joinTypes" ng-value="join.key">{{join.value}}</md-option>\n </md-select>\n </md-card-content>\n </md-card>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newReport" ng-click="vm.saveReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newReport" ng-click="vm.addNewReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORT" translate-attr-aria-label="ANALYTICS.ADD_REPORT">\n ADD REPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newReport" ng-click="vm.deleteReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/condition/group.html",'<md-card class="padding-horizontal-15 padding-top-15">\n <div layout="row">\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.OPERATOR">Operator</label>\n <md-select ng-model="group.operator" required>\n <md-option value="AND">AND</md-option>\n <md-option value="OR">OR</md-option>\n </md-select>\n <div ng-messages="conditionsForm.operator.$error" ng-show="conditionsForm.operator.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-button class="md-raised md-accent" ng-click="vm_rc.addCondition(group.rules)">\n <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.CONDITION\' | translate}}</md-button>\n </md-input-container>\n <md-input-container class="md-block">\n <md-button class="md-raised md-accent" ng-click="vm_rc.addGroup(group.rules)">\n <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}</md-button>\n </md-input-container>\n <div flex></div>\n <md-input-container class="md-block" ng-if="parent">\n <md-button class="md-raised md-warn" ng-click="vm_rc.deleteConfirm(parent, index, $event)">\n <md-icon md-font-icon="icon-delete"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}</md-button>\n </md-input-container>\n </div>\n <div layout="column" ng-repeat="rule in group.rules track by $index">\n <div layout="row" ng-if="!rule.group">\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.COLUMN">COLUMN</label>\n <md-select name="field" ng-model="rule.field" required>\n <md-optgroup label="{{vm_rc.report.table}}">\n <md-option ng-repeat="column in vm_rc.columns" value="{{vm_rc.report.table}}.{{column}}">{{column}}</md-option>\n </md-optgroup>\n <md-optgroup ng-if="vm_rc.report.joins" ng-repeat="join in vm_rc.report.joins" label="{{join.foreignTable}}">\n <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="conditionsForm.field.$error" ng-show="conditionsForm.field.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.CONDITION">CONDITION</label>\n <md-select name="condition" ng-model="rule.condition" required>\n <md-option ng-repeat="condition in vm_rc.conditions" ng-value="condition">{{condition}}</md-option>\n </md-select>\n <div ng-messages="conditionsForm.condition.$error" ng-show="conditionsForm.condition.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm_rc.isValueByCondition(rule.condition)" class="md-block" flex>\n <label translate="ANALYTICS.VALUE">VALUE</label>\n <input type="text" name="value" ng-model="rule.value" required md-autofocus>\n <div ng-messages="conditionsForm.value.$error" ng-show="conditionsForm.value.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <md-button class="md-fab md-mini md-warn" aria-label="Delete row" ng-click="vm_rc.deleteConfirm(group.rules, $index, $event)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </md-input-container>\n </div>\n <div ng-if="rule.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="parent=group.rules;index=$index;group=rule.group"></div>\n </div>\n</md-card>'),e.put("app/main/apps/analytics/views/reports/edit/field/dialog.html",'<md-dialog class="reportField-dialog" aria-label="New Report Field">\n <form name="reportFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{vm.title}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <pre></pre>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.reportField.type" ng-change="vm.reportField.field = undefined" required>\n <md-option value="column">Select a column</md-option>\n <md-option value="metric">Select an existing metric</md-option>\n <md-option value="custom">Write a custom metric</md-option>\n </md-select>\n <div ng-messages="reportForm.type.$error" ng-show="reportForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-switch on="vm.reportField.type">\n <md-input-container class="md-block" ng-switch-when="column">\n <label translate="ANALYTICS.COLUMN">Column Name</label>\n <md-select name="column" ng-model="vm.reportField.field" required>\n <md-optgroup label="{{vm.report.table}}">\n <md-option ng-repeat="column in vm.columns" value="{{vm.report.table}}.{{column}}">{{column}}</md-option>\n \x3c!-- <md-option ng-repeat="column in vm.columns" ng-value="">{{column}}</md-option> --\x3e\n </md-optgroup>\n <md-optgroup ng-if="vm.report.joins" ng-repeat="join in vm.report.joins" label="{{join.foreignTable}}">\n <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="reportForm.column.$error" ng-show="reportForm.column.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-switch-when="metric">\n <label translate="ANALYTICS.METRIC_NAME">Metric Name</label>\n <md-select name="metric" ng-model="vm.reportField.MetricId" required>\n <md-option ng-repeat="metric in vm.metrics" ng-value="metric.id">{{metric.name}}</md-option>\n </md-select>\n <div ng-messages="reportForm.metric.$error" ng-show="reportForm.metric.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-switch-when="custom">\n <label translate="ANALYTICS.CUSTOM_METRIC">Custom Metric</label>\n <input type="text" name="field" ng-model="vm.reportField.field" required md-autofocus>\n <div ng-messages="reportFieldForm.field.$error" ng-show="reportFieldForm.field.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.CUSTOM_METRIC_REQUIRED">Custom Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.reportField.alias" ng-required="vm.reportField.type === \'custom\' || vm.reportField.type === \'metric\'">\n <div ng-messages="reportFieldForm.alias.$error" ng-show="reportFieldForm.alias.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n <label translate="ANALYTICS.FUNCTION">Function</label>\n <md-select name="function" ng-model="vm.reportField.function">\n <md-option ng-value="null">No Function</md-option>\n <md-option ng-repeat="function in vm.sqlUtil.getFunctions" ng-value="function.value">{{function.value}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n <label translate="ANALYTICS.FORMAT">Format</label>\n <md-select name="format" ng-model="vm.reportField.format">\n <md-option ng-value="null">No Format</md-option>\n <md-option ng-repeat="format in vm.sqlUtil.getFormats" ng-value="format.value">{{format.value}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.GROUP_BY">Group By</label>\n <md-select name="groupBy" ng-model="vm.reportField.groupBy">\n <md-option ng-repeat="gb in vm.sqlUtil.getGroupBy" ng-value="gb.value">{{gb.value ? \'Yes\' : \'No\'}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.ORDER_BY">Order By</label>\n <md-select name="orderBy" ng-model="vm.reportField.orderBy">\n <md-option ng-value="null">No Order</md-option>\n <md-option ng-repeat="ob in vm.sqlUtil.getOrderBy" ng-value="ob.value">{{ob.value}}</md-option>\n </md-select>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newReportField" ng-click="vm.saveReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newReportField" ng-click="vm.addNewReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORTFIELD" translate-attr-aria-label="ANALYTICS.ADD_REPORTFIELD">\n ADD REPORT FIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newReportField" ng-click="vm.deleteReportField($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/view.html",'<div id="analytics-report" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-reports-button md-icon-button" aria-label="Go to reports" ng-click="vm.gotoReports()" translate translate-attr-aria-label="ANALYTICS.GO_TO_ANALYTICSQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="report-image" hide-xs>\n <img ng-src="assets/images/business/reports.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.report.id}} {{vm.report.name}}\n </div>\n <div class="subtitle secondary-text">\n <span translate="ANALYTICS.CREATED_AT"></span> <span>{{vm.report.createdAt | date:\'medium\'}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span>{{vm.report.description}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveReport()" ng-disabled="generalForm.$pristine && conditionsForm.$pristine" class="send-button md-accent md-raised" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="ANALYTICS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="generalForm.name.$error" ng-show="generalForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.report.description">\n <div ng-messages="generalForm.description.$error" ng-show="generalForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.FIELDS">FIELDS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container fields md-background-bg md-whiteframe-1dp">\n <div ng-controller="ReportFieldsController as vm_rf" ng-init="vm_rf.init(vm.report)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_rf.selectedReportFields.length">\n <div class="md-toolbar-tools">\n <div layout="row" layout-align="start center">\n <div layout="column" layout-align="start start">\n <div class="md-subhead" translate="ANALYTICS.FIELDS">\n <span translate="ANALYTICS.FIELDS">FIELDS</span>\n </div>\n <div class="h4">\n <span translate="ANALYTICS.TABLE">TABLE</span> <span class="text-bold">{{vm.report.table}}</span>\n </div>\n <div class="h4" ng-if="vm.report.joins && vm.report.joins.length && vm.isArray(vm.report.joins)">\n <span>Join</span> <span class="text-bold">{{ vm.mapArray(vm.report.joins, \'foreignTable\') }}</span>\n </div>\n </div>\n </div>\n <div flex></div>\n <ms-search-bar on-search="vm_rf.query.filter = query" on-collapse="vm_rf.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_rf.createOrEditReportField($event)" aria-label="add field" translate translate-attr-label="ANALYTICS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_rf.selectedReportFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_rf.selectedReportFields.length}} {{vm_rf.selectedReportFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_rf.deleteSelectedReportFields($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_rf.selectedReportFields" md-progress="vm_rf.promise">\n <thead md-head md-order="vm_rf.query.sort" md-on-reorder="vm_rf.getReportFields">\n <tr md-row>\n <th md-column width="10px">\n <md-icon md-font-icon="icon-drag-vertical"></md-icon>\n </th>\n <th md-column>Type</th>\n <th md-column>Column or Metric</th>\n <th md-column>Alias</th>\n <th md-column>Function</th>\n <th md-column>Format</th>\n <th md-column>Group By</th>\n <th md-column>Order By</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_rf.sortableTable">\n <tr md-row md-select="reportField" md-select-id="id" ng-repeat="reportField in vm_rf.reportFields.rows">\n <td md-cell class="handle">\n <md-icon md-font-icon="icon-drag-vertical" class="s16">\n </td>\n <td md-cell>\n <div ng-if="reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-shape-plus s16"></div>\n <div ng-if="!reportField.MetricId && reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-pencil-box-outline s16"></div>\n <div ng-if="!reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-view-column s16"></div>\n </td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.MetricId ? vm_rf.getMetricName(reportField.MetricId) : reportField.field}}</td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.alias}}</td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.function">{{reportField.function}}</span><span ng-if="!reportField.function">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.format">{{reportField.format}}</span><span ng-if="!reportField.format">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.groupBy">YES</span><span ng-if="!reportField.groupBy">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.orderBy">{{reportField.orderBy}}</span><span ng-if="!reportField.orderBy">--</span></td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_rf.createOrEditReportField($event, reportField)" translate="ANALYTICS.EDIT_REPORTFIELD">\n Edit Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_rf.deleteConfirm(reportField, $event)" translate="ANALYTICS.DELETE_REPORTFIELD">\n Delete Report\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.CONDITIONS">CONDITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container conditions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ReportConditionsController as vm_rc" ng-init="vm_rc.init(vm.report)">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="ANALYTICS.CONDITION">CONDITION</div>\n </div>\n <form name="conditionsForm" novalidate>\n <div ng-if="vm_rc.report.condition.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="group=vm_rc.report.condition.group"></div>\n </form>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab md-on-select="vm.previewReport()">\n <md-tab-label>\n <span translate="ANALYTICS.PREVIEW">PREVIEW</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.rows.length">\n <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab md-on-select="vm.queryReport()">\n <md-tab-label>\n <span>Query</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text">SQL</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <div ng-if="!vm.error">\n {{vm.queryResult}}\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/analytics/views/reports/preview/dialog.html",'<md-dialog aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.PREVIEW_REPORT">Preview Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.rows.length">\n <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div flex></div>\n <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/reports.html",'<div id="reports" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.REPORTS">Reports</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedReports.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedReports =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-reports-count">\n <span>{{vm.selectedReports.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllReports()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectReports()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedReports" csv-label="true" filename="reports.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.currentNode.custom && (vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\')" class="md-icon-button" ng-click="vm.deleteSelectedReports($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div layout="column" flex="30">\n <md-card class="padding-top-5 padding-horizontal-10 padding-bottom-0">\n \x3c!-- SEARCH --\x3e\n <div layout="row" layout-align="start center">\n <label for="searchFolder" class="m-0">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="margin-horizontal-0 margin-bottom-0 margin-top-10" flex>\n <input id="searchFolder" placeholder="Search folder" type="text" ng-model="vm.search" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_FOLDER">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </md-card>\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeDefaultConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n </md-card>\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </md-card>\n </div>\n <md-card flex="70">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n <p ng-if="vm.currentPath">\n <span class="text-boxed">{{vm.currentPath}}</span>\n </p>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flow-init flow-file-added="vm.importReport($file, $event, $flow)">\n <md-button ng-if="vm.currentNode.custom" class="md-icon-button" aria-label="import report" translate translate-attr-label="ANALYTICS.IMPORT_REPORT" flow-btn>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n </div>\n <md-button ng-if="vm.currentNode.custom" class="md-icon-button" ng-click="vm.createOrEditReport($event)" aria-label="add report" translate translate-attr-label="ANALYTICS.ADD_REPORT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedReports" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n <tr md-row>\n <th md-column md-order-by="id" width="10px">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'ANALYTICS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.reports.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n <td ng-click="vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="id">{{report.id}}</td>\n <td ng-click="vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="name">{{report.name}}</td>\n <td ng-click="vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="description">{{report.description}}</td>\n <td ng-click="vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="createdAt">{{report.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.copydialog(report, $event)" translate="ANALYTICS.COPY_REPORT">\n Copy Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.previewdialog(report, $event)" translate="ANALYTICS.PREVIEW_REPORT">\n Preview Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.rundialog(report, $event)" translate="ANALYTICS.RUN_REPORT">\n Run Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadfile(report, $event)" translate="ANALYTICS.DOWNLOAD_JSON_REPORT">\n Download Json Report\n </md-button>\n </md-menu-item>\n <md-menu-divider ng-if="vm.currentNode.custom"></md-menu-divider>\n <md-menu-item ng-if="vm.currentNode.custom">\n <md-button ng-click="vm.editstate(report, $event)" translate="ANALYTICS.EDIT_REPORT">\n Edit Report\n </md-button>\n </md-menu-item>\n\n <md-menu-item ng-if="vm.currentNode.custom && (vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\')">\n <md-button ng-click="vm.deleteconfirm(report, $event)" translate="ANALYTICS.DELETE_REPORT">\n Delete Report\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.reports.count}}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/run/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.RUN_REPORT">Run Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input name="name" ng-model="vm.export.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.FORMAT">FORMAT</label>\n <md-select name="format" ng-model="vm.export.output" required>\n <md-option value="csv">CSV</md-option>\n <md-option value="xlsx">Excel (XLSX)</md-option>\n <md-option value="pdf">PDF</md-option>\n <md-option value="web">Web</md-option>\n </md-select>\n <div ng-messages="reportForm.format.$error" ng-show="reportForm.format.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n </div>\n </div>\n </md-input-container>\n <div layout="row">\n <div class="md-block" flex>\n <mdp-date-picker mdp-open-on-click required name="dateRangeFrom" mdp-placeholder="Date Range From" mdp-format="YYYY-MM-DD" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startDate">\n <div ng-messages="reportForm.dateRangeFrom.$error" ng-show="reportForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_REQUIRED">Date Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_INVALID">Date Range From field is invalid</span>\n </div>\n <div ng-message="maxDate">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MAX_INVALID">Date Range From Max field is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div class="md-block" flex>\n <mdp-date-picker mdp-open-on-click required name="dateRangeTo" mdp-placeholder="Date Range To" mdp-format="YYYY-MM-DD" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endDate">\n <div ng-messages="reportForm.dateRangeTo.$error" ng-show="reportForm.dateRangeTo.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_REQUIRED">Date Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_INVALID">Date Range From field is invalid</span>\n </div>\n <div ng-message="minDate">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MIN_INVALID">Date Range From Min field is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n </div>\n <div layout="row">\n <div class="md-block" flex>\n <mdp-time-picker required name="timeRangeFrom" mdp-placeholder="Time Range From" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startDate">\n <div ng-messages="reportForm.timeRangeFrom.$error" ng-show="reportForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_REQUIRED">Time Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex>\n <mdp-time-picker required name="timeRangeTo" mdp-placeholder="Time Range To" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endDate">\n <div ng-messages="reportForm.timeRangeTo.$error" ng-show="reportForm.timeRangeTo.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.runReport($event)" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid" aria-label="RUN" translate="ANALYTICS.RUN_REPORT" translate-attr-aria-label="ANALYTICS.RUN_REPORT">\n RUN REPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-click="vm.refreshDate()" aria-label="REFRESH" translate translate-attr-aria-label="ANALYTICS.REFRESH">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <md-tooltip><span translate="ANALYTICS.REFRESH">REFRESH</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/run/web/dialog.html",'<md-dialog class="web-dialog" aria-label="Show Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.PREVIEW_REPORT">Web Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.results.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.results.rows.length">\n <td md-cell colspan="{{vm.columns.length}}">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_DATA">NO DATA</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div flex></div>\n <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/create/dialog.html",'<md-dialog class="odbc-dialog" aria-label="New Odbc">\n <form name="odbcForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.odbc.name" ng-required="true" autofocus>\n <div ng-messages="odbcForm[\'name\'].$error" ng-show="odbcForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DSN">DSN</label>\n <input type="text" name="dsn" ng-model="vm.odbc.dsn" ng-required="true">\n <div class="hint"><span translate="CALLYSQUARE.HELP.DSN"></span></div>\n <div ng-messages="odbcForm[\'dsn\'].$error" ng-show="odbcForm[\'dsn\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DSN_REQUIRED">DSN field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.odbc.description">\n <div ng-messages="odbcForm[\'description\'].$error" ng-show="odbcForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newOdbc" ng-click="vm.saveOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid || odbcForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newOdbc" ng-click="vm.addNewOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_ODBC" translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n ADD ODBC\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newOdbc" ng-click="vm.deleteOdbc($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/odbcs.html",'<div id="odbcs" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.ODBC">ODBC</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedODBC.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedODBC =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-odbcs-count">\n <span>{{vm.selectedODBC.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ODBC.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllODBC()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectODBC()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedODBC" csv-label="true" filename="odbcs.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedODBC($event)" aria-label="delete selected" translate translate-attr-label="ODBC.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- ODBC TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedODBC" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getODBC">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n <th md-column md-order-by="dsn">{{ \'CALLYSQUARE.DSN\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.odbcs.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="odbc" md-select-id="id" ng-repeat="odbc in vm.odbcs.rows">\n <td md-cell ng-if="odbc.userpic"><img class="avatar" alt="{{odbc.name}}" ng-src="api/users/{{odbc.id}}/avatar" /></td>\n <td md-cell ng-if="!odbc.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{odbc.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="id ">{{odbc.id}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="name ">{{odbc.name}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="dsn ">{{odbc.dsn}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="description ">{{odbc.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(odbc, $event)" translate="CALLYSQUARE.EDIT_ODBC">\n Edit Odbc\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestOdbc(odbc, $event)" translate="CALLYSQUARE.TEST_ODBC">\n Test Odbc\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(odbc, $event)" translate="CALLYSQUARE.DELETE_ODBC">\n Delete Odbc\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.odbcs.count}}" md-on-paginate="vm.getODBC" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ODBC TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ODBC BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-odbc-button" ng-click="vm.createOrEditOdbc($event)" aria-label="add odbc" translate translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ODBC BUTTON --\x3e\n</div>'),e.put("app/main/apps/callysquare/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{vm.title | translate}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input name="name" ng-model="vm.project.name" required md-autofocus ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-disabled="!vm.newProject">\n <div ng-messages="projectForm.name.$error" ng-show="projectForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input name="description" ng-model="vm.project.description">\n <div ng-messages="projectForm.description.$error" ng-show="projectForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.openFromEditor" class="md-block">\n \x3c!-- Added to check if I\'m opening the dialog directly from the square editor --\x3e\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="ADD" translate="CALLYSQUARE.ADD_PROJECT" translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n ADD PROJECT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="dialogForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.EDIT"></span> <span translate="CALLYSQUARE.{{vm.cellName | uppercase}}"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <md-input-container class="md-block" ng-repeat="attribute in vm.attributes" ng-switch="attribute.name">\n <label translate="CALLYSQUARE.{{attribute.name | uppercase}}">{{attribute.name | ucfirst }}</label>\n\n \x3c!-- START SELECT INPUT --\x3e\n <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-switch-when-separator="|" ng-switch-when="answer|trunk_name|trunk_id|queue_id|file_id|variable_id|google_tts_language|ispeech_tts_language|ispeech_asr_language|google_asr_language|hiddendigitspos|odbc_id|project_id|beep|account_id|interval_id|template_id|list_id|recordingFormat|callback_priority|aws_polly_voice|aws_polly_region|sms_account_id|findBy|pause_id"\n ng-required="attribute.required">\n <md-option ng-if="attribute.defaultValue" ng-value="\'\'"> - None - </md-option>\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]">{{v.option}}</md-option>\n <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n </md-select>\n \x3c!-- END SELECT INPUT --\x3e\n\n \x3c!-- START SELECT INPUT --\x3e\n <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-switch-when-separator="|" ng-switch-when="sip_id" ng-required="attribute.required">\n <md-optgroup label="{{\'CALLYSQUARE.AGENTS\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'agent\'">{{v.option}}</md-option>\n </md-optgroup>\n <md-optgroup label="{{\'CALLYSQUARE.TELEPHONES\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'telephone\'">{{v.option}}</md-option>\n </md-optgroup>\n <md-optgroup label="{{\'CALLYSQUARE.USERS\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'admin\' || v.group === \'user\'">{{v.option}}</md-option>\n </md-optgroup>\n <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n </md-select>\n \x3c!-- END SELECT INPUT --\x3e\n\n \x3c!-- START NUMBER INPUT --\x3e\n <div ng-switch-when="timeout">\n <div ng-switch="vm.cellName">\n <input ng-switch-when-separator="|" ng-switch-when="answer|ext_dial|dial|queue" type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="record|ispeechasr|googleasr" type="number" step="any" name="{{attribute.name}}" min="-1" ng-model="attribute.value" ng-required="attribute.required" string-to-number>\n <input ng-switch-default type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" string-to-number>\n </div>\n </div>\n <input ng-switch-when-separator="|" ng-switch-when="speed" type="number" step="any" name="{{attribute.name}}" min="-10" max="-10" ng-model="attribute.value" ng-required="attribute.required" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="maxdigit|mindigit|digit" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="retry|response|hiddendigitsnum|priority|delay" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" string-to-number>\n \x3c!-- END NUMBER INPUT --\x3e\n\n \x3c!-- START TEXTAREA INPUT --\x3e\n <textarea name="{{attribute.name}}" ng-model="attribute.value" ng-switch-when-separator="|" ng-switch-when="query|sms_text|condition|text" ng-required="attribute.required"></textarea>\n \x3c!-- END TEXTAREA INPUT --\x3e\n\n \x3c!-- START TEXT INPUT --\x3e\n <input ng-switch-default name="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required">\n \x3c!-- END TEXT INPUT--\x3e\n\n <div class="hint" ng-if="attribute.help">\n <span translate="CALLYSQUARE.HELP.{{attribute.name | uppercase}}"></span>\n </div>\n <div ng-messages="dialogForm[attribute.name].$error" ng-show="dialogForm[attribute.name].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.FIELD_REQUIRED">The field is required</span>\n </div>\n </div>\n </md-input-container>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="dialogForm.$invalid || dialogForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/edit/edit.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="editForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.EDIT_XML"></span></span>\n </span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label>XML</label>\n <textarea name="preproduction" ng-model="vm.project.preproduction"></textarea>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="editForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/import/import.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="importForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.IMPORT_XML"></span></span>\n </span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="xml-uploader" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-file-added="vm.fileAdded($file)" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="CALLYSQUARE.DROP_TO_UPLOAD_MESSAGE">You can also drop files here to upload. Only XML - Max. 5MB</span>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" ng-disabled="importForm.$invalid" aria-label="CLOSE" translate="CALLYSQUARE.CLOSE" translate-attr-aria-label="CALLYSQUARE.CLOSE">\n CLOSE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/info/info.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="descriptionFrom" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.UPDATE_INFO"></span></span>\n </span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input name="description" ng-model="vm.project.description" md-autofocus>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NOTES">Description</label>\n <textarea name="notes" ng-model="vm.project.notes"></textarea>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="descriptionFrom.$invalid" aria-label="SAVE" translate="CALLYSQUARE.UPDATE_INFO" translate-attr-aria-label="CALLYSQUARE.UPDATE">\n UPDATE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/open/open.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="openForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.OPEN_PROJECT"></span></span>\n </span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.PROJECT">Project</label>\n <md-select name="id" ng-model="vm.id" required>\n <md-option value="{{p.id}}" ng-repeat="p in vm.projects">{{p.name}}</md-option>\n </md-select>\n <div ng-messages="openForm.id.$error" ng-show="openForm.id.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.PROJECT_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="openForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.OPEN_PROJECT" translate-attr-aria-label="CALLYSQUARE.OPEN">\n OPEN\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="newForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.COPY_PROJECT"></span></span>\n </span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input name="name" ng-model="vm.project.name" required md-autofocus>\n <div ng-messages="newForm.name.$error" ng-show="newForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="newForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.COPY_PROJECT" translate-attr-aria-label="CALLYSQUARE.COPY">\n COPY\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/view.html",'<div id="callysquare-project" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="CALLYSQUARE.GO_TO_PROJECTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="project-image" hide-xs>\n <img ng-src="assets/images/business/cprojects.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.project.id}} {{vm.project.name}}\n </div>\n <div class="subtitle secondary-text text-truncate">\n <span ng-if="vm.project.description">{{vm.project.description}} - </span><span translate="CALLYSQUARE.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.updateInfo($event)" class="md-fab md-yellow-700-bg md-icon-button" aria-label="edit">\n <md-icon md-font-icon="icon-tooltip-edit"></md-icon>\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content class="callysquare-content">\n\n <div id="geEditor" class="geEditor"></div>\n\n </md-content>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-vector-square" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.PROJECTS">Projects</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-projects-count">\n <span>{{vm.selectedProjects.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllProjects()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectProjects()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- PROJECT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="notes">{{ \'CALLYSQUARE.NOTES\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.projects.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n <td md-cell ng-if="project.userpic"><img class="avatar" alt="{{project.name}}" ng-src="api/users/{{project.id}}/avatar" /></td>\n <td md-cell ng-if="!project.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{project.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="notes ">{{project.notes}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(project, ev)" translate="CALLYSQUARE.EDIT_PROJECT">\n Edit Project\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(project, ev)" translate="CALLYSQUARE.DELETE_PROJECT">\n Delete Project\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PROJECT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PROJECT BUTTON --\x3e\n <md-button class="md-fab md-accent md-icon-button" id="add-project-button" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PROJECT BUTTON --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/squareRecordings/create/dialog.html",'<md-dialog class="squareRecording-dialog" aria-label="New SquareRecording">\n <form name="squareRecordingForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.FILENAME">Filename</label>\n <input type="" name="filename" ng-model="vm.squareRecording.filename" ng-required="true" autofocus>\n <div ng-messages="squareRecordingForm[\'filename\'].$error" ng-show="squareRecordingForm[\'filename\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.FILENAME_REQUIRED">Filename field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSquareRecording" ng-click="vm.saveSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid || squareRecordingForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE"\n translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSquareRecording" ng-click="vm.addNewSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_SQUARERECORDING" translate-attr-aria-label="CALLYSQUARE.ADD_SQUARERECORDING">\n ADD SQUARERECORDING\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSquareRecording" ng-click="vm.deleteSquareRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",'<div id="squareRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.SQUARERECORDINGS">SquareRecordings</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSquareRecordings.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSquareRecordings =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-squareRecordings-count">\n <span>{{vm.selectedSquareRecordings.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SQUARERECORDINGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSquareRecordings()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSquareRecordings()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSquareRecordings" csv-label="true" filename="squareRecordings.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedSquareRecordings($event)" aria-label="delete selected" translate translate-attr-label="SQUARERECORDINGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- SQUARERECORDING TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSquareRecordings" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSquareRecordings">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="filename">{{ \'CALLYSQUARE.FILENAME\' | translate }}</th>\n <th md-column md-order-by="projectName">{{ \'CALLYSQUARE.PROJECT\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'CALLYSQUARE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="callerid">{{ \'CALLYSQUARE.PHONE\' | translate }}</th>\n <th md-column md-order-by="extension">{{ \'CALLYSQUARE.EXTEN\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'CALLYSQUARE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CALLYSQUARE.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.squareRecordings.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="squareRecording" md-select-id="id" ng-repeat="squareRecording in vm.squareRecordings.rows">\n <td md-cell ng-if="squareRecording.userpic"><img class="avatar" alt="{{squareRecording.name}}" ng-src="api/users/{{squareRecording.id}}/avatar" /></td>\n <td md-cell ng-if="!squareRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{squareRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="filename ">{{squareRecording.filename}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="projectName ">{{squareRecording.projectName}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="uniqueid ">{{squareRecording.uniqueid}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="callerid ">{{squareRecording.callerid}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="extension ">{{squareRecording.extension}}</td>\n <td md-cell class="audio ">\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="squareRecording.id" model="\'squareRecording\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="createdAt ">{{squareRecording.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(squareRecording, $event)" translate="CALLYSQUARE.DOWNLOAD_SQUARERECORDING">\n Download SquareRecording\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(squareRecording, $event)" translate="CALLYSQUARE.DELETE_SQUARERECORDING">\n Delete SquareRecording\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.squareRecordings.count}}" md-on-paginate="vm.getSquareRecordings" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SQUARERECORDING TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/chatQueues.html",'<div id="chatQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CHAT.CHATQUEUES">ChatQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChatQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChatQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CHAT.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chatQueues-count">\n <span>{{vm.selectedChatQueues.length}}</span>\n <span translate="CHAT.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHATQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChatQueues()" translate="CHAT.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChatQueues()" translate="CHAT.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChatQueues" csv-label="true" filename="chatQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedChatQueues($event)" aria-label="delete selected" translate translate-attr-label="CHATQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- CHATQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChatQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'CHAT.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chatQueue" md-select-id="id" ng-repeat="chatQueue in vm.chatQueues.rows">\n <td md-cell ng-if="chatQueue.userpic"><img class="avatar" alt="{{chatQueue.name}}" ng-src="api/users/{{chatQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!chatQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditChatQueue($event, chatQueue)" md-cell class="id ">{{chatQueue.id}}</td>\n <td ng-click="vm.createOrEditChatQueue($event, chatQueue)" md-cell class="name ">{{chatQueue.name}}</td>\n <td ng-click="vm.createOrEditChatQueue($event, chatQueue)" md-cell class="strategy ">{{ vm.arraystrategy[chatQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(chatQueue, $event)" translate="CHAT.EDIT_CHATQUEUE">\n Edit ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(chatQueue, $event)" translate="CHAT.TEAMADD_CHATQUEUE">\n teamadd ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(chatQueue, $event)" translate="CHAT.AGENTADD_CHATQUEUE">\n agentadd ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(chatQueue, $event)" translate="CHAT.DELETE_CHATQUEUE">\n Delete ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(chatQueue, $event)" translate="CHAT.GOTOREALTIME_CHATQUEUE">\n goToRealtime ChatQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.chatQueues.count}}" md-on-paginate="vm.getChatQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHATQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHATQUEUE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-chatQueue-button" ng-click="vm.createOrEditChatQueue($event)" aria-label="add chatQueue" translate translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHATQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/create/dialog.html",'<md-dialog class="chatQueue-dialog" aria-label="New ChatQueue">\n <form name="chatQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newChatQueue">\n <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n <div ng-messages="chatQueueForm[\'name\'].$error" ng-show="chatQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.chatQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="chatQueueForm[\'strategy\'].$error" ng-show="chatQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="chatQueueForm[\'timeout\'].$error" ng-show="chatQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatQueue.description">\n <div ng-messages="chatQueueForm[\'description\'].$error" ng-show="chatQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newChatQueue" ng-click="vm.saveChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid || chatQueueForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newChatQueue" ng-click="vm.addNewChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATQUEUE" translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n ADD CHATQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newChatQueue" ng-click="vm.deleteChatQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue">\n <form name="chatQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.AGENTADD_CHATQUEUE">Add Agent to chatQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue">\n <form name="chatQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.TEAMADD_CHATQUEUE">Add Team in CHATQUEUE</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/view.html",'<div id="chat-chatQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-chatQueues-button md-icon-button" aria-label="Go to chatQueues" ng-click="vm.gotoChatQueues()" translate translate-attr-aria-label="CHAT.GO_TO_CHATQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="chatQueue-image" hide-xs>\n <img ng-src="assets/images/business/chatQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.chatQueue.id}}\n <span ng-if="vm.chatQueue.name">{{vm.chatQueue.name}}</span>\n <span ng-if="vm.chatQueue.exten">{{vm.chatQueue.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.chatQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="CHAT.TEAMADD_CHATQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.chatQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CHAT.AGENTADD_CHATQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveChatQueue()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.chatQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatQueue.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/chatWebsites.html",'<div id="chatWebsites" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CHAT.CHATWEBSITES">ChatWebsites</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChatWebsites.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChatWebsites =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CHAT.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chatWebsites-count">\n <span>{{vm.selectedChatWebsites.length}}</span>\n <span translate="CHAT.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHATWEBSITES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChatWebsites()" translate="CHAT.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChatWebsites()" translate="CHAT.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChatWebsites" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedChatWebsites($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- CHATWEBSITE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChatWebsites" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatWebsites">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'CHAT.KEY\' | translate }}</th>\n <th md-column md-order-by="address">{{ \'CHAT.MOTIONADDRESS\' | translate }}</th>\n <th md-column md-order-by="remote">{{ \'CHAT.MOTIONPROXY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatWebsites.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chatWebsite" md-select-id="id" ng-repeat="chatWebsite in vm.chatWebsites.rows">\n <td md-cell ng-if="chatWebsite.userpic"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="api/users/{{chatWebsite.id}}/avatar" /></td>\n <td md-cell ng-if="!chatWebsite.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="id ">{{chatWebsite.id}}</td>\n <td ng-click="vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="name ">{{chatWebsite.name}}</td>\n <td ng-click="vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="key ">{{chatWebsite.key}}</td>\n <td ng-click="vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="address ">{{chatWebsite.address}}</td>\n <td ng-click="vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="remote ">{{chatWebsite.remote}}</td>\n <td ng-click="vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="description ">{{chatWebsite.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(chatWebsite, $event)" translate="CHAT.EDIT_CHATWEBSITE">\n Edit ChatWebsite\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(chatWebsite, $event)" translate="CHAT.INTERACTIONS_CHATWEBSITE">\n Interactions ChatWebsite\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.offlinemessagesgoto(chatWebsite, $event)" translate="CHAT.OFFLINEMESSAGES_CHATWEBSITE">\n OfflineMessages ChatWebsite\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(chatWebsite, $event)" translate="CHAT.DELETE_CHATWEBSITE">\n Delete ChatWebsite\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.chatWebsites.count}}" md-on-paginate="vm.getChatWebsites" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHATWEBSITE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHATWEBSITE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-chatWebsite-button" ng-click="vm.createOrEditChatWebsite($event)" aria-label="add chatWebsite" translate translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHATWEBSITE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/create/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus ng-disabled="!vm.newChatWebsite">\n <div ng-messages="chatWebsiteForm[\'name\'].$error" ng-show="chatWebsiteForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">key</label>\n <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true">\n <div ng-messages="chatWebsiteForm[\'key\'].$error" ng-show="chatWebsiteForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true">\n <div ng-messages="chatWebsiteForm[\'address\'].$error" ng-show="chatWebsiteForm[\'address\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.chatWebsite.remote" md-maxlength="255" ng-required="true">\n <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="chatWebsiteForm[\'remote\'].$error" ng-show="chatWebsiteForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LIST">List</label>\n <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n <div ng-messages="chatWebsiteForm[\'ListId\'].$error" ng-show="chatWebsiteForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId">\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval">{{ IntervalId.name }}</md-option>\n <md-option ng-value="null">Always</md-option>\n </md-select>\n <div ng-messages="chatWebsiteForm[\'IntervalId\'].$error" ng-show="chatWebsiteForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatWebsite.description">\n <div ng-messages="chatWebsiteForm[\'description\'].$error" ng-show="chatWebsiteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newChatWebsite" ng-click="vm.saveChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid || chatWebsiteForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newChatWebsite" ng-click="vm.addNewChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATWEBSITE" translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n ADD CHATWEBSITE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newChatWebsite" ng-click="vm.deleteChatWebsite($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/agent/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" required autofocus>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'agent\'].$error" ng-show="chatWebsiteFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/autoreply/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" required autofocus>\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'times\'].$error" ng-show="chatWebsiteFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" md-maxlength="255" required></textarea>\n\n <div ng-messages="chatWebsiteFormApp[\'text\'].$error" ng-show="chatWebsiteFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.TEXT_MAX_LENGTH" translate-values=\'{max: 255}\'>Text must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/close/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus>\n <div ng-messages="chatWebsiteFormApp[\'disposition\'].$error" ng-show="chatWebsiteFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotoif/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus>\n <div ng-messages="chatWebsiteFormApp[\'condition\'].$error" ng-show="chatWebsiteFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true">\n <div ng-messages="chatWebsiteFormApp[\'truepriority\'].$error" ng-show="chatWebsiteFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true">\n <div ng-messages="chatWebsiteFormApp[\'falsepriority\'].$error" ng-show="chatWebsiteFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus>\n <div ng-messages="chatWebsiteFormApp[\'priority\'].$error" ng-show="chatWebsiteFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/noop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus>\n <div ng-messages="chatWebsiteFormApp[\'value\'].$error" ng-show="chatWebsiteFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/queue/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" required autofocus>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'queue\'].$error" ng-show="chatWebsiteFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/system/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus>\n <div ng-messages="chatWebsiteFormApp[\'command\'].$error" ng-show="chatWebsiteFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable">\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables">{{ variable.name }}</md-option>\n <md-option ng-value="\'\'">None</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'variable\'].$error" ng-show="chatWebsiteFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",'<md-dialog class="chatCannedAnswer-dialog" aria-label="New ChatCannedAnswer">\n <form name="chatCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">Key</label>\n <input type="" name="key" ng-model="vm.chatCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n <div ng-messages="chatCannedAnswerForm[\'key\'].$error" ng-show="chatCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.VALUE">Value</label>\n <textarea name="value" ng-model="vm.chatCannedAnswer.value" required></textarea>\n\n <div ng-messages="chatCannedAnswerForm[\'value\'].$error" ng-show="chatCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatCannedAnswer.description">\n <div ng-messages="chatCannedAnswerForm[\'description\'].$error" ng-show="chatCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newChatCannedAnswer" ng-click="vm.saveChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid || chatCannedAnswerForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE"\n translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newChatCannedAnswer" ng-click="vm.addNewChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATCANNEDANSWER" translate-attr-aria-label="CHAT.ADD_CHATCANNEDANSWER">\n ADD CHATCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newChatCannedAnswer" ng-click="vm.deleteChatCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/chatDispositions/dialog.html",'<md-dialog class="chatDisposition-dialog" aria-label="New ChatDisposition">\n <form name="chatDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="" name="name" ng-model="vm.chatDisposition.name" md-maxlength="255" ng-required="true" autofocus>\n <div ng-messages="chatDispositionForm[\'name\'].$error" ng-show="chatDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newChatDisposition" ng-click="vm.saveChatDisposition()" class="send-button md-accent md-raised" ng-disabled="chatDispositionForm.$invalid || chatDispositionForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newChatDisposition" ng-click="vm.addNewChatDisposition()" class="send-button md-accent md-raised" ng-disabled="chatDispositionForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATDISPOSITION" translate-attr-aria-label="CHAT.ADD_CHATDISPOSITION">\n ADD CHATDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newChatDisposition" ng-click="vm.deleteChatDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",'<md-dialog class="offlineMessage-dialog" aria-label="New OfflineMessage">\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-content flex layout-padding>\n <pre>{{vm.message.body}}</pre>\n </md-content>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",'<md-dialog class="chatProactiveAction-dialog" aria-label="New ChatProactiveAction">\n <form name="chatProactiveActionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="" name="name" ng-model="vm.chatProactiveAction.name" ng-required="true" autofocus>\n <div ng-messages="chatProactiveActionForm[\'name\'].$error" ng-show="chatProactiveActionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TYPE">Type</label>\n <md-select name="type" ng-model="vm.chatProactiveAction.type">\n\n <md-option ng-value="\'mouseOver\'"> {{ \'CHAT.MOUSEOVER\' | translate }}</md-option>\n\n <md-option ng-value="\'timeout\'"> {{ \'CHAT.TIMEOUT\' | translate }}</md-option>\n </md-select>\n <div ng-messages="chatProactiveActionForm[\'type\'].$error" ng-show="chatProactiveActionForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatProactiveAction.type === \'mouseOver\'" class="md-block">\n <label translate="CHAT.SELECTOR">Selector</label>\n <input type="" name="selector" ng-model="vm.chatProactiveAction.selector" ng-required="true">\n <div ng-messages="chatProactiveActionForm[\'selector\'].$error" ng-show="chatProactiveActionForm[\'selector\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SELECTOR_REQUIRED">Selector field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatProactiveAction.type === \'timeout\'" class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatProactiveAction.timeout" min="1" ng-required="true">\n <div ng-messages="chatProactiveActionForm[\'timeout\'].$error" ng-show="chatProactiveActionForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newChatProactiveAction" ng-click="vm.saveChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid || chatProactiveActionForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE"\n translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newChatProactiveAction" ng-click="vm.addNewChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATPROACTIVEACTION" translate-attr-aria-label="CHAT.ADD_CHATPROACTIVEACTION">\n ADD CHATPROACTIVEACTION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newChatProactiveAction" ng-click="vm.deleteChatProactiveAction($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/view.html",'<div id="chat-chatWebsite" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-chatWebsites-button md-icon-button" aria-label="Go to chatWebsites" ng-click="vm.gotoChatWebsites()" translate translate-attr-aria-label="CHAT.GO_TO_CHATWEBSITES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="chatWebsite-image" hide-xs>\n <img ng-src="assets/images/business/chatWebsites.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.chatWebsite.id}}\n <span ng-if="vm.chatWebsite.name">{{vm.chatWebsite.name}}</span>\n <span ng-if="vm.chatWebsite.exten">{{vm.chatWebsite.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatWebsite.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveChatWebsite()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (scriptForm.$invalid) || (intervalForm.$invalid) || (appearanceForm.$invalid) || (onlinestatusForm.$invalid) || (offlinestatusForm.$invalid) || (closingformForm.$invalid) || (unmanagedstatusForm.$invalid) || (interactionForm.$invalid) || (whitelabelForm.$invalid) || (logoForm.$invalid) || (agentAvatarForm.$invalid) || (chatFormOnlineForm.$invalid) || (chatFormOfflineForm.$invalid) || (proactiveForm.$invalid) || (chatDispositionsForm.$invalid) || (chatCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid) || (offlineMessagesForm.$invalid)"\n translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus ng-disabled="true">\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">key</label>\n <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true">\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true">\n <div ng-messages="generalForm[\'address\'].$error" ng-show="generalForm[\'address\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LIST">List</label>\n <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.fidelity" class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatWebsite.timeout" ng-required="true">\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.chatWebsite.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatWebsite.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.notificationSound" aria-label="notificationSound"><span translate="CHAT.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.notificationShake" aria-label="notificationShake"><span translate="CHAT.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="CHAT.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.chatWebsite.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container script md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteScriptController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite)" class="content" md-background-bg>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.SCRIPT">SCRIPT</div>\n </div>\n\n <form name="scriptForm" flex="100" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm_ac.chatWebsite.token" autofocus ng-disabled="true">\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm_ac.chatWebsite.remote" required>\n <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="scriptForm[\'remote\'].$error" ng-show="scriptForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">Motion Proxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">Motion Proxy must be a valid url e.g.: http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WEBSITESCRIPT">WebsiteScript</label>\n <div>\n <pre style="font-size: 13px;">\n {{vm_ac.start}} {{vm_ac.script}} {{vm_ac.end}}\n </pre>\n </div>\n <div class="hint"><span translate="CHAT.HELP.COPYSCRIPTTOCLIPBOARD"></span></div>\n </md-input-container>\n </form>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container interval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.INTERVAL">INTERVAL</div>\n </div>\n <form name="intervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId" autofocus>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval">{{ IntervalId.name }}</md-option>\n <md-option ng-value="null">Always</md-option>\n </md-select>\n <div ng-messages="intervalForm[\'IntervalId\'].$error" ng-show="intervalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEZONE">Timezone</label>\n <ms-timezone name="timezone" ng-model="vm.chatWebsite.timezone">\n < <div class="hint"><span translate="CHAT.HELP.TIMEZONE"></span></div>\n <div ng-messages="intervalForm[\'timezone\'].$error" ng-show="intervalForm[timezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SNIPPET">SNIPPET</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container appearance md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.APPEARANCE">APPEARANCE</div>\n </div>\n <form name="appearanceForm" novalidate>\n <div flex md-color-picker ng-model="vm.chatWebsite.color" label="{{\'CHAT.MAINCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false"\n open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.color_button" label="{{\'CHAT.BUTTONCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false"\n open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.textColor" label="{{\'CHAT.TEXTCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false"\n open-on-input="true"></div>\n <md-input-container class="md-block">\n <label translate="CHAT.FONTSIZE">fontSize</label>\n <input type="number" name="fontSize" ng-model="vm.chatWebsite.fontSize" min="0" ng-required="true">\n <div ng-messages="appearanceForm[\'fontSize\'].$error" ng-show="appearanceForm[\'fontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FONTSIZE_REQUIRED">fontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">fontSize must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADERSHAPE">headershape</label>\n <md-select name="header_shape" ng-model="vm.chatWebsite.header_shape">\n\n <md-option ng-value="\'rounded\'"> {{ \'CHAT.ROUNDED\' | translate }}</md-option>\n\n <md-option ng-value="\'squared\'"> {{ \'CHAT.SQUARED\' | translate }}</md-option>\n </md-select>\n <div ng-messages="appearanceForm[\'header_shape\'].$error" ng-show="appearanceForm[\'header_shape\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADERSHAPE_REQUIRED">headershape field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.showAgentAvatar" aria-label="ShowAgentAvatar"><span translate="CHAT.SHOWAGENTAVATAR">ShowAgentAvatar</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container onlinestatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.ONLINESTATUS">ONLINESTATUS</div>\n </div>\n <form name="onlinestatusForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADER_ONLINE">header_online</label>\n <input type="text" name="header_online" ng-model="vm.chatWebsite.header_online" md-maxlength="255" autofocus>\n <div ng-messages="onlinestatusForm[\'header_online\'].$error" ng-show="onlinestatusForm[\'header_online\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADER_ONLINE_REQUIRED">header_online field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.HEADER_ONLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_online must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.START_CHAT_BUTTON">start_chat_button</label>\n <input type="text" name="start_chat_button" ng-model="vm.chatWebsite.start_chat_button" md-maxlength="255">\n <div ng-messages="onlinestatusForm[\'start_chat_button\'].$error" ng-show="onlinestatusForm[\'start_chat_button\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.START_CHAT_BUTTON_REQUIRED">start_chat_button field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.START_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>start_chat_button must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container offlinestatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.OFFLINESTATUS">OFFLINESTATUS</div>\n </div>\n <form name="offlinestatusForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.hideWhenOffline" aria-label="hideWhenOffline"><span translate="CHAT.HIDEWHENOFFLINE">hideWhenOffline</span></md-switch>\n <div class="hint"><span translate="CHAT.HELP.HIDEWHENOFFLINE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADER_OFFLINE">header_offline</label>\n <input type="text" name="header_offline" ng-model="vm.chatWebsite.header_offline" md-maxlength="255">\n <div ng-messages="offlinestatusForm[\'header_offline\'].$error" ng-show="offlinestatusForm[\'header_offline\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADER_OFFLINE_REQUIRED">header_offline field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.HEADER_OFFLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_offline must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINE_CHAT_BUTTON">offline_chat_button</label>\n <input type="text" name="offline_chat_button" ng-model="vm.chatWebsite.offline_chat_button" md-maxlength="255">\n <div ng-messages="offlinestatusForm[\'offline_chat_button\'].$error" ng-show="offlinestatusForm[\'offline_chat_button\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_REQUIRED">offline_chat_button field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>offline_chat_button must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINEMESSAGESUBJECT">offlineMessageSubject</label>\n <input type="text" name="offlineMessageSubject" ng-model="vm.chatWebsite.offlineMessageSubject" md-maxlength="255">\n <div ng-messages="offlinestatusForm[\'offlineMessageSubject\'].$error" ng-show="offlinestatusForm[\'offlineMessageSubject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_REQUIRED">offlineMessageSubject field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageSubject must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINEMESSAGEBODY">offlineMessageBody</label>\n <input type="text" name="offlineMessageBody" ng-model="vm.chatWebsite.offlineMessageBody" md-maxlength="255">\n <div ng-messages="offlinestatusForm[\'offlineMessageBody\'].$error" ng-show="offlinestatusForm[\'offlineMessageBody\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_REQUIRED">offlineMessageBody field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageBody must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container closingform md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.CLOSINGFORM">CLOSINGFORM</div>\n </div>\n <form name="closingformForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGMESSAGE">closingMessage</label>\n <textarea name="closingMessage" ng-model="vm.chatWebsite.closingMessage" md-maxlength="255" required autofocus></textarea>\n\n <div ng-messages="closingformForm[\'closingMessage\'].$error" ng-show="closingformForm[\'closingMessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGE_REQUIRED">closingMessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SKIPMESSAGEBUTTON">skipMessageButton</label>\n <input type="text" name="skipMessageButton" ng-model="vm.chatWebsite.skipMessageButton" md-maxlength="255">\n <div ng-messages="closingformForm[\'skipMessageButton\'].$error" ng-show="closingformForm[\'skipMessageButton\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_REQUIRED">skipMessageButton field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>skipMessageButton must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableRating" aria-label="enableRating"><span translate="CHAT.ENABLERATING">enableRating</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableRating" class="md-block">\n <label translate="CHAT.RATINGTYPE">ratingType</label>\n <md-select name="ratingType" ng-model="vm.chatWebsite.ratingType">\n <md-option ng-value="\'star\'">Star</md-option>\n <md-option ng-value="\'thumb\'">Thumb</md-option>\n </md-select>\n <div ng-messages="closingformForm[\'ratingType\'].$error" ng-show="closingformForm[\'ratingType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.RATINGTYPE_REQUIRED">ratingType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableRating && vm.chatWebsite.ratingType === \'star\'" class="md-block">\n <label translate="CHAT.RATINGSTARSNUMBER">ratingStarsNumber</label>\n <input type="number" name="ratingStarsNumber" ng-model="vm.chatWebsite.ratingStarsNumber" min="2" max="5" ng-required="true">\n <div ng-messages="closingformForm[\'ratingStarsNumber\'].$error" ng-show="closingformForm[\'ratingStarsNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_REQUIRED">ratingStarsNumber field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>2</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableFeedback" aria-label="enableFeedback"><span translate="CHAT.ENABLEFEEDBACK">enableFeedback</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.forwardTranscript" aria-label="forwardTranscript"><span translate="CHAT.FORWARDTRANSCRIPT">forwardTranscript</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.forwardTranscript" class="md-block">\n <label translate="CHAT.FORWARDTRANSCRIPTMESSAGE">forwardTranscriptMessage</label>\n <input type="text" name="forwardTranscriptMessage" ng-model="vm.chatWebsite.forwardTranscriptMessage" md-maxlength="255">\n <div ng-messages="closingformForm[\'forwardTranscriptMessage\'].$error" ng-show="closingformForm[\'forwardTranscriptMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_REQUIRED">forwardTranscriptMessage field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>forwardTranscriptMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGMESSAGEBUTTON">closingMessageButton</label>\n <input type="text" name="closingMessageButton" ng-model="vm.chatWebsite.closingMessageButton" md-maxlength="255" ng-required="true">\n <div ng-messages="closingformForm[\'closingMessageButton\'].$error" ng-show="closingformForm[\'closingMessageButton\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_REQUIRED">closingMessageButton field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessageButton must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container unmanagedstatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.UNMANAGEDSTATUS">UNMANAGEDSTATUS</div>\n </div>\n <form name="unmanagedstatusForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.autoclose" aria-label="autoclose"><span translate="CHAT.AUTOCLOSE">autoclose</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableUnmanagedNote" aria-label="enableUnmanagedNote"><span translate="CHAT.ENABLEUNMANAGEDNOTE">enableUnmanagedNote</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.UNMANAGEDMESSAGE">unmanagedMessage</label>\n <input type="text" name="unmanagedMessage" ng-model="vm.chatWebsite.unmanagedMessage" md-maxlength="255">\n <div ng-messages="unmanagedstatusForm[\'unmanagedMessage\'].$error" ng-show="unmanagedstatusForm[\'unmanagedMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_REQUIRED">unmanagedMessage field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>unmanagedMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SKIPUNMANAGED">skipUnmanaged</label>\n <input type="text" name="skipUnmanaged" ng-model="vm.chatWebsite.skipUnmanaged" md-maxlength="255">\n <div ng-messages="unmanagedstatusForm[\'skipUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'skipUnmanaged\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SKIPUNMANAGED_REQUIRED">skipUnmanaged field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SKIPUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>skipUnmanaged must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableUnmanagedNote" class="md-block">\n <label translate="CHAT.SENDUNMANAGED">sendUnmanaged</label>\n <input type="text" name="sendUnmanaged" ng-model="vm.chatWebsite.sendUnmanaged" md-maxlength="255" ng-required="true">\n <div ng-messages="unmanagedstatusForm[\'sendUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'sendUnmanaged\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SENDUNMANAGED_REQUIRED">sendUnmanaged field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SENDUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>sendUnmanaged must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container interaction md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.INTERACTION">INTERACTION</div>\n </div>\n <form name="interactionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENTIDENTIFIER">agentIdentifier</label>\n <md-select name="agentIdentifier" ng-model="vm.chatWebsite.agentIdentifier" autofocus>\n\n <md-option ng-value="\'website_alias\'"> {{ \'CHAT.WEBSITEALIAS\' | translate }}</md-option>\n\n <md-option ng-value="\'agent_alias\'"> {{ \'CHAT.AGENTALIAS\' | translate }}</md-option>\n\n <md-option ng-value="\'agent_fullname\'"> {{ \'CHAT.AGENTFULLNAME\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.AGENTIDENTIFIER"></span></div>\n <div ng-messages="interactionForm[\'agentIdentifier\'].$error" ng-show="interactionForm[\'agentIdentifier\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENTIDENTIFIER_REQUIRED">agentIdentifier field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.agentIdentifier === \'website_alias\'" class="md-block">\n <label translate="CHAT.WEBSITEALIAS">WebsiteAlias</label>\n <input type="text" name="agentAlias" ng-model="vm.chatWebsite.agentAlias" md-maxlength="255">\n <div class="hint"><span translate="CHAT.HELP.WEBSITEALIAS"></span></div>\n <div ng-messages="interactionForm[\'agentAlias\'].$error" ng-show="interactionForm[\'agentAlias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WEBSITEALIAS_REQUIRED">WebsiteAlias field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WEBSITEALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>WebsiteAlias must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGQUESTION">closingQuestion</label>\n <input type="text" name="closingQuestion" ng-model="vm.chatWebsite.closingQuestion" md-maxlength="255">\n <div ng-messages="interactionForm[\'closingQuestion\'].$error" ng-show="interactionForm[\'closingQuestion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGQUESTION_REQUIRED">closingQuestion field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGQUESTION_MAX_LENGTH" translate-values=\'{max: 255}\'>closingQuestion must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FORMSUBMITSUCCESSMESSAGE">formSubmitSuccessMessage</label>\n <input type="text" name="formSubmitSuccessMessage" ng-model="vm.chatWebsite.formSubmitSuccessMessage" md-maxlength="255">\n <div ng-messages="interactionForm[\'formSubmitSuccessMessage\'].$error" ng-show="interactionForm[\'formSubmitSuccessMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_REQUIRED">formSubmitSuccessMessage field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitSuccessMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FORMSUBMITFAILUREMESSAGE">formSubmitFailureMessage</label>\n <input type="text" name="formSubmitFailureMessage" ng-model="vm.chatWebsite.formSubmitFailureMessage" md-maxlength="255">\n <div ng-messages="interactionForm[\'formSubmitFailureMessage\'].$error" ng-show="interactionForm[\'formSubmitFailureMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_REQUIRED">formSubmitFailureMessage field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitFailureMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerWriting" aria-label="enableCustomerWriting"><span translate="CHAT.ENABLECUSTOMERWRITING">enableCustomerWriting</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n <label translate="CHAT.WAITINGTITLE">waitingTitle</label>\n <input type="text" name="waitingTitle" ng-model="vm.chatWebsite.waitingTitle" md-maxlength="255" ng-required="true">\n <div ng-messages="interactionForm[\'waitingTitle\'].$error" ng-show="interactionForm[\'waitingTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITINGTITLE_REQUIRED">waitingTitle field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WAITINGTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingTitle must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n <label translate="CHAT.WAITINGMESSAGE">waitingMessage</label>\n <textarea name="waitingMessage" ng-model="vm.chatWebsite.waitingMessage" md-maxlength="255" required></textarea>\n\n <div ng-messages="interactionForm[\'waitingMessage\'].$error" ng-show="interactionForm[\'waitingMessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITINGMESSAGE_REQUIRED">waitingMessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WAITINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.NOTETITLE">noteTitle</label>\n <input type="text" name="noteTitle" ng-model="vm.chatWebsite.noteTitle" md-maxlength="255">\n <div ng-messages="interactionForm[\'noteTitle\'].$error" ng-show="interactionForm[\'noteTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NOTETITLE_REQUIRED">noteTitle field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.NOTETITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>noteTitle must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.PLACEHOLDERMESSAGE">placeholderMessage</label>\n <input type="text" name="placeholderMessage" ng-model="vm.chatWebsite.placeholderMessage" md-maxlength="255">\n <div ng-messages="interactionForm[\'placeholderMessage\'].$error" ng-show="interactionForm[\'placeholderMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_REQUIRED">placeholderMessage field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>placeholderMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.download_transcript" aria-label="downloadTranscript"><span translate="CHAT.DOWNLOADTRANSCRIPT">downloadTranscript</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerAttachment" aria-label="enableCustomerAttachment"><span translate="CHAT.ENABLECUSTOMERATTACHMENT">enableCustomerAttachment</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container whitelabel md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.WHITELABEL">WHITELABEL</div>\n </div>\n <form name="whitelabelForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.defaultWhiteLabel" aria-label="default"><span translate="CHAT.DEFAULT">default</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.defaultWhiteLabel" class="md-block">\n <label translate="CHAT.WHITELABEL">whiteLabel</label>\n <textarea name="whiteLabel" ng-model="vm.chatWebsite.whiteLabel" md-maxlength="255" required></textarea>\n\n <div ng-messages="whitelabelForm[\'whiteLabel\'].$error" ng-show="whitelabelForm[\'whiteLabel\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WHITELABEL_REQUIRED">whiteLabel field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WHITELABEL_MAX_LENGTH" translate-values=\'{max: 255}\'>whiteLabel must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container logo md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.LOGO">LOGO</div>\n </div>\n <div ng-controller="ChatWebsitelogoController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()"\n flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logoimage in vm_ca.chatWebsite.images" ng-switch="logoimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logoimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logoimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container agentavatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.AGENTAVATAR">AGENTAVATAR</div>\n </div>\n <div ng-controller="ChatWebsiteagentAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()"\n flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="agentAvatarimage in vm_ca.chatWebsite.images" ng-switch="agentAvatarimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{agentAvatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="agentAvatarimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{agentAvatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ONLINE">ONLINE</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatformonline md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteonlineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n <div flex>\n \x3c!-- START Buttons --\x3e\n <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n <md-icon md-font-icon="{{button.icon}}"></md-icon>\n </md-button>\n \x3c!-- END Buttons --\x3e\n </div>\n\n <div layout="row" flex>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n\n <form name="onlineForm" novalidate>\n\n \x3c!-- START MapKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.mapKey">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END MapKey --\x3e\n\n \x3c!-- START FromKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.onlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.onlineForm.fromKey != null ? vm_fonc.chatWebsite.onlineForm.items[vm_fonc.chatWebsite.onlineForm.fromKey].props.title : \'None\'">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n </md-select>\n </md-input-container>\n \x3c!-- END FromKey --\x3e\n\n \x3c!-- START EXPANSION PANELS --\x3e\n <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items track by $index" md-component-id="{{\'onlinePanel\' + $index}}">\n <md-expansion-panel-collapsed md-no-sticky="true">\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-down"></md-icon>\n </md-button>\n </md-expansion-panel-collapsed>\n\n <md-expansion-panel-expanded>\n <md-expansion-panel-header>\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n\n <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-up"></md-icon>\n </md-button>\n </md-expansion-panel-header>\n\n <md-expansion-panel-content>\n <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n <md-input-container class="md-block">\n <label translate="CHAT.VARIABLE">Variable</label>\n <md-select ng-model="item.variable">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="variable in vm_fonc.variables" ng-value="variable.name">{{ variable.name }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n <md-select ng-model="item.cmField">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-expansion-panel-content>\n\n </md-expansion-panel-expanded>\n </md-expansion-panel>\n \x3c!-- END EXPANSION PANELS --\x3e\n </form>\n\n </md-card-content>\n </md-card>\n </div>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content flex>\n <form-view form="vm_fonc.chatWebsite.onlineForm" flex="100"></form-view>\n </md-card-content>\n </md-card>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.OFFLINE">OFFLINE</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatformoffline md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteofflineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n <div flex>\n \x3c!-- START Buttons --\x3e\n <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n <md-icon md-font-icon="{{button.icon}}"></md-icon>\n </md-button>\n \x3c!-- END Buttons --\x3e\n </div>\n\n <div layout="row" flex>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n\n <form name="offlineForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm_fonc.chatWebsite.forwardOffline" aria-label="forwardOffline"><span translate="CHAT.FORWARD_OFFLINE">forwardOffline</span></md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.forwardOffline">\n <label translate="CHAT.FORWARD_OFFLINE_ADDRESS">FORWARD OFFLINE ADDRESS</label>\n <input type="text" name="forwardOfflineAddress" ng-model="vm_fonc.chatWebsite.forwardOfflineAddress">\n <div class="hint"><span translate="CHAT.HELP.FORWARD_OFFLINE"></span></div>\n <div ng-messages="offlineForm[\'forwardOfflineAddress\'].$error" ng-show="offlineForm[\'forwardOfflineAddress\'].$touched" role="alert">\n <div ng-message="email">\n <span translate="CHAT.ERRORS.EMAIL_MUST_BE_VALID">forwardOffline must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- START MapKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.mapKeyOffline">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END MapKey --\x3e\n\n \x3c!-- START FromKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.offlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.offlineForm.fromKey != null ? vm_fonc.chatWebsite.offlineForm.items[vm_fonc.chatWebsite.offlineForm.fromKey].props.title : \'None\'">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n </md-select>\n </md-input-container>\n \x3c!-- END FromKey --\x3e\n\n \x3c!-- START EXPANSION PANELS --\x3e\n <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items track by $index" md-component-id="{{\'offlinePanel\' + $index}}">\n <md-expansion-panel-collapsed md-no-sticky="true">\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-down"></md-icon>\n </md-button>\n </md-expansion-panel-collapsed>\n\n <md-expansion-panel-expanded>\n <md-expansion-panel-header>\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n\n <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-up"></md-icon>\n </md-button>\n </md-expansion-panel-header>\n\n <md-expansion-panel-content>\n <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n\n <md-input-container class="md-block">\n <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n <md-select ng-model="item.cmField">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-expansion-panel-content>\n\n </md-expansion-panel-expanded>\n </md-expansion-panel>\n \x3c!-- END EXPANSION PANELS --\x3e\n </form>\n\n </md-card-content>\n </md-card>\n </div>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content flex>\n <form-view form="vm_fonc.chatWebsite.offlineForm" flex="100"></form-view>\n </md-card-content>\n </md-card>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.PROACTIVEACTIONS">PROACTIVEACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container proactive md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteProactiveActionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteProactiveActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.PROACTIVEACTIONS">ProactiveActions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event)" aria-label="add chatProactiveAction" translate translate-attr-label="CHAT.ADD_CHATPROACTIVEACTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteProactiveActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteProactiveActions.length}} {{vm_dc.selectedChatWebsiteProactiveActions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteProactiveActions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteProactiveActions($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteProactiveActions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteProactiveActions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'CHAT.TYPE\' | translate }}</th>\n <th md-column md-order-by="selector">{{ \'CHAT.SELECTOR\' | translate }}</th>\n <th md-column md-order-by="timeout">{{ \'CHAT.TIMEOUT\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatProactiveAction" md-select-id="id" ng-repeat="chatProactiveAction in vm_dc.chatWebsiteProactiveActions.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.id}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.name}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{ \'CHAT.\' + vm_dc.arraytype[chatProactiveAction.type].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.selector}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.timeout}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" translate="CHAT.EDIT_CHATPROACTIVEACTION">\n Edit ChatProactiveAction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(chatProactiveAction, $event)" translate="CHAT.DELETE_CHATPROACTIVEACTION">\n Delete ChatProactiveAction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteProactiveActions.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="CHAT.NO_CHATPROACTIVEACTION_AVAILABLE">No chatproactiveaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.chatWebsiteProactiveActions.count}}" md-on-paginate="vm_dc.getChatWebsiteProactiveActions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatdispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteChatDispositionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteChatDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.CHATDISPOSITIONS">ChatDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event)" aria-label="add chatDisposition" translate translate-attr-label="CHAT.ADD_CHATDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteChatDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteChatDispositions.length}} {{vm_dc.selectedChatWebsiteChatDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteChatDispositions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteChatDispositions($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteChatDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteChatDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatDisposition" md-select-id="id" ng-repeat="chatDisposition in vm_dc.chatWebsiteChatDispositions.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" md-cell>{{chatDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" md-cell>{{chatDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" md-cell>{{chatDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" translate="CHAT.EDIT_CHATDISPOSITION">\n Edit ChatDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(chatDisposition, $event)" translate="CHAT.DELETE_CHATDISPOSITION">\n Delete ChatDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteChatDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="CHAT.NO_CHATDISPOSITION_AVAILABLE">No chatdisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.chatWebsiteChatDispositions.count}}" md-on-paginate="vm_dc.getChatWebsiteChatDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteChatCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.CHATCANNEDANSWERS">ChatCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event)" aria-label="add chatCannedAnswer" translate translate-attr-label="CHAT.ADD_CHATCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteChatCannedAnswers.length}} {{vm_dc.selectedChatWebsiteChatCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteChatCannedAnswers" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteChatCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteChatCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteChatCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'CHAT.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'CHAT.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatCannedAnswer" md-select-id="id" ng-repeat="chatCannedAnswer in vm_dc.chatWebsiteChatCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.value}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" translate="CHAT.EDIT_CHATCANNEDANSWER">\n Edit ChatCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(chatCannedAnswer, $event)" translate="CHAT.DELETE_CHATCANNEDANSWER">\n Delete ChatCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteChatCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="CHAT.NO_CHATCANNEDANSWER_AVAILABLE">No chatcannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.chatWebsiteChatCannedAnswers.count}}" md-on-paginate="vm_dc.getChatWebsiteChatCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteActionsController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="CHAT.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedChatWebsiteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedChatWebsiteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedChatWebsiteApps.length}} {{vm_ac.selectedChatWebsiteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedChatWebsiteApps($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedChatWebsiteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.chatWebsiteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editChatWebsiteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.chatWebsiteApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteInteractionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getChatWebsiteInteractions()" aria-label="refresh Interactions" translate translate-attr-label="CHAT.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteInteractions.length}} {{vm_dc.selectedChatWebsiteInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteInteractions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteInteractions($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.STARTEDAT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'CHAT.CLOSEDAT\' | translate }}</th>\n <th md-column>{{ \'CHAT.CONTACT\' | translate }}</th>\n <th md-column>{{ \'CHAT.AGENT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'CHAT.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="ratingValue">{{ \'CHAT.RATING\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'CHAT.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'CHAT.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.chatWebsiteInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="interaction.ratingValue != null && (!interaction.ratingType || interaction.ratingType == \'star\')" ng-repeat="ratingValue in [1,2,3,4,5] | limitTo:interaction.ratingValue"></md-icon>\n <md-icon md-font-icon="icon-thumb-up" style="color:green" ng-show="interaction.ratingValue != null && interaction.ratingType && interaction.ratingType == \'thumb\' && interaction.ratingValue == 1"></md-icon>\n <md-icon md-font-icon="icon-thumb-down" style="color:red" ng-show="interaction.ratingValue != null && interaction.ratingType && interaction.ratingType == \'thumb\' && interaction.ratingValue == 0"></md-icon><span ng-show="interaction.ratingValue == null" translate="CHAT.NO_RATINGVALUE">No ratingValue</span></td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spychatInteraction($event, interaction)" translate="CHAT.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="CHAT.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteInteractions.rows.length">\n <td md-cell colspan="15">\n <span class="text-boxed-ligth" translate="CHAT.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.chatWebsiteInteractions.count}}" md-on-paginate="vm_dc.getChatWebsiteInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.OFFLINEMESSAGES">OFFLINEMESSAGES</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container offlinemessages md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteOfflineMessagesController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteOfflineMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.OFFLINEMESSAGES">OfflineMessages</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteOfflineMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteOfflineMessages.length}} {{vm_dc.selectedChatWebsiteOfflineMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteOfflineMessages" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteOfflineMessages($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteOfflineMessages" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteOfflineMessages">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'CHAT.CONTACT\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="offlineMessage" md-select-id="id" ng-repeat="offlineMessage in vm_dc.chatWebsiteOfflineMessages.rows">\n <td md-cell>{{offlineMessage.id}}</td>\n <td md-cell>{{ ContactId = vm_dc.contacts[offlineMessage.ContactId]; ContactId.firstName }}</td>\n <td md-cell>{{offlineMessage.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.showOfflineMessageChatWebsiteOfflineMessage($event, offlineMessage)" translate="CHAT.SHOW_OFFLINEMESSAGE">\n SHOW OfflineMessage\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(offlineMessage, $event)" translate="CHAT.DELETE_OFFLINEMESSAGE">\n Delete OfflineMessage\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteOfflineMessages.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="CHAT.NO_OFFLINEMESSAGE_AVAILABLE">No offlinemessage available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.chatWebsiteOfflineMessages.count}}" md-on-paginate="vm_dc.getChatWebsiteOfflineMessages" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n</div>\n\x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'CHAT.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'CHAT.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'CHAT.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'CHAT.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'CHAT.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="3">{{ \'CHAT.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n \x3c!-- <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSE\' | translate }}</th>\n <th md-column width="10px"></th> --\x3e\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'CHAT.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'CHAT.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatusTime">{{ \'CHAT.TIMER\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'CHAT.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'busy\':\'indigo-100-bg\',\'*pause\':\'amber-50-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].globalStatus]">{{ vm.isPause(vm.agents[value].globalStatus) ? \'\' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? \'*\'+vm.agents[value].pauseType || \'DEFAULT PAUSE\' : vm.agents[value].pauseType || \'DEFAULT PAUSE\') : \'\'}}</span>\n </td>\n <td class="bt custom-column">\n <timer start-time="vm.agents[value].globalStatusTime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class="bt bl">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'talking\':\'indigo-100-bg\',\'ringing\':\'orange-400-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt bl">\n <div layout="column">\n <span ng-if="vm.agents[value].queue" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].queue }}</span>\n <span ng-if="vm.agents[value].destconnectedlinenum" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class="padding-5" ng-if="vm.agents[value].queue || vm.agents[value].destconnectedlinenum">\n <timer start-time="vm.agents[value].voiceStatusTime" interval="1000" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n \x3c!-- <td class="bt">--</td>\n <td class="bt">--</td> --\x3e\n <td class="bt bl" ng-if="vm.license.chat">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n \x3c!-- <td class="bt padding-5 text-center">{{ agent.chatCurrentCapacity }}/{{ agent.chatCapacity > 0 ? agent.chatCapacity : \'∞\' }}</td> --\x3e\n <td md-number class="bt text-center font-size-20" ng-if="vm.license.chat" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.mail">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.mail" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.messaging">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.messaging" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.openchannel">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">4</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">89</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.openchannel" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.fax">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">7</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">2</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.fax" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class="bl bt padding-5 text-center">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.logout(vm.agents[value], $event)" translate="CHAT.LOGOUT">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.queueAdd(vm.agents[value], $event)" translate="CHAT.AGENTADD_QUEUE">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="CHAT.PAUSE">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=" vm.agents[value].voicePause && \'DEFAULT PAUSE\' === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value])"><em translate="CHAT.DEFAULT_PAUSE">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.pauses.rows.length" ng-repeat="pause in vm.pauses.rows">\n <md-button ng-disabled="vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value], pause.name)">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="vm.isPause(vm.agents[value].globalStatus)">\n <md-button ng-click="vm.unPause(vm.agents[value])" translate="CHAT.UNPAUSE">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.filteredAgents.length}}" md-on-paginate="vm.onInit" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/chat/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column>{{ \'CHAT.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'CHAT.PAUSED\' | translate }}</th>\n <th md-column>{{ \'CHAT.READY\' | translate }}</th>\n <th md-column>{{ \'CHAT.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditChatQueue($event, vm.queues[value])" translate="CHAT.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="CHAT.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/chat/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/companies.html",'<div id="companies" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.COMPANIES">Companies</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCompanies.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCompanies =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-companies-count">\n <span>{{vm.selectedCompanies.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="COMPANIES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCompanies()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCompanies()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCompanies" csv-label="true" filename="companies.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedCompanies($event)" aria-label="delete selected" translate translate-attr-label="COMPANIES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- COMPANY TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCompanies" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCompanies">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.companies.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="company" md-select-id="id" ng-repeat="company in vm.companies.rows">\n <td md-cell ng-if="company.userpic"><img class="avatar" alt="{{company.name}}" ng-src="api/users/{{company.id}}/avatar" /></td>\n <td md-cell ng-if="!company.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{company.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditCompany($event, company)" md-cell class="id ">{{company.id}}</td>\n <td ng-click="vm.createOrEditCompany($event, company)" md-cell class="name ">{{company.name}}</td>\n <td ng-click="vm.createOrEditCompany($event, company)" md-cell class="description ">{{company.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(company, $event)" translate="CONTACTMANAGER.EDIT_COMPANY">\n Edit Company\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotocontactsgoto(company, $event)" translate="CONTACTMANAGER.GOTOCONTACTS_COMPANY">\n goToContacts Company\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(company, $event)" translate="CONTACTMANAGER.DELETE_COMPANY">\n Delete Company\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.companies.count}}" md-on-paginate="vm.getCompanies" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / COMPANY TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD COMPANY BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-company-button" ng-click="vm.createOrEditCompany($event)" aria-label="add company" translate translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD COMPANY BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/create/dialog.html",'<md-dialog class="company-dialog" aria-label="New Company">\n <form name="companyForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus>\n <div ng-messages="companyForm[\'name\'].$error" ng-show="companyForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.company.phone">\n <div ng-messages="companyForm[\'phone\'].$error" ng-show="companyForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.VAT">Vat</label>\n <input type="text" name="vat" ng-model="vm.company.vat">\n <div ng-messages="companyForm[\'vat\'].$error" ng-show="companyForm[\'vat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.company.fax">\n <div ng-messages="companyForm[\'fax\'].$error" ng-show="companyForm[\'fax\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n <input type="text" name="companyId" ng-model="vm.company.companyId">\n <div ng-messages="companyForm[\'companyId\'].$error" ng-show="companyForm[\'companyId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.company.type">\n <div ng-messages="companyForm[\'type\'].$error" ng-show="companyForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255">\n <div ng-messages="companyForm[\'website\'].$error" ng-show="companyForm[\'website\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n <input type="text" name="emailDomain" ng-model="vm.company.emailDomain">\n <div ng-messages="companyForm[\'emailDomain\'].$error" ng-show="companyForm[\'emailDomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.company.email">\n <div ng-messages="companyForm[\'email\'].$error" ng-show="companyForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.company.description">\n <div ng-messages="companyForm[\'description\'].$error" ng-show="companyForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newCompany" ng-click="vm.saveCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid || companyForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newCompany" ng-click="vm.addNewCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_COMPANY" translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n ADD COMPANY\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newCompany" ng-click="vm.deleteCompany($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/companies/edit/view.html",'<div id="contactmanager-company" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-companies-button md-icon-button" aria-label="Go to companies" ng-click="vm.gotoCompanies()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_COMPANIES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="company-image" hide-xs>\n <img ng-src="assets/images/business/companies.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.company.id}}\n <span ng-if="vm.company.name">{{vm.company.name}}</span>\n <span ng-if="vm.company.exten">{{vm.company.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.company.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.company, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="CONTACTMANAGER.GOTO_COMPANY"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveCompany()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (addressForm.$invalid) || (shipmentAddressForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.GENERAL">GENERAL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="company-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.company.phone">\n <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.VAT">Vat</label>\n <input type="text" name="vat" ng-model="vm.company.vat">\n <div ng-messages="generalForm[\'vat\'].$error" ng-show="generalForm[\'vat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.company.fax">\n <div ng-messages="generalForm[\'fax\'].$error" ng-show="generalForm[\'fax\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n <input type="text" name="companyId" ng-model="vm.company.companyId">\n <div ng-messages="generalForm[\'companyId\'].$error" ng-show="generalForm[\'companyId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.company.type">\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255">\n <div ng-messages="generalForm[\'website\'].$error" ng-show="generalForm[\'website\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n <input type="text" name="emailDomain" ng-model="vm.company.emailDomain">\n <div ng-messages="generalForm[\'emailDomain\'].$error" ng-show="generalForm[\'emailDomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.company.email">\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.company.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.ADDRESS">ADDRESS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="company-detail-form-container address md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.ADDRESS">ADDRESS</div>\n </div>\n <form name="addressForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.company.street" autofocus>\n <div ng-messages="addressForm[\'street\'].$error" ng-show="addressForm[\'street\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n <input type="text" name="postalCode" ng-model="vm.company.postalCode">\n <div ng-messages="addressForm[\'postalCode\'].$error" ng-show="addressForm[\'postalCode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.company.city">\n <div ng-messages="addressForm[\'city\'].$error" ng-show="addressForm[\'city\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="country" ng-model="vm.company.country">\n <div ng-messages="addressForm[\'country\'].$error" ng-show="addressForm[\'country\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="company-detail-form-container shipmentaddress md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</div>\n </div>\n <form name="shipmentAddressForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="sStreet" ng-model="vm.company.sStreet" autofocus>\n <div ng-messages="shipmentAddressForm[\'sStreet\'].$error" ng-show="shipmentAddressForm[\'sStreet\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n <input type="text" name="sPostalCode" ng-model="vm.company.sPostalCode">\n <div ng-messages="shipmentAddressForm[\'sPostalCode\'].$error" ng-show="shipmentAddressForm[\'sPostalCode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="sCity" ng-model="vm.company.sCity">\n <div ng-messages="shipmentAddressForm[\'sCity\'].$error" ng-show="shipmentAddressForm[\'sCity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="sCountry" ng-model="vm.company.sCountry">\n <div ng-messages="shipmentAddressForm[\'sCountry\'].$error" ng-show="shipmentAddressForm[\'sCountry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/contacts.html",'<div id="contacts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.CONTACTS">Contacts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedContacts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedContacts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-contacts-count">\n <span>{{vm.selectedContacts.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllContacts()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectContacts()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedContacts" csv-label="true" filename="contacts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm.deleteSelectedContacts($event)" aria-label="delete selected" translate translate-attr-label="CONTACTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n <div layout="row">\n <div class="column" flex="20">\n <md-card>\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm.selectedList = null; vm.selectedCompany = null; vm.selectedTags = []"><md-icon md-font-icon="icon-refresh"></md-icon>{{ \'CONTACTMANAGER.ALL_CONTACTS\' | translate }}</button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_LIST">Select a list</label>\n <md-select placeholder="Select a list" ng-model="vm.selectedList">\n <md-optgroup label="Lists">\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_COMPANY">Select a company</label>\n <md-select placeholder="Select a companie" flex="100" ng-model="vm.selectedCompany">\n <md-optgroup label="Companies">\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_TAGS">Select one or more tags</label>\n <md-select placeholder="Select one or more tags" flex="100" ng-model="vm.selectedTags" multiple>\n <md-optgroup label="Tags">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags.rows">{{tag.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n\n\n \x3c!-- USER TABLE --\x3e\n <md-card flex="80">\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedContacts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="firstName">{{\'CONTACTMANAGER.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'CONTACTMANAGER.PHONE\' | translate}}</th>\n <th md-column md-order-by="email">{{\'CONTACTMANAGER.EMAIL\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'CONTACTMANAGER.LIST\' | translate}}</th>\n <th md-column md-order-by="CompanyId">{{\'CONTACTMANAGER.COMPANY\' | translate}}</th>\n <th md-column md-order-by="tags">{{\'CONTACTMANAGER.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="contact" md-select-id="id" ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.createOrEditContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.createOrEditContact($event, contact)" md-cell class="firstName">{{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.createOrEditContact($event, contact)" md-cell class="phone">{{contact.phone}}</td>\n <td ng-click="vm.createOrEditContact($event, contact)" md-cell class="email">{{contact.email}}</td>\n <td ng-click="vm.createOrEditContact($event, contact)" md-cell class="list">{{vm.listsMap[contact.ListId]}}</td>\n <td ng-click="vm.createOrEditContact($event, contact)" md-cell class="company">{{vm.companiesMap[contact.CompanyId]}}</td>\n <td md-cell class="tags">\n <div ng-if="contact.tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.tags">{{tag}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(contact, ev)" translate="CONTACTMANAGER.EDIT_CONTACT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.mergeContact(ev, contact)" translate="CONTACTMANAGER.MERGE_CONTACT">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.duplicateContact(ev, contact)" translate="CONTACTMANAGER.DUPLICATE_CONTACT">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n <md-menu-divider></md-menu-divider>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(contact, ev)" translate="CONTACTMANAGER.DELETE_CONTACT">\n Delete Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USER TABLE --\x3e\n </div>\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USER BUTTON --\x3e\n <md-fab-speed-dial id="add-contact-button" ng-hide="vm.options.hidden" md-direction="up" md-open="vm.options.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm.options.hover }" ng-mouseenter="vm.options.isOpen=true" ng-mouseleave="vm.options.isOpen=false">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-accent">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n \x3c!-- OLD IMPORT --\x3e\n \x3c!-- <md-button class="md-fab md-mini md-warn" ng-click="vm.uploadContacts($event)" aria-label="add contact" translate translate-attr-aria-label="CONTACTMANAGER.UPLOAD_CSV">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.UPLOAD_CSV\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button> --\x3e\n \x3c!-- NEW IMPORT --\x3e\n <md-button class="md-fab md-mini md-warn" flow-btn flow-init="vm.ngFlowOptions" flow-files-submitted="$flow.upload()" flow-file-success="vm.importContacts($file, $message, $flow)" flow-file-added="!!{csv:1}[$file.getExtension()]" aria-label="Select File"\n translate translate-attr-aria-label="CONTACTMANAGER.IMPORT_CONTACTS">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.IMPORT_CONTACTS\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n <md-button class="md-fab md-mini md-accent" ng-click="vm.createOrEditContact($event)" aria-label="add contact" translate translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.ADD_CONTACT\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </md-fab-actions>\n </md-fab-speed-dial>\n \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/create/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="New Contact">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FIRSTNAME">First name</label>\n <input name="firstName" ng-model="vm.contact.firstName" required md-autofocus>\n\n <div ng-messages="contactForm.firstName.$error" ng-show="contactForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LASTNAME">Last name</label>\n <input name="lastName" ng-model="vm.contact.lastName">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input name="phone" ng-model="vm.contact.phone" required>\n\n <div ng-messages="contactForm.phone.$error" ng-show="contactForm.phone.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input name="email" type="email" ng-model="vm.contact.email">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n <input name="mobile" ng-model="vm.contact.mobile">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input name="fax" ng-model="vm.contact.fax">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" ng-disabled="vm.contact.id && vm.contact.ListId" ng-init="vm.getCustomFields(vm.contact.ListId)" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n\n <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div ng-repeat="customField in vm.customFields.rows" class="md-block" ng-switch="customField.type">\n <div ng-switch-when="datetime">\n <label>{{customField.alias}}</label>\n\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-time-picker>\n </div>\n </div>\n\n <div ng-switch-when="select">\n <label>{{customField.alias}}</label>\n\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </div>\n\n <div ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}\n </md-switch>\n </div>\n\n <md-input-container ng-switch-default>\n <label>{{customField.alias}}</label>\n\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n </md-input-container>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.contact.CompanyId">\n <md-optgroup label="Companies">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n\n <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All Fields</md-button>\n </div>\n\n <md-input-container class="md-block" ng-if="vm.allFields" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth"></mdp-date-picker>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="country" ng-model="vm.contact.country">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.NOTES">Notes</label>\n <input type="text" name="description" ng-model="vm.contact.description">\n </md-input-container>\n\n <div ng-if="vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer Fields</md-button>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newContact" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newContact" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n ADD CONTACT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newContact" ng-click="vm.deleteContact($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="{{ \'CONTACTMANAGER.DUPLICATE_CONTACT\' | translate }}">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId">\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-optgroup>\n </md-select>\n\n <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n ADD CONTACT\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="CONTACTMANAGER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="CONTACTMANAGER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_HOPPER" translate-attr-aria-label="CONTACTMANAGER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/view.html",'<div id="cm-contact" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-contacts-button md-icon-button" aria-label="Go to contacts" ng-click="vm.gotoContacts()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_CONTACTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="contact-image" hide-xs>\n <img ng-src="assets/images/business/contacts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.contact.id}} {{vm.contact.firstName}} {{vm.contact.lastName}}\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-if="vm.contact.role && vm.contact.role !== \'admin\'" ng-controller="ContactQueueAddButtonController as vm_contact_qa" ng-cloak>\n <md-fab-speed-dial ng-hide="vm_contact_qa.hidden" md-direction="left" md-open="vm_contact_qa.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm_contact_qa.hover }" ng-mouseenter="vm_contact_qa.isOpen=true" ng-mouseleave="vm_contact_qa.isOpen=false">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n <md-tooltip md-direction="top" md-visible="tooltipVisible">Channels</md-tooltip>\n <md-icon md-font-icon="icon-eye" aria-label="channels"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <div ng-repeat="channel in vm_contact_qa.channels">\n <md-button aria-label="{{channel.name}}" class="md-fab md-raised md-icon-button md-mini" ng-click="vm_contact_qa.openDialog($event, vm.contact, channel)">\n <md-tooltip md-direction="{{channel.direction}}" md-visible="tooltipVisible" md-autohide="false">\n {{channel.name}}\n </md-tooltip>\n <md-icon md-font-icon="{{channel.icon}}" aria-label="{{channel.name}}"></md-icon>\n </md-button>\n </div>\n </md-fab-actions>\n </md-fab-speed-dial>\n </div>\n\n <div>\n <md-button ng-click="vm.duplicateContact($event)" class="md-fab md-warn md-icon-button" aria-label="DUPLICATE">\n <md-icon md-font-icon="icon-file-multiple"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="detailForm.$pristine && customFieldsForm.$pristine" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.DETAIL">DETAIL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div layout="column" flex="70">\n <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="detailForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- fistName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.FIRSTNAME">First Name</label>\n <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required>\n\n <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- lastName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.LASTNAME">Last Name</label>\n <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate">\n </md-input-container>\n\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- phone --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <md-icon md-font-icon="icon-phone"></md-icon>\n <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate" required>\n\n <div ng-messages="detailForm.phone.$error" ng-show="detailForm.phone.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- mobile --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- email --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <md-icon md-font-icon="icon-email" class="email"></md-icon>\n <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate">\n <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- fax --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <input type="text" name="fax" ng-model="vm.contact.fax">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- date of birdth --\x3e\n \x3c!-- <md-input-container class="md-block" flex-gt-sm="">\n <mdp-date-picker mdp-open-on-click name="dateOfBirth" mdp-placeholder="Date Of Birth" mdp-format="YYYY-MM-DD" ng-model="vm.contact.dateOfBirth">\n <div ng-messages="detailForm.dateOfBirth.$error" ng-show="reportForm.dateOfBirth.$touched" role="alert">\n <div ng-message="format">\n <span translate="CONTACTMANAGER.ERRORS.DATE_OF_RANGE_FROM_INVALID">Date Range From field is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </md-input-container> --\x3e\n\n <md-input-container class="md-block" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth"></mdp-date-picker>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container ng-if="vm.companies.rows.length" class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-icon md-font-icon="icon-domain"></md-icon>\n <md-select name="company" ng-model="vm.contact.CompanyId">\n <md-optgroup label="Companies">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n <md-icon class="pointer" ng-show="vm.contact.CompanyId" md-font-icon="icon-information-outline" ng-click="vm.editCompany($event, vm.contact.CompanyId)"></md-icon>\n </md-input-container>\n <section ng-if="!vm.companies.rows.length" flex-gt-sm="">\n <md-icon md-font-icon="icon-briefcase"></md-icon>\n <label translate="CONTACTMANAGER.NO_COMPANIES">No Companies</label>\n <md-button class="md-accent" translate="CONTACTMANAGER.ADD_COMPANY">Add Company</md-button>\n </section>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container ng-if="vm.tags.rows.length" class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.TAGS">Tags</label>\n <md-icon md-font-icon="icon-tag"></md-icon>\n <md-select ng-model="vm.contact.tags" multiple>\n <md-optgroup label="Tags">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags.rows">{{tag.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <section ng-if="!vm.tags.rows.length" flex-gt-sm="">\n <md-icon md-font-icon="icon-tag"></md-icon>\n <label translate="CONTACTMANAGER.NO_TAGS">No Tags</label>\n <md-button class="md-accent" translate="CONTACTMANAGER.ADD_TAG">Add Tag</md-button>\n </section>\n </div>\n\n <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All Fields</md-button>\n </div>\n\n <div ng-if="vm.allFields">\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- country --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <md-icon md-font-icon="icon-home" class="country"></md-icon>\n <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- city --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div flex="5"></div>\n \x3c!-- street --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- postalCode --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.POSTALCODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate translate-attr-placeholder="CONTACTMANAGER.NOTES">Notes</label>\n <md-icon md-font-icon="icon-note"></md-icon>\n <textarea ng-model="vm.contact.description" type="text" max-rows="4"></textarea>\n </md-input-container>\n </div>\n\n <div layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer Fields\n </md-button>\n </div>\n\n </div>\n </form>\n </md-card>\n <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.SOCIAL">Social</div>\n </div>\n <form name="socialForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- fistName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Facebook</label>\n <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- lastName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Twitter</label>\n <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate">\n </md-input-container>\n\n </div>\n </form>\n </md-card>\n </div>\n\n <div flex></div>\n\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex="25">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.CUSTOM_FIELDS">CUSTOM FIELDS</div>\n </div>\n <form name="customFieldsForm" novalidate>\n <md-input-container class="md-block">\n <label translate translate-attr-placeholder="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" md-on-close="vm.onSelectList($event)" ng-disabled="vm.contact.ListId">\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">#{{list.id}} - {{list.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <div ng-repeat="customField in vm.customFields.rows" ng-switch="customField.type">\n <md-input-container class="md-block" ng-switch-when="datetime">\n <label>{{customField.alias}}</label>\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-time-picker>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="select">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}\n </md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-default>\n <label>{{customField.alias}}</label>\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n </md-input-container>\n </div>\n </form>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab ng-if="vm.license.dialer">\n <md-tab-label>\n <span translate="CONTACTMANAGER.MOTION_BULL">MOTION BULL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.HOPPER">Hopper</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryHopper.filter = query;" on-collapse="vm.queryHopper.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getHoppers()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryHopper.sort" md-on-reorder="vm.getHoppers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="VoiceQueueId">{{ \'CONTACTMANAGER.VOICEQUEUEID\' | translate }}</th>\n <th md-column md-order-by="CampaignId">{{ \'CONTACTMANAGER.CAMPAIGNID\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.hoppers.count">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, hopper) in vm.hoppers.rows">\n <td md-cell>{{hopper.id}}</td>\n <td md-cell>{{hopper.phone}}</td>\n <td md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{ vm.arraypriority[hopper.priority].option }}</td>\n <td md-cell class="recallme ">\n <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell>{{hopper.VoiceQueueId}}</td>\n <td md-cell>{{hopper.CampaignId}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-if="hopper.VoiceQueueId" ng-click="vm.editHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n <md-button ng-if="hopper.CampaignId" ng-click="vm.createOrEditIvrCampaignHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(hopper, $event)" translate="CONTACTMANAGER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.FINAL">Final</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryFinal.filter = query;" on-collapse="vm.queryFinal.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getFinals()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryFinal.sort" md-on-reorder="vm.getFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'CONTACTMANAGER.DISPOSITION\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.finals.count">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, final) in vm.finals.rows">\n <td md-cell>{{final.uniqueid}}</td>\n <td md-cell>{{final.calleridnum}}</td>\n <td md-cell>{{final.statedesc}}</td>\n <td md-cell>{{final.starttime | date:\'medium\'}}</td>\n <td md-cell>{{final.disposition}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryFinal.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.queryFinal.page" md-total="{{vm.finals.count}}" md-on-paginate="vm.getFinals" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.HISTORY">History</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryHistory.filter = query;" on-collapse="vm.queryHistory.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getHistories()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryHistory.sort" md-on-reorder="vm.getHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.histories.count">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, history) in vm.histories.rows">\n <td md-cell>{{history.uniqueid}}</td>\n <td md-cell>{{history.calleridnum}}</td>\n <td md-cell>{{history.statedesc}}</td>\n <td md-cell>{{history.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{history.starttime | date:\'medium\'}}</td>\n <td md-cell>{{history.endtime | date:\'medium\'}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHistory.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.queryHistory.page" md-total="{{vm.histories.count}}" md-on-paginate="vm.getHistories" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab ng-if="vm.license.jscripty">\n <md-tab-label>\n <span translate="CONTACTMANAGER.JSCRIPTY">JSCRIPTY</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.SESSIONS">Sessions</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryJscriptySession.filter = query;" on-collapse="vm.queryJscriptySession.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n\n \x3c!-- SESSION TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryJscriptySession.sort" md-on-reorder="vm.getJscriptySessions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="agent">{{ \'CONTACTMANAGER.AGENT\' | translate }}</th>\n <th md-column md-order-by="project">{{ \'CONTACTMANAGER.PROJECT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.jscriptySessions.count">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, session) in vm.jscriptySessions.rows">\n <td md-cell>{{session.id}}</td>\n <td md-cell>{{session.starttime | date:\'medium\'}}</td>\n <td md-cell>{{session.endtime | date:\'medium\'}}</td>\n <td md-cell>{{session.membername}}</td>\n <td md-cell>{{session.projectname}}</td>\n <td md-cell class="actions">\n \x3c!-- <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical" ></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.editHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(hopper, $event)" translate="CONTACTMANAGER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu> --\x3e\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n \x3c!-- / SESSION TABLE --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n \x3c!-- <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.CUSTOMER_JOURNEY">CUSTOMER JOURNEY</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n\n </div>\n </div>\n </md-tab-body>\n </md-tab> --\x3e\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/import/import.html",'<md-dialog class="import-dialog" aria-label="Import contact">\n <form name="importForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="CONTACTMANAGER.IMPORT_CONTACTS">Import Contacts</span>\n <md-button ng-if="vm.result.finish || !vm.processing" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear ng-disabled="!vm.processing || vm.result.finish" md-mode="indeterminate" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div>\n <md-content ng-show="!vm.processing">\n <div class="form-title" translate="CONTACTMANAGER.CONTACTMANAGER">CONTACT MANAGER</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="contactField in vm.contactFields">\n <label>{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</label>\n <md-select name="{{contactField.key}}" ng-model="vm.binding[contactField.key]" placeholder="{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}" ng-required="contactField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.ListId" placeholder="Select a list" ng-change="vm.onChangeList()" required>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="customField in vm.customFields.rows">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.binding[\'cf_\' + customField.id]" placeholder="{{customField.alias}}" ng-required="customField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="customField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.CompanyId" placeholder="Select a company">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null">\n <em translate="CONTACTMANAGER.NONE">None</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <md-select ng-model="vm.duplicates" placeholder="{{ \'CONTACTMANAGER.CHECK_DUPLICATES\' | translate}}" multiple>\n <md-option ng-value="contactField.key" ng-repeat="contactField in vm.contactFields">{{ \'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</md-option>\n </md-select>\n </md-input-container>\n\n <div ng-if="vm.license.dialer">\n <div class="form-title" translate="CONTACTMANAGER.MOTIONDIALER">MOTION BULL</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="motionBullField in vm.motionBullFields">\n <label>{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}</label>\n <md-select name="{{motionBullField.key}}" ng-model="vm.binding[motionBullField.key]" placeholder="{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}" ng-required="motionBullField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n\n </md-content>\n\n <div class="error-list" ng-if="vm.result.finish">\n <div class="info" layout="row" layout-align="space-between center">\n <div>\n <div class="message">{{\'CONTACTMANAGER.UPLOAD_COMPLETED\' | translate | uppercase}} ({{vm.result.elapsed}}s)</div>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row" ng-if="vm.processing">\n \x3c!-- WIDGET PROCESSING --\x3e\n <ms-widget ng-if="!vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.rows"></span>\n </div>\n <div ng-if="vm.processing" class="font-weight-500 secondary-text">Please wait, we are processing your contacts...</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET PROCESSING --\x3e\n \x3c!-- WIDGET SUCCESS --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 green-fg">\n <span ng-bind="vm.result.affectedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.SUCCESS">Success</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET SUCCESS --\x3e\n\n \x3c!-- WIDGET FAILURE --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 red-fg">\n <span ng-bind="vm.result.failedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.FAILURE">Failure</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET FAILURE --\x3e\n\n \x3c!-- WIDGET DUPLICATES --\x3e\n <ms-widget ng-if="vm.result.duplicatedRows && vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.duplicatedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.DUPLICATES">Duplicates</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET DUPLICATES --\x3e\n </div>\n\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.processing" ng-disabled="importForm.$invalid || importForm.$pristine" ng-click="vm.uploadCsv()" class="md-accent md-raised" aria-label="UPLOAD" translate="CONTACTMANAGER.UPLOAD" translate-attr-aria-label="CONTACTMANAGER.IMPORT">\n IMPORT\n </md-button>\n <md-button ng-if="vm.processing && !vm.result.finish && !vm.stopping" ng-click="vm.stopUpload()" class="md-accent md-raised" aria-label="Stop Upload" translate="CONTACTMANAGER.STOP" translate-attr-aria-label="CONTACTMANAGER.STOP">\n STOP\n </md-button>\n <md-button ng-if="vm.result.finish && vm.result.errors.length" ng-csv="vm.getArrayErrors()" csv-header="vm.getHeaderErrors()" class="md-accent md-raised" aria-label="Export Errors" filename="contacts_import_errors.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon> {{\'CONTACTMANAGER.EXPORT_ERRORS\' | translate}}\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/merge/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="Merge Contact">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block" flex-gt-sm>\n <label>Filter</label>\n <input ng-model="vm.searchTerm" name="searchTerm" ng-model-options="{ debounce: 300 }" ng-change="vm.change()">\n </md-input-container>\n\n <md-list flex>\n <md-subheader class="md-no-sticky" ng-hide="vm.contacts.length"><em>Filter doesn\'t match any contact</em></md-subheader>\n <md-list-item class="md-3-line" ng-repeat="contact in vm.contacts | filter:{ id: \'!\' + vm.contact.id}" ng-click="vm.showConfirm($event, vm.contact, contact)">\n <img ng-src="assets/images/avatars/profile.png" class="md-avatar" alt="{{contact.who}}" />\n <div class="md-list-item-text" layout="column">\n <h3>#{{ contact.id }} - {{ contact.firstName }} {{ contact.lastName }}</h3>\n <h4>{{ contact.email }}</h4>\n <p>{{ contact.phone }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/upload/upload.html",'<md-dialog class="upload-dialog" aria-label="Upload contact">\n <form name="uploadForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="CONTACTMANAGER.UPLOAD_CONTACTS">Upload Contacts</span>\n <md-button ng-if="vm.finished || !vm.uploading" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear ng-disabled="!vm.uploading" md-mode="indeterminate" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row" layout-align="center center" ng-show="!vm.fileSelected">\n <md-button flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-btn flow-file-added="vm.fileAdded($event, $file, $flow)" flow-file-success="vm.fileSuccess($file, $message, $flow)" class="md-accent md-raised md-warn" aria-label="Select File" translate\n translate-attr-aria-label="CONTACTMANAGER.SELECT_FILE">\n <span translate="CONTACTMANAGER.SELECT_FILE">Select File</span>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n </div>\n\n <div>\n <md-content ng-show="!vm.uploading && !vm.finished && vm.fileSelected">\n <md-input-container class="md-icon-float md-block" ng-repeat="contactField in vm.contactFields">\n <label>{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</label>\n <md-select name="{{contactField.key}}" ng-model="vm.binding[contactField.key]" placeholder="{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}" ng-required="contactField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required"><em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.ListId" placeholder="Select a list" ng-change="vm.onChangeList()" required>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="customField in vm.customFields.rows">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.binding[\'cf_\' + customField.id]" placeholder="{{customField.alias}}" ng-required="customField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="customField.required"><em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.CompanyId" placeholder="Select a company">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <md-select ng-model="vm.duplicates" placeholder="{{ \'CONTACTMANAGER.CHECK_DUPLICATES\' | translate}}" multiple>\n <md-option ng-value="contactField.key" ng-repeat="contactField in vm.contactFields">{{ \'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</md-option>\n </md-select>\n </md-input-container>\n </md-content>\n\n <div layout="row" ng-if="vm.uploading || vm.finished">\n \x3c!-- WIDGET SUCCESS --\x3e\n <ms-widget class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 green-fg"><span ng-bind="vm.success"></span></div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.SUCCESS">Success</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET SUCCESS --\x3e\n\n \x3c!-- WIDGET FAILURE --\x3e\n <ms-widget class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 red-fg"><span ng-bind="vm.errors"></span></div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.FAILURE">Failure</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET FAILURE --\x3e\n\n \x3c!-- WIDGET DUPLICATES --\x3e\n <ms-widget class="h-140" flex ng-if="vm.duplicate">\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg"><span ng-bind="vm.duplicate"></span></div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.DUPLICATES">Duplicates</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET DUPLICATES --\x3e\n </div>\n\n <div class="error-list" ng-if="vm.finished">\n <div class="info" layout="row" layout-align="space-between center">\n <div>\n <div class="message">{{\'CONTACTMANAGER.UPLOAD_COMPLETED\' | translate | uppercase}}</div>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-disabled="uploadForm.$invalid || uploadForm.$pristine || vm.uploading || vm.finished || !vm.fileSelected" ng-click="vm.uploadCsv()" class="md-accent md-raised" aria-label="UPLOAD" translate="CONTACTMANAGER.UPLOAD" translate-attr-aria-label="CONTACTMANAGER.UPLOAD">\n UPLOAD\n </md-button>\n <md-button ng-if="vm.showStopButton && !vm.finished" ng-disabled="vm.disableStopButton" ng-click="vm.stopUpload()" class="md-accent md-raised" aria-label="Stop Upload" translate="CONTACTMANAGER.STOP" translate-attr-aria-label="CONTACTMANAGER.STOP">\n STOP\n </md-button>\n <md-button ng-if="vm.rows.length" ng-csv="vm.exportErrors()" class="md-accent md-raised" aria-label="Export Errors" filename="contacts_upload_errors.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon> {{\'CONTACTMANAGER.EXPORT_ERRORS\' | translate}}\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",'<md-dialog class="globalCustomField-dialog" aria-label="New GlobalCustomField">\n <form name="globalCustomFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n <input type="" name="alias" ng-model="vm.globalCustomField.alias" ng-required="true" autofocus>\n <div ng-messages="globalCustomFieldForm[\'alias\'].$error" ng-show="globalCustomFieldForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <md-select name="type" ng-model="vm.globalCustomField.type" required ng-disabled="!vm.newGlobalCustomField">\n <md-option ng-value="\'text\'">Text</md-option>\n <md-option ng-value="\'select\'">Select</md-option>\n <md-option ng-value="\'number\'">Number</md-option>\n <md-option ng-value="\'switch\'">Switch</md-option>\n <md-option ng-value="\'datetime\'">Datetime</md-option>\n </md-select>\n <div ng-messages="globalCustomFieldForm[\'type\'].$error" ng-show="globalCustomFieldForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.globalCustomField.type == \'select\'" class="md-block">\n <md-list>\n <md-list-item layout-margin>\n <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.globalCustomField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n </md-button>\n <md-button ng-if="vm.globalCustomField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.globalCustomField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list ng-sortable="vm.sortable">\n <md-list-item ng-repeat="item in vm.globalCustomField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n <div>\n <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n <input type="text" ng-model="item.value" flex>\n </div>\n <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.globalCustomField.values, $index);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list>\n <md-list-item ng-if="!vm.globalCustomField.values.length" layout="row" layout-align="center center">\n <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n </md-list-item>\n </md-list>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.globalCustomField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newGlobalCustomField" ng-click="vm.saveGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid || globalCustomFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE"\n translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newGlobalCustomField" ng-click="vm.addNewGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n ADD GLOBALCUSTOMFIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newGlobalCustomField" ng-click="vm.deleteGlobalCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",'<div id="globalCustomFields" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.GLOBALCUSTOMFIELDS">GlobalCustomFields</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedGlobalCustomFields.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedGlobalCustomFields =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-globalCustomFields-count">\n <span>{{vm.selectedGlobalCustomFields.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="GLOBALCUSTOMFIELDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedGlobalCustomFields" csv-label="true" filename="globalCustomFields.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedGlobalCustomFields($event)" aria-label="delete selected" translate translate-attr-label="GLOBALCUSTOMFIELDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- GLOBALCUSTOMFIELD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedGlobalCustomFields" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getGlobalCustomFields">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="alias">{{ \'CONTACTMANAGER.ALIAS\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'CONTACTMANAGER.TYPE\' | translate }}</th>\n <th md-column md-order-by="required">{{ \'CONTACTMANAGER.REQUIRED\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.globalCustomFields.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="globalCustomField" md-select-id="id" ng-repeat="globalCustomField in vm.globalCustomFields.rows">\n <td md-cell ng-if="globalCustomField.userpic"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="api/users/{{globalCustomField.id}}/avatar" /></td>\n <td md-cell ng-if="!globalCustomField.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="id ">{{globalCustomField.id}}</td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="alias ">{{globalCustomField.alias}}</td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="type ">{{ vm.arraytype[globalCustomField.type].option }}</td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="required ">\n <md-icon md-colors="{color: {{globalCustomField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{globalCustomField.required ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(globalCustomField, $event)" translate="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD">\n Edit GlobalCustomField\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(globalCustomField, $event)" translate="CONTACTMANAGER.DELETE_GLOBALCUSTOMFIELD">\n Delete GlobalCustomField\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.globalCustomFields.count}}" md-on-paginate="vm.getGlobalCustomFields" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / GLOBALCUSTOMFIELD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-globalCustomField-button" ng-click="vm.createOrEditGlobalCustomField($event)" aria-label="add globalCustomField" translate translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/lists/create/dialog.html",'<md-dialog class="list-dialog" aria-label="New List">\n <form name="listForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus>\n <div ng-messages="listForm[\'name\'].$error" ng-show="listForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.list.description">\n <div ng-messages="listForm[\'description\'].$error" ng-show="listForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newList" ng-click="vm.saveList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid || listForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newList" ng-click="vm.addNewList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_LIST" translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n ADD LIST\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newList" ng-click="vm.deleteList($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",'<md-dialog class="list-dialog" aria-label="list">\n <form name="listForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CONTACTMANAGER.AGENTADD_LIST">Add Agent to list</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",'<md-dialog class="customField-dialog" aria-label="New CustomField">\n <form name="customFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n <input type="" name="alias" ng-model="vm.customField.alias" ng-required="true" autofocus>\n <div ng-messages="customFieldForm[\'alias\'].$error" ng-show="customFieldForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <md-select name="type" ng-model="vm.customField.type" required ng-disabled="!vm.newCustomField">\n <md-option ng-value="\'text\'">Text</md-option>\n <md-option ng-value="\'select\'">Select</md-option>\n <md-option ng-value="\'number\'">Number</md-option>\n <md-option ng-value="\'switch\'">Switch</md-option>\n <md-option ng-value="\'datetime\'">Datetime</md-option>\n </md-select>\n <div ng-messages="customFieldForm[\'type\'].$error" ng-show="customFieldForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.customField.type == \'select\'" class="md-block">\n <md-list>\n <md-list-item layout-margin>\n <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.customField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n </md-button>\n <md-button ng-if="vm.customField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.customField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list ng-sortable="vm.sortable">\n <md-list-item ng-repeat="item in vm.customField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n <div>\n <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n <input type="text" ng-model="item.value" flex>\n </div>\n <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.customField.values, $index);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list>\n <md-list-item ng-if="!vm.customField.values.length" layout="row" layout-align="center center">\n <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n </md-list-item>\n </md-list>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newCustomField" ng-click="vm.saveCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid || customFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newCustomField" ng-click="vm.addNewCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n ADD CUSTOMFIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newCustomField" ng-click="vm.deleteCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/view.html",'<div id="contactmanager-list" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-lists-button md-icon-button" aria-label="Go to lists" ng-click="vm.gotoLists()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_LISTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="list-image" hide-xs>\n <img ng-src="assets/images/business/lists.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.list.id}}\n <span ng-if="vm.list.name">{{vm.list.name}}</span>\n <span ng-if="vm.list.exten">{{vm.list.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.list.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="CONTACTMANAGER.GOTO_LIST"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CONTACTMANAGER.AGENTADD_LIST"></span></md-tooltip>\n <md-icon md-font-icon="icon-eye"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveList()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (customFieldsForm.$invalid) || (voiceDispositionsForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="list-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.list.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.list.dialPrefix">\n <div ng-messages="generalForm[\'dialPrefix\'].$error" ng-show="generalForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.CUSTOMFIELDS">CUSTOMFIELDS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="list-detail-form-container customfields md-background-bg md-whiteframe-1dp">\n <div ng-controller="ListCustomFieldsController as vm_dc" ng-init="vm_dc.init(vm.list)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListCustomFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.CUSTOMFIELDS">CustomFields</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditListCustomField($event)" aria-label="add customField" translate translate-attr-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedListCustomFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedListCustomFields.length}} {{vm_dc.selectedListCustomFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedListCustomFields" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedListCustomFields($event)" aria-label="delete selected" translate translate-attr-label="LISTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedListCustomFields" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getListCustomFields">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="alias">{{ \'CONTACTMANAGER.ALIAS\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'CONTACTMANAGER.TYPE\' | translate }}</th>\n <th md-column md-order-by="required">{{ \'CONTACTMANAGER.REQUIRED\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="customField" md-select-id="id" ng-repeat="customField in vm_dc.listCustomFields.rows">\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>{{customField.id}}</td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>{{customField.alias}}</td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>{{ vm_dc.arraytype[customField.type].option }}</td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell class="required ">\n <md-icon md-colors="{color: {{customField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{customField.required? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditListCustomField($event, customField)" translate="CONTACTMANAGER.EDIT_CUSTOMFIELD">\n Edit CustomField\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(customField, $event)" translate="CONTACTMANAGER.DELETE_CUSTOMFIELD">\n Delete CustomField\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.listCustomFields.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="CONTACTMANAGER.NO_CUSTOMFIELD_AVAILABLE">No customfield available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.listCustomFields.count}}" md-on-paginate="vm_dc.getListCustomFields" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="list-detail-form-container voicedispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ListVoiceDispositionsController as vm_dc" ng-init="vm_dc.init(vm.list)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListVoiceDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.VOICEDISPOSITIONS">VoiceDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditListVoiceDisposition($event)" aria-label="add voiceDisposition" translate translate-attr-label="CONTACTMANAGER.ADD_VOICEDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedListVoiceDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedListVoiceDispositions.length}} {{vm_dc.selectedListVoiceDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedListVoiceDispositions" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedListVoiceDispositions($event)" aria-label="delete selected" translate translate-attr-label="LISTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedListVoiceDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getListVoiceDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CONTACTMANAGER.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="voiceDisposition" md-select-id="id" ng-repeat="voiceDisposition in vm_dc.listVoiceDispositions.rows">\n <td ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" md-cell>{{voiceDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" md-cell>{{voiceDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" md-cell>{{voiceDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" translate="CONTACTMANAGER.EDIT_VOICEDISPOSITION">\n Edit VoiceDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(voiceDisposition, $event)" translate="CONTACTMANAGER.DELETE_VOICEDISPOSITION">\n Delete VoiceDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.listVoiceDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="CONTACTMANAGER.NO_VOICEDISPOSITION_AVAILABLE">No voicedisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.listVoiceDispositions.count}}" md-on-paginate="vm_dc.getListVoiceDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/lists/edit/voiceDispositions/dialog.html",'<md-dialog class="voiceDisposition-dialog" aria-label="New VoiceDisposition">\n <form name="voiceDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="" name="name" ng-model="vm.voiceDisposition.name" ng-required="true" autofocus>\n <div ng-messages="voiceDispositionForm[\'name\'].$error" ng-show="voiceDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newVoiceDisposition" ng-click="vm.saveVoiceDisposition()" class="send-button md-accent md-raised" ng-disabled="voiceDispositionForm.$invalid || voiceDispositionForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE"\n translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newVoiceDisposition" ng-click="vm.addNewVoiceDisposition()" class="send-button md-accent md-raised" ng-disabled="voiceDispositionForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_VOICEDISPOSITION" translate-attr-aria-label="CONTACTMANAGER.ADD_VOICEDISPOSITION">\n ADD VOICEDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newVoiceDisposition" ng-click="vm.deleteVoiceDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/lists.html",'<div id="lists" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.LISTS">Lists</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedLists.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedLists =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-lists-count">\n <span>{{vm.selectedLists.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="LISTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllLists()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectLists()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedLists" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedLists($event)" aria-label="delete selected" translate translate-attr-label="LISTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- LIST TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedLists" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getLists">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.lists.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="list" md-select-id="id" ng-repeat="list in vm.lists.rows">\n <td md-cell ng-if="list.userpic"><img class="avatar" alt="{{list.name}}" ng-src="api/users/{{list.id}}/avatar" /></td>\n <td md-cell ng-if="!list.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{list.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditList($event, list)" md-cell class="id ">{{list.id}}</td>\n <td ng-click="vm.createOrEditList($event, list)" md-cell class="name ">{{list.name}}</td>\n <td ng-click="vm.createOrEditList($event, list)" md-cell class="description ">{{list.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(list, $event)" translate="CONTACTMANAGER.EDIT_LIST">\n Edit List\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotocontactsgoto(list, $event)" translate="CONTACTMANAGER.GOTOCONTACTS_LIST">\n goToContacts List\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.exportcsvcontactsexport(list, $event)" translate="CONTACTMANAGER.EXPORTCSVCONTACTS_LIST">\n exportCsvContacts List\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(list, $event)" translate="CONTACTMANAGER.AGENTADD_LIST">\n AgentAdd List\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(list, $event)" translate="CONTACTMANAGER.DELETE_LIST">\n Delete List\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.lists.count}}" md-on-paginate="vm.getLists" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / LIST TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD LIST BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-list-button" ng-click="vm.createOrEditList($event)" aria-label="add list" translate translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD LIST BUTTON --\x3e\n</div>'),e.put("app/main/apps/dashboards/views/custom/custom.html",'<div ng-if="!vm.customDashboard">\n <p>Custom Dashboard not available...</p>\n</div>\n<div id="dashboard-custom" ng-if="vm.customDashboard" ng-cloak layout-fill>\n <md-content>\n <md-toolbar class="md-default md-accent filter-header">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.customDashboard.name}}</span>\n <div flex></div>\n <div layout="column">\n <span class="font-size-10" translate="DASHBOARDS.FILTER_VOICE_QUEUES">Filter Voice Queues</span>\n <md-select placeholder="Select one or more queues" class="font-size-12 no-margin w-200" md-on-close="vm.onChangeVoiceQueues()" ng-model="vm.voiceQueuesSelected" multiple aria-label="voiceQueues">\n <md-option ng-value="voiceQueue.id" ng-repeat="voiceQueue in vm.voiceQueues.rows">{{ voiceQueue.name }}</md-option>\n </md-select>\n </div>\n <md-button ng-if="vm.currentUser.role == \'admin\'" class="md-icon-button" ng-click="vm.goToEdit()" aria-label="goToEdit">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.EDIT"></span></md-tooltip>\n <md-icon md-font-icon="icon-table-edit"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <ms-widget-engine config="vm.customDashboard"></ms-widget-engine>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/agent.general.html",'<div id="agent-general" layout="column">\n <div layout="row" layout-align="start center" class="md-primary-bg">\n <md-button class="md-raised no-margin width-50" style="border-radius: 0px" ng-class="{\'md-primary\': !vm.isActiveTab(0)}" ng-click="vm.onClickTab(0)" aria-label="home">\n <md-tooltip md-direction="bottom" md-delay="500">Home</md-tooltip>\n <md-icon md-font-icon="icon-home" class="icon"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center" ms-scroll>\n <div style="height: 36px" layout="column" ng-repeat="(key, tab) in vm.tabs" ng-click="vm.onClickTab(tab.id)" ng-class="{\'grey-50-bg\': vm.isActiveTab(tab.id)}">\n <div style="height: 34px" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="{{tab.icon}}" class="icon s16 margin-horizontal-5" ng-class="tab.color + \'-fg\'"></md-icon>\n <span class="text-truncate font-size-12" ng-class="vm.isActiveTab(tab.id) ? \'black-fg\' : \'grey-300-fg\'"> {{tab.title}} <span ng-if="tab.badges" class="badge md-white-fg md-red-bg">{{tab.badges}}</span></span>\n <md-button class="md-icon-button md-mini no-margin" ng-class="vm.isActiveTab(tab.id) ? \'md-primary\' : \'grey-300-fg\'" aria-label="close" ng-click="vm.closeTab(tab)">\n <md-icon md-font-icon="icon-close-circle-outline" class="icon s16"></md-icon>\n </md-button>\n </div>\n <div style="height: 2px" ng-class="vm.isActiveTab(tab.id) ? tab.color + \'-bg\' : \'\'"></div>\n </div>\n </div>\n </div>\n <div layout="row" class="agent-content" ng-if="vm.isActiveTab(0)" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.html\'" ng-controller="AgentGeneralHomeController as vm_home"\n ng-init="vm_home.init(vm.license)"></div>\n <div ng-if="!vm.isActiveTab(0)" ng-repeat="(key, tab) in vm.tabs" ng-switch="tab.type">\n <div ng-switch-when="contact">\n <div class="agent-content" ms-scroll ng-if="vm.isActiveTab(tab.id)" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html\'" ng-controller="AgentGeneralContactController as vm"\n ng-init="vm.init(tab,$parent.vm.license)"></div>\n </div>\n <div ng-switch-when="popup">\n <div ng-if="vm.isActiveTab(tab.id)" ms-scroll ng-include="\'app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html\'" ng-controller="AgentGeneralPopupController as vm" ng-init="vm.init(tab)"></div>\n </div>\n <div ng-switch-when="jscripty">\n <div class="agent-content" ms-scroll ng-if="vm.isActiveTab(tab.id)" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html\'" ng-controller="AgentGeneralJscriptyController as vm"\n ng-init="vm.init(tab)"></div>\n </div>\n <div ng-switch-when="interaction">\n <div id="interaction-app" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'"\n ng-controller="AgentGeneralInteractionController as vm" ng-init="vm.init(tab)"></div>\n </div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html",'<md-tabs md-selected="vm.currentTab" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.DETAIL">Detail</span>\n </md-tab-label>\n <md-tab-body>\n <md-content>\n <div layout="row">\n \x3c!-- MS-CARD --\x3e\n <md-card class="template-7" layout="row" layout-align="space-between" ng-repeat="call in vm.tab.calls track by call.uniqueid">\n <div class="info" layout="column" layout-align="space-between" layout-fill flex>\n <div layout="row">\n <span ng-if="call.answeredAt" class="text-boxed indigo-100-bg"><timer start-time="call.answeredAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span>\n <div flex></div>\n <span ng-if="call.disposedAt" class="text-boxed amber-200-bg"><timer start-time="call.disposedAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span>\n </div>\n <div class="p-16">\n <div class="title h1">\n <md-icon ng-if="!call.routeId" md-font-icon="icon-phone-incoming"></md-icon>\n <md-icon ng-if="call.routeId" md-font-icon="icon-phone-outgoing"></md-icon>\n {{ call.routeId ? call.destcalleridnum : call.calleridnum }}\n </div>\n\n <div class="subtitle h4 secondary-text" ng-if="call.calleridname && call.calleridname != \'<unknown>\' && !call.routeId">\n <md-icon md-font-icon="icon-account"></md-icon>\n Name: {{ call.calleridname }}\n </div>\n\n <div class="text h4 pt-8" ng-if="call.queue">\n <md-icon md-font-icon="icon-stackoverflow"></md-icon>\n Queue: {{call.queue}}\n </div>\n <div class="text h4 pt-8" ng-if="call.variables.extravar">\n <md-icon md-font-icon="icon-minus"></md-icon>\n Extra: {{call.variables.extravar}}\n </div>\n </div>\n <div layout="row" layout-align="end center">\n <md-button ng-if="call.disposedAt" type="submit" ng-click="vm.disposeCall($event, call)" class="send-button md-accent md-raised">\n {{ \'DASHBOARDS.DISPOSE\' | translate}}\n </md-button>\n </div>\n </div>\n </md-card>\n \x3c!-- / MS-CARD --\x3e\n <div flex layout="row" layout-align="end center">\n <md-button type="submit" ng-click="vm.mergeContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid" aria-label="merge">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.MERGE"></span></md-tooltip>\n <md-icon md-font-icon="icon-source-fork"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.duplicateContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid" aria-label="duplicate">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.DUPLICATE"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.addNewContact($event)" class="send-button md-accent md-raised" ng-if="vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid" aria-label="add">\n {{ \'DASHBOARDS.ADD\'| translate }}\n </md-button>\n <md-button type="submit" ng-click="vm.saveContact($event)" class="send-button md-accent md-raised" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid" aria-label="save">\n {{ \'DASHBOARDS.SAVE\' | translate }}\n </md-button>\n </div>\n </div>\n <div layout="row">\n <div layout="column" flex="75">\n <md-card layout-padding>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.PERSONAL_INFO">PERSONAL_INFO</div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n </div>\n\n <form name="vm.detailForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.FIRSTNAME">First Name</label>\n <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required>\n <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.jscripty" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="JSCRIPTY PROJECTS" ng-click="$mdOpenMenu($event)" aria-label="jscripty">\n <md-icon md-font-icon="icon-script"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.jscriptyProjects && vm.jscriptyProjects.rows.length" ng-repeat="project in vm.jscriptyProjects.rows">\n <md-button ng-click="vm.addJscriptyTab(project, $event)">\n <md-icon md-font-icon="icon-script"></md-icon> {{project.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.jscriptyProjects || !vm.jscriptyProjects.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_JSCRIPTY_PROJECTS_AVAILABLE">\n <md-icon md-font-icon="icon-script"></md-icon> No jscripty projects available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.LASTNAME">Last Name</label>\n <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.PHONE">Phone</label>\n <md-icon md-font-icon="icon-phone"></md-icon>\n <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate" required>\n <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.phone" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n <div ng-messages="vm.detailForm.phone.$error" ng-show="vm.detailForm.phone.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.PHONE_REQUIRED">Phone name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div>\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="vm.contact.phone" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </div>\n </div>\n <div flex="5"></div>\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.MOBILE">Mobile</label>\n <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate">\n <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.mobile" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n </md-input-container>\n <div>\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="vm.contact.mobile" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </div>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.messaging || !vm.hasPermission(107) || !vm.contact.mobile" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW SMS" ng-click="$mdOpenMenu($event)" aria-label="sms">\n <md-icon md-font-icon="icon-message-text"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.smsAccounts && vm.smsAccounts.rows.length" ng-repeat="account in vm.smsAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Sms\', account, vm.contact.mobile)">\n <md-icon md-font-icon="icon-message-text"></md-icon> {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.smsAccounts || !vm.smsAccounts.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_SMS_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-message-text"></md-icon> No sms accounts available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.EMAIL">Email</label>\n <md-icon md-font-icon="icon-email" class="email"></md-icon>\n <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate">\n <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n <div ng-message="email">\n <span translate="DASHBOARDS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.mail || !vm.hasPermission(106) || !vm.contact.email" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW EMAIL" ng-click="$mdOpenMenu($event)" aria-label="email">\n <md-icon md-font-icon="icon-email"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.mailAccounts && vm.mailAccounts.rows.length" ng-repeat="account in vm.mailAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Mail\', account, vm.contact.email)">\n <md-icon md-font-icon="icon-email"></md-icon> {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.mailAccounts || !vm.mailAccounts.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_MAIL_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-email"></md-icon> No email accounts available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n <div flex="5"></div>\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.FAX">Fax</label>\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <input type="text" name="fax" ng-model="vm.contact.fax">\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.fax || !vm.hasPermission(109) || !vm.contact.fax" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW FAX" ng-click="$mdOpenMenu($event)" aria-label="fax">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.faxAccounts && vm.faxAccounts.rows.length" ng-repeat="account in vm.faxAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Fax\', account, vm.contact.fax)">\n <md-icon md-font-icon="icon-deskphone"></md-icon> {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.faxAccounts || !vm.faxAccounts.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_FAX_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-deskphone"></md-icon> No fax accounts available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="DASHBOARDS.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth"></mdp-date-picker>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.COMPANY">Company</label>\n <md-icon md-font-icon="icon-domain" class="email"></md-icon>\n <md-select name="company" ng-model="vm.contact.CompanyId">\n <md-option ng-value="company.id" ng-repeat="company in vm.tab.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null"><em translate="DASHBOARDS.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.TAG">TAG</label>\n <md-icon md-font-icon="icon-tag"></md-icon>\n <md-select ng-model="vm.contact.tags" multiple>\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tab.tags.rows">{{tag.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.COUNTRY">Country</label>\n <md-icon md-font-icon="icon-home" class="country"></md-icon>\n <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.POSTALCODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate translate-attr-placeholder="DASHBOARDS.NOTES">Notes</label>\n <md-icon md-font-icon="icon-note"></md-icon>\n <textarea ng-model="vm.contact.description" type="text" max-rows="4"></textarea>\n </md-input-container>\n </div>\n </form>\n </md-card>\n <md-card>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.SOCIAL">Social</div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Facebook</label>\n <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Twitter</label>\n <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate">\n </md-input-container>\n </div>\n </md-card>\n </div>\n <div flex="25" layout="column" layout-padding>\n <md-card flex="100">\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.CUSTOM_FIELDS">CUSTOM FIELDS</div>\n <form name="vm.customFieldsForm" novalidate>\n\n \x3c!-- START INPUT LIST --\x3e\n <md-input-container class="md-block" ng-if="!vm.contact.ListId">\n <label translate translate-attr-placeholder="DASHBOARDS.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.tab.userLists.rows">#{{list.id}} - {{list.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.contact.ListId">\n <label translate translate-attr-placeholder="DASHBOARDS.LIST">List</label>\n <md-select ng-disabled="!vm.newContact" name="list" ng-model="vm.contact.ListId" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.tab.lists.rows">#{{list.id}} - {{list.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END INPUT LIST --\x3e\n\n <div ng-repeat="customField in vm.tab.customFields.rows" ng-switch="customField.type">\n <md-input-container class="md-block" ng-switch-when="datetime">\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-time-picker>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="select">\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}<span ng-if="customField.required">*</span>\n </md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-default>\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n </md-input-container>\n </div>\n </form>\n </md-card>\n </div>\n </div>\n </md-content>\n </md-tab-body>\n </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",'<md-dialog class="agent-dialog" aria-label="agent dispose">\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.DISPOSE"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div ng-if="!vm.isReschedule">\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.DISPOSITIONS">Dispositions</label>\n <md-select name="disposition" ng-model="vm.choice" required>\n <md-optgroup ng-if="vm.dispositions.rows.length" label="Custom">\n <md-option ng-value="disposition.name" ng-repeat="disposition in vm.dispositions.rows">{{ disposition.name }}</md-option>\n </md-optgroup>\n <md-optgroup label="Default">\n <md-option ng-value="null">NONE</md-option>\n <md-option value="fax"><span translate="DASHBOARDS.FAX">Fax</span></md-option>\n <md-option value="amd"><span translate="DASHBOARDS.ANSWER_MACHINE">Answer Machine</span></md-option>\n <md-option value="interested"><span translate="DASHBOARDS.INTERESTED">Interested</span></md-option>\n <md-option value="notinterested"><span translate="DASHBOARDS.NOT_INTERESTED">Not Interested</span></md-option>\n <md-option value="sold"><span translate="DASHBOARDS.SOLD">Sold</span></md-option>\n <md-option value="special"><span translate="DASHBOARDS.SPECIAL">Special</span></md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.NOTE">Note</label>\n <textarea ng-model="vm.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n </md-input-container>\n </div>\n <div ng-if="vm.isReschedule" layout="row">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.date.$error" ng-show="dateTime.date.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.time.$error" ng-show="dateTime.time.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-if="!vm.isReschedule" layout="row">\n <md-button ng-disabled="!(vm.choice || vm.note)" class="send-button md-raised md-accent" ng-click="vm.saveDisposition()">\n {{(vm.choice ? \'DASHBOARDS.DISPOSE\' : \'DASHBOARDS.SAVE\') | translate}}\n </md-button>\n <md-button ng-if="vm.dialerCall" class="send-button md-raised md-primary" translate="DASHBOARDS.RESCHEDULE" ng-click="vm.saveDisposition(\'reschedule\')">\n Reschedule\n </md-button>\n <md-button ng-if="vm.dialerCall" class="send-button md-accent md-raised" translate="DASHBOARDS.RECALLME" ng-click="vm.saveDisposition(\'recallme\')">\n Recall Me\n </md-button>\n <span flex></span>\n <md-button ng-if="vm.dialerCall" class="md-raised md-warn" translate="DASHBOARDS.BLACKLIST" ng-click="vm.saveDisposition(\'blacklist\')">\n Blacklist\n </md-button>\n </md-dialog-actions>\n <md-dialog-actions ng-if="vm.isReschedule" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-disabled="vm.disable" ng-click="vm.saveReschedule()" class="send-button md-accent md-raised" ng-disabled="dateTime.$invalid || dateTime.$pristine" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/contact/reschedule/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n <form name="dateTime" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.date.$error" ng-show="dateTime.date.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.time.$error" ng-show="dateTime.time.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-disabled="vm.disable" ng-click="vm.saveDialog()" class="send-button md-accent md-raised" ng-disabled="dateTime.$invalid || dateTime.$pristine" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html",'<div ng-cloak>\n <md-content>\n <md-tabs md-selected="vm.selectedTab" md-dynamic-height md-border-bottom>\n <md-tab ng-if="vm_home.hasPermission(110)" label="Voice">\n <div ng-controller="AgentHomeAbandonedVoiceController as vm_voice">\n <md-content ng-if="vm.selectedTab==0" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html\'" class="md-padding">\n </md-content>\n </div>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="Bull">\n <div ng-controller="AgentHomeAbandonedBullController as vm_bull">\n <md-content ng-if="vm.selectedTab==1" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html\'" class="md-padding">\n </md-content>\n </div>\n </md-tab>\n </md-tabs>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header blue-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm_bull.query.filter = query" on-collapse="vm_bull.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm_bull.pickerModel.dateStart" ng-click="vm_bull.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm_bull.localizationMap" ng-model="vm_bull.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_bull.getContacts()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_bull.query.lastAssignedTo" ng-change="vm_bull.getContacts()">\n <md-option ng-value="vm_bull.currentUser.name" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div ng-if="vm_bull.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_bull.query.queue" ng-change="vm_bull.getContacts()">\n <md-option ng-value="vm_bull.defaultQueues" ng-if="vm_bull.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm_bull.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm_bull.refresh && vm_bull.refreshContacts($event)" aria-label="refresh Contacts" translate translate-attr-label="DASHBOARDS.REFRESH_CONTACTS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm_bull.showTooltip" md-visible="vm_bull.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_bull.promise">\n <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm_bull.contacts.rows">\n <td md-cell class="id">{{contact.id}}</td>\n <td md-cell class="firstName">{{contact.calleridname}}</td>\n <td md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.calleridnum" license="vm_home.license" disabled="contact.lastAssignedTo !== vm_bull.currentUser.name"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="list">{{vm_bull.queuesMap[contact.queue]}}</td>\n <td md-cell class="list">{{contact.queuecallerabandonAt ? (contact.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.queuecallerexitAt ? (contact.queuecallerexitAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.queuecallerexitreason}}</td>\n <td md-cell class="list">{{contact.disposition}}</td>\n <td md-cell class="actions">\n <md-switch no-margin ng-if="contact.lastAssignedTo === vm_bull.currentUser.name || !contact.lastAssignedTo" ng-disabled="vm_bull.disable[contact.id]" ng-model="contact.assigned" aria-label="reserved" ng-change="vm_bull.reserved(contact, contact.disposition)">\n \x3c!-- <span>{{ contact.assigned ? \'DASHBOARDS.RESERVED\' : \'DASHBOARDS.FREE\' | translate }}</span> --\x3e\n </md-switch>\n </td>\n <td md-cell class="list">{{contact.lastAssignedTo}}</td>\n <td md-cell class="actions">\n <md-menu ng-if="contact.lastAssignedTo === vm_bull.currentUser.name">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="1">\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-click="vm_bull.reserved(contact, null)"><em translate="DASHBOARDS.NONE">NONE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_bull.reserved(contact, \'fax\')"><em translate="DASHBOARDS.FAX">FAX</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_bull.reserved(contact, \'Answer Machine\')"><em translate="DASHBOARDS.ANSWER_MACHINE">ANSWER_MACHINE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_bull.reserved(contact, \'Interested\')"><em translate="DASHBOARDS.INTERESTED">INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_bull.reserved(contact, \'Not Interested\')"><em translate="DASHBOARDS.NOT_INTERESTED">NOT_INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_bull.reserved(contact, \'Sold\')"><em translate="DASHBOARDS.SOLD">SOLD</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_bull.reserved(contact, \'Special\')"><em translate="DASHBOARDS.SPECIAL">SPECIAL</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_bull.disposition.length" ng-repeat="disposition in vm_bull.disposition">\n <md-button ng-click="vm_bull.reserved(contact, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.contacts.count}}" md-on-paginate="vm_bull.getContacts" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header blue-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm_voice.query.filter = query" on-collapse="vm_voice.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm_voice.pickerModel.dateStart" ng-click="vm_voice.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm_voice.localizationMap" ng-model="vm_voice.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_voice.getContacts()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_voice.query.lastAssignedTo" ng-change="vm_voice.getContacts()">\n <md-option ng-value="vm_voice.currentUser.name" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div ng-if="vm_voice.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_voice.query.queue" ng-change="vm_voice.getContacts()">\n <md-option ng-value="vm_voice.defaultQueues" ng-if="vm_voice.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm_voice.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm_voice.refresh && vm_voice.refreshContacts($event)" aria-label="refresh Contacts" translate translate-attr-label="DASHBOARDS.REFRESH_CONTACTS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm_voice.showTooltip" md-visible="vm_voice.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_voice.promise">\n <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm_voice.contacts.rows">\n <td md-cell class="id">{{contact.id}}</td>\n <td md-cell class="firstName">{{contact.calleridname}}</td>\n <td md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.calleridnum" license="vm_home.license" disabled="contact.lastAssignedTo !== vm_voice.currentUser.name"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="list">{{vm_voice.queuesMap[contact.queue]}}</td>\n <td md-cell class="list">{{contact.queuecallerabandonAt ? (contact.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.disposition}}</td>\n <td md-cell class="actions">\n <md-switch no-margin ng-if="contact.lastAssignedTo === vm_voice.currentUser.name || !contact.lastAssignedTo" ng-disabled="vm_voice.disable[contact.id]" ng-model="contact.assigned" aria-label="reserved" ng-change="vm_voice.reserved(contact, contact.disposition)">\n \x3c!-- <span>{{ contact.assigned ? \'DASHBOARDS.RESERVED\' : \'DASHBOARDS.FREE\' | translate }}</span> --\x3e\n </md-switch>\n </td>\n <td md-cell class="list">{{contact.lastAssignedTo}}</td>\n <td md-cell class="actions">\n <md-menu ng-if="contact.lastAssignedTo === vm_voice.currentUser.name">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="1">\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-click="vm_voice.reserved(contact, null)"><em translate="DASHBOARDS.NONE">NONE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_voice.reserved(contact, \'fax\')"><em translate="DASHBOARDS.FAX">FAX</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_voice.reserved(contact, \'Answer Machine\')"><em translate="DASHBOARDS.ANSWER_MACHINE">ANSWER_MACHINE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_voice.reserved(contact, \'Interested\')"><em translate="DASHBOARDS.INTERESTED">INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_voice.reserved(contact, \'Not Interested\')"><em translate="DASHBOARDS.NOT_INTERESTED">NOT_INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_voice.reserved(contact, \'Sold\')"><em translate="DASHBOARDS.SOLD">SOLD</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_voice.reserved(contact, \'Special\')"><em translate="DASHBOARDS.SPECIAL">SPECIAL</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_voice.disposition.length" ng-repeat="disposition in vm_voice.disposition">\n <md-button ng-click="vm_voice.reserved(contact, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.contacts.count}}" md-on-paginate="vm_voice.getContacts" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/agent.general.home.html",'<div layout="column" layout-align="start center" class="md-primary-bg width-50">\n <div ng-repeat="node in vm_home.navigation">\n <div ng-repeat="home in node.children">\n <md-button ng-repeat="button in home.children" ng-if="!button.hidden()" class="md-raised width-50 height-50 no-margin" style="border-radius: 0px" aria-label="{{button.state}}" ng-click="vm_home.changeSidebarTab(button.state)" ng-class="{\'md-primary\': vm_home.sidebar != button.state}">\n <md-tooltip md-direction="right" md-delay="500"><span translate="{{button.translate}}"></span></md-tooltip>\n <md-icon md-font-icon="{{button.icon}}" ng-class="button.iconClass"></md-icon>\n </md-button>\n </div>\n </div>\n</div>\n<div ng-switch="vm_home.sidebar" style="overflow-y: auto" flex>\n <div ng-switch-when="contacts">\n <div ng-if="vm_home.hasPermission(102)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html\'" ng-controller="AgentHomeContactsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(102)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="mycontacts">\n <div ng-if="vm_home.hasPermission(103) && vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html\'" ng-controller="AgentHomeMyContactsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(103) || !vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="voice">\n <div ng-if="vm_home.hasPermission(110)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html\'" ng-controller="AgentHomeVoiceController as vm"></div>\n <div ng-if="!vm_home.hasPermission(110)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="abandoned">\n <div ng-if="vm_home.hasPermission(111)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html\'" ng-controller="AgentHomeAbandonedController as vm"></div>\n <div ng-if="!vm_home.hasPermission(111)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="recordings">\n <div ng-if="vm_home.hasPermission(104)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html\'" ng-controller="AgentHomeRecordingsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(104)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="chat">\n <div ng-if="vm_home.hasPermission(105) && vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html\'" ng-controller="AgentHomeChatController as vm"></div>\n <div ng-if="!vm_home.hasPermission(105) || !vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="mail">\n <div ng-if="vm_home.hasPermission(106) && vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html\'" ng-controller="AgentHomeMailController as vm"></div>\n <div ng-if="!vm_home.hasPermission(106) || !vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="sms">\n <div ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html\'" ng-controller="AgentHomeSmsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(107) || !vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="openchannel">\n <div ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html\'" ng-controller="AgentHomeOpenchannelController as vm"></div>\n <div ng-if="!vm_home.hasPermission(108) || !vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="fax">\n <div ng-if="vm_home.hasPermission(109) && vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html\'" ng-controller="AgentHomeFaxController as vm"></div>\n <div ng-if="!vm_home.hasPermission(109) || !vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-default>\n <div ng-if="vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html\'" ng-controller=" AgentHomeDashboardController as vm"></div>\n <div ng-if="!vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getChatInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getChatInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getChatInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_WEBSITE">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.ChatWebsiteId" ng-change="vm.getChatInteractions()">\n <md-option ng-value="chatAccount.id" ng-repeat="chatAccount in vm.chatAccounts.rows">{{chatAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getChatInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getChatInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getChatInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.WEBSITE\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatInteractions.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="chatInteraction in vm.chatInteractions.rows" ng-class="{\'text-bold text-italic\': chatInteraction.unread}">\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{chatInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!chatInteraction.closed && chatInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in chatInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!chatInteraction.closed && chatInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'chat\')" layout-margin>{{chatInteraction.unread}}</span>\n <md-icon ng-if="chatInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(chatInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{chatInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <div layout="row" ng-if="chatInteraction.lastMsgAt">\n <span><md-icon md-font-icon="{{chatInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon></span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{chatInteraction.lastMsgAt | formatdate }}</span>\n </div </div>\n <span ng-if="!chatInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <span ng-if="chatInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="chatInteraction.disposition">- {{chatInteraction.disposition}}</span></span>\n <md-tooltip ng-if="chatInteraction.closed">{{chatInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!chatInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="chatInteraction.substatus"> - {{chatInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(chatInteraction)}}</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell class="chatAccount">\n {{ vm.getChatWebsiteLabel(chatInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="chatInteraction.Tags.length">\n <div ng-if="chatInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': chatInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{chatInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="chatInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in chatInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showChatInteraction($event, chatInteraction)" translate="DASHBOARDS.SHOW">\n Show Chat\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.chatInteractions.count}}" md-on-paginate="vm.getChatInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html",'<md-card>\n <md-toolbar class="md-table-toolbar md-default table-header red-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.CONTACTS">Contacts</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div layout="column">\n <span class="font-size-10" translate="CONTACTMANAGER.SELECT_LIST">Select a list</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.ListId" ng-change="vm.getContacts()">\n <md-option ng-value="vm.defaultLists" ng-if="vm.lists.count > 1"><em translate="CONTACTMANAGER.ALL_CONTACTS">All</em></md-option>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm.refreshContacts($event)" aria-label="refresh Contacts" translate translate-attr-label="DASHBOARDS.REFRESH_CONTACTS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n <md-button class="md-icon-button" ng-click="vm.openContact($event)" aria-label="add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.openContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="firstName">{{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="mobile">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="fax">{{contact.fax}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="email">{{contact.email}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="list">{{vm.listsMap[contact.ListId].name}}</td>\n <td md-cell class="tags">\n <div ng-if="contact.tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.tags">{{tag}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.openContact($event, contact)" translate="DASHBOARDS.EDIT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html",'<div ng-cloak>\n <md-content>\n <md-tabs md-dynamic-height md-border-bottom>\n <md-tab ng-if="vm_home.hasPermission(110)" label="Voice">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html\'" ng-controller="AgentHomeDashboardVoiceController as vm_voice" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="Bull">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html\'" ng-controller="AgentHomeDashboardBullController as vm_bull" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(105) && vm_home.license.chat" label="Chat">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html\'" ng-controller="AgentHomeDashboardMultiChannelChatController as vm_chat" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(106) && vm_home.license.mail" label="Email">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html\'" ng-controller="AgentHomeDashboardMultiChannelMailController as vm_mail" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" label="Sms">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html\'" ng-controller="AgentHomeDashboardMultiChannelSmsController as vm_sms" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" label="Open Channel">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html\'" ng-controller="AgentHomeDashboardMultiChannelOpenchannelController as vm_openchannel" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(109) && vm_home.license.fax" label="Fax">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html\'" ng-controller="AgentHomeDashboardMultiChannelFaxController as vm_fax" class="md-padding">\n </md-content>\n </md-tab>\n </md-tabs>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_bull.promise">\n <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getVoiceQueues">\n <tr md-row>\n <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.getSize(vm_bull.voiceQueues)">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, voiceQueue) in vm_bull.voiceQueues">\n <td md-cell class="name">{{voiceQueue.name}}</td>\n <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.voiceQueuesTotal}}" md-on-paginate="vm_bull.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm_bull.rpcVoiceQueuesChannels | limitObjectFromTo: vm_bull.queryChannels.limit:(vm_bull.queryChannels.page - 1) * vm_bull.queryChannels.limit">\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.queryChannels.limit" md-page="vm_bull.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_chat.promise">\n <thead md-head md-order="vm_chat.query.sort" md-on-reorder="vm_chat.getChatQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_chat.getSize(vm_chat.chatQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_chat.chatQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_chat.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_chat.query.page" md-total="{{vm_chat.chatQueuesTotal}}" md-on-paginate="vm_chat.getChatQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_chat.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_chat.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_chat.queryChannels.limit" md-page="vm_chat.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_chat.paginatedInteractions.length}}" md-on-paginate="vm_chat.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_fax.promise">\n <thead md-head md-order="vm_fax.query.sort" md-on-reorder="vm_fax.getFaxQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_fax.getSize(vm_fax.faxQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_fax.faxQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_fax.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_fax.query.page" md-total="{{vm_fax.faxQueuesTotal}}" md-on-paginate="vm_fax.getFaxQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_fax.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_fax.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_fax.queryChannels.limit" md-page="vm_fax.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_fax.paginatedInteractions.length}}" md-on-paginate="vm_fax.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_mail.promise">\n <thead md-head md-order="vm_mail.query.sort" md-on-reorder="vm_mail.getMailQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_mail.getSize(vm_mail.mailQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_mail.mailQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_mail.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_mail.query.page" md-total="{{vm_mail.mailQueuesTotal}}" md-on-paginate="vm_mail.getMailQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_mail.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_mail.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_mail.queryChannels.limit" md-page="vm_mail.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_mail.paginatedInteractions.length}}" md-on-paginate="vm_mail.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_openchannel.promise">\n <thead md-head md-order="vm_openchannel.query.sort" md-on-reorder="vm_openchannel.getOpenchannelQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_openchannel.getSize(vm_openchannel.openchannelQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_openchannel.openchannelQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_openchannel.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_openchannel.query.page" md-total="{{vm_openchannel.openchannelQueuesTotal}}" md-on-paginate="vm_openchannel.getOpenchannelQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_openchannel.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_openchannel.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_openchannel.queryChannels.limit" md-page="vm_openchannel.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_openchannel.paginatedInteractions.length}}" md-on-paginate="vm_openchannel.paginate"\n md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_sms.promise">\n <thead md-head md-order="vm_sms.query.sort" md-on-reorder="vm_sms.getSmsQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_sms.getSize(vm_sms.smsQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_sms.smsQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_sms.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_sms.query.page" md-total="{{vm_sms.smsQueuesTotal}}" md-on-paginate="vm_sms.getSmsQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_sms.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_sms.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_sms.queryChannels.limit" md-page="vm_sms.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_sms.paginatedInteractions.length}}" md-on-paginate="vm_sms.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_voice.promise">\n <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getVoiceQueues">\n <tr md-row>\n <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.getSize(vm_voice.voiceQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, voiceQueue) in vm_voice.voiceQueues">\n <td md-cell class="name">{{voiceQueue.name}}</td>\n <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.voiceQueuesTotal}}" md-on-paginate="vm_voice.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm_voice.rpcVoiceQueuesChannels | limitObjectFromTo: vm_voice.queryChannels.limit:(vm_voice.queryChannels.page - 1) * vm_voice.queryChannels.limit">\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.queryChannels.limit" md-page="vm_voice.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getFaxInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getFaxInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getFaxInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.FaxAccountId" ng-change="vm.getFaxInteractions()">\n <md-option ng-value="faxAccount.id" ng-repeat="faxAccount in vm.faxAccounts.rows">{{faxAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getFaxInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getFaxInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getFaxInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n <md-menu ng-if="vm.faxAccounts.rows && vm.faxAccounts.rows.length">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="faxAccount in vm.faxAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeFaxInteraction($event, faxAccount)">{{ faxAccount.name }} ({{ faxAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxInteractions.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="faxInteraction in vm.faxInteractions.rows" ng-class="{\'text-bold text-italic\': faxInteraction.unread}">\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{faxInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!faxInteraction.closed && faxInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in faxInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!faxInteraction.closed && faxInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'fax\')" layout-margin>{{faxInteraction.unread}}</span>\n <md-icon ng-if="faxInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(faxInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{faxInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <div layout="row" ng-if="faxInteraction.lastMsgAt">\n <span><md-icon md-font-icon="{{faxInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon></span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{faxInteraction.lastMsgAt | formatdate }}</span>\n </div </div>\n <span ng-if="!faxInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <span ng-if="faxInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="faxInteraction.disposition">- {{faxInteraction.disposition}}</span></span>\n <md-tooltip ng-if="faxInteraction.closed">{{faxInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!faxInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="faxInteraction.substatus"> - {{faxInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(faxInteraction)}}</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell class="faxAccount">\n {{ vm.getFaxAccountLabel(faxInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="faxInteraction.Tags.length">\n <div ng-if="faxInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': faxInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{faxInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="faxInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in faxInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showFaxInteraction($event, faxInteraction)" translate="DASHBOARDS.SHOW">\n Show Fax\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.faxInteractions.count}}" md-on-paginate="vm.getFaxInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getMailInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getMailInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getMailInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column" ng-if="vm.query.closed == 0">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_SUBSTATUS">Select a sub status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.substatus" ng-change="vm.getMailInteractions()">\n <md-option ng-repeat="subStatus in vm.subStatuses.rows" ng-value="subStatus.name">{{subStatus.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.MailAccountId" ng-change="vm.getMailInteractions()">\n <md-option ng-value="mailAccount.id" ng-repeat="mailAccount in vm.mailAccounts.rows">{{mailAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getMailInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getMailInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getMailInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n <md-menu ng-if="vm.mailAccounts.rows && vm.mailAccounts.rows.length">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="mailAccount in vm.mailAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeMailInteraction($event, mailAccount)">{{ mailAccount.name }} ({{ mailAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="subject" style="width:200px">{{\'DASHBOARDS.SUBJECT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailInteractions.rows.length">\n <td md-cell colspan="9">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="mailInteraction in vm.mailInteractions.rows" ng-class="{\'text-bold text-italic\': mailInteraction.unread}">\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{mailInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!mailInteraction.closed && mailInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in mailInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!mailInteraction.closed && mailInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'mail\')" layout-margin>{{mailInteraction.unread}}</span>\n <md-icon ng-if="mailInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(mailInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <span class="text-truncate font-size-12" style="width:200px">{{mailInteraction.subject}}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{mailInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <div layout="row" ng-if="mailInteraction.lastMsgAt">\n <span><md-icon md-font-icon="{{mailInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon></span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{mailInteraction.lastMsgAt | formatdate }}</span>\n </div </div>\n <span ng-if="!mailInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <span ng-if="mailInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="mailInteraction.disposition">- {{mailInteraction.disposition}}</span></span>\n <md-tooltip ng-if="mailInteraction.closed">{{mailInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!mailInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="mailInteraction.substatus"> - {{mailInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(mailInteraction)}}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell class="mailAccount">\n {{ vm.getMailAccountLabel(mailInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="mailInteraction.Tags.length">\n <div ng-if="mailInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': mailInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{mailInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="mailInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in mailInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showMailInteraction($event, mailInteraction)" translate="DASHBOARDS.SHOW">\n Show Mail\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.mailInteractions.count}}" md-on-paginate="vm.getMailInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header red-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.MYCONTACTS">My Contacts</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div layout="column">\n <span class="font-size-10" translate="CONTACTMANAGER.SELECT_LIST">Select a list</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.ListId" ng-change="vm.getContacts()">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n <md-option ng-value="vm.defaultLists" ng-if="vm.lists.count > 1"><em translate="CONTACTMANAGER.ALL_CONTACTS">All</em></md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm.refreshContacts($event)" aria-label="refresh Contacts" translate translate-attr-label="DASHBOARDS.REFRESH_CONTACTS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n <md-button class="md-icon-button" ng-click="vm.openContact($event)" aria-label="add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.openContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="firstName">{{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="mobile">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="fax">{{contact.fax}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="email">{{contact.email}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="list">{{vm.listsMap[contact.ListId].name}}</td>\n <td md-cell class="tags">\n <div ng-if="contact.tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.tags">{{tag}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.openContact($event, contact)" translate="DASHBOARDS.EDIT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getOpenchannelInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getOpenchannelInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getOpenchannelInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.OpenchannelAccountId" ng-change="vm.getOpenchannelInteractions()">\n <md-option ng-value="openchannelAccount.id" ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">{{openchannelAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getOpenchannelInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getOpenchannelInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getOpenchannelInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelInteractions.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="openchannelInteraction in vm.openchannelInteractions.rows" ng-class="{\'text-bold text-italic\': openchannelInteraction.unread}">\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{openchannelInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!openchannelInteraction.closed && openchannelInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in openchannelInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!openchannelInteraction.closed && openchannelInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'openchannel\')" layout-margin>{{openchannelInteraction.unread}}</span>\n <md-icon ng-if="openchannelInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(openchannelInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{openchannelInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <div layout="row" ng-if="openchannelInteraction.lastMsgAt">\n <span><md-icon md-font-icon="{{openchannelInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon></span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{openchannelInteraction.lastMsgAt | formatdate }}</span>\n </div </div>\n <span ng-if="!openchannelInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <span ng-if="openchannelInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="openchannelInteraction.disposition">- {{openchannelInteraction.disposition}}</span></span>\n <md-tooltip ng-if="openchannelInteraction.closed">{{openchannelInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!openchannelInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="openchannelInteraction.substatus"> - {{openchannelInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(openchannelInteraction)}}</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell class="openchannelAccount">\n {{ vm.getOpenchannelAccountLabel(openchannelInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="openchannelInteraction.Tags.length">\n <div ng-if="openchannelInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': openchannelInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{openchannelInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="openchannelInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in openchannelInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" translate="DASHBOARDS.SHOW">\n Show Openchannel\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.openchannelInteractions.count}}" md-on-paginate="vm.getOpenchannelInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header indigo-A100-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.RECORDINGS">Recordings</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="VOICE.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'VOICE.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getVoiceRecordings()" placeholder="{{ \'VOICE.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="VOICE.SELECT_TYPE">Select a type</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.type" ng-change="vm.getVoiceRecordings()">\n <md-option value="internal" translate="VOICE.INTERNAL">Internal</md-option>\n <md-option value="inbound">Inbound</md-option>\n <md-option value="outbound">Outbound</md-option>\n <md-option ng-value="null" translate="VOICE.ALL">All</md-option>\n </md-select>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n <tr md-row>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n <th md-column>{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n <td md-cell class="type">{{voiceRecording.type}}</td>\n <td md-cell class="uniqueid">{{voiceRecording.uniqueid}}</td>\n <td md-cell class="calleridnum">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.calleridnum" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="exten">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.exten" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="connectedlinenum">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.connectedlinenum" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="queue">{{voiceRecording.queue}}</td>\n <td md-cell class="rating">\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span></td>\n <td md-cell class="audio" ng-switch="voiceRecording.format">\n \x3c!-- audio recording directive --\x3e\n <ms-recording ng-switch-when=".wav" id="voiceRecording.id"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n <span ng-switch-when=".gsm">\n <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n </span>\n </td>\n <td md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.downloadfile(voiceRecording, $event)" translate="VOICE.DOWNLOAD_VOICERECORDING">\n Download VoiceRecording\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getSmsInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getSmsInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getSmsInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.SmsAccountId" ng-change="vm.getSmsInteractions()">\n <md-option ng-value="smsAccount.id" ng-repeat="smsAccount in vm.smsAccounts.rows">{{smsAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getSmsInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getSmsInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getSmsInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n <md-menu ng-if="vm.smsAccounts.rows && vm.smsAccounts.rows.length">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="smsAccount in vm.smsAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeSmsInteraction($event, smsAccount)">{{ smsAccount.name }} ({{ smsAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsInteractions.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="smsInteraction in vm.smsInteractions.rows" ng-class="{\'text-bold text-italic\': smsInteraction.unread}">\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{smsInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!smsInteraction.closed && smsInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in smsInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!smsInteraction.closed && smsInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'sms\')" layout-margin>{{smsInteraction.unread}}</span>\n <md-icon ng-if="smsInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(smsInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{smsInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <div layout="row" ng-if="smsInteraction.lastMsgAt">\n <span><md-icon md-font-icon="{{smsInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon></span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{smsInteraction.lastMsgAt | formatdate }}</span>\n </div </div>\n <span ng-if="!smsInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <span ng-if="smsInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="smsInteraction.disposition">- {{smsInteraction.disposition}}</span></span>\n <md-tooltip ng-if="smsInteraction.closed">{{smsInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!smsInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="smsInteraction.substatus"> - {{smsInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(smsInteraction)}}</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell class="smsAccount">\n {{ vm.getSmsAccountLabel(smsInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="smsInteraction.Tags.length">\n <div ng-if="smsInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': smsInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{smsInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="smsInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in smsInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showSmsInteraction($event, smsInteraction)" translate="DASHBOARDS.SHOW">\n Show Sms\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.smsInteractions.count}}" md-on-paginate="vm.getSmsInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.CALLS">Calls</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="VOICE.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'VOICE.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getVoiceCalls()" placeholder="{{ \'VOICE.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="VOICE.SELECT_TYPE">Select a type</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.type" ng-change="vm.getVoiceCalls()">\n <md-option value="internal" translate="VOICE.INTERNAL">Internal</md-option>\n <md-option value="inbound">Inbound</md-option>\n <md-option value="outbound">Outbound</md-option>\n <md-option ng-value="null" translate="VOICE.ALL">All</md-option>\n </md-select>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceCalls">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="source">{{ \'VOICE.SOURCE\' | translate }}</th>\n <th md-column md-order-by="destination">{{ \'VOICE.DESTINATION\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'VOICE.STARTEDAT\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'VOICE.ENDEDAT\' | translate }}</th>\n <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n <th md-column>{{ \'VOICE.NOTE\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceCalls.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="voiceCall in vm.voiceCalls.rows" ng-click="vm.showDetails(voiceCall, $event)">\n <td md-cell class="type">{{voiceCall.id}}</td>\n <td md-cell class="type">{{voiceCall.type}}</td>\n <td md-cell class="source">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceCall.source" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="destination">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceCall.destination" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="starttime">{{voiceCall.starttime | date:\'medium\' }}</td>\n <td md-cell class="endtime">{{voiceCall.endtime | date:\'medium\' }}</td>\n <td md-cell class="disposition">{{voiceCall.userDisposition}}</td>\n <td md-cell class="note">\n <md-icon ng-if="voiceCall.note" md-font-icon="icon-clipboard-outline"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showDetails(voiceCall, $event)" translate="VOICE.DETAILS">\n Show Details\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceCalls.count}}" md-on-paginate="vm.getVoiceCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",'<md-dialog class="details-dialog" aria-label="details">\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="!vm.interaction.closed" class="title" translate="VOICE.DETAILS"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-list flex>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.UNIQUEID">Uniqueid</p>\n <h4>{{vm.call.uniqueid}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.TYPE">Type</p>\n <h4>{{vm.call.type ? vm.call.type : \'no type\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.SOURCE">Source</p>\n <h4>{{vm.call.source ? vm.call.source : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DESTINATION">Destination</p>\n <h4>{{vm.call.destination ? vm.call.destination : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.STARTEDAT">Started At</p>\n <h4>{{vm.call.starttime | date:\'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.ANSWEREDAT">Answered At</p>\n <h4>{{vm.call.answertime ? (vm.call.answertime | date:\'medium\') : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.ENDEDAT">Ended At</p>\n <h4>{{vm.call.endtime ? (vm.call.endtime | date:\'medium\') : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DURATION">Duration</p>\n <h4>{{vm.call.duration ? vm.call.duration : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.BILLABLESECONDS">Billable Seconds</p>\n <h4>{{vm.call.billableseconds ? vm.call.billableseconds : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DISPOSITION">Disposition</p>\n <h4>{{vm.call.userDisposition ? vm.call.userDisposition : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.NOTE">Note</p>\n <h4>{{vm.call.note ? vm.call.note : \'--\'}}</h4>\n </div>\n </md-list-item>\n </md-list>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="button" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="DISPOSE" translate="VOICE.CLOSE" translate-attr-aria-label="VOICE.DISPOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",'<md-dialog id="agent-general-dialog" aria-label="Spy Dialog">\n <div id="interaction-app" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'"></div>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html",'\x3c!-- CONTENT CARD --\x3e\n<md-content class="content-card" layout="row" layout-fill>\n\n <div ng-if="!vm.showInteraction" class="start-point" flex layout="column" layout-align="center center" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html\'"></div>\n\n <div ng-if="vm.showInteraction" flex layout="row">\n\n <md-card flex="75" class="interaction">\n\n <md-content class="interaction-agents" layout="row" layout-align="start center" ng-if="!vm.interaction.closed && vm.interaction.Users.length">\n <strong layout-margin translate="DASHBOARDS.CURRENTLY_IN_USE_BY">Currently in use by </strong>\n\n <div ng-repeat="u in vm.interaction.Users">\n <img class="avatar-small" ng-src="api/users/{{u.id}}/avatar">\n <md-tooltip> {{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersMap[u.id] | translate }} </md-tooltip>\n </div>\n </md-content>\n\n \x3c!-- TOOLBAR --\x3e\n <md-toolbar class="interaction-toolbar" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html\'"></md-toolbar>\n \x3c!-- / TOOLBAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content id="interaction-content" name="{{\'interaction-content-\' + vm.tab.id}}" flex ms-scroll layout-wrap>\n <div class="interaction-messages" ng-switch="vm.tab.channel">\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html\'"></div>\n </div>\n <div ng-switch-default>\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html\'"></div>\n </div>\n </div>\n </md-content>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- FOOTER --\x3e\n <div ng-if="!vm.interaction.closed && vm.tab.channel != \'mail\' && vm.tab.channel !== \'fax\' && (vm.tab.channel != \'sms\' || !vm.tab.spy)" class="interaction-footer flex-noshrink" layout="row" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html\'"></div>\n \x3c!-- / FOOTER--\x3e\n </md-card>\n\n <md-card layout="column" flex class="info" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html\'"></md-card>\n </div>\n</md-content>\n\x3c!-- / CONTENT CARD --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/composeFax/dialog.html",'<md-dialog class="compose-dialog-fax" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="FAX.SEND">SEND</span>\n </md-button>\n <md-button ng-disabled="vm.message.attachments.length === 1" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions"\n flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n </md-button>\n </div>\n <span class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="FAX.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <md-input-container class="md-block to">\n <label translate="FAX.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n \x3c!-- <input ng-model="vm.message.subject" type="text"> --\x3e\n <md-autocomplete ng-hide="vm.message.to.length === 1" md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.fax" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" ng-if="composeForm.$dirty">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n <div ng-message="md-max-chips">You reached the maximum amount of chips</div>\n </div>\n </md-input-container>\n\n <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n <div>\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n <span class="filename">{{attachment.name}}</span>\n <span class="size">({{attachment.size | byteFmt: 0}})</span>\n </div>\n\n <md-button class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="FAX.DELETE_ATTACHMENT">\n \x3c!-- <md-icon md-font-icon="icon-close" class="s16"></md-icon> --\x3e\n </md-button>\n </div>\n </div>\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/composeMail/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message" ng-style="{\n \'max-width\': {true: \'620px\', false: \'90%\'}[ vm.secret ],\n \'width\': {true: \'620px\', false: \'100%\'}[ vm.secret ],\n \'max-height\': {true: undefined, false: \'97%\'}[ vm.secret ]\n }">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar ng-class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <div ng-if="!vm.secret" class="md-button md-raised blue-bg no-padding">\n <button class="white-fg margin-horizontal-10" aria-label="Send message" ng-disabled="!vm.verifySmtp" ng-click="vm.send($event, false, null)">\n <span>{{ \'MAIL.SEND\' | translate | uppercase }}</span>\n </button>\n <span class="white-fg secondary-text vertical-divider"></span>\n <md-menu>\n <button ng-disabled="!vm.verifySmtp" class="white-fg margin-left-0" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-menu-down" class="icon s24"></md-icon>\n </button>\n\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.subStatuses.rows.length">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="MAIL.SEND_AS">\n Send as\n </md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n <md-button ng-click="vm.send($event, false, subStatus.name)">\n {{subStatus.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.send($event, true, null)" translate="MAIL.SEND_AND_CLOSE">\n Send and Close\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="MAIL.ADD_NOTE">Add note</span>\n </md-button>\n <md-button ng-disabled="!vm.verifySmtp" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload($files)" flow-init="vm.ngFlowOptions"\n flow-file-success="vm.fileSuccess($file, $message)">\n <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="MAIL.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container ng-if="!vm.secret" class="md-block to" ng-class="{\'hidden-cc\': vm.hiddenCC, \'hidden-bcc\': vm.hiddenBCC}">\n <label translate="MAIL.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n\n <div class="cc-bcc" layout="row" layout-align="start center">\n <div class="show-cc" ng-show="vm.hiddenCC" ng-click="vm.hiddenCC = false">CC</div>\n <div class="show-bcc" ng-show="vm.hiddenBCC" ng-click="vm.hiddenBCC = false">BCC</div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenCC">\n <label translate="MAIL.CC">Cc</label>\n <md-chips name="cc" ng-model="vm.message.cc" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchCc" md-items="contact in vm.contactSearch(vm.searchCc)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n </md-input-container>\n\n <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenBCC">\n <label translate="MAIL.BCC">Bcc</label>\n <md-chips name="bcc" ng-model="vm.message.bcc" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchBcc" md-items="contact in vm.contactSearch(vm.searchBcc)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n </md-input-container>\n\n <md-input-container ng-if="!vm.secret" class="md-block no-margin">\n <label translate="MAIL.SUBJECT">Subject</label>\n <input ng-model="vm.message.subject" type="text">\n </md-input-container>\n\n <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n <div>\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n <span class="filename">{{attachment.name}}</span>\n <span class="size" ng-if="attachment.size">({{attachment.size | byteFmt: 0}})</span>\n </div>\n\n <md-button ng-click="vm.deleteAttachment(attachment)" class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="MAIL.DELETE_ATTACHMENT">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div class="padding-top-5">\n <textarea ckeditor="vm.ckeditor" id="html-area" ng-model="vm.message.body" md-select-on-focus="" ready="vm.onReadyEditor()"></textarea>\n </div>\n\n <md-switch ng-if="!vm.message.showLastMessage && !vm.secret" ng-model="vm.message.showLastMessage" ng-change="vm.loadLastMessage()" aria-label="load last message"><span translate="MAIL.SHOW_ORIGINAL_MESSAGE">Show original message</span></md-switch>\n\n <md-autocomplete ng-if="!vm.secret" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1"\n md-floating-label="{{ \'MAIL.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.MailAccountId" md-font-icon="icon-earth" aria-label="alert email" class="s16"></md-icon>\n <md-icon ng-if="item.MailAccountId" md-font-icon="icon-email" aria-label="alert email" class="s16 teal-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="MAIL.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/composeSms/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="SMS.SEND">SEND</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n <span translate="SMS.ADD_NOTE">Add note</span>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="SMS.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container ng-if="!vm.secret" class="md-block to">\n <label translate="SMS.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- msEmojyArea directive --\x3e\n <ms-emoji-area ng-if="vm.tab.channel != \'fax\'" on-reply="vm.reply(event, body)" set-text="vm.setTextWrapper(dirFn)" get-text="vm.getTextWrapper(dirFn)" picker-position="\'bottom\'" search="false" recent-emojis="false" placeholder="\'SMS.INSERT_MESSAGE_HERE\'"></ms-emoji-area>\n \x3c!-- / msEmojyArea directive --\x3e\n\n <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value"\n md-min-length="1" md-floating-label="{{ \'SMS.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.SmsAccountId" md-font-icon="icon-earth" aria-label="alert sms" class="s16"></md-icon>\n <md-icon ng-if="item.SmsAccountId" md-font-icon="icon-message-text" aria-label="alert sms" class="s16 orange-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="SMS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",'<md-dialog class="disposition-dialog" aria-label="disposition">\n <form name="dispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="!vm.interaction.closed" class="title" translate="DASHBOARDS.DISPOSE"></span>\n <span ng-if="vm.interaction.closed" class="title" translate="DASHBOARDS.INFO"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.DISPOSITIONS">Dispositions</label>\n <md-select name="disposition" ng-model="vm.interaction.disposition" required>\n \x3c!-- <md-select ng-disabled="vm.interaction.closed && vm.interaction.disposition" name="disposition" ng-model="vm.interaction.disposition" required> --\x3e\n <md-option ng-value="null">NONE</md-option>\n <md-option ng-value="disposition.name" ng-repeat="disposition in vm.dispositions.rows">{{ disposition.name }}</md-option>\n </md-select>\n <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.NOTE">Note</label>\n \x3c!-- <textarea ng-disabled="vm.interaction.closed && vm.interaction.disposition" ng-model="vm.interaction.note" md-maxlength="255" max-rows="5" autofocus></textarea> --\x3e\n <textarea ng-model="vm.interaction.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n \x3c!-- <md-dialog-actions ng-if="!vm.interaction.closed || !vm.interaction.disposition" layout="row" layout-align="space-between center"> --\x3e\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveDisposition(true)" class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && vm.interaction.disposition" aria-label="CLOSE_AND_DISPOSE" translate="DASHBOARDS.CLOSE_AND_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_AND_DISPOSE">\n CLOSE AND DISPOSE\n </md-button>\n <md-button type="submit" ng-click="vm.saveDisposition(false)" class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && !vm.interaction.disposition" aria-label="CLOSE_WITHOUT_DISPOSE" translate="DASHBOARDS.CLOSE_WITHOUT_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_WITHOUT_DISPOSE">\n CLOSE WITHOUT DISPOSE\n </md-button>\n <md-button type="submit" ng-click="vm.saveDisposition(false)" class="send-button md-accent md-raised" ng-if="vm.interaction.closed" aria-label="DISPOSE" translate="DASHBOARDS.DISPOSE" translate-attr-aria-label="DASHBOARDS.DISPOSE">\n DISPOSE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",'<md-dialog class="tag-dialog" aria-label="tag">\n <form name="tagForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.TAGS"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <md-chips ng-model="vm.interaction.Tags" md-autocomplete-snap md-require-match="vm.autocompleteRequireMatch">\n <md-autocomplete ng-blur="vm.searchText = \'\'" md-min-length="0" md-selected-item-change="vm.selectedItemChange" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="item in vm.tags.rows | filter:{ name: vm.searchText }" md-item-text="item.name"\n placeholder="Search for a tag">\n <span md-highlight-text="vm.searchText">{{item.name}}</span>\n </md-autocomplete>\n <md-chip-template>\n <span>\n <strong>{{$chip.name}}</strong>\n </span>\n </md-chip-template>\n </md-chips>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveTag(false)" ng-disabled="tagForm.$pristine" class="send-button md-accent md-raised" aria-label="TAG" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html",'\x3c!-- REPLY FORM --\x3e\n<div ng-show="vm.showFooter" layout="column" layout-align "center center" flex>\n <div layout="row" layout-align="center center" flex>\n \x3c!-- msEmojyArea directive --\x3e\n <ms-emoji-area ng-if="vm.tab.channel != \'fax\'" on-reply="vm.reply(event, body)" set-text="vm.setTextWrapper(dirFn)" get-text="vm.getTextWrapper(dirFn)" placeholder="vm.tab.channel.toUpperCase() + \'.INSERT_MESSAGE_HERE\'"></ms-emoji-area>\n \x3c!-- / msEmojyArea directive --\x3e\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm.tab.channel != \'fax\'" style="margin:1px;" class="md-icon-button md-mini" ng-click="vm.changeDisplayCannedAnswerInputValue()" aria-label="Search canned answer" translate translate-attr-aria-label="DASHBOARDS.SEND_MESSAGE">\n <md-icon md-font-icon="icon-auto-fix" class="green-fg"></md-icon>\n </md-button>\n\n <md-button ng-if="vm.tab.channel == \'openchannel\' || vm.tab.channel == \'chat\' || vm.tab.channel == \'fax\'" style="margin:1px;" class="md-icon-button md-warn md-mini" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow"\n flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n <md-icon md-font-icon="icon-paperclip"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-autocomplete ng-hide="!vm.displayCannedAnswerInput" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value"\n md-min-length="1" placeholder="{{ \'DASHBOARDS.CANNED_ANSWER_SEARCH\' | translate}}" class="cannedarea input-show-hide">\n <md-item-template>\n <md-icon ng-if="!item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="icon-earth" aria-label="alert channel" class="s16"></md-icon>\n <md-icon ng-if="item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" aria-label="alert channel" class="s16" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="DASHBOARDS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n</div>\n\x3c!-- / REPLY FORM --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line" ng-if="item.browserName">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.BROWSER_NAME">Browser Name</p>\n <h4>{{item.browserName}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.osName">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.OS_NAME">OS Name</p>\n <h4>{{item.osName}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.deviceModel">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DEVICE_MODEL">Device Model</p>\n <h4>{{item.deviceModel}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.referer">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.REFERER">Referer</p>\n <h4>{{item.referer}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.customerIp">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CUSTOMER_IP">Customer IP</p>\n <h4>{{item.customerIp}}</h4>\n </div>\n </md-list-item>\n <md-divider></md-divider>\n <md-list-item class="md-2-line" ng-if="item.closed && item.ratingValue != null">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.RATING">Rating</p>\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="!item.ratingType || item.ratingType == \'star\'" ng-repeat="ratingValue in [1,2,3,4,5] | limitTo:item.ratingValue"></md-icon>\n <md-icon md-font-icon="icon-thumb-up" style="color:green" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 1"></md-icon>\n <md-icon md-font-icon="icon-thumb-down" style="color:red" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 0"></md-icon>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.ratingMessage">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.FEEDBACK">Feedback</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{item.ratingMessage}}</h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html",'<md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.CONTACT">Contact</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-account"></md-icon>\n <label translate="DASHBOARDS.NAME">Name</label>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" disabled>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-email"></md-icon>\n <label translate="DASHBOARDS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.contact.email" disabled>\n </md-input-container>\n\n <md-input-container ng-if="vm.tab.channel != \'fax\'" class="md-block">\n <md-icon md-font-icon="icon-phone"></md-icon>\n <label translate="DASHBOARDS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.contact.phone" disabled>\n </md-input-container>\n\n <md-input-container ng-if="vm.tab.channel == \'fax\'" class="md-block">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <label translate="DASHBOARDS.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.contact.fax" disabled>\n </md-input-container>\n\n <div ng-if="!vm.tab.spy" layout="row" layout-align="center center">\n <md-button class="md-raised md-accent" ng-click="vm.openContact(ev)" translate="DASHBOARDS.MORE">\n More\n </md-button>\n </div>\n </form>\n </md-content>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.INTERACTION">Interaction</span>\n </md-tab-label>\n <md-tab-body>\n <div layout="column" layout-align="space-between center" class="md-padding">\n <md-icon class="s42" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <span ng-if="vm.interaction.closed" class="md-background-bg red-fg font-size-14">#{{vm.interaction.id}} - <span translate="DASHBOARDS.CLOSED"></span></span>\n <span ng-if="!vm.interaction.closed" class="md-background-bg green-fg font-size-14">#{{vm.interaction.id}} - <span translate="DASHBOARDS.OPENED"></span></span>\n <span ng-if="!vm.interaction.closed && vm.interaction.substatus" class="md-background-bg green-fg font-size-14">{{ \'DASHBOARDS.\' + vm.interaction.substatus.toUpperCase() | translate }}</span>\n </div>\n <md-divider></md-divider>\n <md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.WEBSITE" ng-if="vm.tab.channel == \'chat\'">Website</p>\n <p translate="DASHBOARDS.ACCOUNT" ng-if="vm.tab.channel != \'chat\'">Account</p>\n <h4>{{vm.account.name}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.AGENT">Agent</p>\n <h4>{{vm.agent.fullname || vm.usersMap[vm.interaction.UserId]}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.externalUrl">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n <a href="{{vm.interaction.externalUrl}}" target="_blank">\n <h4>{{vm.interaction.externalUrl}}</h4>\n </a>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n <h4>{{vm.interaction.createdAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <div ng-switch="vm.tab.channel">\n <div ng-switch-when="chat">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'"></div>\n </div>\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'"></div>\n </div>\n </div>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.Tags.length">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.TAGS">Tags</p>\n <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </div>\n </md-list-item>\n\n <md-divider ng-if="vm.interaction.closed"></md-divider>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n <h4>{{vm.interaction.closedAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.disposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n <h4>{{ vm.interaction.disposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-3-line md-long-text" ng-if="vm.interaction.closed && vm.interaction.note">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">NOTE</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{ vm.interaction.note }}</h4>\n </div>\n </md-list-item>\n </md-list>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span>Journey (beta)</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'"></div>\n </md-content>\n </md-tab-body>\n </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html",'<md-divider></md-divider>\n\n<md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.AGENT">Agent</p>\n <h4>{{vm.agent.fullname || vm.usersMap[item.UserId]}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line" ng-if="item.externalUrl">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n <a href="{{item.externalUrl}}" target="_blank">\n <h4>{{item.externalUrl}}</h4>\n </a>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n <h4>{{item.createdAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <div ng-if="item.ChatWebsiteId">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'"></div>\n </div>\n <div ng-if="item.MailAccountId">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'"></div>\n </div>\n\n <md-divider ng-if="item.closed"></md-divider>\n <md-list-item class="md-2-line" ng-if="item.closed">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n <h4>{{item.closedAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.closed && item.disposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n <h4>{{ item.disposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-3-line md-long-text" ng-if="item.closed && item.note">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">NOTE</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{ item.note }}</h4>\n </div>\n </md-list-item>\n\n <p class="padding-horizontal-15 grey-fg">Tags</p>\n <md-list-item ng-if="item.Tags.length">\n <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in item.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html",'<div id="timeline" ms-timeline layout="column">\n \x3c!-- TIMELINE ITEM --\x3e\n <div class="ms-timeline-item" layout-align="center center" ng-repeat="item in vm.journey | orderBy:\'-createdAt\'">\n <div class="timeline-card">\n <md-card class="channel" ng-class="{\'md-grey-200-bg\': item.id == vm.interaction.id}">\n <div class="header p-6" layout="row" layout-align="space-between center">\n\n <md-button class="md-fab md-mini" aria-label="icon-channel" ng-class="vm.getColorByItem(item) + \'-bg\'">\n <md-icon ng-if="item.FaxAccountId" md-font-icon="icon-deskphone"></md-icon>\n <md-icon ng-if="item.OpenchannelAccountId" md-font-icon="icon-google-earth"></md-icon>\n <md-icon ng-if="item.SmsAccountId" md-font-icon="icon-message-text"></md-icon>\n <md-icon ng-if="item.MailAccountId" md-font-icon="icon-email"></md-icon>\n <md-icon ng-if="item.ChatWebsiteId" md-font-icon="icon-hangouts"></md-icon>\n <md-icon ng-if="item.amaflags" md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <div class="info" layout="column" ng-init="item.showMore = false">\n <span class="font-size-12 text-truncate">#{{item.id}} - {{ item.Account.key || item.destination }}</span>\n <span class="font-size-10">{{item.createdAt | date: \'medium\'}}</span>\n <span>\n <a class="toggle-details md-accent-color" ng-hide="item.showMore" ng-click="item.showMore = !item.showMore" translate="DASHBOARDS.SHOW_DETAILS">\n Show Details\n </a>\n <a class="toggle-details md-accent-color" ng-show="item.showMore" ng-click="item.showMore = !item.showMore" translate="DASHBOARDS.HIDE_DETAILS">\n Hide Details\n </a>\n </span>\n </div>\n\n <span>\n <img ng-if="item.UserId" class="avatar" ng-src="api/users/{{item.UserId}}/avatar">\n <md-tooltip md-direction="left">{{item.Owner.fullname || item.User.fullname}}</md-tooltip>\n </span>\n\n </div>\n\n <div ng-if="item.showMore">\n <div ng-if="!item.amaflags" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html\'"></div>\n <div ng-if="item.amaflags" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html\'"></div>\n </div>\n\n <md-divider></md-divider>\n\n <div ng-if="item.id != vm.interaction.id" layout="row" layout-align="space-around center">\n <div ng-if="item.closed && !amaflags" class="text-truncate white-fg">\n <span class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.CLOSED\' | translate}} {{ item.disposition }}">{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.CLOSED\' | translate}} {{ item.disposition }}</span>\n </div>\n <span class="text-boxed md-background-bg green-fg" ng-if="!item.closed && !item.amaflags" title="{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.OPENED\' | translate}}">{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.OPENED\' | translate}}<span ng-if="item.substatus"> - {{ \'DASHBOARDS.\' + item.substatus.toUpperCase() | translate }}</span></span>\n <span ng-if="item.amaflags" class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.DISPOSITION\' | translate}}: {{ item.userDisposition || \'No Dispose\'}}">{{ \'DASHBOARDS.DISPOSITION\' | translate}}: {{ item.userDisposition || \'No Dispose\'}}</span>\n <div flex></div>\n <md-button ng-if="!vm.tab.spy" ng-disabled="item.amaflags" class="md-icon-button" aria-label="go" ng-click="vm.openInteraction($event, item)">\n <md-icon md-font-icon="icon-open-in-new" class="s20"></md-icon>\n </md-button>\n\n </div>\n </md-card>\n </div>\n </div>\n \x3c!-- / TIMELINE ITEM --\x3e\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html",'<md-divider></md-divider>\n\n<md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.TYPE">Type</p>\n <h4>{{item.type ? item.type : \'no type\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SOURCE">Source</p>\n <h4>{{item.source ? item.source : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DESTINATION">Destination</p>\n <h4>{{item.destination ? item.destination : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CALLERID">Caller Id</p>\n <h4>{{item.callerid ? item.callerid : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.STARTEDAT">Started At</p>\n <h4>{{item.starttime | date:\'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.END_AT">End At</p>\n <h4>{{item.endtime | date:\'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DURATION">Duration</p>\n <h4>{{item.duration ? item.duration : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">Note</p>\n <h4>{{item.note ? item.note : \'--\'}}</h4>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line" ng-if="item.subject">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SUBJECT">Subject</p>\n <h4>{{item.subject}}</h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html",'\x3c!-- MESSAGES --\x3e\n<div layout="row" ng-repeat="message in vm.messages.rows" class="md-padding message-row" ng-class="message.secret && vm.user.id != message.UserId ? \'in\' : message.direction">\n <img ng-if="message.direction ===\'in\'" src="assets/images/avatars/customer.png" class="avatar" />\n <img ng-if="message.direction ===\'out\' && message.UserId && !message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n <img ng-if="message.direction ===\'out\' && message.UserId && message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n\n <div class="bubble" ng-class="{\'md-yellow-200-bg\': message.secret}" ng-switch="message.direction">\n <div ng-if="message.secret">\n <div class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n {{ vm.getLabelByMessage(message) }} - {{message.createdAt | date: \'medium\'}}\n </div>\n <div ng-if="message.id">\n <md-icon class="s18" md-font-icon="icon-lock"></md-icon>\n </div>\n </div>\n </div>\n <div ng-if="!message.secret">\n <div ng-switch-when="in" class="time secondary-text" ng-click="message.Contact && vm.openContact(ev, message.Contact)">{{ vm.getLabelByMessage(message) }} - {{message.createdAt | date: \'medium\'}}</div>\n <div ng-switch-when="out" class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n {{ vm.getLabelByMessage(message) }} - {{message.createdAt | date: \'medium\'}}\n </div>\n <div ng-if="message.id && vm.tab.channel !== \'fax\'">\n <md-icon ng-if="!message.read" class="s18" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n </div>\n <div ng-if="message.id && vm.tab.channel === \'fax\'">\n <md-icon ng-if="!message.read && !(message.failMessage )" class="s18" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n <span ng-if="!message.read && message.failMessage" class="s18 red-900-fg"> {{ message.failMessage }}</span>\n <md-icon ng-if="!message.read && message.failMessage" class="s18 red-900-fg" md-font-icon="icon-close md-accent"></md-icon>\n </div>\n </div>\n </div>\n <div ng-if="message.AttachmentId" layout="row" layout-align="end center">\n <md-button class="md-raised md-accent" ng-click="vm.getAttachment({id: message.AttachmentId, name: vm.htmlToPlaintext(message.body)})">\n <span>{{vm.htmlToPlaintext(message.body)}}</span>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n </div>\n <div ng-if="!message.AttachmentId" ng-bind-html="message.body | embed:vm.emojiOptions" class="message" layout="row" layout-align="end center"></div>\n </div>\n</div>\n\x3c!-- / MESSAGES --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html",'<div ms-timeline="vm.timelineOptions" ms-timeline-load-more="vm.loadNextPage()">\n <div ng-repeat="message in vm.messages.rows track by message.id" ng-init="vm.selectedMailShowSystemMessage[message.id] = false">\n <md-card ng-if="message.secret" class="md-padding md-yellow-100-bg" layout="column">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n <div layout="column">\n <span class="grey-fg">{{vm.agent.fullname || vm.usersMap[message.UserId]}}</span>\n <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n <div layout="row" layout-align="center center" layout-fill ng-if="message.attach">\n <div flex>\n <md-divider></md-divider>\n </div>\n <md-menu>\n <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span></md-tooltip>\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon><span>{{message.attach}}</span>\n </div>\n </md-button>\n <md-menu-content width="4">\n <div layout="column" layout-align="center center" ng-if="!message.attachments">\n <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n <span translate="MAIL.ATTACHMENTS">Attachments</span>\n </div>\n <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n <md-button ng-click="vm.getAttachment(attachment)">{{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n <div flex>\n <md-divider></md-divider>\n </div>\n </div>\n <div class="padding-top-5" ng-bind-html-unsafe="message.body"></div>\n </md-card>\n <div ng-if="!message.secret">\n <div layout="row" layout-align="center center" ng-if="message.direction == \'out\' && !message.UserId && !vm.selectedMailShowSystemMessage[message.id]">\n <md-button class="md-raised blue-grey-300-bg white-fg" ng-click="vm.selectedMailShowSystemMessage[message.id] = !vm.selectedMailShowSystemMessage[message.id]">[{{message.createdAt | date: \'medium\'}}] {{ \'MAIL.SHOW_AUTOREPLY\' | translate }}</md-button>\n </div>\n <md-card layout="column" class="md-padding message-row" ng-if="message.direction == \'in\' || (message.direction == \'out\' && (message.UserId || vm.selectedMailShowSystemMessage[message.id]))">\n <md-content class="mail-content">\n <div class="info" layout="row" layout-align="space-between start">\n\n <div layout="column" layout-align="start start">\n <div layout="row" layout-align="start start">\n \x3c!-- <div>\n <img ng-if="message.direction ===\'in\'" ng-src="assets/images/avatars/customer.png" class="avatar" alt="customer" />\n\n <img ng-if="message.direction ===\'out\' && message.UserId" class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n </div> --\x3e\n\n <div layout="column" layout-align="start start">\n <div class="name" ng-click="message.Contact && vm.openContact(ev, message.Contact)"><strong>{{message.from}}</strong>\n <md-icon ng-if="message.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <div class="name">\n <div>{{message.subject}}</div>\n </div>\n <div class="name" layout="row" layout-align="start center"><span translate="MAIL.TO">To</span>: <span class="padding-left-5 subject text-truncate">{{message.to}}</span></div>\n </div>\n </div>\n\n <a class="toggle-details md-accent-color" ng-hide="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.SHOW_DETAILS">\n Show Details\n </a>\n <a class="toggle-details md-accent-color" ng-show="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.HIDE_DETAILS">\n Hide Details\n </a>\n\n <div ng-show="vm.selectedMailShowDetails[message.id]" class="details" layout="row" layout-align="start start">\n <div layout="column">\n <span class="title" translate="MAIL.DATE">Date:</span>\n <span class="title" translate="MAIL.FROM">From:</span>\n <span class="title" translate="MAIL.TO">To:</span>\n <span class="title" translate="MAIL.CC" ng-if="message.cc">Cc:</span>\n <span class="title" translate="MAIL.ACCEPTED" ng-if="message.UserId && message.direction ===\'in\'">Accepted:</span>\n </div>\n\n <div layout="column">\n <span class="detail">{{message.createdAt | date:\'medium\'}}</span>\n <span class="detail">{{message.from}}</span>\n <span class="detail">{{message.to}}</span>\n <span class="detail" ng-if="message.cc">{{message.cc}}</span>\n <span class="detail" ng-if="message.UserId && message.direction ===\'in\'">{{vm.usersMap[message.UserId]}}</span>\n </div>\n </div>\n </div>\n\n <div layout="row" layout-align="center center">\n <div layout="column" layout-align="center end" class="md-padding">\n <span class="grey-fg" ng-if="message.direction ===\'in\'">{{message.from.indexOf(vm.contact.email) >= 0 ? vm.contact.firstName + \' \' + vm.contact.lastName : \'*\' + message.from}}</span>\n\n <span class="grey-fg" ng-if="message.direction ===\'out\' && message.UserId">{{vm.agent.fullname || vm.usersMap[message.UserId]}}</span>\n <span class="grey-fg" ng-if="message.direction ===\'out\' && !message.UserId">System</span>\n\n <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n </div>\n <img ng-if="message.direction ===\'in\'" ng-src="assets/images/avatars/customer.png" class="avatar" alt="customer" />\n\n <img ng-if="message.direction ===\'out\' && message.UserId" class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n\n\n \x3c!-- <md-menu>\n <md-button aria-label="More" class="md-icon-button"\n ng-click="$mdOpenMenu($event)"\n translate translate-aria-label="MAIL.MORE">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button aria-label="Print" translate-aria-label="MAIL.PRINT">\n <md-icon md-font-icon="icon-printer"></md-icon>\n <span translate="MAIL.PRINT">Print</span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu> --\x3e\n </div>\n\n\n </div>\n\n <div layout="row" layout-align="center center" layout-fill>\n <div flex>\n <md-divider></md-divider>\n </div>\n <div>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span></md-tooltip>\n <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span></md-tooltip>\n <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n </md-button>\n <md-menu ng-if="message.attach">\n <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span></md-tooltip>\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon><span>{{message.attach}}</span>\n </div>\n </md-button>\n <md-menu-content width="4">\n <div layout="column" layout-align="center center" ng-if="!message.attachments">\n <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n <span translate="MAIL.ATTACHMENTS">Attachments</span>\n </div>\n <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n <md-button ng-click="vm.getAttachment(attachment)">{{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div flex>\n <md-divider></md-divider>\n </div>\n </div>\n\n <md-content ng-bind-html-unsafe="message.body"></md-content>\n </md-content>\n </md-card>\n </div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html",'<div class="big-circle md-whiteframe-4dp">\n <md-icon class="s128 md-accent" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n</div>\n<span class="app-title" translate="DASHBOARDS.WAITING">Waiting</span>\n<span class="hide show-gt-md secondary-text" translate="DASHBOARDS.LOADING_INTERACTION">We are loading the interaction...</span>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html",'<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeFaxInteraction(\'new\')">\n <md-tooltip md-direction="bottom"><span translate="FAX.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html",'<div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" class="s20" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <div class="padding-left-10" layout="column" layout-align="center start" flex>\n <div class="font-size-14" layout="row" layout-align="start center" layout-fill>\n <span>#{{vm.interaction.id}} - {{vm.account.key}}</span>\n <div layout="row" layout-align="center center">\n <md-icon ng-if="vm.interaction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="red-fg padding-left-25" ng-if="vm.interaction.closed" translate="DASHBOARDS.CLOSED">CLOSED</span>\n <span class="green-fg padding-left-25" ng-if="!vm.interaction.closed"><span translate="DASHBOARDS.OPENED">OPENED</span><span ng-if="vm.interaction.substatus"> - {{vm.interaction.substatus}}</span></span>\n <div layout="row" layout-align="center center" class="blue-grey-300-fg padding-left-40" ng-if="!vm.interaction.closed">\n <timer start-time="vm.interaction.createdAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <md-icon md-font-icon="icon-timelapse" class="s16 padding-left-5"></md-icon>\n </div>\n </div>\n <div class="tags" layout="row" layout-align="start center" ng-if="vm.interaction.Tags.length" ng-class="{\'padding-top-5\': vm.interaction.Tags.length}">\n <div class="tag margin-right-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </div>\n <div layout="row" layout-align="end center">\n <div ng-switch="vm.tab.channel">\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html\'"></div>\n </div>\n <div ng-switch-when="fax">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html\'"></div>\n </div>\n <div ng-switch-when="sms">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html\'"></div>\n </div>\n </div>\n <md-menu class="no-margin" ng-if="!vm.interaction.disposition" md-position-mode="target-right target">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.tagInteraction()" translate="DASHBOARDS.TAG">\n Tag\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && (vm.subStatuses.rows.length || vm.interaction.substatus != null)">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.SET_AS">\n Set as\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.interaction.substatus != null">\n <md-button ng-click="vm.setAs(null)" translate="DASHBOARDS.NONE">\n None\n </md-button>\n </md-menu-item>\n <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n <md-button ng-click="vm.setAs(subStatus.name)">\n {{subStatus.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && vm.account.markAsUnread">\n <md-button ng-click="vm.markAsUnread()" translate="DASHBOARDS.MARK_AS_UNREAD">\n Unread\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.tab.spy && !vm.interaction.closed">\n <md-button ng-click="vm.disposeInteraction()" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.tab.spy && vm.interaction.closed && !vm.interaction.disposition">\n <md-button ng-click="vm.disposeInteraction(ev)" translate="DASHBOARDS.DISPOSE">\n Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html",'<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span></md-tooltip>\n <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span></md-tooltip>\n <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeMailInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeSmsInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="SMS.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html",'<md-content class="md-padding" layout="column" layout-align="center center">\n <div layout="row" layout-align="center center">\n <span ng-if="!vm.tab.saved" class="text-boxed md-green-bg"><timer start-time="vm.starttime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span>\n <span ng-if="vm.contact" class="text-boxed md-gray-bg font-weight-900">{{vm.contact.firstName}} {{vm.contact.lastName}} {{vm.contact.phone}}</span>\n <md-button ng-if="vm.showResetButton" ng-click="vm.resetViewer()" md-no-ink class="md-raised md-accent orange-bg">\n <md-icon md-font-icon="icon-rotate-left" class="icon s16"></md-icon> {{\'JSCRIPTY.RESET_SESSION\' | translate}}</md-button>\n <md-button ng-if="vm.contact" ng-click="vm.openContact($event, vm.contact)" md-no-ink class="md-raised md-accent" translate="JSCRIPTY.OPEN_CONTACT"></md-button>\n <md-button ng-if="vm.showIncompleteSubmitButton" ng-click="vm.onSubmit($event, true)" md-no-ink class="md-raised md-accent green-bg" translate="JSCRIPTY.SUBMIT"></md-button>\n </div>\n <h1 ng-if="!vm.project.formData"><span translate="JSCRIPTY.PROJECT_NOT_AVAILABLE">Project is not available. Please contact the administrator</span></h1>\n <mw-form-viewer ng-if="vm.project.formData" form-data="vm.project.formData" response-data="vm.project.responseData" on-submit="vm.onSubmit($event)" template-data="call" api="vm.formViewer"></mw-form-viewer>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/notification/dialog.html",'\x3c!-- <md-toast> --\x3e\n<div class="md-padding" layout="column" layout-align="center center">\n <span class="md-title">#{{vm.notification.id}} {{vm.notification.title}}</span>\n <span class="md-subhead" ng-if="vm.notification.queue">{{vm.notification.queue}}</span>\n <div class="padding-top-5" layout="row">\n <md-button class="md-raised md-accent" ng-click="vm.accept($event)" translate="DASHBOARDS.ACCEPT">\n ACCEPT\n </md-button>\n <md-button class="md-raised md-warn" ng-click="vm.reject($event)" translate="DASHBOARDS.REJECT">\n REJECT\n </md-button>\n </div>\n</div>\n\x3c!-- </md-toast> --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html",'<md-content class="md-padding" flex>\n <div ng-if="vm.html" ng-bind-html="vm.html"></div>\n <h1 ng-if="!vm.html">Template is empty. Please contact the administrator</h1>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_MOTION_BULL_STATS">Today Motion Bull STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timelapse"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{(vm.inbound.talking || 0) + (vm.inbound.pTalking || 0)}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TALKING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.TALKING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TALKING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.INBOUND_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.INBOUND_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.INBOUND_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-missed"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.outboundDropCallsDayCallersExit || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDONED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.outboundDropCallsDayTimeout || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROPPED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.DROPPED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.DROPPED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.originated || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.ORIGINATED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ORIGINATED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_TALK_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_TALK_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundanswerRate || 0 |number : 1}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.INBOUND_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.INBOUND_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.INBOUND_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundAbandonRate || 0}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDON_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundDropRate }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROP_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.DROP_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.DROP_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e\n\n\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_IVR_CAMPAIGNS_STATS">Today IVR campaigns stats</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.ivr.originated || 0}}/{{vm.ivr.limitCalls || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}/{{\'DASHBOARDS.LIMITED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.LIMITED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ORIGINATEDLIMITED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET IVR --\x3e'),e.put("app/main/apps/dashboards/views/general/user/user.general.html",'<div id="dashboard-general" class="page-layout simple right-sidenav" layout="row">\n \x3c!-- CENTER --\x3e\n <div class="center" flex ms-scroll>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n \x3c!-- NOTE: aggoiungere nel controller ng-if="vm.hasPermission()" --\x3e\n <md-tabs md-selected="vm.currentTab" ng-if="vm.hasPermission()" md-dynamic-height>\n <md-tab label="{{\'DASHBOARDS.VOICE\' | translate}}" ui-sref="app.dashboards.general.voice">\n <div ui-view="voice"></div>\n </md-tab>\n <md-tab ng-if="vm.license.dialer" label="{{\'DASHBOARDS.MOTIONDIALER\' | translate}}" ui-sref="app.dashboards.general.dialer">\n <div ui-view="dialer"></div>\n </md-tab>\n </md-tabs>\n </div>\n \x3c!-- END CONTENT --\x3e\n\n <md-content ng-if="!vm.hasPermission()" layout="row" layout-align="space-around center" flex layout-padding layout-wrap>\n <div layout="column" layout-align="space-around center" flex="50">\n <span class="font-size-40 text-center">{{ \'DASHBOARDS.WELCOME_TO_MOTION\' | translate }}!</span>\n <span class="font-size-30 text-center" translate="DASHBOARDS.WELCOME_MESSAGE">Use the left sidebar to navigate through available sections.</span>\n </div>\n\n <div layout="column" flex="50">\n <img src="assets/images/avatars/permissions.png" alt="permissions">\n </div>\n </md-content>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-incoming" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INBOUND_STATS">Today Inbound STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timelapse"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TALKING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.TALKING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TALKING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.INBOUND_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.INBOUND_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.INBOUND_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-missed"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.abandoned || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDONED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-incoming"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timer-sand"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_TALK_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_TALK_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.INBOUND_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.INBOUND_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.INBOUND_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDON_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e\n\n\x3c!-- WIDGET OUTBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_OUTBOUND_STATS">Today Outbound STATS</div>\n </div>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.outbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.outbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OUTBOUND_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-clock"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{vm.outbound.sumDuration || 0 | secToTime | date:\'HH:mm:ss\'}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOT_DURATION\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.TOT_DURATION_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOT_DURATION\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-division"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{vm.outbound.total ? ((vm.outbound.sumDuration / vm.outbound.total) | number: 0) : 0 | secToTime | date:\'HH:mm:ss\'}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_DURATION\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_DURATION_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_DURATION\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-42 line-height-72">\n {{vm.outbound.total ? (vm.outbound.answered / vm.outbound.total * 100) : 0 | number: 1}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OUTBOUND_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e'),e.put("app/main/apps/fax/views/faxAccounts/create/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus>\n <div ng-messages="faxAccountForm[\'name\'].$error" ng-show="faxAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.KEY">key</label>\n <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="faxAccountForm[\'key\'].$error" ng-show="faxAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUNK">trunk</label>\n <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountForm[\'TrunkId\'].$error" ng-show="faxAccountForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LOCALSTATIONID">localstationid</label>\n <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true">\n <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n <div ng-messages="faxAccountForm[\'localstationid\'].$error" ng-show="faxAccountForm[\'localstationid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LIST">List</label>\n <md-select name="ListId" ng-model="vm.faxAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountForm[\'ListId\'].$error" ng-show="faxAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxAccount.description">\n <div ng-messages="faxAccountForm[\'description\'].$error" ng-show="faxAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newFaxAccount" ng-click="vm.saveFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid || faxAccountForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newFaxAccount" ng-click="vm.addNewFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXACCOUNT" translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n ADD FAXACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newFaxAccount" ng-click="vm.deleteFaxAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/agent/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" required autofocus>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'agent\'].$error" ng-show="faxAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/close/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus>\n <div ng-messages="faxAccountFormApp[\'disposition\'].$error" ng-show="faxAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus>\n <div ng-messages="faxAccountFormApp[\'condition\'].$error" ng-show="faxAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true">\n <div ng-messages="faxAccountFormApp[\'truepriority\'].$error" ng-show="faxAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true">\n <div ng-messages="faxAccountFormApp[\'falsepriority\'].$error" ng-show="faxAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus>\n <div ng-messages="faxAccountFormApp[\'priority\'].$error" ng-show="faxAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/noop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus>\n <div ng-messages="faxAccountFormApp[\'value\'].$error" ng-show="faxAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/queue/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" required autofocus>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'queue\'].$error" ng-show="faxAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/system/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus>\n <div ng-messages="faxAccountFormApp[\'command\'].$error" ng-show="faxAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable">\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables">{{ variable.name }}</md-option>\n <md-option ng-value="\'\'">None</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'variable\'].$error" ng-show="faxAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/faxDispositions/dialog.html",'<md-dialog class="faxDisposition-dialog" aria-label="New FaxDisposition">\n <form name="faxDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="" name="name" ng-model="vm.faxDisposition.name" ng-required="true" autofocus>\n <div ng-messages="faxDispositionForm[\'name\'].$error" ng-show="faxDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newFaxDisposition" ng-click="vm.saveFaxDisposition()" class="send-button md-accent md-raised" ng-disabled="faxDispositionForm.$invalid || faxDispositionForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newFaxDisposition" ng-click="vm.addNewFaxDisposition()" class="send-button md-accent md-raised" ng-disabled="faxDispositionForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXDISPOSITION" translate-attr-aria-label="FAX.ADD_FAXDISPOSITION">\n ADD FAXDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newFaxDisposition" ng-click="vm.deleteFaxDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/view.html",'<div id="fax-faxAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-faxAccounts-button md-icon-button" aria-label="Go to faxAccounts" ng-click="vm.gotoFaxAccounts()" translate translate-attr-aria-label="FAX.GO_TO_FAXACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="faxAccount-image" hide-xs>\n <img ng-src="assets/images/business/faxAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.faxAccount.id}}\n <span ng-if="vm.faxAccount.name">{{vm.faxAccount.name}}</span>\n <span ng-if="vm.faxAccount.exten">{{vm.faxAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.faxAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="FAX.GOTO_FAXACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFaxAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (advancedForm.$invalid) || (faxDispositionsForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)"\n translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="faxAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.KEY">key</label>\n <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.HEADERINFO">headerinfo</label>\n <input type="text" name="headerinfo" ng-model="vm.faxAccount.headerinfo" ng-required="true">\n <div class="hint"><span translate="FAX.HELP.HEADERINFO"></span></div>\n <div ng-messages="generalForm[\'headerinfo\'].$error" ng-show="generalForm[\'headerinfo\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.HEADERINFO_REQUIRED">headerinfo field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUNK">trunk</label>\n <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LOCALSTATIONID">localstationid</label>\n <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true">\n <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n <div ng-messages="generalForm[\'localstationid\'].$error" ng-show="generalForm[\'localstationid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LIST">List</label>\n <md-select name="ListId" ng-model="vm.faxAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.faxAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="faxAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.notificationSound" aria-label="notificationSound"><span translate="FAX.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.notificationShake" aria-label="notificationShake"><span translate="FAX.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="FAX.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.faxAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="faxAccount-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.ECM">ECM</label>\n <md-select name="ecm" ng-model="vm.faxAccount.ecm" required autofocus>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.ECM"></span></div>\n <div ng-messages="advancedForm[\'ecm\'].$error" ng-show="advancedForm[\'ecm\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.ECM_REQUIRED">ECM field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MINRATE">minrate</label>\n <md-select name="minrate" ng-model="vm.faxAccount.minrate" required>\n <md-option ng-value="\'2400\'">2400</md-option>\n <md-option ng-value="\'4800\'">4800</md-option>\n <md-option ng-value="\'7200\'">7200</md-option>\n <md-option ng-value="\'9600\'">9600</md-option>\n <md-option ng-value="\'12000\'">12000</md-option>\n <md-option ng-value="\'14400\'">14400</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MINRATE"></span></div>\n <div ng-messages="advancedForm[\'minrate\'].$error" ng-show="advancedForm[\'minrate\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MINRATE_REQUIRED">minrate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MAXRATE">maxrate</label>\n <md-select name="maxrate" ng-model="vm.faxAccount.maxrate" required>\n <md-option ng-value="\'2400\'">2400</md-option>\n <md-option ng-value="\'4800\'">4800</md-option>\n <md-option ng-value="\'7200\'">7200</md-option>\n <md-option ng-value="\'9600\'">9600</md-option>\n <md-option ng-value="\'12000\'">12000</md-option>\n <md-option ng-value="\'14400\'">14400</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MAXRATE"></span></div>\n <div ng-messages="advancedForm[\'maxrate\'].$error" ng-show="advancedForm[\'maxrate\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MAXRATE_REQUIRED">maxrate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MODEM">modem</label>\n <input type="text" name="modem" ng-model="vm.faxAccount.modem" ng-required="true">\n <div class="hint"><span translate="FAX.HELP.MODEM"></span></div>\n <div ng-messages="advancedForm[\'modem\'].$error" ng-show="advancedForm[\'modem\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MODEM_REQUIRED">modem field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.GATEWAY">gateway</label>\n <input type="text" name="gateway" ng-model="vm.faxAccount.gateway" ng-required="true">\n <div class="hint"><span translate="FAX.HELP.GATEWAY"></span></div>\n <div ng-messages="advancedForm[\'gateway\'].$error" ng-show="advancedForm[\'gateway\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.GATEWAY_REQUIRED">gateway field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.FAXDETECT">faxdetect</label>\n <input type="text" name="faxdetect" ng-model="vm.faxAccount.faxdetect" ng-required="true">\n <div class="hint"><span translate="FAX.HELP.FAXDETECT"></span></div>\n <div ng-messages="advancedForm[\'faxdetect\'].$error" ng-show="advancedForm[\'faxdetect\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.FAXDETECT_REQUIRED">faxdetect field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.T38TIMEOUT">t38timeout</label>\n <input type="number" name="t38timeout" ng-model="vm.faxAccount.t38timeout" ng-required="true">\n <div class="hint"><span translate="FAX.HELP.T38TIMEOUT"></span></div>\n <div ng-messages="advancedForm[\'t38timeout\'].$error" ng-show="advancedForm[\'t38timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.T38TIMEOUT_REQUIRED">t38timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.SIP">SIP</label>\n <md-select name="tech" ng-model="vm.faxAccount.tech" required>\n <md-option ng-value="\'SIP\'">SIP</md-option>\n <md-option ng-value="\'IAX\'">IAX</md-option>\n <md-option ng-value="\'DADHI\'">DADHI</md-option>\n <md-option ng-value="\'KHOMP\'">KHOMP</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'tech\'].$error" ng-show="advancedForm[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.SIP_REQUIRED">SIP field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="faxAccount-detail-form-container faxdispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountFaxDispositionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountFaxDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.FAXDISPOSITIONS">FaxDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event)" aria-label="add faxDisposition" translate translate-attr-label="FAX.ADD_FAXDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedFaxAccountFaxDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedFaxAccountFaxDispositions.length}} {{vm_dc.selectedFaxAccountFaxDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedFaxAccountFaxDispositions" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedFaxAccountFaxDispositions($event)" aria-label="delete selected" translate translate-attr-label="FAXACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedFaxAccountFaxDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getFaxAccountFaxDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'FAX.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="faxDisposition" md-select-id="id" ng-repeat="faxDisposition in vm_dc.faxAccountFaxDispositions.rows">\n <td ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" md-cell>{{faxDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" md-cell>{{faxDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" md-cell>{{faxDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" translate="FAX.EDIT_FAXDISPOSITION">\n Edit FaxDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(faxDisposition, $event)" translate="FAX.DELETE_FAXDISPOSITION">\n Delete FaxDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.faxAccountFaxDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="FAX.NO_FAXDISPOSITION_AVAILABLE">No faxdisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.faxAccountFaxDispositions.count}}" md-on-paginate="vm_dc.getFaxAccountFaxDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="faxAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.faxAccount)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="FAX.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedFaxAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedFaxAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedFaxAccountApps.length}} {{vm_ac.selectedFaxAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedFaxAccountApps($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedFaxAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.faxAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editFaxAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.faxAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="faxAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getFaxAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="FAX.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedFaxAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedFaxAccountInteractions.length}} {{vm_dc.selectedFaxAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedFaxAccountInteractions" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedFaxAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="FAXACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedFaxAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getFaxAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'FAX.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'FAX.CONTACT\' | translate }}</th>\n <th md-column>{{ \'FAX.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'FAX.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'FAX.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'FAX.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'FAX.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.faxAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spyfaxInteraction($event, interaction)" translate="FAX.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="FAX.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.faxAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="FAX.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.faxAccountInteractions.count}}" md-on-paginate="vm_dc.getFaxAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxAccounts/faxAccounts.html",'<div id="faxAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="FAX.FAXACCOUNTS">FaxAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFaxAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFaxAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="FAX.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-faxAccounts-count">\n <span>{{vm.selectedFaxAccounts.length}}</span>\n <span translate="FAX.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAXACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFaxAccounts()" translate="FAX.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFaxAccounts()" translate="FAX.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFaxAccounts" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedFaxAccounts($event)" aria-label="delete selected" translate translate-attr-label="FAXACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- FAXACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFaxAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'FAX.KEY\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'FAX.TRUNK\' | translate }}</th>\n <th md-column md-order-by="localstationid">{{ \'FAX.LOCALSTATIONID\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'FAX.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="faxAccount" md-select-id="id" ng-repeat="faxAccount in vm.faxAccounts.rows">\n <td md-cell ng-if="faxAccount.userpic"><img class="avatar" alt="{{faxAccount.name}}" ng-src="api/users/{{faxAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!faxAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="id ">{{faxAccount.id}}</td>\n <td ng-click="vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="name ">{{faxAccount.name}}</td>\n <td ng-click="vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="key ">{{faxAccount.key}}</td>\n <td ng-click="vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="TrunkId ">{{ TrunkId = vm.trunks[faxAccount.TrunkId]; TrunkId.name }}</td>\n <td ng-click="vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="localstationid ">{{faxAccount.localstationid}}</td>\n <td ng-click="vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="description ">{{faxAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(faxAccount, $event)" translate="FAX.EDIT_FAXACCOUNT">\n Edit FaxAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(faxAccount, $event)" translate="FAX.INTERACTIONS_FAXACCOUNT">\n Interactions FaxAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(faxAccount, $event)" translate="FAX.GOTOREALTIME_FAXACCOUNT">\n goToRealtime FaxAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(faxAccount, $event)" translate="FAX.DELETE_FAXACCOUNT">\n Delete FaxAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxAccounts.count}}"\n md-on-paginate="vm.getFaxAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FAXACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FAXACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-faxAccount-button" ng-click="vm.createOrEditFaxAccount($event)" aria-label="add faxAccount" translate translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FAXACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/faxQueues/create/dialog.html",'<md-dialog class="faxQueue-dialog" aria-label="New FaxQueue">\n <form name="faxQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newFaxQueue">\n <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n <div ng-messages="faxQueueForm[\'name\'].$error" ng-show="faxQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.faxQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="faxQueueForm[\'strategy\'].$error" ng-show="faxQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="faxQueueForm[\'timeout\'].$error" ng-show="faxQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxQueue.description">\n <div ng-messages="faxQueueForm[\'description\'].$error" ng-show="faxQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newFaxQueue" ng-click="vm.saveFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid || faxQueueForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newFaxQueue" ng-click="vm.addNewFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXQUEUE" translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n ADD FAXQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newFaxQueue" ng-click="vm.deleteFaxQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue">\n <form name="faxQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.AGENTADD_FAXQUEUE">Add Agent to faxQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue">\n <form name="faxQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.TEAMADD_FAXQUEUE">Add Team in FAXQUEUE</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/view.html",'<div id="fax-faxQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-faxQueues-button md-icon-button" aria-label="Go to faxQueues" ng-click="vm.gotoFaxQueues()" translate translate-attr-aria-label="FAX.GO_TO_FAXQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="faxQueue-image" hide-xs>\n <img ng-src="assets/images/business/faxQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.faxQueue.id}}\n <span ng-if="vm.faxQueue.name">{{vm.faxQueue.name}}</span>\n <span ng-if="vm.faxQueue.exten">{{vm.faxQueue.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.faxQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="FAX.TEAMADD_FAXQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.faxQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="FAX.AGENTADD_FAXQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFaxQueue()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="faxQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.faxQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxQueue.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxQueues/faxQueues.html",'<div id="faxQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="FAX.FAXQUEUES">FaxQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFaxQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFaxQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="FAX.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-faxQueues-count">\n <span>{{vm.selectedFaxQueues.length}}</span>\n <span translate="FAX.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAXQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFaxQueues()" translate="FAX.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFaxQueues()" translate="FAX.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFaxQueues" csv-label="true" filename="faxQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedFaxQueues($event)" aria-label="delete selected" translate translate-attr-label="FAXQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- FAXQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFaxQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'FAX.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="faxQueue" md-select-id="id" ng-repeat="faxQueue in vm.faxQueues.rows">\n <td md-cell ng-if="faxQueue.userpic"><img class="avatar" alt="{{faxQueue.name}}" ng-src="api/users/{{faxQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!faxQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="id ">{{faxQueue.id}}</td>\n <td ng-click="vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="name ">{{faxQueue.name}}</td>\n <td ng-click="vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="strategy ">{{ vm.arraystrategy[faxQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(faxQueue, $event)" translate="FAX.EDIT_FAXQUEUE">\n Edit FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(faxQueue, $event)" translate="FAX.TEAMADD_FAXQUEUE">\n teamadd FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(faxQueue, $event)" translate="FAX.AGENTADD_FAXQUEUE">\n agentadd FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(faxQueue, $event)" translate="FAX.DELETE_FAXQUEUE">\n Delete FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(faxQueue, $event)" translate="FAX.GOTOREALTIME_FAXQUEUE">\n goToRealtime FaxQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxQueues.count}}"\n md-on-paginate="vm.getFaxQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FAXQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FAXQUEUE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-faxQueue-button" ng-click="vm.createOrEditFaxQueue($event)" aria-label="add faxQueue" translate translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FAXQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.ACCOUNTS">Accounts</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column>{{ \'FAX.KEY\' | translate }}</th>\n <th md-column>{{ \'FAX.TOTAL\' | translate }}</th>\n <th md-column>{{ \'FAX.IN\' | translate }}</th>\n <th md-column>{{ \'FAX.OUT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxAccounts">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.faxAccounts[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.faxAccounts[value].name}}</td>\n <td md-cell>{{vm.faxAccounts[value].key}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(vm.faxAccounts[value].in || 0) + (vm.faxAccounts[value].out || 0)}}</span>\n </td>\n <td md-cell>\n <div layout="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">{{vm.faxAccounts[value].in || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.in">{{vm.faxAccounts[value].lastIn ? (vm.faxAccounts[value].lastIn | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">{{vm.faxAccounts[value].out || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.out">{{vm.faxAccounts[value].lastOut ? (vm.faxAccounts[value].lastOut | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToFaxAccount($event, vm.faxAccounts[value])" translate="FAX.EDIT_ACCOUNT">\n Edit Account\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}"\n md-on-paginate="vm.getfaxAccounts" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/fax/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'FAX.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'FAX.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'FAX.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'FAX.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'FAX.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="3">{{ \'FAX.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n \x3c!-- <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSE\' | translate }}</th>\n <th md-column width="10px"></th> --\x3e\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'FAX.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'FAX.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatusTime">{{ \'FAX.TIMER\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'FAX.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'busy\':\'indigo-100-bg\',\'*pause\':\'amber-50-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].globalStatus]">{{ vm.isPause(vm.agents[value].globalStatus) ? \'\' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? \'*\'+vm.agents[value].pauseType || \'DEFAULT PAUSE\' : vm.agents[value].pauseType || \'DEFAULT PAUSE\') : \'\'}}</span>\n </td>\n <td class="bt custom-column">\n <timer start-time="vm.agents[value].globalStatusTime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class="bt bl">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'talking\':\'indigo-100-bg\',\'ringing\':\'orange-400-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt bl">\n <div layout="column">\n <span ng-if="vm.agents[value].queue" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].queue }}</span>\n <span ng-if="vm.agents[value].destconnectedlinenum" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class="padding-5" ng-if="vm.agents[value].queue || vm.agents[value].destconnectedlinenum">\n <timer start-time="vm.agents[value].voiceStatusTime" interval="1000" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n \x3c!-- <td class="bt">--</td>\n <td class="bt">--</td> --\x3e\n <td class="bt bl" ng-if="vm.license.chat">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n \x3c!-- <td class="bt padding-5 text-center">{{ agent.chatCurrentCapacity }}/{{ agent.chatCapacity > 0 ? agent.chatCapacity : \'∞\' }}</td> --\x3e\n <td md-number class="bt text-center font-size-20" ng-if="vm.license.chat" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.mail">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.mail" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.messaging">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.messaging" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.openchannel">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">4</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">89</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.openchannel" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.fax">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">7</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">2</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.fax" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class="bl bt padding-5 text-center">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.logout(vm.agents[value], $event)" translate="FAX.LOGOUT">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.queueAdd(vm.agents[value], $event)" translate="FAX.AGENTADD_QUEUE">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="FAX.PAUSE">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=" vm.agents[value].voicePause && \'DEFAULT PAUSE\' === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value])"><em translate="FAX.DEFAULT_PAUSE">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.pauses.rows.length" ng-repeat="pause in vm.pauses.rows">\n <md-button ng-disabled="vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value], pause.name)">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="vm.isPause(vm.agents[value].globalStatus)">\n <md-button ng-click="vm.unPause(vm.agents[value])" translate="FAX.UNPAUSE">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.filteredAgents.length}}"\n md-on-paginate="vm.onInit" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/fax/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column>{{ \'FAX.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'FAX.PAUSED\' | translate }}</th>\n <th md-column>{{ \'FAX.READY\' | translate }}</th>\n <th md-column>{{ \'FAX.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditFaxQueue($event, vm.queues[value])" translate="FAX.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="FAX.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}"\n md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/fax/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.TRUNKS">Trunks</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ACCOUNTS">Accounts</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.TRUNKS">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'FAX.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head>\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column>{{ \'FAX.TRUNK_STATUS\' | translate }}</th>\n <th md-column>{{ \'FAX.REGISTRY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n <td md-cell>{{trunk.name}}</td>\n <td md-cell>\n <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n <md-tooltip>{{\'FAX.\' + trunk.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n </td>\n <td md-cell>\n <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n <md-tooltip>{{\'FAX.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n <span ng-if="!trunk.registry" translate="FAX.NO_REGISTRY">\n No Registry\n </span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToTrunk($event, trunk)" translate="FAX.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}"\n md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/help/views/about/about.html",'<div id="maintenance" class="flex-scrollable" layout="column" ms-scroll>\n <div id="maintenance-form-wrapper" layout="column" layout-align="center center">\n <div id="maintenance-form" class="md-whiteframe-8dp">\n <div>\n <img src="/api/settings/1/logo_login" alt="logo_login" />\n </div>\n\n <br>\n\n <div>\n <div class="info-line">\n <div class="title">Useful pages</div>\n </div>\n <section layout="row" flex layout-sm="column" layout-align="center center" layout-wrap>\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button grey-bg" href="https://wiki.xcallymotion.com/display/XMV" target="_blank">\n <md-icon md-font-icon="icon-wikipedia"></md-icon>\n </a>\n <div class="info"><a href="https://wiki.xcallymotion.com/display/XMV" target="_blank">Wiki</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button md-accent" href="/apidoc" target="_blank">\n <md-icon md-font-icon="icon-apple-mobileme"></md-icon>\n </a>\n <div class="info"><a href="/apidoc" target="_blank">Motion API</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button orange-bg" href="http://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">\n <md-icon md-font-icon="icon-headphones"></md-icon>\n </a>\n <div class="info"><a href="http://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">Phonebar Download</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button green-bg" href="/demo" target="_blank">\n <md-icon md-font-icon="icon-console"></md-icon>\n </a>\n <div class="info"><a href="/demo" target="_blank">Playground</a></div>\n </div>\n\n </section>\n\n <br>\n\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="title">Follow us on</div>\n </div>\n <section ng-if="!vm.license.custom" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <a class="md-fab md-mini md-button blue-900-bg" href="https://www.facebook.com/xcallymotion" target="_blank">\n <md-icon md-font-icon="icon-facebook"></md-icon>\n </a>\n\n <a class="md-fab md-mini md-button" href="https://twitter.com/xcallymotion" target="_blank">\n <md-icon md-font-icon="icon-twitter"></md-icon>\n </a>\n <a class="md-fab md-mini md-button md-warn" href="https://plus.google.com/+Xcally" target="_blank">\n <md-icon md-font-icon="icon-google-plus"></md-icon>\n </a>\n <a class="md-fab md-mini md-button light-blue-800-bg" href="https://www.linkedin.com/company/xcally" target="_blank">\n <md-icon md-font-icon="icon-linkedin"></md-icon>\n </a>\n </section>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="title" translate="HELP.CONTACT_US">Contact Us</div>\n </div>\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="info"><a href="mailto:support@xcally.com" target="_top">support@xcally.com</a></div>\n </div>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info">xCALLY Motion <u>{{vm.info.current}}</u> | <a href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.info.current}}" target="_blank">Changelog</a></div>\n\n <br>\n\n <div class="info" ng-if="!vm.license.custom">xCALLY© 2016 - 2018 | Powered by Xenialab | <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">EULA</a></div>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info" ng-if="!vm.license.custom"><a href="https://www.xenialab.com/" target="_blank">www.xenialab.com</a> | <a href="https://www.xcallymotion.com/" target="_blank">www.xcallymotion.com</a></div>\n </div>\n </div>\n </div>\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/create/dialog.html",'<md-dialog class="deskAccount-dialog" aria-label="New DeskAccount">\n <form name="deskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus>\n <div ng-messages="deskAccountForm[\'name\'].$error" ng-show="deskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }}</md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }}</md-option>\n </md-select>\n <div ng-messages="deskAccountForm[\'type\'].$error" ng-show="deskAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true">\n <div ng-messages="deskAccountForm[\'remoteUri\'].$error" ng-show="deskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.deskAccount.authType" required>\n <md-option ng-value="\'basic\'">Basic</md-option>\n </md-select>\n <div ng-messages="deskAccountForm[\'authType\'].$error" ng-show="deskAccountForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true">\n <div ng-messages="deskAccountForm[\'username\'].$error" ng-show="deskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="deskAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="deskAccountForm[\'serverUrl\'].$error" ng-show="deskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.deskAccount.description">\n <div ng-messages="deskAccountForm[\'description\'].$error" ng-show="deskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newDeskAccount" ng-click="vm.saveDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid || deskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newDeskAccount" ng-click="vm.addNewDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n ADD DESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newDeskAccount" ng-click="vm.deleteDeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/deskAccounts.html",'<div id="deskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.DESKACCOUNTS">DeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedDeskAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedDeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-deskAccounts-count">\n <span>{{vm.selectedDeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="DESKACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllDeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectDeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedDeskAccounts" csv-label="true" filename="deskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedDeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="DESKACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- DESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedDeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.deskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="deskAccount" md-select-id="id" ng-repeat="deskAccount in vm.deskAccounts.rows">\n <td md-cell ng-if="deskAccount.userpic"><img class="avatar" alt="{{deskAccount.name}}" ng-src="api/users/{{deskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!deskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{deskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="id ">{{deskAccount.id}}</td>\n <td ng-click="vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="name ">{{deskAccount.name}}</td>\n <td ng-click="vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="remoteUri ">{{deskAccount.remoteUri}}</td>\n <td ng-click="vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="username ">{{deskAccount.username}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(deskAccount, $event)" translate="INTEGRATIONS.EDIT_DESKACCOUNT">\n Edit DeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(deskAccount, $event)" translate="INTEGRATIONS.TEST_DESKACCOUNT">\n Test DeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(deskAccount, $event)" translate="INTEGRATIONS.DELETE_DESKACCOUNT">\n Delete DeskAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.deskAccounts.count}}" md-on-paginate="vm.getDeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / DESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD DESKACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-deskAccount-button" ng-click="vm.createOrEditDeskAccount($event)" aria-label="add deskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD DESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",'<md-dialog class="deskConfiguration-dialog" aria-label="New DeskConfiguration">\n <form name="deskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.deskConfiguration.name" ng-required="true" autofocus>\n <div ng-messages="deskConfigurationForm[\'name\'].$error" ng-show="deskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.deskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="deskConfigurationForm[\'channel\'].$error" ng-show="deskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="deskConfigurationForm[\'type\'].$error" ng-show="deskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newDeskConfiguration" ng-click="vm.saveDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid || deskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newDeskConfiguration" ng-click="vm.addNewDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_DESKCONFIGURATION">\n ADD DESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newDeskConfiguration" ng-click="vm.deleteDeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",'<md-dialog class="deskAccount-item-dialog" aria-label="New Item">\n <form name="deskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="deskAccountItemForm.key.$error" ng-show="deskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.keyType.$error" ng-show="deskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="deskAccountItemForm.keyContent.$error" ng-show="deskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.variableName.$error" ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.customField.$error" ng-show="deskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.option.$error" ng-show="deskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="deskAccountItemForm.option.$error" ng-show="deskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.variableName.$error" ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/view.html",'<div id="integrations-deskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-deskAccounts-button md-icon-button" aria-label="Go to deskAccounts" ng-click="vm.gotoDeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_DESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="deskAccount-image" hide-xs>\n <img ng-src="assets/images/business/deskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.deskAccount.id}}\n <span ng-if="vm.deskAccount.name">{{vm.deskAccount.name}}</span>\n <span ng-if="vm.deskAccount.exten">{{vm.deskAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.deskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveDeskAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="deskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }}</md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true">\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.deskAccount.authType" required>\n <md-option ng-value="\'basic\'">Basic</md-option>\n </md-select>\n <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true">\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.deskAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="deskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="DeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.deskAccount)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-click="vm_cc.createOrEditDeskConfiguration($event)" class="md-icon-button" aria-label="create deskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="deskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedDeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getDeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ deskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.deleteDeskConfiguration($event, deskConfiguration)" translate="INTEGRATIONS.DELETE_DESKCONFIGURATION">\n Delete DeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length" ng-click="vm_cc.createOrEditDeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",'<md-dialog class="freshdeskAccount-dialog" aria-label="New FreshdeskAccount">\n <form name="freshdeskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus>\n <div ng-messages="freshdeskAccountForm[\'name\'].$error" ng-show="freshdeskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true">\n <div ng-messages="freshdeskAccountForm[\'username\'].$error" ng-show="freshdeskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true">\n <div ng-messages="freshdeskAccountForm[\'remoteUri\'].$error" ng-show="freshdeskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true">\n <div ng-messages="freshdeskAccountForm[\'apiKey\'].$error" ng-show="freshdeskAccountForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="freshdeskAccountForm[\'serverUrl\'].$error" ng-show="freshdeskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshdeskAccount.description">\n <div ng-messages="freshdeskAccountForm[\'description\'].$error" ng-show="freshdeskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newFreshdeskAccount" ng-click="vm.saveFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid || freshdeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newFreshdeskAccount" ng-click="vm.addNewFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n ADD FRESHDESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newFreshdeskAccount" ng-click="vm.deleteFreshdeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",'<md-dialog class="freshdeskConfiguration-dialog" aria-label="New FreshdeskConfiguration">\n <form name="freshdeskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.freshdeskConfiguration.name" ng-required="true" autofocus>\n <div ng-messages="freshdeskConfigurationForm[\'name\'].$error" ng-show="freshdeskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.freshdeskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="freshdeskConfigurationForm[\'channel\'].$error" ng-show="freshdeskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.freshdeskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="freshdeskConfigurationForm[\'type\'].$error" ng-show="freshdeskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newFreshdeskConfiguration" ng-click="vm.saveFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid || freshdeskConfigurationForm.$pristine" aria-label="SAVE"\n translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newFreshdeskConfiguration" ng-click="vm.addNewFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION"\n translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION">\n ADD FRESHDESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newFreshdeskConfiguration" ng-click="vm.deleteFreshdeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",'<md-dialog class="freshdeskAccount-item-dialog" aria-label="New Item">\n <form name="freshdeskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.key.$error" ng-show="freshdeskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.keyType.$error" ng-show="freshdeskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.keyContent.$error" ng-show="freshdeskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.variableName.$error" ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.customField.$error" ng-show="freshdeskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.option.$error" ng-show="freshdeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="freshdeskAccountItemForm.option.$error" ng-show="freshdeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.variableName.$error" ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",'<div id="integrations-freshdeskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-freshdeskAccounts-button md-icon-button" aria-label="Go to freshdeskAccounts" ng-click="vm.gotoFreshdeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_FRESHDESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="freshdeskAccount-image" hide-xs>\n <img ng-src="assets/images/business/freshdeskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.freshdeskAccount.id}}\n <span ng-if="vm.freshdeskAccount.name">{{vm.freshdeskAccount.name}}</span>\n <span ng-if="vm.freshdeskAccount.exten">{{vm.freshdeskAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.freshdeskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="freshdeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true">\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true">\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true">\n <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshdeskAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="freshdeskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="FreshdeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.freshdeskAccount)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" class="md-icon-button" aria-label="create freshdeskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="freshdeskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedFreshdeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getFreshdeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ freshdeskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.deleteFreshdeskConfiguration($event, freshdeskConfiguration)" translate="INTEGRATIONS.DELETE_FRESHDESKCONFIGURATION">\n Delete FreshdeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",'<div id="freshdeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.FRESHDESKACCOUNTS">FreshdeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFreshdeskAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFreshdeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-freshdeskAccounts-count">\n <span>{{vm.selectedFreshdeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FRESHDESKACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFreshdeskAccounts" csv-label="true" filename="freshdeskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedFreshdeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="FRESHDESKACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- FRESHDESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFreshdeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFreshdeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.freshdeskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="freshdeskAccount" md-select-id="id" ng-repeat="freshdeskAccount in vm.freshdeskAccounts.rows">\n <td md-cell ng-if="freshdeskAccount.userpic"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="api/users/{{freshdeskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!freshdeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="id ">{{freshdeskAccount.id}}</td>\n <td ng-click="vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="name ">{{freshdeskAccount.name}}</td>\n <td ng-click="vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="username ">{{freshdeskAccount.username}}</td>\n <td ng-click="vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="remoteUri ">{{freshdeskAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(freshdeskAccount, $event)" translate="INTEGRATIONS.EDIT_FRESHDESKACCOUNT">\n Edit FreshdeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(freshdeskAccount, $event)" translate="INTEGRATIONS.TEST_FRESHDESKACCOUNT">\n Test FreshdeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(freshdeskAccount, $event)" translate="INTEGRATIONS.DELETE_FRESHDESKACCOUNT">\n Delete FreshdeskAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.freshdeskAccounts.count}}" md-on-paginate="vm.getFreshdeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FRESHDESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FRESHDESKACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-freshdeskAccount-button" ng-click="vm.createOrEditFreshdeskAccount($event)" aria-label="add freshdeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FRESHDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",'<md-dialog class="salesforceAccount-dialog" aria-label="New SalesforceAccount">\n <form name="salesforceAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus>\n <div ng-messages="salesforceAccountForm[\'name\'].$error" ng-show="salesforceAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }}</md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }}</md-option>\n </md-select>\n <div ng-messages="salesforceAccountForm[\'type\'].$error" ng-show="salesforceAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true">\n <div ng-messages="salesforceAccountForm[\'username\'].$error" ng-show="salesforceAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true">\n <div ng-messages="salesforceAccountForm[\'remoteUri\'].$error" ng-show="salesforceAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="salesforceAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true">\n <div ng-messages="salesforceAccountForm[\'clientId\'].$error" ng-show="salesforceAccountForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true">\n <div ng-messages="salesforceAccountForm[\'clientSecret\'].$error" ng-show="salesforceAccountForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true">\n <div ng-messages="salesforceAccountForm[\'securityToken\'].$error" ng-show="salesforceAccountForm[\'securityToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="salesforceAccountForm[\'serverUrl\'].$error" ng-show="salesforceAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.salesforceAccount.description">\n <div ng-messages="salesforceAccountForm[\'description\'].$error" ng-show="salesforceAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSalesforceAccount" ng-click="vm.saveSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid || salesforceAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSalesforceAccount" ng-click="vm.addNewSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCEACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n ADD SALESFORCEACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSalesforceAccount" ng-click="vm.deleteSalesforceAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",'<md-dialog class="salesforceConfiguration-dialog" aria-label="New SalesforceConfiguration">\n <form name="salesforceConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.salesforceConfiguration.name" ng-required="true" autofocus>\n <div ng-messages="salesforceConfigurationForm[\'name\'].$error" ng-show="salesforceConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.salesforceConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="salesforceConfigurationForm[\'channel\'].$error" ng-show="salesforceConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="salesforceConfigurationForm[\'type\'].$error" ng-show="salesforceConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSalesforceConfiguration" ng-click="vm.saveSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid || salesforceConfigurationForm.$pristine" aria-label="SAVE"\n translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSalesforceConfiguration" ng-click="vm.addNewSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCECONFIGURATION"\n translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCECONFIGURATION">\n ADD SALESFORCECONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSalesforceConfiguration" ng-click="vm.deleteSalesforceConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",'<md-dialog class="salesforceAccount-item-dialog" aria-label="New Item">\n <form name="salesforceAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.key.$error" ng-show="salesforceAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.keyType.$error" ng-show="salesforceAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.keyContent.$error" ng-show="salesforceAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.variableName.$error" ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.customField.$error" ng-show="salesforceAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.option.$error" ng-show="salesforceAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="salesforceAccountItemForm.option.$error" ng-show="salesforceAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.variableName.$error" ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/view.html",'<div id="integrations-salesforceAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-salesforceAccounts-button md-icon-button" aria-label="Go to salesforceAccounts" ng-click="vm.gotoSalesforceAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SALESFORCEACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="salesforceAccount-image" hide-xs>\n <img ng-src="assets/images/business/salesforceAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.salesforceAccount.id}}\n <span ng-if="vm.salesforceAccount.name">{{vm.salesforceAccount.name}}</span>\n <span ng-if="vm.salesforceAccount.exten">{{vm.salesforceAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.salesforceAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="salesforceAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }}</md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true">\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true">\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true">\n <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true">\n <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true">\n <div ng-messages="generalForm[\'securityToken\'].$error" ng-show="generalForm[\'securityToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.salesforceAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="salesforceAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="SalesforceAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.salesforceAccount)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" class="md-icon-button" aria-label="create salesforceConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="salesforceConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSalesforceConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSalesforceConfiguration($index)">\n <span class="text-truncate" flex="80">{{ salesforceConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.deleteSalesforceConfiguration($event, salesforceConfiguration)" translate="INTEGRATIONS.DELETE_SALESFORCECONFIGURATION">\n Delete SalesforceConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_SEARCH"></label>\n <md-select ng-model="vm_cc.salesforceConfiguration.moduleSearch" ng-change="vm_cc.selectChangedAdvanced()">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'contact_lead\', value: \'Contact & Lead\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">{{ option.value }}</md-option>\n </md-select>\n </div>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_CREATE"></label>\n <md-select ng-model="vm_cc.salesforceConfiguration.moduleCreate" ng-change="vm_cc.selectChangedAdvanced()">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'nothing\', value: \'Nothing\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">{{ option.value }}</md-option>\n </md-select>\n </div>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",'<div id="salesforceAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SALESFORCEACCOUNTS">SalesforceAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSalesforceAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSalesforceAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-salesforceAccounts-count">\n <span>{{vm.selectedSalesforceAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SALESFORCEACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSalesforceAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSalesforceAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSalesforceAccounts" csv-label="true" filename="salesforceAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedSalesforceAccounts($event)" aria-label="delete selected" translate translate-attr-label="SALESFORCEACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- SALESFORCEACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSalesforceAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSalesforceAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.salesforceAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="salesforceAccount" md-select-id="id" ng-repeat="salesforceAccount in vm.salesforceAccounts.rows">\n <td md-cell ng-if="salesforceAccount.userpic"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="api/users/{{salesforceAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!salesforceAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="id ">{{salesforceAccount.id}}</td>\n <td ng-click="vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="name ">{{salesforceAccount.name}}</td>\n <td ng-click="vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="username ">{{salesforceAccount.username}}</td>\n <td ng-click="vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="remoteUri ">{{salesforceAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(salesforceAccount, $event)" translate="INTEGRATIONS.EDIT_SALESFORCEACCOUNT">\n Edit SalesforceAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(salesforceAccount, $event)" translate="INTEGRATIONS.TEST_SALESFORCEACCOUNT">\n Test SalesforceAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(salesforceAccount, $event)" translate="INTEGRATIONS.DELETE_SALESFORCEACCOUNT">\n Delete SalesforceAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.salesforceAccounts.count}}" md-on-paginate="vm.getSalesforceAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SALESFORCEACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SALESFORCEACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-salesforceAccount-button" ng-click="vm.createOrEditSalesforceAccount($event)" aria-label="add salesforceAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SALESFORCEACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",'<md-dialog class="sugarcrmAccount-dialog" aria-label="New SugarcrmAccount">\n <form name="sugarcrmAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus>\n <div ng-messages="sugarcrmAccountForm[\'name\'].$error" ng-show="sugarcrmAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true">\n <div ng-messages="sugarcrmAccountForm[\'username\'].$error" ng-show="sugarcrmAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true">\n <div ng-messages="sugarcrmAccountForm[\'remoteUri\'].$error" ng-show="sugarcrmAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="sugarcrmAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="sugarcrmAccountForm[\'serverUrl\'].$error" ng-show="sugarcrmAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sugarcrmAccount.description">\n <div ng-messages="sugarcrmAccountForm[\'description\'].$error" ng-show="sugarcrmAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSugarcrmAccount" ng-click="vm.saveSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid || sugarcrmAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSugarcrmAccount" ng-click="vm.addNewSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n ADD SUGARCRMACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSugarcrmAccount" ng-click="vm.deleteSugarcrmAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",'<md-dialog class="sugarcrmConfiguration-dialog" aria-label="New SugarcrmConfiguration">\n <form name="sugarcrmConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.sugarcrmConfiguration.name" ng-required="true" autofocus>\n <div ng-messages="sugarcrmConfigurationForm[\'name\'].$error" ng-show="sugarcrmConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.sugarcrmConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="sugarcrmConfigurationForm[\'channel\'].$error" ng-show="sugarcrmConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.sugarcrmConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="sugarcrmConfigurationForm[\'type\'].$error" ng-show="sugarcrmConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSugarcrmConfiguration" ng-click="vm.saveSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid || sugarcrmConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSugarcrmConfiguration" ng-click="vm.addNewSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION"\n translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION">\n ADD SUGARCRMCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSugarcrmConfiguration" ng-click="vm.deleteSugarcrmConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",'<md-dialog class="sugarcrmAccount-item-dialog" aria-label="New Item">\n <form name="sugarcrmAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.key.$error" ng-show="sugarcrmAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.keyType.$error" ng-show="sugarcrmAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.keyContent.$error" ng-show="sugarcrmAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.variableName.$error" ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.customField.$error" ng-show="sugarcrmAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.option.$error" ng-show="sugarcrmAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="sugarcrmAccountItemForm.option.$error" ng-show="sugarcrmAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.variableName.$error" ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",'<div id="integrations-sugarcrmAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-sugarcrmAccounts-button md-icon-button" aria-label="Go to sugarcrmAccounts" ng-click="vm.gotoSugarcrmAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SUGARCRMACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="sugarcrmAccount-image" hide-xs>\n <img ng-src="assets/images/business/sugarcrmAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.sugarcrmAccount.id}}\n <span ng-if="vm.sugarcrmAccount.name">{{vm.sugarcrmAccount.name}}</span>\n <span ng-if="vm.sugarcrmAccount.exten">{{vm.sugarcrmAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.sugarcrmAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="sugarcrmAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true">\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true">\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sugarcrmAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="sugarcrmAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="SugarcrmAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.sugarcrmAccount)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" class="md-icon-button" aria-label="create sugarcrmConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="sugarcrmConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSugarcrmConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSugarcrmConfiguration($index)">\n <span class="text-truncate" flex="80">{{ sugarcrmConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.deleteSugarcrmConfiguration($event, sugarcrmConfiguration)" translate="INTEGRATIONS.DELETE_SUGARCRMCONFIGURATION">\n Delete SugarcrmConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",'<div id="sugarcrmAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SUGARCRMACCOUNTS">SugarcrmAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSugarcrmAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSugarcrmAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-sugarcrmAccounts-count">\n <span>{{vm.selectedSugarcrmAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SUGARCRMACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSugarcrmAccounts" csv-label="true" filename="sugarcrmAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedSugarcrmAccounts($event)" aria-label="delete selected" translate translate-attr-label="SUGARCRMACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- SUGARCRMACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSugarcrmAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSugarcrmAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.sugarcrmAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="sugarcrmAccount" md-select-id="id" ng-repeat="sugarcrmAccount in vm.sugarcrmAccounts.rows">\n <td md-cell ng-if="sugarcrmAccount.userpic"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="api/users/{{sugarcrmAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!sugarcrmAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="id ">{{sugarcrmAccount.id}}</td>\n <td ng-click="vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="name ">{{sugarcrmAccount.name}}</td>\n <td ng-click="vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="username ">{{sugarcrmAccount.username}}</td>\n <td ng-click="vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="remoteUri ">{{sugarcrmAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(sugarcrmAccount, $event)" translate="INTEGRATIONS.EDIT_SUGARCRMACCOUNT">\n Edit SugarcrmAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(sugarcrmAccount, $event)" translate="INTEGRATIONS.TEST_SUGARCRMACCOUNT">\n Test SugarcrmAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(sugarcrmAccount, $event)" translate="INTEGRATIONS.DELETE_SUGARCRMACCOUNT">\n Delete SugarcrmAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.sugarcrmAccounts.count}}" md-on-paginate="vm.getSugarcrmAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SUGARCRMACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SUGARCRMACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-sugarcrmAccount-button" ng-click="vm.createOrEditSugarcrmAccount($event)" aria-label="add sugarcrmAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SUGARCRMACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",'<md-dialog class="zendeskAccount-dialog" aria-label="New ZendeskAccount">\n <form name="zendeskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus>\n <div ng-messages="zendeskAccountForm[\'name\'].$error" ng-show="zendeskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }}</md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }}</md-option>\n </md-select>\n <div ng-messages="zendeskAccountForm[\'type\'].$error" ng-show="zendeskAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true">\n <div ng-messages="zendeskAccountForm[\'username\'].$error" ng-show="zendeskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true">\n <div ng-messages="zendeskAccountForm[\'remoteUri\'].$error" ng-show="zendeskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.zendeskAccount.authType" required>\n <md-option ng-value="\'password\'">Password</md-option>\n <md-option ng-value="\'token\'">Token</md-option>\n </md-select>\n <div ng-messages="zendeskAccountForm[\'authType\'].$error" ng-show="zendeskAccountForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="zendeskAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n <label translate="INTEGRATIONS.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true">\n <div ng-messages="zendeskAccountForm[\'token\'].$error" ng-show="zendeskAccountForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="zendeskAccountForm[\'serverUrl\'].$error" ng-show="zendeskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zendeskAccount.description">\n <div ng-messages="zendeskAccountForm[\'description\'].$error" ng-show="zendeskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newZendeskAccount" ng-click="vm.saveZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid || zendeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newZendeskAccount" ng-click="vm.addNewZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n ADD ZENDESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newZendeskAccount" ng-click="vm.deleteZendeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",'<md-dialog class="zendeskAccount-item-dialog" aria-label="New Item">\n <form name="zendeskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.key.$error" ng-show="zendeskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.keyType.$error" ng-show="zendeskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.keyContent.$error" ng-show="zendeskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.variableName.$error" ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.customField.$error" ng-show="zendeskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.option.$error" ng-show="zendeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="zendeskAccountItemForm.option.$error" ng-show="zendeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.variableName.$error" ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/view.html",'<div id="integrations-zendeskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-zendeskAccounts-button md-icon-button" aria-label="Go to zendeskAccounts" ng-click="vm.gotoZendeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZENDESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="zendeskAccount-image" hide-xs>\n <img ng-src="assets/images/business/zendeskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.zendeskAccount.id}}\n <span ng-if="vm.zendeskAccount.name">{{vm.zendeskAccount.name}}</span>\n <span ng-if="vm.zendeskAccount.exten">{{vm.zendeskAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zendeskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (zendeskConfigurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="zendeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }}</md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true">\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true">\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.zendeskAccount.authType" required>\n <md-option ng-value="\'password\'">Password</md-option>\n <md-option ng-value="\'token\'">Token</md-option>\n </md-select>\n <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n <label translate="INTEGRATIONS.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true">\n <div ng-messages="generalForm[\'token\'].$error" ng-show="generalForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zendeskAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="zendeskAccount-detail-form-container zendeskconfigurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.ZENDESKCONFIGURATIONS">ZENDESKCONFIGURATIONS</div>\n </div>\n <div ng-controller="ZendeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zendeskAccount)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" class="md-icon-button" aria-label="create zendeskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="zendeskConfiguration in vm_cc.zendeskConfigurations" class="border-top" md-colors="{background: (vm_cc.selectedZendeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZendeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ zendeskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.deleteZendeskConfiguration($event, zendeskConfiguration)" translate="INTEGRATIONS.DELETE_ZENDESKCONFIGURATION">\n Delete ZendeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.zendeskConfigurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.zendeskConfigurations.length" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",'<md-dialog class="zendeskConfiguration-dialog" aria-label="New ZendeskConfiguration">\n <form name="zendeskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.zendeskConfiguration.name" ng-required="true" autofocus>\n <div ng-messages="zendeskConfigurationForm[\'name\'].$error" ng-show="zendeskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.zendeskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="zendeskConfigurationForm[\'channel\'].$error" ng-show="zendeskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="zendeskConfigurationForm[\'type\'].$error" ng-show="zendeskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newZendeskConfiguration" ng-click="vm.saveZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid || zendeskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newZendeskConfiguration" ng-click="vm.addNewZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKCONFIGURATION"\n translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKCONFIGURATION">\n ADD ZENDESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newZendeskConfiguration" ng-click="vm.deleteZendeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",'<div id="zendeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.ZENDESKACCOUNTS">ZendeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedZendeskAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedZendeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-zendeskAccounts-count">\n <span>{{vm.selectedZendeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ZENDESKACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllZendeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectZendeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedZendeskAccounts" csv-label="true" filename="zendeskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedZendeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="ZENDESKACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- ZENDESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedZendeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZendeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.zendeskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="zendeskAccount" md-select-id="id" ng-repeat="zendeskAccount in vm.zendeskAccounts.rows">\n <td md-cell ng-if="zendeskAccount.userpic"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="api/users/{{zendeskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!zendeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="id ">{{zendeskAccount.id}}</td>\n <td ng-click="vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="name ">{{zendeskAccount.name}}</td>\n <td ng-click="vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="username ">{{zendeskAccount.username}}</td>\n <td ng-click="vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="remoteUri ">{{zendeskAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(zendeskAccount, $event)" translate="INTEGRATIONS.EDIT_ZENDESKACCOUNT">\n Edit ZendeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(zendeskAccount, $event)" translate="INTEGRATIONS.TEST_ZENDESKACCOUNT">\n Test ZendeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(zendeskAccount, $event)" translate="INTEGRATIONS.DELETE_ZENDESKACCOUNT">\n Delete ZendeskAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.zendeskAccounts.count}}" md-on-paginate="vm.getZendeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ZENDESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ZENDESKACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-zendeskAccount-button" ng-click="vm.createOrEditZendeskAccount($event)" aria-label="add zendeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ZENDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/create/dialog.html",'<md-dialog class="zohoAccount-dialog" aria-label="New ZohoAccount">\n <form name="zohoAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus>\n <div ng-messages="zohoAccountForm[\'name\'].$error" ng-show="zohoAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <md-select name="host" ng-model="vm.zohoAccount.host" required>\n <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n </md-select>\n <div ng-messages="zohoAccountForm[\'host\'].$error" ng-show="zohoAccountForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.zohoAccount.authToken" ng-required="true">\n <div ng-messages="zohoAccountForm[\'authToken\'].$error" ng-show="zohoAccountForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="zohoAccountForm[\'serverUrl\'].$error" ng-show="zohoAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zohoAccount.description">\n <div ng-messages="zohoAccountForm[\'description\'].$error" ng-show="zohoAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newZohoAccount" ng-click="vm.saveZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid || zohoAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newZohoAccount" ng-click="vm.addNewZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n ADD ZOHOACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newZohoAccount" ng-click="vm.deleteZohoAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",'<md-dialog class="zohoConfiguration-dialog" aria-label="New ZohoConfiguration">\n <form name="zohoConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.zohoConfiguration.name" ng-required="true" autofocus>\n <div ng-messages="zohoConfigurationForm[\'name\'].$error" ng-show="zohoConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.zohoConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="zohoConfigurationForm[\'channel\'].$error" ng-show="zohoConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zohoConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="zohoConfigurationForm[\'type\'].$error" ng-show="zohoConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newZohoConfiguration" ng-click="vm.saveZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid || zohoConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newZohoConfiguration" ng-click="vm.addNewZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOCONFIGURATION">\n ADD ZOHOCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newZohoConfiguration" ng-click="vm.deleteZohoConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",'<md-dialog class="zohoAccount-item-dialog" aria-label="New Item">\n <form name="zohoAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.key.$error" ng-show="zohoAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.keyType.$error" ng-show="zohoAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.keyContent.$error" ng-show="zohoAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.variableName.$error" ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.customField.$error" ng-show="zohoAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.option.$error" ng-show="zohoAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="zohoAccountItemForm.option.$error" ng-show="zohoAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.variableName.$error" ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/view.html",'<div id="integrations-zohoAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-zohoAccounts-button md-icon-button" aria-label="Go to zohoAccounts" ng-click="vm.gotoZohoAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZOHOACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="zohoAccount-image" hide-xs>\n <img ng-src="assets/images/business/zohoAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.zohoAccount.id}}\n <span ng-if="vm.zohoAccount.name">{{vm.zohoAccount.name}}</span>\n <span ng-if="vm.zohoAccount.exten">{{vm.zohoAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zohoAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveZohoAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="zohoAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <md-select name="host" ng-model="vm.zohoAccount.host" required>\n <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n </md-select>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.zohoAccount.authToken" ng-required="true">\n <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zohoAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="zohoAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="ZohoAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zohoAccount)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-click="vm_cc.createOrEditZohoConfiguration($event)" class="md-icon-button" aria-label="create zohoConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="zohoConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedZohoConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZohoConfiguration($index)">\n <span class="text-truncate" flex="80">{{ zohoConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.deleteZohoConfiguration($event, zohoConfiguration)" translate="INTEGRATIONS.DELETE_ZOHOCONFIGURATION">\n Delete ZohoConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length" ng-click="vm_cc.createOrEditZohoConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",'<div id="zohoAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.ZOHOACCOUNTS">ZohoAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedZohoAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedZohoAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-zohoAccounts-count">\n <span>{{vm.selectedZohoAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ZOHOACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllZohoAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectZohoAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedZohoAccounts" csv-label="true" filename="zohoAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedZohoAccounts($event)" aria-label="delete selected" translate translate-attr-label="ZOHOACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- ZOHOACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedZohoAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZohoAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="host">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.zohoAccounts.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="zohoAccount" md-select-id="id" ng-repeat="zohoAccount in vm.zohoAccounts.rows">\n <td md-cell ng-if="zohoAccount.userpic"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="api/users/{{zohoAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!zohoAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="id ">{{zohoAccount.id}}</td>\n <td ng-click="vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="name ">{{zohoAccount.name}}</td>\n <td ng-click="vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="host ">{{ vm.arrayhost[zohoAccount.host].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(zohoAccount, $event)" translate="INTEGRATIONS.EDIT_ZOHOACCOUNT">\n Edit ZohoAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(zohoAccount, $event)" translate="INTEGRATIONS.TEST_ZOHOACCOUNT">\n Test ZohoAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(zohoAccount, $event)" translate="INTEGRATIONS.DELETE_ZOHOACCOUNT">\n Delete ZohoAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.zohoAccounts.count}}" md-on-paginate="vm.getZohoAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ZOHOACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ZOHOACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-zohoAccount-button" ng-click="vm.createOrEditZohoAccount($event)" aria-label="add zohoAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ZOHOACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/jscripty/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.project.description">\n <div ng-messages="projectForm[\'description\'].$error" ng-show="projectForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="JSCRIPTY.SAVE" translate-attr-aria-label="JSCRIPTY.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="ADD" translate="JSCRIPTY.ADD_PROJECT" translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n ADD PROJECT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="JSCRIPTY.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="JSCRIPTY.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/clone/clone.html",'<md-dialog class="project-dialog" aria-label="Clone Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="CLONE" translate="JSCRIPTY.CLONE_PROJECT" translate-attr-aria-label="JSCRIPTY.CLONE_PROJECT">\n CLONE PROJECT\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",'<md-dialog class="session-dialog" aria-label="New Session">\n <form name="sessionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <md-list>\n <md-subheader class="md-no-sticky">\n <div class="margin-bottom-5"><span translate="JSCRIPTY.ANSWERS">Answers</span></div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.STARTTIME" class="ng-scope font-weight-700">Start Time</span>: <span class="ng-binding">{{vm.session.starttime | date:\'medium\'}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.MEMBERNAME" class="ng-scope font-weight-700">Member Name</span>: <span class="ng-binding">{{vm.session.membername}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.PROJECT" class="ng-scope font-weight-700">Project</span>: <span class="ng-binding">{{vm.project.name}}</span>\n </div>\n </md-subheader>\n <md-list-item ng-if="vm.questions.rows.length" class="md-2-line contact-item" ng-repeat="question in vm.questions.rows">\n <div class="md-list-item-text compact">\n <h3>{{$index+1}}. {{question.question}}</h3>\n <p>{{question.answer}}</p>\n </div>\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n <md-list-item ng-if="!vm.questions.rows.length" class="md-2-line contact-item">\n <div class="md-list-item-text compact">\n <h3><span class="text-boxed-ligth" translate="JSCRIPTY.NO_RESULTS_AVAILABLE">No results available</span></h3>\n </div>\n </md-list-item>\n </md-list>\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/view.html",'<div id="jscripty-project" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="JSCRIPTY.GO_TO_PROJECTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="project-image" hide-xs>\n <img ng-src="assets/images/business/projects.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.project.id}}\n <span ng-if="vm.project.name">{{vm.project.name}}</span>\n <span ng-if="vm.project.exten">{{vm.project.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.clonedialog(vm.project, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="JSCRIPTY.CLONE_PROJECT"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (builderForm.$invalid) || (previewForm.$invalid) || (sessionsForm.$invalid) || (answersForm.$invalid)" translate="JSCRIPTY.SAVE"\n translate-attr-aria-label="JSCRIPTY.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="project-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="JSCRIPTY.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.project.enableUncompleteSave" aria-label="EnableUncompleteSave"><span translate="JSCRIPTY.ENABLEUNCOMPLETESAVE">EnableUncompleteSave</span></md-switch>\n <div class="hint"><span translate="JSCRIPTY.HELP.ENABLEUNCOMPLETESAVE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.project.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.BUILDER">BUILDER</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="project-detail-form-container builder md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectBuilderController as vm_bc" ng-init="vm_bc.init(vm.project)">\n <mw-form-builder ng-if="vm_bc.project.formData" form-data="vm_bc.project.formData" options="vm_bc.optionsBuilder" read-only="false"></mw-form-builder>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.PREVIEW">PREVIEW</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="project-detail-form-container preview md-background-bg md-whiteframe-1dp">\n <div layout="column" layout-align="center" ng-controller="ProjectViewerController as vm_vc" ng-init="vm_vc.init(vm.project)">\n <div layout="row" layout-align="center">\n <md-button class="md-raised md-accent" aria-label="Reset" ng-click="vm_vc.resetViewer()">\n Reset\n </md-button>\n </div>\n <mw-form-viewer ng-if="vm_vc.project.formData" form-data="vm_vc.project.formData" response-data="vm_vc.responseData" on-submit="vm_vc.onSubmit($event)" api="vm_vc.formViewer"></mw-form-viewer>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.SESSIONS">SESSIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="project-detail-form-container sessions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectSessionsController as vm_dc" ng-init="vm_dc.init(vm.project)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedProjectSessions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="JSCRIPTY.SESSIONS">Sessions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedProjectSessions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedProjectSessions.length}} {{vm_dc.selectedProjectSessions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedProjectSessions" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedProjectSessions($event)" aria-label="delete selected" translate translate-attr-label="PROJECTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedProjectSessions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getProjectSessions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'JSCRIPTY.ID\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'JSCRIPTY.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'JSCRIPTY.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="membername">{{ \'JSCRIPTY.MEMBERNAME\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'JSCRIPTY.CALLERIDNUM\' | translate }}</th>\n <th md-column md-order-by="completed">{{ \'JSCRIPTY.COMPLETE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="session" md-select-id="id" ng-repeat="session in vm_dc.projectSessions.rows">\n <td md-cell>{{session.id}}</td>\n <td md-cell>{{session.starttime | date:\'medium\'}}</td>\n <td md-cell>{{session.endtime | date:\'medium\'}}</td>\n <td md-cell>{{session.membername}}</td>\n <td md-cell>{{session.calleridnum}}</td>\n <td md-cell class="completed ">\n <md-icon md-colors="{color: {{session.completed ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{session.completed? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.showQuestionsProjectSession($event, session)" translate="JSCRIPTY.SHOW_QUESTIONS_SESSION">\n Results Session\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(session, $event)" translate="JSCRIPTY.DELETE_SESSION">\n Delete Session\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.projectSessions.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="JSCRIPTY.NO_SESSION_AVAILABLE">No session available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.projectSessions.count}}" md-on-paginate="vm_dc.getProjectSessions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.ANSWERS">ANSWERS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="project-detail-form-container answers md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectAnswersController as vm_an" ng-init="vm_an.init(vm.project)">\n <div class="pb-16" layout="row" layout-align="space-between center">\n <div class="h2 secondary-text" translate="JSCRIPTY.ANSWERS">Answers</div>\n <md-date-range localization-map="vm_an.localizationMap" ng-model="vm_an.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_an.getAnswers()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n <md-button type="button" ng-disabled="!vm_an.answers" ng-click="vm_an.getSummary($event)" class="md-accent md-raised md-button ng-scope md-default-theme md-ink-ripple md-green-500-bg md-icon-button" title="{{\'JSCRIPTY.EXPORT_TO_CSV\' | translate}}">\n <md-icon md-font-icon="icon-file-excel" class="md-default-theme md-font material-icons icon-file-excel"></md-icon>\n </md-button>\n </div>\n <div layout="row">\n <md-card class="md-whiteframe-1dp" ng-if="vm_an.answers && vm_an.hasIdAnswers" flex>\n <md-list>\n <md-list-item class="md-2-line contact-item" ng-repeat="(key, question) in vm_an.answers">\n <div class="md-list-item-text compact" layout-padding>\n <h3>{{question.question}}</h3>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column></th>\n <th md-column>#</th>\n <th md-column>%</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="(key, value) in question.answers">\n <td md-cell>{{key}}</td>\n <td md-cell width="20px">{{value}}</td>\n <td md-cell width="20px">{{value*100/question.sum | number:1}}</td>\n </tr>\n <tr md-row>\n <td md-cell><b>{{\'JSCRIPTY.TOTAL\' | translate}}</b></td>\n <td md-cell width="20px"><b>{{question.sum}}</b></td>\n <td md-cell width="20px"><b>100</b></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n </md-list>\n </md-card>\n <span ng-if="!vm_an.answers || !vm_an.hasIdAnswers" class="text-boxed-ligth" translate="JSCRIPTY.NO_ANSWERS_AVAILABLE">No answers available</span>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/jscripty/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-script" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="JSCRIPTY.PROJECTS">Projects</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="JSCRIPTY.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="JSCRIPTY.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-projects-count">\n <span>{{vm.selectedProjects.length}}</span>\n <span translate="JSCRIPTY.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="PROJECTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllProjects()" translate="JSCRIPTY.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectProjects()" translate="JSCRIPTY.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="PROJECTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- PROJECT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'JSCRIPTY.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'JSCRIPTY.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'JSCRIPTY.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'JSCRIPTY.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.projects.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="JSCRIPTY.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n <td md-cell ng-if="project.userpic"><img class="avatar" alt="{{project.name}}" ng-src="api/users/{{project.id}}/avatar" /></td>\n <td md-cell ng-if="!project.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{project.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="createdAt ">{{project.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(project, $event)" translate="JSCRIPTY.EDIT_PROJECT">\n Edit Project\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.clonedialog(project, $event)" translate="JSCRIPTY.CLONE_PROJECT">\n clone Project\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.sessionsgoto(project, $event)" translate="JSCRIPTY.SESSIONS_PROJECT">\n Sessions Project\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(project, $event)" translate="JSCRIPTY.DELETE_PROJECT">\n Delete Project\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PROJECT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PROJECT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-project-button" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PROJECT BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/create/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus>\n <div ng-messages="mailAccountForm[\'name\'].$error" ng-show="mailAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="mailAccountForm[\'key\'].$error" ng-show="mailAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.EMAIL_ADDRESS">Email_Address</label>\n <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true">\n <div ng-messages="mailAccountForm[\'email\'].$error" ng-show="mailAccountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email_Address field is required</span>\n </div>\n <div ng-message="email">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email_Address must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.mailAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountForm[\'ListId\'].$error" ng-show="mailAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.active" aria-label="Active"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.newMailAccount" class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="cservice" ng-model="vm.mailAccount.cservice" required>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="mailAccountForm[\'cservice\'].$error" ng-show="mailAccountForm[\'cservice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true">\n <div ng-messages="mailAccountForm[\'Imap.host\'].$error" ng-show="mailAccountForm[\'Imap.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_PORT">IMAP_Port</label>\n <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" ng-required="true">\n <div ng-messages="mailAccountForm[\'Imap.port\'].$error" ng-show="mailAccountForm[\'Imap.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true">\n <div ng-messages="mailAccountForm[\'Smtp.host\'].$error" ng-show="mailAccountForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" ng-required="true">\n <div ng-messages="mailAccountForm[\'Smtp.port\'].$error" ng-show="mailAccountForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.cservice !== undefined && vm.mailAccount.cservice == null && vm.newMailAccount" class="md-block">\n <md-switch ng-model="vm.mailAccount.cauthentication" aria-label="Authentication"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="(vm.mailAccount.cauthentication == true || vm.mailAccount.cservice != null) && vm.newMailAccount" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="cuser" ng-model="vm.mailAccount.cuser" ng-required="true">\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="mailAccountForm[\'cuser\'].$error" ng-show="mailAccountForm[\'cuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="(vm.mailAccount.cauthentication == true || vm.mailAccount.cservice != null) && vm.newMailAccount">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="cpassword" ng-model="vm.mailAccount.cpassword" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="mailAccountForm[\'cpassword\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailAccount.description">\n <div ng-messages="mailAccountForm[\'description\'].$error" ng-show="mailAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMailAccount" ng-click="vm.saveMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid || mailAccountForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMailAccount" ng-click="vm.addNewMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILACCOUNT" translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n ADD MAILACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMailAccount" ng-click="vm.deleteMailAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/agent/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" required autofocus>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'agent\'].$error" ng-show="mailAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" required autofocus>\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'times\'].$error" ng-show="mailAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.TEXT">Text</label>\n <textarea aria-label="Text text" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.autoreply.text"></textarea>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/close/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus>\n <div ng-messages="mailAccountFormApp[\'disposition\'].$error" ng-show="mailAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus>\n <div ng-messages="mailAccountFormApp[\'condition\'].$error" ng-show="mailAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true">\n <div ng-messages="mailAccountFormApp[\'truepriority\'].$error" ng-show="mailAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true">\n <div ng-messages="mailAccountFormApp[\'falsepriority\'].$error" ng-show="mailAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus>\n <div ng-messages="mailAccountFormApp[\'priority\'].$error" ng-show="mailAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/noop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus>\n <div ng-messages="mailAccountFormApp[\'value\'].$error" ng-show="mailAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/queue/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" required autofocus>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'queue\'].$error" ng-show="mailAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/system/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus>\n <div ng-messages="mailAccountFormApp[\'command\'].$error" ng-show="mailAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable">\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables">{{ variable.name }}</md-option>\n <md-option ng-value="\'\'">None</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'variable\'].$error" ng-show="mailAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",'<md-dialog class="mailCannedAnswer-dialog" aria-label="New MailCannedAnswer">\n <form name="mailCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">Key</label>\n <input type="" name="key" ng-model="vm.mailCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n <div ng-messages="mailCannedAnswerForm[\'key\'].$error" ng-show="mailCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.VALUE">Value</label>\n <textarea name="value" ng-model="vm.mailCannedAnswer.value" required></textarea>\n\n <div ng-messages="mailCannedAnswerForm[\'value\'].$error" ng-show="mailCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="MAIL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailCannedAnswer.description">\n <div ng-messages="mailCannedAnswerForm[\'description\'].$error" ng-show="mailCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMailCannedAnswer" ng-click="vm.saveMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid || mailCannedAnswerForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE"\n translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMailCannedAnswer" ng-click="vm.addNewMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILCANNEDANSWER" translate-attr-aria-label="MAIL.ADD_MAILCANNEDANSWER">\n ADD MAILCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMailCannedAnswer" ng-click="vm.deleteMailCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/mailDispositions/dialog.html",'<md-dialog class="mailDisposition-dialog" aria-label="New MailDisposition">\n <form name="mailDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="" name="name" ng-model="vm.mailDisposition.name" ng-required="true" autofocus>\n <div ng-messages="mailDispositionForm[\'name\'].$error" ng-show="mailDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMailDisposition" ng-click="vm.saveMailDisposition()" class="send-button md-accent md-raised" ng-disabled="mailDispositionForm.$invalid || mailDispositionForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMailDisposition" ng-click="vm.addNewMailDisposition()" class="send-button md-accent md-raised" ng-disabled="mailDispositionForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILDISPOSITION" translate-attr-aria-label="MAIL.ADD_MAILDISPOSITION">\n ADD MAILDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMailDisposition" ng-click="vm.deleteMailDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/view.html",'<div id="mail-mailAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-mailAccounts-button md-icon-button" aria-label="Go to mailAccounts" ng-click="vm.gotoMailAccounts()" translate translate-attr-aria-label="MAIL.GO_TO_MAILACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="mailAccount-image" hide-xs>\n <img ng-src="assets/images/business/mailAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.mailAccount.id}}\n <span ng-if="vm.mailAccount.name">{{vm.mailAccount.name}}</span>\n <span ng-if="vm.mailAccount.exten">{{vm.mailAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.mailAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MAIL.GOTO_MAILACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMailAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (imapForm.$invalid) || (smtpForm.$invalid) || (mailDispositionsForm.$invalid) || (mailCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)"\n translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.EMAIL_ADDRESS">Email_Address</label>\n <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true">\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email_Address field is required</span>\n </div>\n <div ng-message="email">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email_Address must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.mailAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.active" aria-label="Active"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FONT_FAMILY">Font_Family</label>\n <ms-font-family name="fontFamily" ng-model="vm.mailAccount.fontFamily" required></ms-font-family>\n <div class="hint"><span translate="MAIL.HELP.FONT_FAMILY"></span></div>\n <div ng-messages="generalForm[\'fontFamily\'].$error" ng-show="generalForm[fontFamily].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FONT_FAMILY_REQUIRED">Font_Family field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FONT_SIZE">Font_Size</label>\n <input type="number" name="fontSize" ng-model="vm.mailAccount.fontSize" min="8" max="72" ng-required="true">\n <div class="hint"><span translate="MAIL.HELP.FONT_SIZE"></span></div>\n <div ng-messages="generalForm[\'fontSize\'].$error" ng-show="generalForm[\'fontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FONT_SIZE_REQUIRED">Font_Size field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>8</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>72</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.TEMPLATE">Template</label>\n <textarea aria-label="Template template" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.mailAccount.template"></textarea>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.markAsUnread" aria-label="mark_as_unread"><span translate="MAIL.MARK_AS_UNREAD">mark_as_unread</span></md-switch>\n <div class="hint"><span translate="MAIL.HELP.MARK_AS_UNREAD"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.mailAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="mailAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.notificationSound" aria-label="notificationSound"><span translate="MAIL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.notificationShake" aria-label="notificationShake"><span translate="MAIL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.mailAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.IMAP">IMAP</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailAccount-detail-form-container imap md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.IMAP">IMAP</div>\n </div>\n <form name="imapForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="Imap.service" ng-model="vm.mailAccount.Imap.service" required autofocus>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="imapForm[\'Imap.service\'].$error" ng-show="imapForm[\'Imap.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true">\n <div ng-messages="imapForm[\'Imap.host\'].$error" ng-show="imapForm[\'Imap.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_PORT">IMAP_Port</label>\n <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" ng-required="true">\n <div ng-messages="imapForm[\'Imap.port\'].$error" ng-show="imapForm[\'Imap.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.tls" aria-label="ssl"><span translate="MAIL.SSL">ssl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Imap.service == null" class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.authentication" aria-label="Authentication"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Imap.authentication == true || vm.mailAccount.Imap.service != null" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="Imap.user" ng-model="vm.mailAccount.Imap.user" ng-required="true">\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="imapForm[\'Imap.user\'].$error" ng-show="imapForm[\'Imap.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.mailAccount.Imap.authentication == true || vm.mailAccount.Imap.service != null">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="Imap.password" ng-model="vm.mailAccount.Imap.password" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="imapForm[\'Imap.password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="MAIL.MAILBOX">mailbox</label>\n <input type="text" name="Imap.mailbox" ng-model="vm.mailAccount.Imap.mailbox">\n <div ng-messages="imapForm[\'Imap.mailbox\'].$error" ng-show="imapForm[\'Imap.mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.MAILBOX_REQUIRED">mailbox field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.CONNTIMEOUT">connTimeout</label>\n <input type="number" name="Imap.connTimeout" ng-model="vm.mailAccount.Imap.connTimeout" min="1" ng-required="true">\n <div ng-messages="imapForm[\'Imap.connTimeout\'].$error" ng-show="imapForm[\'Imap.connTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_REQUIRED">connTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">connTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AUTHTIMEOUT">authTimeout</label>\n <input type="number" name="Imap.authTimeout" ng-model="vm.mailAccount.Imap.authTimeout" min="1" ng-required="true">\n <div ng-messages="imapForm[\'Imap.authTimeout\'].$error" ng-show="imapForm[\'Imap.authTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_REQUIRED">authTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">authTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SMTP">SMTP</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailAccount-detail-form-container smtp md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.SMTP">SMTP</div>\n </div>\n <form name="smtpForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="Smtp.service" ng-model="vm.mailAccount.Smtp.service" required autofocus>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="smtpForm[\'Smtp.service\'].$error" ng-show="smtpForm[\'Smtp.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true">\n <div ng-messages="smtpForm[\'Smtp.host\'].$error" ng-show="smtpForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" ng-required="true">\n <div ng-messages="smtpForm[\'Smtp.port\'].$error" ng-show="smtpForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.secure" aria-label="Secure"><span translate="MAIL.SECURE">Secure</span></md-switch>\n <div class="hint"><span translate="MAIL.HELP.SECURE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.authentication" aria-label="Authentication"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Smtp.authentication == true || vm.mailAccount.Smtp.service != null" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="Smtp.user" ng-model="vm.mailAccount.Smtp.user" ng-required="true">\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="smtpForm[\'Smtp.user\'].$error" ng-show="smtpForm[\'Smtp.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.mailAccount.Smtp.authentication == true || vm.mailAccount.Smtp.service != null">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="Smtp.pass" ng-model="vm.mailAccount.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="smtpForm[\'Smtp.pass\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailAccount-detail-form-container maildispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountMailDispositionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountMailDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.MAILDISPOSITIONS">MailDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditMailAccountMailDisposition($event)" aria-label="add mailDisposition" translate translate-attr-label="MAIL.ADD_MAILDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountMailDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountMailDispositions.length}} {{vm_dc.selectedMailAccountMailDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountMailDispositions" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountMailDispositions($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountMailDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountMailDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'MAIL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mailDisposition" md-select-id="id" ng-repeat="mailDisposition in vm_dc.mailAccountMailDispositions.rows">\n <td ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" md-cell>{{mailDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" md-cell>{{mailDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" md-cell>{{mailDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" translate="MAIL.EDIT_MAILDISPOSITION">\n Edit MailDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(mailDisposition, $event)" translate="MAIL.DELETE_MAILDISPOSITION">\n Delete MailDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountMailDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="MAIL.NO_MAILDISPOSITION_AVAILABLE">No maildisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.mailAccountMailDispositions.count}}" md-on-paginate="vm_dc.getMailAccountMailDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailAccount-detail-form-container mailcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountMailCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.mailAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountMailCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.MAILCANNEDANSWERS">MailCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event)" aria-label="add mailCannedAnswer" translate translate-attr-label="MAIL.ADD_MAILCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountMailCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountMailCannedAnswers.length}} {{vm_dc.selectedMailAccountMailCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountMailCannedAnswers" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountMailCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountMailCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountMailCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'MAIL.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'MAIL.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'MAIL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mailCannedAnswer" md-select-id="id" ng-repeat="mailCannedAnswer in vm_dc.mailAccountMailCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.value}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" translate="MAIL.EDIT_MAILCANNEDANSWER">\n Edit MailCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(mailCannedAnswer, $event)" translate="MAIL.DELETE_MAILCANNEDANSWER">\n Delete MailCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountMailCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="MAIL.NO_MAILCANNEDANSWER_AVAILABLE">No mailcannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.mailAccountMailCannedAnswers.count}}" md-on-paginate="vm_dc.getMailAccountMailCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.mailAccount)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="MAIL.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedMailAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedMailAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedMailAccountApps.length}} {{vm_ac.selectedMailAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedMailAccountApps($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedMailAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.mailAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editMailAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.mailAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getMailAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="MAIL.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountInteractions.length}} {{vm_dc.selectedMailAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountInteractions" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'MAIL.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'MAIL.CONTACT\' | translate }}</th>\n <th md-column>{{ \'MAIL.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'MAIL.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'MAIL.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'MAIL.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'MAIL.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.mailAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spymailInteraction($event, interaction)" translate="MAIL.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="MAIL.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="MAIL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.mailAccountInteractions.count}}" md-on-paginate="vm_dc.getMailAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/mailAccounts.html",'<div id="mailAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILACCOUNTS">MailAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailAccounts-count">\n <span>{{vm.selectedMailAccounts.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAILACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailAccounts()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailAccounts()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailAccounts" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedMailAccounts($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- MAILACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'MAIL.KEY\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'MAIL.EMAIL_ADDRESS\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MAIL.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailAccount" md-select-id="id" ng-repeat="mailAccount in vm.mailAccounts.rows">\n <td md-cell ng-if="mailAccount.userpic"><img class="avatar" alt="{{mailAccount.name}}" ng-src="api/users/{{mailAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!mailAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMailAccount($event, mailAccount)" md-cell class="id ">{{mailAccount.id}}</td>\n <td ng-click="vm.createOrEditMailAccount($event, mailAccount)" md-cell class="name ">{{mailAccount.name}}</td>\n <td ng-click="vm.createOrEditMailAccount($event, mailAccount)" md-cell class="key ">{{mailAccount.key}}</td>\n <td ng-click="vm.createOrEditMailAccount($event, mailAccount)" md-cell class="email ">{{mailAccount.email}}</td>\n <td ng-click="vm.createOrEditMailAccount($event, mailAccount)" md-cell class="active ">\n <md-icon md-colors="{color: {{mailAccount.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{mailAccount.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditMailAccount($event, mailAccount)" md-cell class="description ">{{mailAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(mailAccount, $event)" translate="MAIL.EDIT_MAILACCOUNT">\n Edit MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.verifysmtpverifysmtp(mailAccount, $event)" translate="MAIL.VERIFYSMTP_MAILACCOUNT">\n verifysmtp MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(mailAccount, $event)" translate="MAIL.INTERACTIONS_MAILACCOUNT">\n Interactions MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(mailAccount, $event)" translate="MAIL.GOTOREALTIME_MAILACCOUNT">\n goToRealtime MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(mailAccount, $event)" translate="MAIL.DELETE_MAILACCOUNT">\n Delete MailAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.mailAccounts.count}}" md-on-paginate="vm.getMailAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-mailAccount-button" ng-click="vm.createOrEditMailAccount($event)" aria-label="add mailAccount" translate translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailQueues/create/dialog.html",'<md-dialog class="mailQueue-dialog" aria-label="New MailQueue">\n <form name="mailQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newMailQueue">\n <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n <div ng-messages="mailQueueForm[\'name\'].$error" ng-show="mailQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.mailQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="mailQueueForm[\'strategy\'].$error" ng-show="mailQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="mailQueueForm[\'timeout\'].$error" ng-show="mailQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailQueue.description">\n <div ng-messages="mailQueueForm[\'description\'].$error" ng-show="mailQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMailQueue" ng-click="vm.saveMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid || mailQueueForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMailQueue" ng-click="vm.addNewMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILQUEUE" translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n ADD MAILQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMailQueue" ng-click="vm.deleteMailQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue">\n <form name="mailQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.AGENTADD_MAILQUEUE">Add Agent to mailQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue">\n <form name="mailQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.TEAMADD_MAILQUEUE">Add Team in MAILQUEUE</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/view.html",'<div id="mail-mailQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-mailQueues-button md-icon-button" aria-label="Go to mailQueues" ng-click="vm.gotoMailQueues()" translate translate-attr-aria-label="MAIL.GO_TO_MAILQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="mailQueue-image" hide-xs>\n <img ng-src="assets/images/business/mailQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.mailQueue.id}}\n <span ng-if="vm.mailQueue.name">{{vm.mailQueue.name}}</span>\n <span ng-if="vm.mailQueue.exten">{{vm.mailQueue.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.mailQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="MAIL.TEAMADD_MAILQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.mailQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MAIL.AGENTADD_MAILQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMailQueue()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.mailQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailQueue.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/mail/views/mailQueues/mailQueues.html",'<div id="mailQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILQUEUES">MailQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailQueues-count">\n <span>{{vm.selectedMailQueues.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAILQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailQueues()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailQueues()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailQueues" csv-label="true" filename="mailQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedMailQueues($event)" aria-label="delete selected" translate translate-attr-label="MAILQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- MAILQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'MAIL.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailQueue" md-select-id="id" ng-repeat="mailQueue in vm.mailQueues.rows">\n <td md-cell ng-if="mailQueue.userpic"><img class="avatar" alt="{{mailQueue.name}}" ng-src="api/users/{{mailQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!mailQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMailQueue($event, mailQueue)" md-cell class="id ">{{mailQueue.id}}</td>\n <td ng-click="vm.createOrEditMailQueue($event, mailQueue)" md-cell class="name ">{{mailQueue.name}}</td>\n <td ng-click="vm.createOrEditMailQueue($event, mailQueue)" md-cell class="strategy ">{{ vm.arraystrategy[mailQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(mailQueue, $event)" translate="MAIL.EDIT_MAILQUEUE">\n Edit MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(mailQueue, $event)" translate="MAIL.TEAMADD_MAILQUEUE">\n teamadd MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(mailQueue, $event)" translate="MAIL.AGENTADD_MAILQUEUE">\n agentadd MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(mailQueue, $event)" translate="MAIL.DELETE_MAILQUEUE">\n Delete MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(mailQueue, $event)" translate="MAIL.GOTOREALTIME_MAILQUEUE">\n goToRealtime MailQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.mailQueues.count}}" md-on-paginate="vm.getMailQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILQUEUE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-mailQueue-button" ng-click="vm.createOrEditMailQueue($event)" aria-label="add mailQueue" translate translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailSubtatuses/create/dialog.html",'<md-dialog class="mailSubstatus-dialog" aria-label="New MailSubstatus">\n <form name="mailSubstatusForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailSubstatus.name" ng-required="true" autofocus>\n <div ng-messages="mailSubstatusForm[\'name\'].$error" ng-show="mailSubstatusForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailSubstatus.description">\n <div ng-messages="mailSubstatusForm[\'description\'].$error" ng-show="mailSubstatusForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMailSubstatus" ng-click="vm.saveMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid || mailSubstatusForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMailSubstatus" ng-click="vm.addNewMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILSUBSTATUS" translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n ADD MAILSUBSTATUS\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMailSubstatus" ng-click="vm.deleteMailSubstatus($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",'<div id="mailSubtatuses" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILSUBSTATUSES">MailSubstatuses</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailSubstatuses.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailSubstatuses =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailSubtatuses-count">\n <span>{{vm.selectedMailSubstatuses.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAILSUBSTATUSES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailSubstatuses()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailSubstatuses()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailSubstatuses" csv-label="true" filename="mailSubtatuses.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedMailSubstatuses($event)" aria-label="delete selected" translate translate-attr-label="MAILSUBSTATUSES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- MAILSUBSTATUS TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailSubstatuses" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailSubstatuses">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailSubtatuses.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailSubstatus" md-select-id="id" ng-repeat="mailSubstatus in vm.mailSubtatuses.rows">\n <td md-cell ng-if="mailSubstatus.userpic"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="api/users/{{mailSubstatus.id}}/avatar" /></td>\n <td md-cell ng-if="!mailSubstatus.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="id ">{{mailSubstatus.id}}</td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="name ">{{mailSubstatus.name}}</td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="description ">{{mailSubstatus.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(mailSubstatus, $event)" translate="MAIL.EDIT_MAILSUBSTATUS">\n Edit MailSubstatus\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(mailSubstatus, $event)" translate="MAIL.DELETE_MAILSUBSTATUS">\n Delete MailSubstatus\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.mailSubtatuses.count}}" md-on-paginate="vm.getMailSubstatuses" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILSUBSTATUS TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILSUBSTATUS BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-mailSubstatus-button" ng-click="vm.createOrEditMailSubstatus($event)" aria-label="add mailSubstatus" translate translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILSUBSTATUS BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.ACCOUNTS">Accounts</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column>{{ \'MAIL.KEY\' | translate }}</th>\n <th md-column>{{ \'MAIL.TOTAL\' | translate }}</th>\n <th md-column>{{ \'MAIL.IN\' | translate }}</th>\n <th md-column>{{ \'MAIL.OUT\' | translate }}</th>\n <th md-column>{{ \'MAIL.IMAP_STATUS\' | translate }}</th>\n <th md-column>{{ \'MAIL.SMTP_STATUS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailAccounts">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.mailAccounts[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.mailAccounts[value].name}}</td>\n <td md-cell>{{vm.mailAccounts[value].key}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(vm.mailAccounts[value].in || 0) + (vm.mailAccounts[value].out || 0)}}</span>\n </td>\n <td md-cell>\n <div layout="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">{{vm.mailAccounts[value].in || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.in">{{vm.mailAccounts[value].lastIn ? (vm.mailAccounts[value].lastIn | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">{{vm.mailAccounts[value].out || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.out">{{vm.mailAccounts[value].lastOut ? (vm.mailAccounts[value].lastOut | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column" layout-align="center center">\n <md-button class="md-icon-button" aria-label="Status">\n <md-tooltip>{{vm.mailAccounts[value].Imap.messageStatus}}</md-tooltip>\n <div ng-switch="vm.mailAccounts[value].Imap.status">\n <md-icon ng-switch-when="error" md-font-icon="icon-alert yellow-fg"></md-icon>\n <md-icon ng-switch-when="disabled" md-font-icon="icon-close grey-fg"></md-icon>\n <md-icon ng-switch-default md-font-icon="icon-checkbox-marked-circle-outline green-fg"></md-icon>\n </div>\n </md-button>\n <span class="md-caption grey-fg">{{ (\'MAIL.\' + vm.mailAccounts[value].Imap.status.toUpperCase()) | translate}}</span>\n </div>\n <span class="text-boxed" ng-if="vm.mailAccounts[value].active">{{vm.mailAccounts[value].Imap.lastSync | date: \'shortTime\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row" layout-align="start center" ng-if="vm.mailAccounts[value].Smtp.status">\n <div layout="column" layout-align="center center">\n <md-button class="md-icon-button" aria-label="Status">\n <md-tooltip>{{vm.mailAccounts[value].Smtp.messageStatus}}</md-tooltip>\n <md-icon md-font-icon="{{ vm.mailAccounts[value].Smtp.status == \'error\' ? \'icon-alert yellow-fg\' : \'icon-checkbox-marked-circle-outline green-fg\'}}"></md-icon>\n </md-button>\n <span class="md-caption grey-fg">{{ (\'MAIL.\' + vm.mailAccounts[value].Smtp.status.toUpperCase()) | translate}}</span>\n </div>\n <span class="text-boxed">{{vm.mailAccounts[value].Smtp.lastSync | date: \'shortTime\'}}</span>\n </div>\n <span class="md-caption grey-fg" ng-if="!vm.mailAccounts[value].Smtp.status">{{ \'MAIL.NEVER_VERIFIED\' | translate }}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToMailAccount($event, vm.mailAccounts[value])" translate="MAIL.EDIT_ACCOUNT">\n Edit Account\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.verifySmtp($event, vm.mailAccounts[value])" translate="MAIL.VERIFY_SMTP">\n Verify Smtp\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.count}}" md-on-paginate="vm.getmailAccounts" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/mail/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'MAIL.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'MAIL.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'MAIL.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'MAIL.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'MAIL.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="3">{{ \'MAIL.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n \x3c!-- <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSE\' | translate }}</th>\n <th md-column width="10px"></th> --\x3e\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'MAIL.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'MAIL.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatusTime">{{ \'MAIL.TIMER\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'MAIL.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'busy\':\'indigo-100-bg\',\'*pause\':\'amber-50-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].globalStatus]">{{ vm.isPause(vm.agents[value].globalStatus) ? \'\' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? \'*\'+vm.agents[value].pauseType || \'DEFAULT PAUSE\' : vm.agents[value].pauseType || \'DEFAULT PAUSE\') : \'\'}}</span>\n </td>\n <td class="bt custom-column">\n <timer start-time="vm.agents[value].globalStatusTime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class="bt bl">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'talking\':\'indigo-100-bg\',\'ringing\':\'orange-400-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt bl">\n <div layout="column">\n <span ng-if="vm.agents[value].queue" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].queue }}</span>\n <span ng-if="vm.agents[value].destconnectedlinenum" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class="padding-5" ng-if="vm.agents[value].queue || vm.agents[value].destconnectedlinenum">\n <timer start-time="vm.agents[value].voiceStatusTime" interval="1000" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n \x3c!-- <td class="bt">--</td>\n <td class="bt">--</td> --\x3e\n <td class="bt bl" ng-if="vm.license.chat">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n \x3c!-- <td class="bt padding-5 text-center">{{ agent.chatCurrentCapacity }}/{{ agent.chatCapacity > 0 ? agent.chatCapacity : \'∞\' }}</td> --\x3e\n <td md-number class="bt text-center font-size-20" ng-if="vm.license.chat" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.mail">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.mail" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.messaging">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.messaging" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.openchannel">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">4</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">89</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.openchannel" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.fax">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">7</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">2</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.fax" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class="bl bt padding-5 text-center">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.logout(vm.agents[value], $event)" translate="MAIL.LOGOUT">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.queueAdd(vm.agents[value], $event)" translate="MAIL.AGENTADD_QUEUE">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="MAIL.PAUSE">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=" vm.agents[value].voicePause && \'DEFAULT PAUSE\' === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value])"><em translate="MAIL.DEFAULT_PAUSE">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.pauses.rows.length" ng-repeat="pause in vm.pauses.rows">\n <md-button ng-disabled="vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value], pause.name)">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="vm.isPause(vm.agents[value].globalStatus)">\n <md-button ng-click="vm.unPause(vm.agents[value])" translate="MAIL.UNPAUSE">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.filteredAgents.length}}" md-on-paginate="vm.onInit" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/mail/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column>{{ \'MAIL.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'MAIL.PAUSED\' | translate }}</th>\n <th md-column>{{ \'MAIL.READY\' | translate }}</th>\n <th md-column>{{ \'MAIL.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditMailQueue($event, vm.queues[value])" translate="MAIL.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="MAIL.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/mail/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ACCOUNTS">Accounts</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",'<md-dialog class="ivrCampaign-dialog" aria-label="New IvrCampaign">\n <form name="ivrCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newIvrCampaign">\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="ivrCampaignForm[\'name\'].$error" ng-show="ivrCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'TrunkId\'].$error" ng-show="ivrCampaignForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'IntervalId\'].$error" ng-show="ivrCampaignForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }}</md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }}</md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="ivrCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" required>\n <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects">{{ SquareProjectId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'SquareProjectId\'].$error" ng-show="ivrCampaignForm[\'SquareProjectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n <div ng-messages="ivrCampaignForm[\'limitCalls\'].$error" ng-show="ivrCampaignForm[\'limitCalls\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.ivrCampaign.description">\n <div ng-messages="ivrCampaignForm[\'description\'].$error" ng-show="ivrCampaignForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newIvrCampaign" ng-click="vm.saveIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid || ivrCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newIvrCampaign" ng-click="vm.addNewIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_IVRCAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n ADD IVRCAMPAIGN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newIvrCampaign" ng-click="vm.deleteIvrCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign">\n <form name="ivrCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n <md-select name="priority" ng-model="vm.hopper.priority">\n <md-option ng-value="\'4\'">Highest</md-option>\n <md-option ng-value="\'3\'">High</md-option>\n <md-option ng-value="\'2\'">Medium</md-option>\n <md-option ng-value="\'1\'">Low</md-option>\n <md-option ng-value="\'0\'">Lowest</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign">\n <form name="ivrCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-hide="vm.loading">\n <div layout="row" layout-wrap flex>\n <div flex-xs flex="50">\n <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n </md-checkbox>\n </div>\n <div flex-xs flex="50">\n </div>\n <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n {{ item.name | limitTo:40 }}\n </md-checkbox>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n <div>\n </div>\n <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n SAVE\n </md-button>\n </md-dialog-actions>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",'<div id="motiondialer-ivrCampaign" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-ivrCampaigns-button md-icon-button" aria-label="Go to ivrCampaigns" ng-click="vm.gotoIvrCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_IVRCAMPAIGNS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="ivrCampaign-image" hide-xs>\n <img ng-src="assets/images/business/ivrCampaigns.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.ivrCampaign.id}}\n <span ng-if="vm.ivrCampaign.name">{{vm.ivrCampaign.name}}</span>\n <span ng-if="vm.ivrCampaign.exten">{{vm.ivrCampaign.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.ivrCampaign.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.listadddialog(vm.ivrCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n <md-tooltip><span translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.blacklistadddialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-block-helper"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.resetlistdialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n <md-tooltip><span translate="MOTIONDIALER.RESETLIST_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-restore"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MOTIONDIALER.GOTO_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (advancedForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)"\n translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n <md-select name="TrunkBackupId" ng-model="vm.ivrCampaign.TrunkBackupId">\n <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks">{{ TrunkBackupId.name }}</md-option>\n <md-option ng-value="null">None</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }}</md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }}</md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.ivrCampaign.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n </div>\n <form name="campaignForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" required autofocus>\n <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects">{{ SquareProjectId.name }}</md-option>\n </md-select>\n <div ng-messages="campaignForm[\'SquareProjectId\'].$error" ng-show="campaignForm[\'SquareProjectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n <div ng-messages="campaignForm[\'limitCalls\'].$error" ng-show="campaignForm[\'limitCalls\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n </div>\n <form name="originateForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n <input type="text" name="dialOriginateCallerIdName" ng-model="vm.ivrCampaign.dialOriginateCallerIdName" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.ivrCampaign.dialOriginateCallerIdNumber">\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n <input type="number" name="dialOriginateTimeout" ng-model="vm.ivrCampaign.dialOriginateTimeout" min="1" max="999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.ivrCampaign.dialPrefix" ng-pattern="/^\\d+$/">\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n <input type="number" name="dialGlobalMaxRetry" ng-model="vm.ivrCampaign.dialGlobalMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n </div>\n <form name="congestionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n <input type="number" name="dialCongestionMaxRetry" ng-model="vm.ivrCampaign.dialCongestionMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.ivrCampaign.dialCongestionRetryFrequency" min="1" max="99999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n </div>\n <form name="busyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n <input type="number" name="dialBusyMaxRetry" ng-model="vm.ivrCampaign.dialBusyMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n <input type="number" name="dialBusyRetryFrequency" ng-model="vm.ivrCampaign.dialBusyRetryFrequency" min="1" max="99999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n </div>\n <form name="noanswerForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.ivrCampaign.dialNoAnswerMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.ivrCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.ivrCampaign.dialOrderByScheduledAt" autofocus>\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }}</md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n </div>\n <form name="globalintervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n <input type="text" name="dialGlobalInterval" ng-model="vm.ivrCampaign.dialGlobalInterval" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n </div>\n <form name="timezoneForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.ivrCampaign.dialTimezone" autofocus>\n < <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span></div>\n <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n </div>\n <form name="amdForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.dialAMDActive" aria-label="AMDActive"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n <input type="number" name="dialAMDInitialSilence" ng-model="vm.ivrCampaign.dialAMDInitialSilence" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n <input type="number" name="dialAMDGreeting" ng-model="vm.ivrCampaign.dialAMDGreeting" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.ivrCampaign.dialAMDAfterGreetingSilence" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.ivrCampaign.dialAMDTotalAnalysisTime" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n <input type="number" name="dialAMDMinWordLength" ng-model="vm.ivrCampaign.dialAMDMinWordLength" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.ivrCampaign.dialAMDBetweenWordsSilence" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.ivrCampaign.dialAMDMaximumNumberOfWords" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.ivrCampaign.dialAMDSilenceThreshold" min="0" max="32767">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.ivrCampaign.dialAMDMaximumWordLength" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.ivrCampaign)">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_hs.init(vm.ivrCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n </div>\n\n </div>\n <div class="ivrCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHoppers.length}} {{vm_dc.selectedIvrCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHoppers" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedIvrCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="IVRCAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHoppers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHoppers">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.ivrCampaignHoppers.rows">\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.ContactId}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.phone}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.countcongestionretry}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.countbusyretry}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.countnoanswerretry}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{ vm_dc.arraypriority[hopper.priority].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHoppers.rows.length">\n <td md-cell colspan="10">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHoppers.count}}" md-on-paginate="vm_dc.getIvrCampaignHoppers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperHistories.length}} {{vm_dc.selectedIvrCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperHistories" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperHistories" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.ivrCampaignHopperHistories.rows">\n <td md-cell>{{hopperHistory.uniqueid}}</td>\n <td md-cell>{{hopperHistory.ContactId}}</td>\n <td md-cell>{{hopperHistory.calleridnum}}</td>\n <td md-cell>{{hopperHistory.calleridname}}</td>\n <td md-cell>{{hopperHistory.statedesc}}</td>\n <td md-cell>{{hopperHistory.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.endtime | date:\'medium\'}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperHistories.rows.length">\n <td md-cell colspan="11">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperHistories" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.FINAL">FINAL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsIvrCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n <md-icon md-font-icon="icon-backup-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(3)">\n <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(5)">\n <span translate="MOTIONDIALER.BUSY ">Busy</span>\n <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(8)">\n <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(10)">\n <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(11)">\n <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(22)">\n <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(0)">\n <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperFinals.length}} {{vm_dc.selectedIvrCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperFinals" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-click="vm_dc.moveSelectedIvrCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="IVRCAMPAIGNS.MOVE_SELECTED">\n <md-icon md-font-icon="icon-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperFinals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'MOTIONDIALER.DISPOSITION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.ivrCampaignHopperFinals.rows">\n <td md-cell>{{hopperFinal.uniqueid}}</td>\n <td md-cell>{{hopperFinal.ContactId}}</td>\n <td md-cell>{{hopperFinal.calleridnum}}</td>\n <td md-cell>{{hopperFinal.calleridname}}</td>\n <td md-cell>{{hopperFinal.statedesc}}</td>\n <td md-cell>{{hopperFinal.countcongestionretry}}</td>\n <td md-cell>{{hopperFinal.countbusyretry}}</td>\n <td md-cell>{{hopperFinal.countnoanswerretry}}</td>\n <td md-cell>{{hopperFinal.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.endtime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.disposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n Move HopperFinal\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperFinals.rows.length">\n <td md-cell colspan="23">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperFinals" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperBlacks.length}} {{vm_dc.selectedIvrCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperBlacks" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperBlacks" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperBlacks">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.ivrCampaignHopperBlacks.rows">\n <td md-cell>{{hopperBlack.ContactId}}</td>\n <td md-cell>{{hopperBlack.phone}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperBlacks.rows.length">\n <td md-cell colspan="4">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperBlacks" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n</div>\n\x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",'<div id="ivrCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MOTIONDIALER.IVRCAMPAIGNS">IvrCampaigns</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedIvrCampaigns.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedIvrCampaigns =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MOTIONDIALER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-ivrCampaigns-count">\n <span>{{vm.selectedIvrCampaigns.length}}</span>\n <span translate="MOTIONDIALER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="IVRCAMPAIGNS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllIvrCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectIvrCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedIvrCampaigns" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedIvrCampaigns($event)" aria-label="delete selected" translate translate-attr-label="IVRCAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- IVRCAMPAIGN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedIvrCampaigns" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIvrCampaigns">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="SquareProjectId">{{ \'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.ivrCampaigns.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="ivrCampaign" md-select-id="id" ng-repeat="ivrCampaign in vm.ivrCampaigns.rows">\n <td md-cell ng-if="ivrCampaign.userpic"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="api/users/{{ivrCampaign.id}}/avatar" /></td>\n <td md-cell ng-if="!ivrCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="id ">{{ivrCampaign.id}}</td>\n <td ng-click="vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="name ">{{ivrCampaign.name}}</td>\n <td ng-click="vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="active ">\n <md-icon md-colors="{color: {{ivrCampaign.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{ivrCampaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="TrunkId ">{{ TrunkId = vm.trunks[ivrCampaign.TrunkId]; TrunkId.name }}</td>\n <td ng-click="vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="SquareProjectId ">{{ SquareProjectId = vm.projects[ivrCampaign.SquareProjectId]; SquareProjectId.name }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(ivrCampaign, $event)" translate="MOTIONDIALER.EDIT_IVRCAMPAIGN">\n Edit IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.listadddialog(ivrCampaign, $event)" translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">\n listadd IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.blacklistadddialog(ivrCampaign, $event)" translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">\n blacklistadd IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(ivrCampaign, $event)" translate="MOTIONDIALER.DELETE_IVRCAMPAIGN">\n Delete IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(ivrCampaign, $event)" translate="MOTIONDIALER.GOTOREALTIME_IVRCAMPAIGN">\n goToRealtime IvrCampaign\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.ivrCampaigns.count}}" md-on-paginate="vm.getIvrCampaigns" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / IVRCAMPAIGN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD IVRCAMPAIGN BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-ivrCampaign-button" ng-click="vm.createOrEditIvrCampaign($event)" aria-label="add ivrCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD IVRCAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",'<md-dialog class="queueCampaign-dialog" aria-label="New QueueCampaign">\n <form name="queueCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newQueueCampaign">\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="queueCampaignForm[\'name\'].$error" ng-show="queueCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'TrunkId\'].$error" ng-show="queueCampaignForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'IntervalId\'].$error" ng-show="queueCampaignForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }}</md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }}</md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }}</md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="queueCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.METHOD">Method</label>\n <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" required>\n <md-option ng-value="\'progressive\'">Progressive</md-option>\n <md-option ng-value="\'power\'">PowerDialing</md-option>\n <md-option ng-value="\'predictive\'">Predictive</md-option>\n <md-option ng-value="\'preview\'">Preview</md-option>\n <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n <div ng-messages="queueCampaignForm[\'dialMethod\'].$error" ng-show="queueCampaignForm[\'dialMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization">\n\n <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }}</md-option>\n\n <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n <div ng-messages="queueCampaignForm[\'dialPredictiveOptimization\'].$error" ng-show="queueCampaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n <div ng-messages="queueCampaignForm[\'dialLimitQueue\'].$error" ng-show="queueCampaignForm[\'dialLimitQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n <div ng-messages="queueCampaignForm[\'dialQueueTimeout\'].$error" ng-show="queueCampaignForm[\'dialQueueTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n <div ng-messages="queueCampaignForm[\'timeout\'].$error" ng-show="queueCampaignForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.queueCampaign.description">\n <div ng-messages="queueCampaignForm[\'description\'].$error" ng-show="queueCampaignForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newQueueCampaign" ng-click="vm.saveQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid || queueCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newQueueCampaign" ng-click="vm.addNewQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_QUEUECAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n ADD QUEUECAMPAIGN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newQueueCampaign" ng-click="vm.deleteQueueCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">Add Agent to queueCampaign</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n <md-select name="priority" ng-model="vm.hopper.priority">\n <md-option ng-value="\'4\'">Highest</md-option>\n <md-option ng-value="\'3\'">High</md-option>\n <md-option ng-value="\'2\'">Medium</md-option>\n <md-option ng-value="\'1\'">Low</md-option>\n <md-option ng-value="\'0\'">Lowest</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.hopper.recallme" aria-label="RecallAgent"><span translate="MOTIONDIALER.RECALLAGENT">RecallAgent</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.hopper.recallme" class="md-block">\n <label translate="MOTIONDIALER.AGENT">Agent</label>\n <md-select name="UserId" ng-model="vm.hopper.UserId" required>\n <md-option ng-value="UserId.id" ng-repeat="UserId in vm.agents">{{ UserId.name }}</md-option>\n </md-select>\n <div ng-messages="hopperForm[\'UserId\'].$error" ng-show="hopperForm[\'UserId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-hide="vm.loading">\n <div layout="row" layout-wrap flex>\n <div flex-xs flex="50">\n <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n </md-checkbox>\n </div>\n <div flex-xs flex="50">\n </div>\n <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n {{ item.name | limitTo:40 }}\n </md-checkbox>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n <div>\n </div>\n <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n SAVE\n </md-button>\n </md-dialog-actions>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN">Add Team in QUEUECAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",'<div id="motiondialer-queueCampaign" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-queueCampaigns-button md-icon-button" aria-label="Go to queueCampaigns" ng-click="vm.gotoQueueCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_QUEUECAMPAIGNS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="queueCampaign-image" hide-xs>\n <img ng-src="assets/images/business/queueCampaigns.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.queueCampaign.id}}\n <span ng-if="vm.queueCampaign.name">{{vm.queueCampaign.name}}</span>\n <span ng-if="vm.queueCampaign.exten">{{vm.queueCampaign.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.queueCampaign.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.listadddialog(vm.queueCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n <md-tooltip><span translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.blacklistadddialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-block-helper"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.queueCampaign, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.queueCampaign, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.resetlistdialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n <md-tooltip><span translate="MOTIONDIALER.RESETLIST_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-restore"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MOTIONDIALER.GOTO_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (queueForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (advancedForm.$invalid) || (advancedpreviewForm.$invalid) || (recallmeForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)"\n translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="queueCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n <md-select name="TrunkBackupId" ng-model="vm.queueCampaign.TrunkBackupId">\n <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks">{{ TrunkBackupId.name }}</md-option>\n <md-option ng-value="null">None</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }}</md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }}</md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.queueCampaign.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="queueCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n </div>\n <form name="campaignForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.METHOD">Method</label>\n <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" required autofocus>\n <md-option ng-value="\'progressive\'">Progressive</md-option>\n <md-option ng-value="\'power\'">PowerDialing</md-option>\n <md-option ng-value="\'predictive\'">Predictive</md-option>\n <md-option ng-value="\'preview\'">Preview</md-option>\n <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n <div ng-messages="campaignForm[\'dialMethod\'].$error" ng-show="campaignForm[\'dialMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization">\n\n <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }}</md-option>\n\n <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n <div ng-messages="campaignForm[\'dialPredictiveOptimization\'].$error" ng-show="campaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n <div ng-messages="campaignForm[\'dialLimitQueue\'].$error" ng-show="campaignForm[\'dialLimitQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n <div ng-messages="campaignForm[\'timeout\'].$error" ng-show="campaignForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container queue md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.QUEUE">QUEUE</div>\n </div>\n <form name="queueForm" novalidate>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUEOPTIONS">QueueOptions</label>\n <input type="text" name="dialQueueOptions" ng-model="vm.queueCampaign.dialQueueOptions" autofocus>\n <div ng-messages="queueForm[\'dialQueueOptions\'].$error" ng-show="queueForm[\'dialQueueOptions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUEOPTIONS_REQUIRED">QueueOptions field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n <div ng-messages="queueForm[\'dialQueueTimeout\'].$error" ng-show="queueForm[\'dialQueueTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'booked\' || vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.queueCampaign.strategy" required>\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'roundrobin\'" ng-if="vm.queueCampaign.dialMethod === \'booked\'">Round Robin</md-option>\n <md-option ng-value="\'leastrecent\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Random</md-option>\n <md-option ng-value="\'linear\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="queueForm[\'strategy\'].$error" ng-show="queueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.RETRY">Retry</label>\n <input type="number" name="retry" ng-model="vm.queueCampaign.retry" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.RETRY"></span></div>\n <div ng-messages="queueForm[\'retry\'].$error" ng-show="queueForm[\'retry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.WRAPUPTIME">WrapupTime</label>\n <input type="number" name="wrapuptime" ng-model="vm.queueCampaign.wrapuptime" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.WRAPUPTIME"></span></div>\n <div ng-messages="queueForm[\'wrapuptime\'].$error" ng-show="queueForm[\'wrapuptime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.WEIGHT">Weight</label>\n <input type="number" name="weight" ng-model="vm.queueCampaign.weight" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.WEIGHT"></span></div>\n <div ng-messages="queueForm[\'weight\'].$error" ng-show="queueForm[\'weight\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.MUSICONHOLD">MusicOnHold</label>\n <md-select name="musiconhold" ng-model="vm.queueCampaign.musiconhold">\n <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds">{{ musiconhold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MUSICONHOLD"></span></div>\n <div ng-messages="queueForm[\'musiconhold\'].$error" ng-show="queueForm[\'musiconhold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject">\n <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects">{{ dialQueueProject.name }}</md-option>\n <md-option ng-value="null">None</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT2">CallySquareProject2</label>\n <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2">\n <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects">{{ dialQueueProject2.name }}</md-option>\n <md-option ng-value="null">None</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT2"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT2_REQUIRED">CallySquareProject2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW">CallySquareProjectPreview</label>\n <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject">\n <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects">{{ dialQueueProject.name }}</md-option>\n <md-option ng-value="null">None</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW_REQUIRED">CallySquareProjectPreview field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW2">CallySquareProjectPreview2</label>\n <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2">\n <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects">{{ dialQueueProject2.name }}</md-option>\n <md-option ng-value="null">None</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW2"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW2_REQUIRED">CallySquareProjectPreview2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialQueueProject2 && (vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\')" class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialAgiAfterHangupAgent" aria-label="RunIfHangupAgent"><span translate="MOTIONDIALER.RUNIFHANGUPAGENT">RunIfHangupAgent</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.RUNIFHANGUPAGENT"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n </div>\n <form name="originateForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n <input type="text" name="dialOriginateCallerIdName" ng-model="vm.queueCampaign.dialOriginateCallerIdName" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.queueCampaign.dialOriginateCallerIdNumber">\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n <input type="number" name="dialOriginateTimeout" ng-model="vm.queueCampaign.dialOriginateTimeout" min="1" max="999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.queueCampaign.dialPrefix" ng-pattern="/^\\d+$/">\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="queueCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n <input type="number" name="dialGlobalMaxRetry" ng-model="vm.queueCampaign.dialGlobalMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n </div>\n <form name="congestionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n <input type="number" name="dialCongestionMaxRetry" ng-model="vm.queueCampaign.dialCongestionMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.queueCampaign.dialCongestionRetryFrequency" min="1" max="99999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n </div>\n <form name="busyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n <input type="number" name="dialBusyMaxRetry" ng-model="vm.queueCampaign.dialBusyMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n <input type="number" name="dialBusyRetryFrequency" ng-model="vm.queueCampaign.dialBusyRetryFrequency" min="1" max="99999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n </div>\n <form name="noanswerForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.queueCampaign.dialNoAnswerMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.queueCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.acw" aria-label="AfterCallWork"><span translate="MOTIONDIALER.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.acw" class="md-block">\n <label translate="MOTIONDIALER.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.queueCampaign.acwTimeout" min="0" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AUTOPAUSE">AutoPause</label>\n <md-select name="autopause" ng-model="vm.queueCampaign.autopause">\n\n <md-option ng-value="\'all\'"> {{ \'MOTIONDIALER.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AUTOPAUSE"></span></div>\n <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.RINGINUSE">RingInUse</label>\n <md-select name="ringinuse" ng-model="vm.queueCampaign.ringinuse">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.RINGINUSE"></span></div>\n <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MEMBERDELAY">MemberDelay</label>\n <input type="number" name="memberdelay" ng-model="vm.queueCampaign.memberdelay" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.MEMBERDELAY"></span></div>\n <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEOUTRESTART">TimeoutRestart</label>\n <md-select name="timeoutrestart" ng-model="vm.queueCampaign.timeoutrestart">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEOUTRESTART"></span></div>\n <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONTEXT">Context</label>\n <input type="text" name="context" ng-model="vm.queueCampaign.context">\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONTEXT"></span></div>\n <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n <md-select name="setinterfacevar" ng-model="vm.queueCampaign.setinterfacevar">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETINTERFACEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETQUEUEVARIABLES">SetQueueVariables</label>\n <md-select name="setqueuevar" ng-model="vm.queueCampaign.setqueuevar">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n <md-select name="setqueueentryvar" ng-model="vm.queueCampaign.setqueueentryvar">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }}</md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="queueCampaign-detail-form-container advancedpreview md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCEDPREVIEW">ADVANCEDPREVIEW</div>\n </div>\n <form name="advancedpreviewForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format" autofocus>\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedpreviewForm[\'monitor_format\'].$error" ng-show="advancedpreviewForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }}</md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedpreviewForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedpreviewForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container recallme md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.RECALLME">RECALLME</div>\n </div>\n <form name="recallmeForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALRECALLMETIMEOUT">DialRecallMeTimeout</label>\n <input type="number" name="dialRecallMeTimeout" ng-model="vm.queueCampaign.dialRecallMeTimeout" min="1" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLMETIMEOUT"></span></div>\n <div ng-messages="recallmeForm[\'dialRecallMeTimeout\'].$error" ng-show="recallmeForm[\'dialRecallMeTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_REQUIRED">DialRecallMeTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DialRecallMeTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialRecallInQueue" aria-label="DialRecallInQueue"><span translate="MOTIONDIALER.DIALRECALLINQUEUE">DialRecallInQueue</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLINQUEUE"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n </div>\n <form name="globalintervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n <input type="text" name="dialGlobalInterval" ng-model="vm.queueCampaign.dialGlobalInterval" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n </div>\n <form name="timezoneForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.queueCampaign.dialTimezone" autofocus>\n < <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span></div>\n <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n </div>\n <form name="amdForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialAMDActive" aria-label="AMDActive"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n <input type="number" name="dialAMDInitialSilence" ng-model="vm.queueCampaign.dialAMDInitialSilence" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n <input type="number" name="dialAMDGreeting" ng-model="vm.queueCampaign.dialAMDGreeting" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.queueCampaign.dialAMDAfterGreetingSilence" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.queueCampaign.dialAMDTotalAnalysisTime" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n <input type="number" name="dialAMDMinWordLength" ng-model="vm.queueCampaign.dialAMDMinWordLength" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.queueCampaign.dialAMDBetweenWordsSilence" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.queueCampaign.dialAMDMaximumNumberOfWords" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.queueCampaign.dialAMDSilenceThreshold" min="0" max="32767">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.queueCampaign.dialAMDMaximumWordLength" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.queueCampaign)">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_hs.init(vm.queueCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n </div>\n\n </div>\n <div class="queueCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHoppers.length}} {{vm_dc.selectedQueueCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHoppers" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedQueueCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="QUEUECAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHoppers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHoppers">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column md-order-by="recallme">{{ \'MOTIONDIALER.RECALLAGENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.queueCampaignHoppers.rows">\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.ContactId}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.phone}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.countcongestionretry}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.countbusyretry}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.countnoanswerretry}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{ vm_dc.arraypriority[hopper.priority].option }}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell class="recallme ">\n <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHoppers.rows.length">\n <td md-cell colspan="12">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHoppers.count}}" md-on-paginate="vm_dc.getQueueCampaignHoppers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperHistories.length}} {{vm_dc.selectedQueueCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperHistories" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperHistories" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.queueCampaignHopperHistories.rows">\n <td md-cell>{{hopperHistory.uniqueid}}</td>\n <td md-cell>{{hopperHistory.ContactId}}</td>\n <td md-cell>{{hopperHistory.calleridnum}}</td>\n <td md-cell>{{hopperHistory.calleridname}}</td>\n <td md-cell>{{hopperHistory.statedesc}}</td>\n <td md-cell>{{hopperHistory.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.endtime | date:\'medium\'}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperHistories.rows.length">\n <td md-cell colspan="11">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperHistories" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.FINAL">FINAL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsQueueCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n <md-icon md-font-icon="icon-backup-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(3)">\n <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(5)">\n <span translate="MOTIONDIALER.BUSY ">Busy</span>\n <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(8)">\n <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(10)">\n <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(11)">\n <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(22)">\n <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(0)">\n <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperFinals.length}} {{vm_dc.selectedQueueCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperFinals" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-click="vm_dc.moveSelectedQueueCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="QUEUECAMPAIGNS.MOVE_SELECTED">\n <md-icon md-font-icon="icon-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperFinals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'MOTIONDIALER.DISPOSITION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.queueCampaignHopperFinals.rows">\n <td md-cell>{{hopperFinal.uniqueid}}</td>\n <td md-cell>{{hopperFinal.ContactId}}</td>\n <td md-cell>{{hopperFinal.calleridnum}}</td>\n <td md-cell>{{hopperFinal.calleridname}}</td>\n <td md-cell>{{hopperFinal.statedesc}}</td>\n <td md-cell>{{hopperFinal.countcongestionretry}}</td>\n <td md-cell>{{hopperFinal.countbusyretry}}</td>\n <td md-cell>{{hopperFinal.countnoanswerretry}}</td>\n <td md-cell>{{hopperFinal.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.endtime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.disposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n Move HopperFinal\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperFinals.rows.length">\n <td md-cell colspan="23">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperFinals" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperBlacks.length}} {{vm_dc.selectedQueueCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperBlacks" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperBlacks" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperBlacks">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.queueCampaignHopperBlacks.rows">\n <td md-cell>{{hopperBlack.ContactId}}</td>\n <td md-cell>{{hopperBlack.phone}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperBlacks.rows.length">\n <td md-cell colspan="4">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperBlacks" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n</div>\n\x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",'<div id="queueCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MOTIONDIALER.QUEUECAMPAIGNS">QueueCampaigns</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedQueueCampaigns.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedQueueCampaigns =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MOTIONDIALER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-queueCampaigns-count">\n <span>{{vm.selectedQueueCampaigns.length}}</span>\n <span translate="MOTIONDIALER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="QUEUECAMPAIGNS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllQueueCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectQueueCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedQueueCampaigns" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedQueueCampaigns($event)" aria-label="delete selected" translate translate-attr-label="QUEUECAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- QUEUECAMPAIGN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedQueueCampaigns" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueueCampaigns">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="dialActive">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="dialMethod">{{ \'MOTIONDIALER.METHOD\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'MOTIONDIALER.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queueCampaigns.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="queueCampaign" md-select-id="id" ng-repeat="queueCampaign in vm.queueCampaigns.rows">\n <td md-cell ng-if="queueCampaign.userpic"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="api/users/{{queueCampaign.id}}/avatar" /></td>\n <td md-cell ng-if="!queueCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="id ">{{queueCampaign.id}}</td>\n <td ng-click="vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="name ">{{queueCampaign.name}}</td>\n <td ng-click="vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialActive ">\n <md-icon md-colors="{color: {{queueCampaign.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queueCampaign.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="TrunkId ">{{ TrunkId = vm.trunks[queueCampaign.TrunkId]; TrunkId.name }}</td>\n <td ng-click="vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialMethod ">{{ vm.arraydialMethod[queueCampaign.dialMethod].option }}</td>\n <td ng-click="vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="strategy ">{{ vm.arraystrategy[queueCampaign.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(queueCampaign, $event)" translate="MOTIONDIALER.EDIT_QUEUECAMPAIGN">\n Edit QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.listadddialog(queueCampaign, $event)" translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">\n listadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.blacklistadddialog(queueCampaign, $event)" translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">\n blacklistadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(queueCampaign, $event)" translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN">\n teamadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(queueCampaign, $event)" translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">\n agentadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(queueCampaign, $event)" translate="MOTIONDIALER.DELETE_QUEUECAMPAIGN">\n Delete QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(queueCampaign, $event)" translate="MOTIONDIALER.GOTOREALTIME_QUEUECAMPAIGN">\n goToRealtime QueueCampaign\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.queueCampaigns.count}}" md-on-paginate="vm.getQueueCampaigns" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / QUEUECAMPAIGN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD QUEUECAMPAIGN BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-queueCampaign-button" ng-click="vm.createOrEditQueueCampaign($event)" aria-label="add queueCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD QUEUECAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",'<md-toolbar class="md-table-toolbar md-default table-header">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 black-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getContacts()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.lastAssignedTo" ng-change="vm.getContacts()">\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents.rows">{{agent.name}}</md-option>\n </md-select>\n </div>\n <div ng-if="vm.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.queue" ng-change="vm.getContacts()">\n <md-option ng-value="undefined" ng-if="vm.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshContacts($event)" aria-label="refresh Contacts" translate translate-attr-label="DASHBOARDS.REFRESH_CONTACTS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n</md-toolbar>\n<md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td md-cell class="id">{{contact.id}}</td>\n <td md-cell class="firstName">{{contact.calleridname}}</td>\n <td md-cell class="list">{{contact.calleridnum}}</td>\n <td md-cell class="list">{{vm.queuesMap[contact.queue]}}</td>\n <td md-cell class="list">{{contact.queuecallerabandonAt ? (contact.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.queuecallerexitAt ? (contact.queuecallerexitAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.queuecallerexitreason}}</td>\n <td md-cell class="list">{{contact.lastAssignedTo}}</td>\n <td md-cell class="list">{{contact.disposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">Assigned a</md-button>\n <md-menu-content>\n <md-menu-item ng-if="contact.lastAssignedTo">\n <md-button ng-click="vm.assignedA(contact)"><em translate="DASHBOARDS.NONE">Not Assigned</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.assignedA(contact,agent)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, null)"><em translate="DASHBOARDS.NONE">NONE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'fax\')"><em translate="DASHBOARDS.FAX">FAX</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Answer Machine\')"><em translate="DASHBOARDS.ANSWER_MACHINE">ANSWER_MACHINE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Interested\')"><em translate="DASHBOARDS.INTERESTED">INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Not Interested\')"><em translate="DASHBOARDS.NOT_INTERESTED">NOT_INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Sold\')"><em translate="DASHBOARDS.SOLD">SOLD</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Special\')"><em translate="DASHBOARDS.SPECIAL">SPECIAL</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.disposition.length" ng-repeat="disposition in vm.disposition">\n <md-button ng-click="vm.disposed(contact, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>'),e.put("app/main/apps/motiondialer/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'MOTIONDIALER.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'MOTIONDIALER.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'MOTIONDIALER.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'MOTIONDIALER.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'MOTIONDIALER.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="3">{{ \'MOTIONDIALER.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n \x3c!-- <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSE\' | translate }}</th>\n <th md-column width="10px"></th> --\x3e\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatusTime">{{ \'MOTIONDIALER.TIMER\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'MOTIONDIALER.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'busy\':\'indigo-100-bg\',\'*pause\':\'amber-50-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].globalStatus]">{{ vm.isPause(vm.agents[value].globalStatus) ? \'\' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? \'*\'+vm.agents[value].pauseType || \'DEFAULT PAUSE\' : vm.agents[value].pauseType || \'DEFAULT PAUSE\') : \'\'}}</span>\n </td>\n <td class="bt custom-column">\n <timer start-time="vm.agents[value].globalStatusTime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class="bt bl">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'talking\':\'indigo-100-bg\',\'ringing\':\'orange-400-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt bl">\n <div layout="column">\n <span ng-if="vm.agents[value].queue" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].queue }}</span>\n <span ng-if="vm.agents[value].destconnectedlinenum" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class="padding-5" ng-if="vm.agents[value].queue || vm.agents[value].destconnectedlinenum">\n <timer start-time="vm.agents[value].voiceStatusTime" interval="1000" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n \x3c!-- <td class="bt">--</td>\n <td class="bt">--</td> --\x3e\n <td class="bt bl" ng-if="vm.license.chat">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n \x3c!-- <td class="bt padding-5 text-center">{{ agent.chatCurrentCapacity }}/{{ agent.chatCapacity > 0 ? agent.chatCapacity : \'∞\' }}</td> --\x3e\n <td md-number class="bt text-center font-size-20" ng-if="vm.license.chat" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.mail">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.mail" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.messaging">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.messaging" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.openchannel">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">4</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">89</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.openchannel" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.fax">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">7</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">2</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.fax" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class="bl bt padding-5 text-center">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.logout(vm.agents[value], $event)" translate="MOTIONDIALER.LOGOUT">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.queueAdd(vm.agents[value], $event)" translate="MOTIONDIALER.AGENTADD_QUEUE">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="MOTIONDIALER.PAUSE">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=" vm.agents[value].voicePause && \'DEFAULT PAUSE\' === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value])"><em translate="MOTIONDIALER.DEFAULT_PAUSE">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.pauses.rows.length" ng-repeat="pause in vm.pauses.rows">\n <md-button ng-disabled="vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value], pause.name)">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="vm.isPause(vm.agents[value].globalStatus)">\n <md-button ng-click="vm.unPause(vm.agents[value])" translate="MOTIONDIALER.UNPAUSE">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.filteredAgents.length}}" md-on-paginate="vm.onInit" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCampaigns">\n <tr md-row>\n <th md-column>{{\'MOTIONDIALER.NAME\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL_MANAGED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.LIMITED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.ORIGINATED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.MESSAGE\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate}}</th>\n <th md-column>{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.campaigns">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, campaign) in vm.campaigns">\n <td md-cell>\n <span>{{campaign.name}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.ivrTotalCallsDays || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.ivrAnswerCallsDay || 0}} ({{(campaign.ivrTotalCallsDays) ? (campaign.ivrAnswerCallsDay || 0) * 100/(campaign.ivrTotalCallsDays ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.limitCalls || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.originated || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.message ? (\'MOTIONDIALER.\'+campaign.message | translate) : \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.dialQueueProject || \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{campaign.Trunk ? campaign.Trunk.name : \'--\'}}</span>\n </td>\n <td md-cell>\n <md-icon md-colors="{color: {{campaign.active ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{campaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditIvrCampaign($event, campaign)" translate="MOTIONDIALER.EDIT_CAMPAIGN">\n Edit Campaign\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getCampaigns" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queue_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_CALLS">Queue Calls</span>\n \x3c!-- <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUES TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'MOTIONDIALER.DID\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.QUEUE\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.CALLER\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.AGENT\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.DURATION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.getSize(vm.rpcVoiceQueuesChannels)">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm.rpcVoiceQueuesChannels | limitObjectFromTo: vm.queryChannels.limit:(vm.queryChannels.page - 1) * vm.queryChannels.limit">\n <td md-cell>\n <md-icon ng-if="channel.queuecallerleaveAt" md-font-icon="icon-phone-in-talk green-fg"></md-icon>\n <md-icon ng-if="!channel.queuecallerleaveAt" md-font-icon="icon-phone-incoming md-accent"></md-icon>\n </td>\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n <td md-cell>\n <span ng-if="channel.queuecallerleaveAt">\n {{channel.connectedlinename}}, {{channel.connectedlinenum}}\n <span class="text-boxed">\n <timer start-time="channel.queuecallerleaveAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n <span ng-if="!channel.queuecallerleaveAt" class="text-boxed">\n {{ \'MOTIONDIALER.WAITING_FOR_AGENT\' | translate }}\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell>\n <span class="text-boxed">\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.hangup(channel.uniqueid)" translate="MOTIONDIALER.HANGUP">\n Hangup\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.redirectToNumber($event, channel.uniqueid)" translate="MOTIONDIALER.REDIRECT_TO_NUMBER">\n Number\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" translate="MOTIONDIALER.REDIRECT_TO_AGENT">Redirect to Agent</md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.redirectToAgent(channel.uniqueid, agent.name)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n \x3c!-- <tr md-row ng-repeat="call in vm.calls.rows | filter: vm.query.filter | limitTo: vm.query.limit: (vm.query.page - 1) * vm.query.limit">\n <td md-cell>\n <i ng-class="vm.channelStatusClass[call.status.toLowerCase()]"></i>\n </td>\n <td md-cell>{{call.exten}}</td>\n <td md-cell>{{call.queue}}</td>\n <td md-cell><span ng-if="call.calleridname">{{call.calleridname}}, </span>{{call.calleridnum}}</td>\n <td md-cell>\n <span ng-if="call.queuecallerleaveAt">\n {{call.connectedlinename}}, {{call.connectedlinenum}}\n <span class="text-boxed">\n <timer start-time="call.queuecallerleaveAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n <span ng-if="!call.queuecallerleaveAt" class="text-boxed" translate="MOTIONDIALER.WAITING_FOR_AGENT">\n Waiting for agent...\n <span class="text-boxed">\n <timer start-time="call.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n </td>\n <td md-cell>\n <span class="text-boxed">\n <timer ng-if="call.queuecallerjoinAt" start-time="call.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <span ng-if="call.queuecallercomplete || call.queuecallerabandon || call.queuecallerexit" translate="MOTIONDIALER.CLOSING">Closing</span>\n </span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical" ></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.hangup(call.uniqueid)" translate="MOTIONDIALER.HANGUP">\n Hangup\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.redirectToNumber($event, call.uniqueid)" translate="MOTIONDIALER.REDIRECT_TO_NUMBER">\n Number\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" translate="MOTIONDIALER.REDIRECT_TO_AGENT">Redirect to Agent</md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.redirectToAgent(call.uniqueid, agent.name)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr> --\x3e\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.queryChannels.limit" md-page="vm.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-total="{{vm.getSize(vm.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n\x3c!-- / QUEUES TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column>{{\' MOTIONDIALER.NAME\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.TOTAL\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.TOTAL_OFFERED\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.MANAGED\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.ABANDONED\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.DROPPED\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.AVG_HOLD_TIME\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.AVG_DURATION\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.AVG_BILLABLE\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, queue) in vm.queues">\n <td md-cell>\n <span>{{queue.name}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(queue.answered + queue.outboundNoAnswerCallsDay + queue.outboundBusyCallsDay + queue.outboundCongestionCallsDay + queue.outboundNoSuchCallsDay + queue.outboundUnknownCallsDay + queue.outboundDropCallsDayTimeout + queue.outboundDropCallsDayCallersExit + queue.outboundBlacklistCallsDay + queue.outboundOriginateFailureCallsDay + queue.outboundAnswerAgiCallsDay + queue.outboundReCallsDay + queue.outboundRejectCallsDay )|| 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{queue.total || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.answered) ? (100 - (((queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total)) | number:1 ) - (((queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total )) | number:1 ) ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayCallersExit || 0}} ({{(queue.outboundDropCallsDayCallersExit) ? (queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayTimeout || 0}} ({{(queue.outboundDropCallsDayTimeout) ? (queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumHoldTime / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumDuration / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.PAUSED\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.READY\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.WAITING\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.TALKING\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.ORIGINATED\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.MESSAGE\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.METHOD\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="dialActive">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{(vm.queues[value].talking || 0) + (vm.queues[value].pTalking || 0)}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].originated || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].message ? (\'MOTIONDIALER.\'+vm.queues[value].message | translate) : \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].dialMethod || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].Trunk ? vm.queues[value].Trunk.name : \'--\'}}</span>\n </td>\n <td md-cell>\n <md-icon md-colors="{color: {{vm.queues[value].dialActive ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{vm.queues[value].dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditMotionDialerQueue($event, vm.queues[value])" translate="MOTIONDIALER.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="MOTIONDIALER.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUE_CALLS">Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ABANDONEDCALLS">Abandoned Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUE_PARAMS">Queue Parameters</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelAccount">\n <div ng-messages="openchannelAccountForm[\'name\'].$error" ng-show="openchannelAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="openchannelAccountForm[\'key\'].$error" ng-show="openchannelAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri">\n <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n <div ng-messages="openchannelAccountForm[\'replyUri\'].$error" ng-show="openchannelAccountForm[\'replyUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n <div ng-messages="openchannelAccountForm[\'ListId\'].$error" ng-show="openchannelAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelAccount.description">\n <div ng-messages="openchannelAccountForm[\'description\'].$error" ng-show="openchannelAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newOpenchannelAccount" ng-click="vm.saveOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid || openchannelAccountForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE"\n translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newOpenchannelAccount" ng-click="vm.addNewOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELACCOUNT" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n ADD OPENCHANNELACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newOpenchannelAccount" ng-click="vm.deleteOpenchannelAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/agent/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" required autofocus>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'agent\'].$error" ng-show="openchannelAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" required autofocus>\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'times\'].$error" ng-show="openchannelAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" md-maxlength="255" required></textarea>\n\n <div ng-messages="openchannelAccountFormApp[\'text\'].$error" ng-show="openchannelAccountFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.TEXT_MAX_LENGTH" translate-values=\'{max: 255}\'>Text must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/close/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus>\n <div ng-messages="openchannelAccountFormApp[\'disposition\'].$error" ng-show="openchannelAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus>\n <div ng-messages="openchannelAccountFormApp[\'condition\'].$error" ng-show="openchannelAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true">\n <div ng-messages="openchannelAccountFormApp[\'truepriority\'].$error" ng-show="openchannelAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true">\n <div ng-messages="openchannelAccountFormApp[\'falsepriority\'].$error" ng-show="openchannelAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus>\n <div ng-messages="openchannelAccountFormApp[\'priority\'].$error" ng-show="openchannelAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/noop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus>\n <div ng-messages="openchannelAccountFormApp[\'value\'].$error" ng-show="openchannelAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/queue/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" required autofocus>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'queue\'].$error" ng-show="openchannelAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/system/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus>\n <div ng-messages="openchannelAccountFormApp[\'command\'].$error" ng-show="openchannelAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable">\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables">{{ variable.name }}</md-option>\n <md-option ng-value="\'\'">None</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'variable\'].$error" ng-show="openchannelAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",'<md-dialog class="openchannelCannedAnswer-dialog" aria-label="New OpenchannelCannedAnswer">\n <form name="openchannelCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">Key</label>\n <input type="" name="key" ng-model="vm.openchannelCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n <div ng-messages="openchannelCannedAnswerForm[\'key\'].$error" ng-show="openchannelCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VALUE">Value</label>\n <textarea name="value" ng-model="vm.openchannelCannedAnswer.value" required></textarea>\n\n <div ng-messages="openchannelCannedAnswerForm[\'value\'].$error" ng-show="openchannelCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelCannedAnswer.description">\n <div ng-messages="openchannelCannedAnswerForm[\'description\'].$error" ng-show="openchannelCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newOpenchannelCannedAnswer" ng-click="vm.saveOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid || openchannelCannedAnswerForm.$pristine" aria-label="SAVE"\n translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newOpenchannelCannedAnswer" ng-click="vm.addNewOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER"\n translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n ADD OPENCHANNELCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newOpenchannelCannedAnswer" ng-click="vm.deleteOpenchannelCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelDispositions/dialog.html",'<md-dialog class="openchannelDisposition-dialog" aria-label="New OpenchannelDisposition">\n <form name="openchannelDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="" name="name" ng-model="vm.openchannelDisposition.name" ng-required="true" autofocus>\n <div ng-messages="openchannelDispositionForm[\'name\'].$error" ng-show="openchannelDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newOpenchannelDisposition" ng-click="vm.saveOpenchannelDisposition()" class="send-button md-accent md-raised" ng-disabled="openchannelDispositionForm.$invalid || openchannelDispositionForm.$pristine" aria-label="SAVE"\n translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newOpenchannelDisposition" ng-click="vm.addNewOpenchannelDisposition()" class="send-button md-accent md-raised" ng-disabled="openchannelDispositionForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELDISPOSITION"\n translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELDISPOSITION">\n ADD OPENCHANNELDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newOpenchannelDisposition" ng-click="vm.deleteOpenchannelDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",'<div id="openchannel-openchannelAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-openchannelAccounts-button md-icon-button" aria-label="Go to openchannelAccounts" ng-click="vm.gotoOpenchannelAccounts()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="openchannelAccount-image" hide-xs>\n <img ng-src="assets/images/business/openchannelAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.openchannelAccount.id}}\n <span ng-if="vm.openchannelAccount.name">{{vm.openchannelAccount.name}}</span>\n <span ng-if="vm.openchannelAccount.exten">{{vm.openchannelAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (openchannelDispositionsForm.$invalid) || (openchannelCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)"\n translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus ng-disabled="true">\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri">\n <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n <div ng-messages="generalForm[\'replyUri\'].$error" ng-show="generalForm[\'replyUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.openchannelAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.RECEIVEURI">receiveUri</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUri" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-receiveUri" name="receiveUri" ng-value="vm.location + \'/api/openchannel/accounts/\' + vm.openchannelAccount.id + \'/notify\'" ng-readonly="true">\n </div>\n <div class="hint"><span translate="OPENCHANNEL.HELP.RECEIVEURI"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="openchannelAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.notificationSound" aria-label="notificationSound"><span translate="OPENCHANNEL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.notificationShake" aria-label="notificationShake"><span translate="OPENCHANNEL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="OPENCHANNEL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.openchannelAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container openchanneldispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountOpenchannelDispositionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.OPENCHANNELDISPOSITIONS">OpenchannelDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event)" aria-label="add openchannelDisposition" translate translate-attr-label="OPENCHANNEL.ADD_OPENCHANNELDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length}} {{vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountOpenchannelDispositions" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountOpenchannelDispositions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountOpenchannelDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountOpenchannelDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'OPENCHANNEL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="openchannelDisposition" md-select-id="id" ng-repeat="openchannelDisposition in vm_dc.openchannelAccountOpenchannelDispositions.rows">\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" md-cell>{{openchannelDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" md-cell>{{openchannelDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" md-cell>{{openchannelDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" translate="OPENCHANNEL.EDIT_OPENCHANNELDISPOSITION">\n Edit OpenchannelDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(openchannelDisposition, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELDISPOSITION">\n Delete OpenchannelDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountOpenchannelDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="OPENCHANNEL.NO_OPENCHANNELDISPOSITION_AVAILABLE">No openchanneldisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountOpenchannelDispositions.count}}" md-on-paginate="vm_dc.getOpenchannelAccountOpenchannelDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container openchannelcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountOpenchannelCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.OPENCHANNELCANNEDANSWERS">OpenchannelCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event)" aria-label="add openchannelCannedAnswer" translate translate-attr-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length}} {{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountOpenchannelCannedAnswers" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'OPENCHANNEL.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'OPENCHANNEL.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'OPENCHANNEL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="openchannelCannedAnswer" md-select-id="id" ng-repeat="openchannelCannedAnswer in vm_dc.openchannelAccountOpenchannelCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.value}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" translate="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER">\n Edit OpenchannelCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(openchannelCannedAnswer, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELCANNEDANSWER">\n Delete OpenchannelCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountOpenchannelCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="OPENCHANNEL.NO_OPENCHANNELCANNEDANSWER_AVAILABLE">No openchannelcannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountOpenchannelCannedAnswers.count}}" md-on-paginate="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.openchannelAccount)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="OPENCHANNEL.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedOpenchannelAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedOpenchannelAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedOpenchannelAccountApps.length}} {{vm_ac.selectedOpenchannelAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedOpenchannelAccountApps($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedOpenchannelAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.openchannelAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editOpenchannelAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.openchannelAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getOpenchannelAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="OPENCHANNEL.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountInteractions.length}} {{vm_dc.selectedOpenchannelAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountInteractions" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'OPENCHANNEL.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.CONTACT\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'OPENCHANNEL.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'OPENCHANNEL.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'OPENCHANNEL.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'OPENCHANNEL.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.openchannelAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spyopenchannelInteraction($event, interaction)" translate="OPENCHANNEL.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="OPENCHANNEL.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="OPENCHANNEL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountInteractions.count}}" md-on-paginate="vm_dc.getOpenchannelAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",'<div id="openchannelAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELACCOUNTS">OpenchannelAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOpenchannelAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="OPENCHANNEL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-openchannelAccounts-count">\n <span>{{vm.selectedOpenchannelAccounts.length}}</span>\n <span translate="OPENCHANNEL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNELACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelAccounts" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedOpenchannelAccounts($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- OPENCHANNELACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'OPENCHANNEL.KEY\' | translate }}</th>\n <th md-column md-order-by="replyUri">{{ \'OPENCHANNEL.REPLYURI\' | translate }}</th>\n <th md-column md-order-by="ListId">{{ \'OPENCHANNEL.LIST\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="openchannelAccount" md-select-id="id" ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">\n <td md-cell ng-if="openchannelAccount.userpic"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="api/users/{{openchannelAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!openchannelAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="id ">{{openchannelAccount.id}}</td>\n <td ng-click="vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="name ">{{openchannelAccount.name}}</td>\n <td ng-click="vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="key ">{{openchannelAccount.key}}</td>\n <td ng-click="vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="replyUri ">{{openchannelAccount.replyUri}}</td>\n <td ng-click="vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="ListId ">{{ ListId = vm.lists[openchannelAccount.ListId]; ListId.name }}</td>\n <td ng-click="vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="description ">{{openchannelAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(openchannelAccount, $event)" translate="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT">\n Edit OpenchannelAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(openchannelAccount, $event)" translate="OPENCHANNEL.INTERACTIONS_OPENCHANNELACCOUNT">\n Interactions OpenchannelAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(openchannelAccount, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELACCOUNT">\n Delete OpenchannelAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.openchannelAccounts.count}}" md-on-paginate="vm.getOpenchannelAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OPENCHANNELACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OPENCHANNELACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-openchannelAccount-button" ng-click="vm.createOrEditOpenchannelAccount($event)" aria-label="add openchannelAccount" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OPENCHANNELACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",'<md-dialog class="openchannelQueue-dialog" aria-label="New OpenchannelQueue">\n <form name="openchannelQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelQueue">\n <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n <div ng-messages="openchannelQueueForm[\'name\'].$error" ng-show="openchannelQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="openchannelQueueForm[\'strategy\'].$error" ng-show="openchannelQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="openchannelQueueForm[\'timeout\'].$error" ng-show="openchannelQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelQueue.description">\n <div ng-messages="openchannelQueueForm[\'description\'].$error" ng-show="openchannelQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newOpenchannelQueue" ng-click="vm.saveOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid || openchannelQueueForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE"\n translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newOpenchannelQueue" ng-click="vm.addNewOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELQUEUE" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n ADD OPENCHANNELQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newOpenchannelQueue" ng-click="vm.deleteOpenchannelQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue">\n <form name="openchannelQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">Add Agent to openchannelQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue">\n <form name="openchannelQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE">Add Team in OPENCHANNELQUEUE</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/view.html",'<div id="openchannel-openchannelQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-openchannelQueues-button md-icon-button" aria-label="Go to openchannelQueues" ng-click="vm.gotoOpenchannelQueues()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="openchannelQueue-image" hide-xs>\n <img ng-src="assets/images/business/openchannelQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.openchannelQueue.id}}\n <span ng-if="vm.openchannelQueue.name">{{vm.openchannelQueue.name}}</span>\n <span ng-if="vm.openchannelQueue.exten">{{vm.openchannelQueue.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.openchannelQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.openchannelQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="openchannelQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelQueue.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",'<div id="openchannelQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELQUEUES">OpenchannelQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOpenchannelQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="OPENCHANNEL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-openchannelQueues-count">\n <span>{{vm.selectedOpenchannelQueues.length}}</span>\n <span translate="OPENCHANNEL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNELQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOpenchannelQueues()" translate="OPENCHANNEL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOpenchannelQueues()" translate="OPENCHANNEL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelQueues" csv-label="true" filename="openchannelQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedOpenchannelQueues($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- OPENCHANNELQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'OPENCHANNEL.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="openchannelQueue" md-select-id="id" ng-repeat="openchannelQueue in vm.openchannelQueues.rows">\n <td md-cell ng-if="openchannelQueue.userpic"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="api/users/{{openchannelQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!openchannelQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="id ">{{openchannelQueue.id}}</td>\n <td ng-click="vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="name ">{{openchannelQueue.name}}</td>\n <td ng-click="vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="strategy ">{{ vm.arraystrategy[openchannelQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(openchannelQueue, $event)" translate="OPENCHANNEL.EDIT_OPENCHANNELQUEUE">\n Edit OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(openchannelQueue, $event)" translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE">\n teamadd OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(openchannelQueue, $event)" translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">\n agentadd OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(openchannelQueue, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELQUEUE">\n Delete OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(openchannelQueue, $event)" translate="OPENCHANNEL.GOTOREALTIME_OPENCHANNELQUEUE">\n goToRealtime OpenchannelQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.openchannelQueues.count}}" md-on-paginate="vm.getOpenchannelQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OPENCHANNELQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OPENCHANNELQUEUE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-openchannelQueue-button" ng-click="vm.createOrEditOpenchannelQueue($event)" aria-label="add openchannelQueue" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OPENCHANNELQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'OPENCHANNEL.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'OPENCHANNEL.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'OPENCHANNEL.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'OPENCHANNEL.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'OPENCHANNEL.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="3">{{ \'OPENCHANNEL.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n \x3c!-- <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSE\' | translate }}</th>\n <th md-column width="10px"></th> --\x3e\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatusTime">{{ \'OPENCHANNEL.TIMER\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'OPENCHANNEL.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'busy\':\'indigo-100-bg\',\'*pause\':\'amber-50-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].globalStatus]">{{ vm.isPause(vm.agents[value].globalStatus) ? \'\' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? \'*\'+vm.agents[value].pauseType || \'DEFAULT PAUSE\' : vm.agents[value].pauseType || \'DEFAULT PAUSE\') : \'\'}}</span>\n </td>\n <td class="bt custom-column">\n <timer start-time="vm.agents[value].globalStatusTime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class="bt bl">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'talking\':\'indigo-100-bg\',\'ringing\':\'orange-400-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt bl">\n <div layout="column">\n <span ng-if="vm.agents[value].queue" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].queue }}</span>\n <span ng-if="vm.agents[value].destconnectedlinenum" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class="padding-5" ng-if="vm.agents[value].queue || vm.agents[value].destconnectedlinenum">\n <timer start-time="vm.agents[value].voiceStatusTime" interval="1000" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n \x3c!-- <td class="bt">--</td>\n <td class="bt">--</td> --\x3e\n <td class="bt bl" ng-if="vm.license.chat">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n \x3c!-- <td class="bt padding-5 text-center">{{ agent.chatCurrentCapacity }}/{{ agent.chatCapacity > 0 ? agent.chatCapacity : \'∞\' }}</td> --\x3e\n <td md-number class="bt text-center font-size-20" ng-if="vm.license.chat" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.mail">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.mail" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.messaging">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.messaging" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.openchannel">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">4</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">89</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.openchannel" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.fax">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">7</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">2</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.fax" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class="bl bt padding-5 text-center">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.logout(vm.agents[value], $event)" translate="OPENCHANNEL.LOGOUT">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.queueAdd(vm.agents[value], $event)" translate="OPENCHANNEL.AGENTADD_QUEUE">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="OPENCHANNEL.PAUSE">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=" vm.agents[value].voicePause && \'DEFAULT PAUSE\' === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value])"><em translate="OPENCHANNEL.DEFAULT_PAUSE">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.pauses.rows.length" ng-repeat="pause in vm.pauses.rows">\n <md-button ng-disabled="vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value], pause.name)">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="vm.isPause(vm.agents[value].globalStatus)">\n <md-button ng-click="vm.unPause(vm.agents[value])" translate="OPENCHANNEL.UNPAUSE">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.filteredAgents.length}}" md-on-paginate="vm.onInit" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/openchannel/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.PAUSED\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.READY\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditOpenchannelQueue($event, vm.queues[value])" translate="OPENCHANNEL.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="OPENCHANNEL.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/openchannel/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/customizations/create/dialog.html",'<md-dialog class="customization-dialog" aria-label="New Customization">\n <form name="customizationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n <div ng-messages="customizationForm[\'headerWhiteLabel\'].$error" ng-show="customizationForm[\'headerWhiteLabel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n <div ng-messages="customizationForm[\'pageTitle\'].$error" ng-show="customizationForm[\'pageTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newCustomization" ng-click="vm.saveCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid || customizationForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newCustomization" ng-click="vm.addNewCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_CUSTOMIZATION" translate-attr-aria-label="SETTINGS.ADD_CUSTOMIZATION">\n ADD CUSTOMIZATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newCustomization" ng-click="vm.deleteCustomization($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/customizations/customizations.html",'<div id="customizations" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.CUSTOMIZATIONS">Customizations</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.saveCustomization()" ng-disabled="customizationForm.$pristine || customizationForm.$invalid" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n <div class="customization-detail-form-container customizations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.CUSTOMIZATIONS">CUSTOMIZATIONS</div>\n </div>\n <form name="customizationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n <div ng-messages="customizationForm[\'headerWhiteLabel\'].$error" ng-show="customizationForm[\'headerWhiteLabel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n <div ng-messages="customizationForm[\'pageTitle\'].$error" ng-show="customizationForm[\'pageTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n <div ng-if="!vm.customization.defaultLogo" class="customization-detail-form-container logo md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.LOGO">LOGO</div>\n </div>\n <div ng-controller="CustomizationlogoController as vm_cl" ng-init="vm_cl.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cl.ngFlowOptions" flow-name="vm_cl.ngFlow.flow" flow-files-submitted="vm_cl.upload()" flow-file-added="vm_cl.fileAdded($file)" flow-file-success="vm_cl.fileSuccess($file, $message)" flow-complete="vm_cl.uploadComplete()"\n flow-drop flow-drag-enter="vm_cl.dropping=true" flow-drag-leave="vm_cl.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logoimage in vm_cl.customization.images" ng-switch="logoimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logoimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logoimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n <div ng-if="!vm.customization.defaultLoginLogo" class="customization-detail-form-container logologin md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.LOGOLOGIN">LOGOLOGIN</div>\n </div>\n <div ng-controller="CustomizationlogologinController as vm_cll" ng-init="vm_cll.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cll.ngFlowOptions" flow-name="vm_cll.ngFlow.flow" flow-files-submitted="vm_cll.upload()" flow-file-added="vm_cll.fileAdded($file)" flow-file-success="vm_cll.fileSuccess($file, $message)" flow-complete="vm_cll.uploadComplete()"\n flow-drop flow-drag-enter="vm_cll.dropping=true" flow-drag-leave="vm_cll.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logologinimage in vm_cll.customization.images" ng-switch="logologinimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logologinimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logologinimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logologinimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/generals/create/dialog.html",'<md-dialog class="general-dialog" aria-label="New General">\n <form name="generalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MIN_INTERNAL">Min_Internal</label>\n <input type="number" name="min_internal" ng-model="vm.general.min_internal" min="0" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'min_internal\'].$error" ng-show="generalForm[\'min_internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_REQUIRED">Min_Internal field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Min_Internal must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.securePassword" aria-label="Security_Suite"><span translate="SETTINGS.SECURITY_SUITE">Security_Suite</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SECURITY_SUITE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.callRecordingEncryption" aria-label="Call_Recording_Encryption"><span translate="SETTINGS.CALL_RECORDING_ENCRYPTION">Call_Recording_Encryption</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.STUNADDR">Stunaddr</label>\n <input type="text" name="stunaddr" ng-model="vm.general.stunaddr">\n <div ng-messages="generalForm[\'stunaddr\'].$error" ng-show="generalForm[\'stunaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.STUNADDR_REQUIRED">Stunaddr field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURNADDR">Turnaddr</label>\n <input type="text" name="turnaddr" ng-model="vm.general.turnaddr">\n <div ng-messages="generalForm[\'turnaddr\'].$error" ng-show="generalForm[\'turnaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURNADDR_REQUIRED">Turnaddr field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_USERNAME">Turn_Username</label>\n <input type="text" name="turnusername" ng-model="vm.general.turnusername">\n <div ng-messages="generalForm[\'turnusername\'].$error" ng-show="generalForm[\'turnusername\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_USERNAME_REQUIRED">Turn_Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_PASSWORD">Turn_Password</label>\n <input type="text" name="turnpassword" ng-model="vm.general.turnpassword">\n <div ng-messages="generalForm[\'turnpassword\'].$error" ng-show="generalForm[\'turnpassword\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_PASSWORD_REQUIRED">Turn_Password field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newGeneral" ng-click="vm.saveGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid || generalForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newGeneral" ng-click="vm.addNewGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_GENERAL" translate-attr-aria-label="SETTINGS.ADD_GENERAL">\n ADD GENERAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newGeneral" ng-click="vm.deleteGeneral($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/generals/generals.html",'<div id="generals" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.GENERAL">General</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.saveGeneral()" ng-disabled="generalForm.$pristine || generalForm.$invalid" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n <div class="general-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.GLOBAL">GLOBAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MIN_INTERNAL">Min_Internal</label>\n <input type="number" name="min_internal" ng-model="vm.general.min_internal" min="0" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'min_internal\'].$error" ng-show="generalForm[\'min_internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_REQUIRED">Min_Internal field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Min_Internal must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.securePassword" aria-label="Security_Suite"><span translate="SETTINGS.SECURITY_SUITE">Security_Suite</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SECURITY_SUITE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.callRecordingEncryption" aria-label="Call_Recording_Encryption"><span translate="SETTINGS.CALL_RECORDING_ENCRYPTION">Call_Recording_Encryption</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.STUNADDR">Stunaddr</label>\n <input type="text" name="stunaddr" ng-model="vm.general.stunaddr">\n <div ng-messages="generalForm[\'stunaddr\'].$error" ng-show="generalForm[\'stunaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.STUNADDR_REQUIRED">Stunaddr field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURNADDR">Turnaddr</label>\n <input type="text" name="turnaddr" ng-model="vm.general.turnaddr">\n <div ng-messages="generalForm[\'turnaddr\'].$error" ng-show="generalForm[\'turnaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURNADDR_REQUIRED">Turnaddr field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_USERNAME">Turn_Username</label>\n <input type="text" name="turnusername" ng-model="vm.general.turnusername">\n <div ng-messages="generalForm[\'turnusername\'].$error" ng-show="generalForm[\'turnusername\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_USERNAME_REQUIRED">Turn_Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_PASSWORD">Turn_Password</label>\n <input type="text" name="turnpassword" ng-model="vm.general.turnpassword">\n <div ng-messages="generalForm[\'turnpassword\'].$error" ng-show="generalForm[\'turnpassword\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_PASSWORD_REQUIRED">Turn_Password field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container motionbar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.MOTIONBAR">MOTIONBAR</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.phoneBarAutoUpdater" aria-label="MotionbarAutoUpdater"><span translate="SETTINGS.MOTIONBARAUTOUPDATER">MotionbarAutoUpdater</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.phoneBarAutoUpdater" class="md-block">\n <label translate="SETTINGS.MOTIONBARAUTOUPDATERURL">MotionbarAutoUpdaterUrl</label>\n <input type="url" name="phoneBarAutoUpdaterUrl" ng-model="vm.general.phoneBarAutoUpdaterUrl" ng-required="vm.general.phoneBarAutoUpdater">\n <div ng-messages="generalForm[\'phoneBarAutoUpdaterUrl\'].$error" ng-show="generalForm[\'phoneBarAutoUpdaterUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_REQUIRED">MotionbarAutoUpdaterUrl field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_MUST_VALID_URL">MotionbarAutoUpdaterUrl must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/license/license.html",'<div id="license" class="page-layout simple fullwidth doc-page">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.LICENSE">LICENSE</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n <div>\n <md-button type="submit" ng-click="vm.requestLicense()" class="send-button md-raised" translate="SETTINGS.REQUEST_LICENSE" translate-attr-aria-label="SETTINGS.REQUEST_LICENSE">\n REQUEST LICENSE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n \x3c!-- LICENSE CARD --\x3e\n <div layout="row" flex>\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="row" layout-align="center">\n <div flex layout="row" layout-align="start center">\n <div ng-if="!vm.license.custom">\n <a href="https://www.xcallymotion.com/prices" target="_blank" class="md-button md-fab green-A700-bg" aria-label="Eat cake">\n <md-tooltip><span translate="SETTINGS.PRICES">Prices</span></md-tooltip>\n <md-icon md-font-icon="icon-coin"></md-icon>\n </a>\n </div>\n </div>\n <div flex>\n <div ng-switch="vm.license.months" class="text-center">\n <span ng-switch-when="1" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></span>\n <span ng-switch-when="12" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.ANNUALLY">ANNUALLY</span></span>\n <span ng-switch-when="36" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.PERPETUAL">PERPETUAL</span></span>\n </div>\n </div>\n <div flex layout="row" layout-align="end center">\n <div>\n <md-button type="submit" ng-click="vm.updateLicense()" class="md-button md-fab md-accent">\n <md-tooltip><span translate="SETTINGS.UPDATE_LICENSE">License</span></md-tooltip>\n <md-icon md-font-icon="icon-pencil"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n\n <span ng-if="!vm.license.demo && !vm.license.gray" class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_DATE\' | translate }}: {{vm.license.expiration | date: \'longDate\'}}</span>\n <span class="text-center padding-bottom-10"> {{ vm.license.machineUuid !== vm.license.uuid ? \'SETTINGS.OLD_TOKEN\' : \'SETTINGS.TOKEN\' | translate }}: <span class="text-italic text-bold">{{vm.license.uuid}}</span></span>\n\n <div layout="column">\n <span ng-if="vm.license.machineUuid !== vm.license.uuid" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.NEW_TOKEN_DETECTED\' | translate }}</span>\n <span ng-if="vm.license.machineUuid !== vm.license.uuid" class="text-center padding-bottom-10"> {{\'SETTINGS.NEW_TOKEN\' | translate }}: <span class="text-italic text-bold">{{vm.license.machineUuid}}</span></span>\n <span ng-if="vm.license.gray" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_GRAY_PERIOD\' | translate }}: {{vm.license.deadline | date: \'longDate\'}}</span>\n <span ng-if="vm.license.machineUuid !== vm.license.uuid || vm.license.gray" class="text-center padding-bottom-10 text-italic text-bold"> {{\'SETTINGS.EXPIRATION_REASON\' | translate }} </span>\n <span ng-if="vm.license.gray" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_GRAY\' | translate }}</span>\n <span ng-if="vm.license.machineUuid !== vm.license.uuid" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_CHANGED\' | translate }}</span>\n <span ng-if="vm.license.machineUuid !== vm.license.uuid || vm.license.gray" class="text-center padding-bottom-10 text-italic text-bold" translate="SETTINGS.CONTACT_XCALLY_MOTION_SUPPORT"> Contact xCALLY MOTION Support </span>\n <span ng-if="vm.license.machineUuid !== vm.license.uuid" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=New%20token%20detected&body=Hi xCALLY, New Token: {{vm.license.machineUuid}}, Old token: {{vm.license.uuid}}">license@xcally.com</a>.</span>\n <span ng-if="vm.license.gray && vm.license.machineUuid === vm.license.uuid" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=License%20expired%20or%20disabled&body=Hi xCALLY, My Token: {{vm.license.machineUuid}}">license@xcally.com</a>.</span>\n </div>\n\n <div ng-if="vm.license.demo" layout="column">\n <span class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.TRIAL_VERSION\' | translate }}</span>\n <span class="md-subhead md-warn-fg text-center"><a href="https://www.xcallymotion.com/prices" target="_blank">{{ \'SETTINGS.PRICES\' | translate}}</a></span>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-account" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.users || 0 }} <span ng-class="{\'red-fg\': vm.license.users <= vm.users && vm.license.users > 0}">({{vm.license.users >= vm.users ? vm.users : vm.license.users}})</span></h3>\n <p translate="SETTINGS.USERS">Users</p>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-headphones" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.agents || 0 }} <span ng-class="{\'red-fg\': (vm.license.agents <= vm.agents && vm.license.agents > 0) }">({{vm.license.agents >= vm.agents ? vm.agents : vm.license.agents}})</span></h3>\n <p translate="SETTINGS.AGENTS">Agents</p>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-phone" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.telephones || 0 }} <span ng-class="{\'red-fg\': vm.license.telephones <= vm.telephones && vm.license.telephones > 0}">({{vm.license.telephones >= vm.telephones ? vm.telephones : vm.license.telephones}})</span></h3>\n <p translate="SETTINGS.TELEPHONES">Telephones</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="channel in vm.channels" flex="20">\n <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="module in vm.modules" flex="33">\n <md-icon md-font-icon="{{module.icon}}" class="md-avatar-icon" ng-class="vm.license[module.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{module.name | uppercase}}"></h3>\n <p ng-class="vm.license[module.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[module.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <div ng-repeat="other in vm.others" ng-switch="other.name" flex="33">\n <md-list-item class="md-2-line" ng-switch-when="callysquare">\n <md-icon md-font-icon="{{other.icon}}" class="md-avatar-icon green-A700-bg"></md-icon>\n <div class="md-list-item-text">\n <div layout="row" layout="start center">\n <h3>Cally Square</h3>\n <button ng-click="vm.gotoProcess($event)" class="md-mini" aria-label="restart">\n <md-tooltip>Restart</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </button>\n </div>\n <p ng-if="vm.license[other.name]" class="green-A700-fg">{{vm.license[other.name]}} {{ \'SETTINGS.CHANNELS\' | translate }}</p>\n <p ng-if="!vm.license[other.name]" class="green-A700-fg" translate="SETTINGS.UNLIMITED_CHANNELS">UNLIMITED CHANNELS</p>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-switch-default>\n <md-icon md-font-icon="{{other.icon}}" class="md-avatar-icon" ng-class="vm.license[other.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{other.name | uppercase}}"></h3>\n'+" <p ng-class=\"vm.license[other.name] ? 'green-A700-fg' : 'red-A700-fg'\">{{ 'SETTINGS.' + (vm.license[other.name] ? 'ENABLED' : 'DISABLED') | translate }}</p>\n </div>\n </md-list-item>\n </div>\n\n </md-list>\n </md-card>\n </div>\n \x3c!-- / LICENSE CARD --\x3e\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>"),e.put("app/main/apps/settings/views/license/request/dialog.html",'<md-dialog class="request-dialog" aria-label="Send Request">\n <form name="requestForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="SETTINGS.REQUEST_LICENSE">Request License</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.license.name" required>\n <div ng-messages="requestForm.name.$error" ng-show="requestForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.NAME_REQUIRED">Address field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.license.email" required>\n <div ng-messages="requestForm.email.$error" ng-show="requestForm.email.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.PLAN">Plan</label>\n <md-select name="plan" ng-model="vm.license.months" required>\n <md-option ng-value="1"><span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></md-option>\n <md-option ng-value="12"><span translate="SETTINGS.ANNUALLY">ANNUALLY</span></md-option>\n <md-option ng-value="36"><span translate="SETTINGS.PERPETUAL">PERPETUAL</span></md-option>\n </md-select>\n <div ng-messages="requestForm.plan.$error" ng-show="requestForm.plan.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PLAN_REQUIRED">Plan field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.USERS">Users</label>\n <input type="number" name="users" ng-model="vm.license.users" required>\n <div ng-messages="requestForm.users.$error" ng-show="requestForm.users.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.USERS_REQUIRED">Users field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.AGENTS">Agents</label>\n <input type="number" name="agents" ng-model="vm.license.agents" required>\n <div ng-messages="requestForm.agents.$error" ng-show="requestForm.agents.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.AGENTS_REQUIRED">Agents field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.TELEPHONES">Telephones</label>\n <input type="number" name="telephones" ng-model="vm.license.telephones" required>\n <div ng-messages="requestForm.telephones.$error" ng-show="requestForm.telephones.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TELEPHONES_REQUIRED">Telephones field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[channel.name]" aria-label="{{channel.name}}" ng-repeat="channel in vm.channels"><span translate="SETTINGS.{{channel.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[module.name]" aria-label="{{module.name}}" ng-repeat="module in vm.modules"><span translate="SETTINGS.{{module.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <div ng-repeat="other in vm.others" ng-switch="other.name">\n <md-input-container class="md-block" flex ng-switch-when="callysquare">\n <label>Cally Square ({{ \'SETTINGS.CHANNELS\' | translate }})</label>\n <input type="number" name="callysquare" ng-model="vm.license.callysquare" required>\n <div class="hint"><span>0={{ \'SETTINGS.UNLIMITED_CHANNELS\' | translate }}</span></div>\n <div ng-messages="requestForm.users.$error" ng-show="requestForm.users.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.USERS_REQUIRED">Users field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-switch-default>\n <md-switch ng-model="vm.license[other.name]" aria-label="{{other.name}}"><span translate="SETTINGS.{{other.name | uppercase}}"></span></md-switch>\n </div>\n\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <textarea name="description" ng-model="vm.license.description"></textarea>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.sendRequest()" class="send-button md-accent md-raised" ng-disabled="requestForm.$invalid || requestForm.$pristine" aria-label="SEND" translate="SETTINGS.SEND" translate-attr-aria-label="SETTINGS.SEND">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/create/dialog.html",'<md-dialog class="network-dialog" aria-label="New Network">\n <form name="networkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.network.type" required autofocus>\n <md-option ng-value="\'localnet\'">LocalNET</md-option>\n <md-option ng-value="\'externip\'">ExternIP</md-option>\n </md-select>\n <div ng-messages="networkForm[\'type\'].$error" ng-show="networkForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'localnet\'" class="md-block">\n <label translate="SETTINGS.LOCALNETADDRESS">localNetAddress</label>\n <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/"\n ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.LOCALNETADDRESS"></span></div>\n <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_REQUIRED">localNetAddress field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">localNetAddress must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'externip\'" class="md-block">\n <label translate="SETTINGS.ADDRESS">Address</label>\n <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.ADDRESS"></span></div>\n <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ADDRESS_REQUIRED">Address field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.ADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">Address must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newNetwork" ng-click="vm.saveNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid || networkForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newNetwork" ng-click="vm.addNewNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_NETWORK" translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n ADD NETWORK\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newNetwork" ng-click="vm.deleteNetwork($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/networks.html",'<div id="networks" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.NETWORKS">Networks</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SETTINGS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedNetworks.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedNetworks =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SETTINGS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-networks-count">\n <span>{{vm.selectedNetworks.length}}</span>\n <span translate="SETTINGS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="NETWORKS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllNetworks()" translate="SETTINGS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectNetworks()" translate="SETTINGS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedNetworks" csv-label="true" filename="networks.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedNetworks($event)" aria-label="delete selected" translate translate-attr-label="NETWORKS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- NETWORK TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedNetworks" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getNetworks">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SETTINGS.ID\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'SETTINGS.TYPE\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'SETTINGS.ADDRESS\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SETTINGS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.networks.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="SETTINGS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="network" md-select-id="id" ng-repeat="network in vm.networks.rows">\n <td md-cell ng-if="network.userpic"><img class="avatar" alt="{{network.name}}" ng-src="api/users/{{network.id}}/avatar" /></td>\n <td md-cell ng-if="!network.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{network.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="id ">{{network.id}}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="type ">{{ vm.arraytype[network.type].option }}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="value ">{{network.value}}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="createdAt ">{{network.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SETTINGS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(network, $event)" translate="SETTINGS.EDIT_NETWORK">\n Edit Network\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(network, $event)" translate="SETTINGS.DELETE_NETWORK">\n Delete Network\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SETTINGS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SETTINGS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SETTINGS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.networks.count}}" md-on-paginate="vm.getNetworks" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / NETWORK TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD NETWORK BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-network-button" ng-click="vm.createOrEditNetwork($event)" aria-label="add network" translate translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD NETWORK BUTTON --\x3e\n</div>'),e.put("app/main/apps/settings/views/smtps/create/dialog.html",'<md-dialog class="smtp-dialog" aria-label="New Smtp">\n <form name="smtpForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.ACCOUNTNAME">AccountName</label>\n <input type="text" name="name" ng-model="vm.smtp.name" ng-required="true" autofocus>\n <div ng-messages="smtpForm[\'name\'].$error" ng-show="smtpForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ACCOUNTNAME_REQUIRED">AccountName field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.EMAILADDRESS">EmailAddress</label>\n <input type="email" name="email" ng-model="vm.smtp.email" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="smtpForm[\'email\'].$error" ng-show="smtpForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_MUST_VALID">EmailAddress must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.SMTP_SERVICE">SMTP_Service</label>\n <md-select name="Smtp.service" ng-model="vm.smtp.Smtp.service" required>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="smtpForm[\'Smtp.service\'].$error" ng-show="smtpForm[\'Smtp.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_SERVICE_REQUIRED">SMTP_Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.smtp.Smtp.host" ng-required="true">\n <div ng-messages="smtpForm[\'Smtp.host\'].$error" ng-show="smtpForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.smtp.Smtp.port" ng-required="true">\n <div ng-messages="smtpForm[\'Smtp.port\'].$error" ng-show="smtpForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.secure" aria-label="SMTP_Secure"><span translate="SETTINGS.SMTP_SECURE">SMTP_Secure</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_SECURE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.authentication" aria-label="SMTP_Authentication"><span translate="SETTINGS.SMTP_AUTHENTICATION">SMTP_Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null" class="md-block">\n <label translate="SETTINGS.SMTP_USERNAME">SMTP_Username</label>\n <input type="text" name="Smtp.user" ng-model="vm.smtp.Smtp.user" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_USERNAME"></span></div>\n <div ng-messages="smtpForm[\'Smtp.user\'].$error" ng-show="smtpForm[\'Smtp.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_USERNAME_REQUIRED">SMTP_Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null">\n <label translate="SETTINGS.SMTP_PASSWORD">SMTP_Password</label>\n <input type="password" name="Smtp.pass" ng-model="vm.smtp.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="SETTINGS.PASSWORD" required>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_PASSWORD"></span></div>\n <div ng-messages="smtpForm[\'Smtp.pass\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.smtp.description">\n <div ng-messages="smtpForm[\'description\'].$error" ng-show="smtpForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSmtp" ng-click="vm.saveSmtp()" class="send-button md-accent md-raised" ng-disabled="smtpForm.$invalid || smtpForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSmtp" ng-click="vm.addNewSmtp()" class="send-button md-accent md-raised" ng-disabled="smtpForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_SMTP" translate-attr-aria-label="SETTINGS.ADD_SMTP">\n ADD SMTP\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSmtp" ng-click="vm.deleteSmtp($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/smtps/smtps.html",'<div id="smtps" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.SMTP">Smtp</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.verifySmtp()" ng-disabled="!vm.smtp.id" class="send-button md-accent md-raised" translate="SETTINGS.VERIFY" translate-attr-aria-label="SETTINGS.VERIFY">\n VERIFY\n </md-button>\n <md-button type="submit" ng-click="vm.saveSmtp()" ng-disabled="smtpForm.$pristine || smtpForm.$invalid" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n <div class="smtp-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.GENERAL">GENERAL</div>\n </div>\n <form name="smtpForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.ACCOUNTNAME">AccountName</label>\n <input type="text" name="name" ng-model="vm.smtp.name" ng-required="true" autofocus>\n <div ng-messages="smtpForm[\'name\'].$error" ng-show="smtpForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ACCOUNTNAME_REQUIRED">AccountName field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.EMAILADDRESS">EmailAddress</label>\n <input type="email" name="email" ng-model="vm.smtp.email" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="smtpForm[\'email\'].$error" ng-show="smtpForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_MUST_VALID">EmailAddress must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.SMTP_SERVICE">SMTP_Service</label>\n <md-select name="Smtp.service" ng-model="vm.smtp.Smtp.service" required>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="smtpForm[\'Smtp.service\'].$error" ng-show="smtpForm[\'Smtp.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_SERVICE_REQUIRED">SMTP_Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.smtp.Smtp.host" ng-required="true">\n <div ng-messages="smtpForm[\'Smtp.host\'].$error" ng-show="smtpForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.smtp.Smtp.port" ng-required="true">\n <div ng-messages="smtpForm[\'Smtp.port\'].$error" ng-show="smtpForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.secure" aria-label="SMTP_Secure"><span translate="SETTINGS.SMTP_SECURE">SMTP_Secure</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_SECURE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.authentication" aria-label="SMTP_Authentication"><span translate="SETTINGS.SMTP_AUTHENTICATION">SMTP_Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null" class="md-block">\n <label translate="SETTINGS.SMTP_USERNAME">SMTP_Username</label>\n <input type="text" name="Smtp.user" ng-model="vm.smtp.Smtp.user" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_USERNAME"></span></div>\n <div ng-messages="smtpForm[\'Smtp.user\'].$error" ng-show="smtpForm[\'Smtp.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_USERNAME_REQUIRED">SMTP_Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null">\n <label translate="SETTINGS.SMTP_PASSWORD">SMTP_Password</label>\n <input type="password" name="Smtp.pass" ng-model="vm.smtp.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="SETTINGS.PASSWORD" required>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_PASSWORD"></span></div>\n <div ng-messages="smtpForm[\'Smtp.pass\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.smtp.description">\n <div ng-messages="smtpForm[\'description\'].$error" ng-show="smtpForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/system/system.html",'<div id="system" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.SYSTEM">SYSTEM</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" md-border-bottom flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SETTINGS.GENERAL">GENERAL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="system-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget flex="50" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg">\n <div class="h3">OS</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{vm.system.system.manufacturer}} {{vm.system.system.model}}</div>\n <div class="h4">{{vm.system.cpu.manufacturer}} {{vm.system.cpu.brand}} - {{vm.system.cpu.speed}} GHz - {{vm.system.cpu.cores}} Cores</div>\n <div class="h4">{{vm.system.os.distro}} - {{vm.system.os.release}} - Kernel: {{vm.system.os.kernel}}</div>\n <div class="h4">Node.js: {{vm.system.node}}</div>\n <div class="h4">Host: {{vm.system.os.hostname}} - Uptime: {{vm.system.time.uptime / 60 | number:0}} m</div>\n <div class="h4">TimeZone: {{vm.system.time.timezone}} ({{vm.system.time.timezoneName}})</div>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n <ms-widget flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-1">\n <div class="h3">CPU</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.AVG_LOAD">AVG Load</span>\n <span class="h3 secondary-text font-weight-500">{{vm.system.currentLoad.avgload * 100 | number:0}}%</span>\n </div>\n <md-progress-linear class="red" md-mode="determinate" value="{{vm.system.currentLoad.avgload * 100 | number:0}}"></md-progress-linear>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n <ms-widget flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">MEM</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{vm.system.mem.total / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.FREE\' | translate}}: {{vm.system.mem.available / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{vm.system.mem.active / 1024 / 1024 / 1024 | number:0}} GB</div>\n </div>\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.USED">Used</span>\n <span class="h3 secondary-text font-weight-500">{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0}}%</span>\n </div>\n <md-progress-linear class="md-warn" md-mode="determinate" value="{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0 }}"></md-progress-linear>\n\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget ng-repeat="disk in vm.system.fsSize" flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">DISK {{$index + 1}}</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.FILE_SYSTEM\' | translate}}: {{disk.fs}}</div>\n <div class="h4">{{\'SETTINGS.MOUNT_POINT\' | translate}}: "{{disk.mount}}"</div>\n <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{disk.size / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{disk.used / 1024 / 1024 / 1024 | number:0}} GB</div>\n </div>\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.USED">Used</span>\n <span class="h4 secondary-text font-weight-500">{{disk.use | number:0}}%</span>\n </div>\n <md-progress-linear class="red" md-mode="determinate" value="{{disk.use | number:0}}"></md-progress-linear>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget ng-repeat="net in vm.system.net" flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">NET {{$index + 1}}</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.INTERFACE\' | translate}}: {{net.iface}}</div>\n <div class="h4">IPv4: {{net.ip4}}</div>\n <div class="h4">IPv6: {{net.ip6}}</div>\n <div class="h4">MAC: {{net.mac}}</div>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row">\n <div flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.TOP_N_PROCESSES" translate-values="{value: vm.processLimit}"></span>\n <div flex></div>\n <ms-search-bar on-search="vm.searchTerm1 = query" on-collapse="vm.searchTerm1 = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>pid</th>\n <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n <th md-column>pmem</th>\n <th md-column>pcpu</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="process in vm.system.processes.list | limitTo: vm.processLimit | filter: vm.searchTerm1 | orderBy:\'-pcpu\'">\n <td md-cell>{{process.pid}}</td>\n <td md-cell>{{process.command}}</td>\n <td md-cell>\n <span class="text-boxed white-fg" ng-class="{\n \'green-600-bg\': process.state == \'running\',\n \'yellow-600-bg\': process.state == \'sleeping\',\n \'red-600-bg\': process.state == \'blocked\'}">{{process.state | uppercase}}</span>\n </td>\n <td md-cell>{{process.pmem}}%</td>\n <td md-cell>{{process.pcpu}}%</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </md-card>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SETTINGS.PROCESSES">PROCESSES</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="system-detail-form-container general md-background-bg md-whiteframe-1dp">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.MOTION_PROCESS_MANAGEMENT"></span>\n <div flex></div>\n <ms-search-bar on-search="vm.searchTerm2 = query" on-collapse="vm.searchTerm2 = undefined" debounce="300"></ms-search-bar>\n <md-button ng-click="vm.getProcesses()" class="md-icon-button" aria-label="Reload">\n <md-icon md-font-icon="icon-reload" class="s24"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>id</th>\n <th md-column>pid</th>\n <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n <th md-column>MEM</th>\n <th md-column>CPU</th>\n <th md-column width="20px">Actions</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="process in vm.processes | filter: vm.searchTerm2 | orderBy:\'-monit.cpu\'">\n <td md-cell>{{process.pm_id}}</td>\n <td md-cell>{{process.pid}}</td>\n <td md-cell>{{process.name == \'agi\' ? \'agi (Cally Square IVR)\' : process.name}}</td>\n <td md-cell>\n <span class="text-boxed white-fg" ng-class="{\'green-600-bg\': process.pm2_env.status == \'online\', \'red-600-bg\': process.pm2_env.status == \'stopped\'}">{{process.pm2_env.status | uppercase}}</span>\n </td>\n <td md-cell>{{process.monit.memory / 1024 / 1024 | number:0}} MB</td>\n <td md-cell>{{process.monit.cpu}}%</td>\n <td md-cell>\n <md-button ng-if="process.pm2_env.status !== \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'online\')" class="md-icon-button" aria-label="Play">\n <md-icon md-font-icon="icon-play" class="s24"></md-icon>\n </md-button>\n <md-button ng-if="process.pm2_env.status === \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'stopped\')" class="md-icon-button" aria-label="Stop">\n <md-icon md-font-icon="icon-stop" class="s24"></md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell>{{ (vm.processes | map: \'monit.memory\' | sum) / 1024 / 1024 | number:0 }} MB</td>\n <td md-cell></td>\n <td md-cell></td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n </md-card>\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.USEFUL_COMMANDS"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30%">{{\'SETTINGS.COMMAND\' | translate}}</th>\n <th md-column>{{\'SETTINGS.DESCRIPTION\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr>\n <td md-cell class="no-border">pm2 list</td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_LIST\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 start <id | name></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_START\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 stop <id | name | all></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_STOP\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 restart <id | name></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_RESTART\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 logs [id | name]</td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_LOGS\' | translate}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-card>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/settings/views/updates/update/dialog.html",'<md-dialog aria-label="Update">\n <form name="updateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear md-mode="determinate" value="{{vm.progress}}" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content ms-scroll>\n <div layout="row" layout-align="center center">\n <div ng-if="vm.updating" layout="column" layout-align="center center">\n <span class="text-center md-title">Grab a quick coffee and</span>\n <span class="text-center md-title">get back here as soon as completed!</span>\n <span class="text-center md-title">{{vm.output}}</span>\n </div>\n <div ng-if="!vm.updating">\n <div ng-if="vm.success" layout="column" layout-align="center center">\n <span class="text-center md-title">Update Completed! Thank you for your time.</span>\n <span class="text-center md-title">In order to complete the update,</span>\n <span class="text-center md-title">please click on reload button</span>\n </div>\n <div ng-if="!vm.success" layout="column" layout-align="center center">\n <span class="text-center md-title">Update Error!</span>\n <span class="text-center md-title">Please contact your administrator!</span>\n <span class="text-center md-title">{{vm.output}}</span>\n </div>\n </div>\n <img src="assets/images/business/users.jpg" alt="" width="128" height="128" />\n </div>\n </md-dialog-content>\n\n <md-dialog-actions ng-if="!vm.updating" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.reload()" class="send-button md-warm md-raised" aria-label="RELOAD" translate="SETTINGS.RELOAD" translate-attr-aria-label="SETTINGS.RELOAD">\n RELOAD\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/updates/updates.html",'<div id="updates" class="page-layout simple fullwidth doc-page">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.UPDATES">UPDATES</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- UPDATE CARD --\x3e\n <div layout="row" ng-if="!vm.updating">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.CURRENT_VERSION">CURRENT VERSION</span>\n\n <span class="md-display-3 padding-20">{{vm.version.current}}</span>\n\n <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.current}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n CHANGELOG\n </md-button>\n </div>\n </md-card>\n <md-card class="md-whiteframe-20dp padding-20" flex ng-if="vm.version.current != vm.version.latest">\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.NEW_VERSION">NEW VERSION</span>\n\n <span class="md-display-3 padding-20">{{vm.version.latest}}</span>\n\n <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.latest}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n CHANGELOG\n </md-button>\n <md-button ng-click="vm.updateConfirm($event)" class="md-raised md-warn" aria-label="CHANGELOG" translate="SETTINGS.UPDATE" translate-attr-aria-label="SETTINGS.UPDATE">UPDATE</md-button>\n </div>\n </md-card>\n <md-card class="md-whiteframe-1dp padding-20" flex ng-if="vm.version.current == vm.version.latest">\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.REMOTE_VERSION">REMOTE VERSION</span>\n\n <span class="md-subhead padding-20" translate="SETTINGS.NO_NEW_VERSION_AVAILABLE">NO NEW VERSION AVAILABLE</span>\n </div>\n </md-card>\n </div>\n \x3c!-- / UPDATE CARD --\x3e\n\n <div ng-if="vm.updating">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.UPDATING">...</span>\n <md-progress-linear md-mode="determinate" class="md-accent padding-20" value="{{vm.progress}}"></md-progress-linear>\n <span class="md-display-1 padding-5 text-center">Grab a quick coffee and</span>\n <span class="md-display-1 padding-5 text-center">get back here as soon as completed</span>\n <img src="assets/images/business/users.jpg" alt="" width="40%" height="40%" />\n </div>\n </md-card>\n </div>\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'SMS.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'SMS.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'SMS.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'SMS.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'SMS.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="3">{{ \'SMS.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n \x3c!-- <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSE\' | translate }}</th>\n <th md-column width="10px"></th> --\x3e\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'SMS.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'SMS.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatusTime">{{ \'SMS.TIMER\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'SMS.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'busy\':\'indigo-100-bg\',\'*pause\':\'amber-50-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].globalStatus]">{{ vm.isPause(vm.agents[value].globalStatus) ? \'\' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? \'*\'+vm.agents[value].pauseType || \'DEFAULT PAUSE\' : vm.agents[value].pauseType || \'DEFAULT PAUSE\') : \'\'}}</span>\n </td>\n <td class="bt custom-column">\n <timer start-time="vm.agents[value].globalStatusTime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class="bt bl">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'talking\':\'indigo-100-bg\',\'ringing\':\'orange-400-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt bl">\n <div layout="column">\n <span ng-if="vm.agents[value].queue" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].queue }}</span>\n <span ng-if="vm.agents[value].destconnectedlinenum" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class="padding-5" ng-if="vm.agents[value].queue || vm.agents[value].destconnectedlinenum">\n <timer start-time="vm.agents[value].voiceStatusTime" interval="1000" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n \x3c!-- <td class="bt">--</td>\n <td class="bt">--</td> --\x3e\n <td class="bt bl" ng-if="vm.license.chat">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n \x3c!-- <td class="bt padding-5 text-center">{{ agent.chatCurrentCapacity }}/{{ agent.chatCapacity > 0 ? agent.chatCapacity : \'∞\' }}</td> --\x3e\n <td md-number class="bt text-center font-size-20" ng-if="vm.license.chat" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.mail">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.mail" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.messaging">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.messaging" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.openchannel">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">4</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">89</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.openchannel" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.fax">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">7</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">2</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.fax" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class="bl bt padding-5 text-center">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.logout(vm.agents[value], $event)" translate="SMS.LOGOUT">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.queueAdd(vm.agents[value], $event)" translate="SMS.AGENTADD_QUEUE">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="SMS.PAUSE">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=" vm.agents[value].voicePause && \'DEFAULT PAUSE\' === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value])"><em translate="SMS.DEFAULT_PAUSE">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.pauses.rows.length" ng-repeat="pause in vm.pauses.rows">\n <md-button ng-disabled="vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value], pause.name)">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="vm.isPause(vm.agents[value].globalStatus)">\n <md-button ng-click="vm.unPause(vm.agents[value])" translate="SMS.UNPAUSE">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.filteredAgents.length}}"\n md-on-paginate="vm.onInit" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/sms/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column>{{ \'SMS.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'SMS.PAUSED\' | translate }}</th>\n <th md-column>{{ \'SMS.READY\' | translate }}</th>\n <th md-column>{{ \'SMS.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditSmsQueue($event, vm.queues[value])" translate="SMS.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="SMS.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}"\n md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/sms/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/create/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus ng-disabled="!vm.newSmsAccount">\n <div ng-messages="smsAccountForm[\'name\'].$error" ng-show="smsAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">key</label>\n <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="smsAccountForm[\'key\'].$error" ng-show="smsAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" ng-required="true">\n <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="smsAccountForm[\'remote\'].$error" ng-show="smsAccountForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LIST">List</label>\n <md-select name="ListId" ng-model="vm.smsAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n <div ng-messages="smsAccountForm[\'ListId\'].$error" ng-show="smsAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true">\n <div ng-messages="smsAccountForm[\'phone\'].$error" ng-show="smsAccountForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.smsAccount.type" required>\n <md-option ng-value="\'twilio\'">Twilio</md-option>\n <md-option ng-value="\'skebby\'">Skebby</md-option>\n <md-option ng-value="\'connectel\'">Connectel</md-option>\n <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n <md-option ng-value="\'plivo\'">Plivo</md-option>\n </md-select>\n <div ng-messages="smsAccountForm[\'type\'].$error" ng-show="smsAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n <label translate="SMS.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true">\n <div ng-messages="smsAccountForm[\'accountSid\'].$error" ng-show="smsAccountForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHID">AuthID</label>\n <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true">\n <div ng-messages="smsAccountForm[\'authId\'].$error" ng-show="smsAccountForm[\'authId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true">\n <div ng-messages="smsAccountForm[\'authToken\'].$error" ng-show="smsAccountForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n <label translate="SMS.METHOD">Method</label>\n <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required>\n <md-option ng-value="\'basic\'">Basic</md-option>\n <md-option ng-value="\'classic\'">Classic</md-option>\n <md-option ng-value="\'classic+\'">Classic+</md-option>\n </md-select>\n <div ng-messages="smsAccountForm[\'smsMethod\'].$error" ng-show="smsAccountForm[\'smsMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\'" class="md-block">\n <label translate="SMS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true">\n <div ng-messages="smsAccountForm[\'username\'].$error" ng-show="smsAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\'">\n <label translate="SMS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n <div ng-messages="smsAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsAccount.description">\n <div ng-messages="smsAccountForm[\'description\'].$error" ng-show="smsAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSmsAccount" ng-click="vm.saveSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid || smsAccountForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSmsAccount" ng-click="vm.addNewSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSACCOUNT" translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n ADD SMSACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSmsAccount" ng-click="vm.deleteSmsAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/agent/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" required autofocus>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'agent\'].$error" ng-show="smsAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" required autofocus>\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'times\'].$error" ng-show="smsAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" md-maxlength="255" required></textarea>\n\n <div ng-messages="smsAccountFormApp[\'text\'].$error" ng-show="smsAccountFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.TEXT_MAX_LENGTH" translate-values=\'{max: 255}\'>Text must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/close/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus>\n <div ng-messages="smsAccountFormApp[\'disposition\'].$error" ng-show="smsAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus>\n <div ng-messages="smsAccountFormApp[\'condition\'].$error" ng-show="smsAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true">\n <div ng-messages="smsAccountFormApp[\'truepriority\'].$error" ng-show="smsAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true">\n <div ng-messages="smsAccountFormApp[\'falsepriority\'].$error" ng-show="smsAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus>\n <div ng-messages="smsAccountFormApp[\'priority\'].$error" ng-show="smsAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/noop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus>\n <div ng-messages="smsAccountFormApp[\'value\'].$error" ng-show="smsAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/queue/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" required autofocus>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'queue\'].$error" ng-show="smsAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/system/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus>\n <div ng-messages="smsAccountFormApp[\'command\'].$error" ng-show="smsAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable">\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables">{{ variable.name }}</md-option>\n <md-option ng-value="\'\'">None</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'variable\'].$error" ng-show="smsAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",'<md-dialog class="smsCannedAnswer-dialog" aria-label="New SmsCannedAnswer">\n <form name="smsCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">Key</label>\n <input type="" name="key" ng-model="vm.smsCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n <div ng-messages="smsCannedAnswerForm[\'key\'].$error" ng-show="smsCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.VALUE">Value</label>\n <textarea name="value" ng-model="vm.smsCannedAnswer.value" required></textarea>\n\n <div ng-messages="smsCannedAnswerForm[\'value\'].$error" ng-show="smsCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsCannedAnswer.description">\n <div ng-messages="smsCannedAnswerForm[\'description\'].$error" ng-show="smsCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSmsCannedAnswer" ng-click="vm.saveSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid || smsCannedAnswerForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSmsCannedAnswer" ng-click="vm.addNewSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSCANNEDANSWER" translate-attr-aria-label="SMS.ADD_SMSCANNEDANSWER">\n ADD SMSCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSmsCannedAnswer" ng-click="vm.deleteSmsCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/smsDispositions/dialog.html",'<md-dialog class="smsDisposition-dialog" aria-label="New SmsDisposition">\n <form name="smsDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.smsDisposition.name" ng-required="true" autofocus>\n <div ng-messages="smsDispositionForm[\'name\'].$error" ng-show="smsDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSmsDisposition" ng-click="vm.saveSmsDisposition()" class="send-button md-accent md-raised" ng-disabled="smsDispositionForm.$invalid || smsDispositionForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSmsDisposition" ng-click="vm.addNewSmsDisposition()" class="send-button md-accent md-raised" ng-disabled="smsDispositionForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSDISPOSITION" translate-attr-aria-label="SMS.ADD_SMSDISPOSITION">\n ADD SMSDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSmsDisposition" ng-click="vm.deleteSmsDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/view.html",'<div id="sms-smsAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-smsAccounts-button md-icon-button" aria-label="Go to smsAccounts" ng-click="vm.gotoSmsAccounts()" translate translate-attr-aria-label="SMS.GO_TO_SMSACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="smsAccount-image" hide-xs>\n <img ng-src="assets/images/business/smsAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.smsAccount.id}}\n <span ng-if="vm.smsAccount.name">{{vm.smsAccount.name}}</span>\n <span ng-if="vm.smsAccount.exten">{{vm.smsAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveSmsAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (proxyForm.$invalid) || (smsDispositionsForm.$invalid) || (smsCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)"\n translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="smsAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus ng-disabled="true">\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">key</label>\n <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LIST">List</label>\n <md-select name="ListId" ng-model="vm.smsAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true">\n <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.smsAccount.type" required>\n <md-option ng-value="\'twilio\'">Twilio</md-option>\n <md-option ng-value="\'skebby\'">Skebby</md-option>\n <md-option ng-value="\'connectel\'">Connectel</md-option>\n <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n <md-option ng-value="\'plivo\'">Plivo</md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n <label translate="SMS.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true">\n <div ng-messages="generalForm[\'accountSid\'].$error" ng-show="generalForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHID">AuthID</label>\n <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true">\n <div ng-messages="generalForm[\'authId\'].$error" ng-show="generalForm[\'authId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true">\n <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n <label translate="SMS.METHOD">Method</label>\n <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required>\n <md-option ng-value="\'basic\'">Basic</md-option>\n <md-option ng-value="\'classic\'">Classic</md-option>\n <md-option ng-value="\'classic+\'">Classic+</md-option>\n </md-select>\n <div ng-messages="generalForm[\'smsMethod\'].$error" ng-show="generalForm[\'smsMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\'" class="md-block">\n <label translate="SMS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true">\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\'">\n <label translate="SMS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="(vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'classic+\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.SENDERSTRING">SenderString</label>\n <input type="text" name="senderString" ng-model="vm.smsAccount.senderString" md-maxlength="11" ng-pattern="/^[A-Za-z0-9\\.\\s]*$/i">\n <div ng-messages="generalForm[\'senderString\'].$error" ng-show="generalForm[\'senderString\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.SENDERSTRING_REQUIRED">SenderString field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SENDERSTRING_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\s]*$/i\' }">SenderString must be valid pattern </span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.SENDERSTRING_MAX_LENGTH" translate-values=\'{max: 11}\'>SenderString must have a maximum length equal to 11</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'classic+\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\'" class="md-block">\n <md-switch ng-model="vm.smsAccount.deliveryReport" aria-label="deliveryReport"><span translate="SMS.DELIVERYREPORT">deliveryReport</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.smsAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.RECEIVEURL">receiveUrl</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-receiveUrl" name="receiveUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/notify?token=\' + vm.smsAccount.token" ng-readonly="true">\n </div>\n <div class="hint"><span translate="SMS.HELP.RECEIVEURL"></span></div>\n </md-input-container>\n <md-input-container ng-if="( (vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'classic+\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' ) && vm.smsAccount.deliveryReport" class="md-block">\n <label translate="SMS.DELIVERYREPORTURL">deliveryReportUrl</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-deliveryReportUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-deliveryReportUrl" name="deliveryReportUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/status?token=\' + vm.smsAccount.token" ng-readonly="true">\n </div>\n <div class="hint"><span translate="SMS.HELP.DELIVERYREPORTURL"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="smsAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.notificationSound" aria-label="notificationSound"><span translate="SMS.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.notificationShake" aria-label="notificationShake"><span translate="SMS.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="SMS.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.smsAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="smsAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.PROXY">PROXY</div>\n </div>\n <form name="proxyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.TOKEN">token</label>\n <input type="text" name="token" ng-model="vm.smsAccount.token" autofocus ng-disabled="true">\n <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TOKEN_REQUIRED">token field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" ng-required="true">\n <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="proxyForm[\'remote\'].$error" ng-show="proxyForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="smsAccount-detail-form-container smsdispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountSmsDispositionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountSmsDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.SMSDISPOSITIONS">SmsDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event)" aria-label="add smsDisposition" translate translate-attr-label="SMS.ADD_SMSDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountSmsDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountSmsDispositions.length}} {{vm_dc.selectedSmsAccountSmsDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountSmsDispositions" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountSmsDispositions($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountSmsDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountSmsDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SMS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="smsDisposition" md-select-id="id" ng-repeat="smsDisposition in vm_dc.smsAccountSmsDispositions.rows">\n <td ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" md-cell>{{smsDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" md-cell>{{smsDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" md-cell>{{smsDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" translate="SMS.EDIT_SMSDISPOSITION">\n Edit SmsDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(smsDisposition, $event)" translate="SMS.DELETE_SMSDISPOSITION">\n Delete SmsDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountSmsDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="SMS.NO_SMSDISPOSITION_AVAILABLE">No smsdisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.smsAccountSmsDispositions.count}}" md-on-paginate="vm_dc.getSmsAccountSmsDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="smsAccount-detail-form-container smscannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountSmsCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.smsAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.SMSCANNEDANSWERS">SmsCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event)" aria-label="add smsCannedAnswer" translate translate-attr-label="SMS.ADD_SMSCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountSmsCannedAnswers.length}} {{vm_dc.selectedSmsAccountSmsCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountSmsCannedAnswers" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountSmsCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountSmsCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountSmsCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'SMS.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'SMS.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SMS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="smsCannedAnswer" md-select-id="id" ng-repeat="smsCannedAnswer in vm_dc.smsAccountSmsCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.value}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" translate="SMS.EDIT_SMSCANNEDANSWER">\n Edit SmsCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(smsCannedAnswer, $event)" translate="SMS.DELETE_SMSCANNEDANSWER">\n Delete SmsCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountSmsCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="SMS.NO_SMSCANNEDANSWER_AVAILABLE">No smscannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.smsAccountSmsCannedAnswers.count}}" md-on-paginate="vm_dc.getSmsAccountSmsCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="smsAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.smsAccount)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="SMS.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedSmsAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedSmsAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedSmsAccountApps.length}} {{vm_ac.selectedSmsAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedSmsAccountApps($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedSmsAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.smsAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editSmsAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.smsAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="smsAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getSmsAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="SMS.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountInteractions.length}} {{vm_dc.selectedSmsAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountInteractions" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SMS.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'SMS.CONTACT\' | translate }}</th>\n <th md-column>{{ \'SMS.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'SMS.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'SMS.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'SMS.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'SMS.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.smsAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spysmsInteraction($event, interaction)" translate="SMS.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="SMS.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="SMS.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.smsAccountInteractions.count}}" md-on-paginate="vm_dc.getSmsAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/smsAccounts.html",'<div id="smsAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SMS.SMSACCOUNTS">SmsAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSmsAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSmsAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SMS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-smsAccounts-count">\n <span>{{vm.selectedSmsAccounts.length}}</span>\n <span translate="SMS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMSACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSmsAccounts()" translate="SMS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSmsAccounts()" translate="SMS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSmsAccounts" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedSmsAccounts($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- SMSACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSmsAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'SMS.KEY\' | translate }}</th>\n <th md-column md-order-by="ListId">{{ \'SMS.LIST\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'SMS.PHONE\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'SMS.TYPE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsAccounts.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="smsAccount" md-select-id="id" ng-repeat="smsAccount in vm.smsAccounts.rows">\n <td md-cell ng-if="smsAccount.userpic"><img class="avatar" alt="{{smsAccount.name}}" ng-src="api/users/{{smsAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!smsAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="id ">{{smsAccount.id}}</td>\n <td ng-click="vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="name ">{{smsAccount.name}}</td>\n <td ng-click="vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="key ">{{smsAccount.key}}</td>\n <td ng-click="vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="ListId ">{{ ListId = vm.lists[smsAccount.ListId]; ListId.name }}</td>\n <td ng-click="vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="phone ">{{smsAccount.phone}}</td>\n <td ng-click="vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="type ">{{ vm.arraytype[smsAccount.type].option }}</td>\n <td ng-click="vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="description ">{{smsAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(smsAccount, $event)" translate="SMS.EDIT_SMSACCOUNT">\n Edit SmsAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(smsAccount, $event)" translate="SMS.INTERACTIONS_SMSACCOUNT">\n Interactions SmsAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(smsAccount, $event)" translate="SMS.DELETE_SMSACCOUNT">\n Delete SmsAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsAccounts.count}}"\n md-on-paginate="vm.getSmsAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SMSACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SMSACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-smsAccount-button" ng-click="vm.createOrEditSmsAccount($event)" aria-label="add smsAccount" translate translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SMSACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsQueues/create/dialog.html",'<md-dialog class="smsQueue-dialog" aria-label="New SmsQueue">\n <form name="smsQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newSmsQueue">\n <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n <div ng-messages="smsQueueForm[\'name\'].$error" ng-show="smsQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.smsQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="smsQueueForm[\'strategy\'].$error" ng-show="smsQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="smsQueueForm[\'timeout\'].$error" ng-show="smsQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsQueue.description">\n <div ng-messages="smsQueueForm[\'description\'].$error" ng-show="smsQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSmsQueue" ng-click="vm.saveSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid || smsQueueForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSmsQueue" ng-click="vm.addNewSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSQUEUE" translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n ADD SMSQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSmsQueue" ng-click="vm.deleteSmsQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue">\n <form name="smsQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.AGENTADD_SMSQUEUE">Add Agent to smsQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue">\n <form name="smsQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.TEAMADD_SMSQUEUE">Add Team in SMSQUEUE</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/view.html",'<div id="sms-smsQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-smsQueues-button md-icon-button" aria-label="Go to smsQueues" ng-click="vm.gotoSmsQueues()" translate translate-attr-aria-label="SMS.GO_TO_SMSQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="smsQueue-image" hide-xs>\n <img ng-src="assets/images/business/smsQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.smsQueue.id}}\n <span ng-if="vm.smsQueue.name">{{vm.smsQueue.name}}</span>\n <span ng-if="vm.smsQueue.exten">{{vm.smsQueue.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.smsQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="SMS.TEAMADD_SMSQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.smsQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="SMS.AGENTADD_SMSQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSmsQueue()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="smsQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.smsQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsQueue.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsQueues/smsQueues.html",'<div id="smsQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SMS.SMSQUEUES">SmsQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSmsQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSmsQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SMS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-smsQueues-count">\n <span>{{vm.selectedSmsQueues.length}}</span>\n <span translate="SMS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMSQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSmsQueues()" translate="SMS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSmsQueues()" translate="SMS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSmsQueues" csv-label="true" filename="smsQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedSmsQueues($event)" aria-label="delete selected" translate translate-attr-label="SMSQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- SMSQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSmsQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'SMS.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="smsQueue" md-select-id="id" ng-repeat="smsQueue in vm.smsQueues.rows">\n <td md-cell ng-if="smsQueue.userpic"><img class="avatar" alt="{{smsQueue.name}}" ng-src="api/users/{{smsQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!smsQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="id ">{{smsQueue.id}}</td>\n <td ng-click="vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="name ">{{smsQueue.name}}</td>\n <td ng-click="vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="strategy ">{{ vm.arraystrategy[smsQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(smsQueue, $event)" translate="SMS.EDIT_SMSQUEUE">\n Edit SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(smsQueue, $event)" translate="SMS.TEAMADD_SMSQUEUE">\n teamadd SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(smsQueue, $event)" translate="SMS.AGENTADD_SMSQUEUE">\n agentadd SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(smsQueue, $event)" translate="SMS.DELETE_SMSQUEUE">\n Delete SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(smsQueue, $event)" translate="SMS.GOTOREALTIME_SMSQUEUE">\n goToRealtime SmsQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsQueues.count}}"\n md-on-paginate="vm.getSmsQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SMSQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SMSQUEUE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-smsQueue-button" ng-click="vm.createOrEditSmsQueue($event)" aria-label="add smsQueue" translate translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SMSQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/agents.html",'<div id="agents" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.AGENTS">Agents</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedAgents.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedAgents =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-agents-count">\n <span>{{vm.selectedAgents.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="AGENTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllAgents()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectAgents()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedAgents" csv-label="true" filename="agents.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedAgents($event)" aria-label="delete selected" translate translate-attr-label="AGENTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- AGENT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedAgents" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAgents">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.agents.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="agent" md-select-id="id" ng-repeat="agent in vm.agents.rows">\n <td md-cell ng-if="agent.userpic"><img class="avatar" alt="{{agent.name}}" ng-src="api/users/{{agent.id}}/avatar" /></td>\n <td md-cell ng-if="!agent.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{agent.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditAgent($event, agent)" md-cell class="fullname font-weight-600">{{agent.fullname}}</td>\n <td ng-click="vm.createOrEditAgent($event, agent)" md-cell class="name ">{{agent.name}}</td>\n <td ng-click="vm.createOrEditAgent($event, agent)" md-cell class="email ">{{agent.email}}</td>\n <td ng-click="vm.createOrEditAgent($event, agent)" md-cell class="phone ">{{agent.phone}}</td>\n <td ng-click="vm.createOrEditAgent($event, agent)" md-cell class="mobile ">{{agent.mobile}}</td>\n <td ng-click="vm.createOrEditAgent($event, agent)" md-cell class="internal ">{{agent.internal}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(agent, $event)" translate="STAFF.EDIT_AGENT">\n Edit Agent\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(agent, $event)" translate="STAFF.TEAMADD_AGENT">\n teamadd Agent\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(agent, $event)" translate="STAFF.DELETE_AGENT">\n Delete Agent\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.agents.count}}" md-on-paginate="vm.getAgents" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / AGENT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD AGENT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-agent-button" ng-click="vm.createOrEditAgent($event)" aria-label="add agent" translate translate-attr-aria-label="STAFF.ADD_AGENT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD AGENT BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/create/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n <form name="agentForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus>\n <div ng-messages="agentForm[\'fullname\'].$error" ng-show="agentForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newAgent">\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="agentForm[\'name\'].$error" ng-show="agentForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.agent.alias">\n <div ng-messages="agentForm[\'alias\'].$error" ng-show="agentForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.agent.email" ng-required="true">\n <div ng-messages="agentForm[\'email\'].$error" ng-show="agentForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newAgent">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.agent.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="agentForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newAgent && (vm.newAgent)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n <md-select name="showWebBar" ng-model="vm.agent.showWebBar">\n <md-option ng-value="0">Phonebar</md-option>\n <md-option ng-value="1">External</md-option>\n <md-option ng-value="2">WebRTC (rc-1)</md-option>\n </md-select>\n <div ng-messages="agentForm[\'showWebBar\'].$error" ng-show="agentForm[\'showWebBar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newAgent" class="md-block">\n <md-switch ng-model="vm.agent.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" ng-disabled="!vm.newAgent">\n <div ng-messages="agentForm[\'internal\'].$error" ng-show="agentForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.agent.description">\n <div ng-messages="agentForm[\'description\'].$error" ng-show="agentForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newAgent" class="md-block">\n <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" ng-required="true">\n <div ng-messages="agentForm[\'phoneBarRemoteControlPort\'].$error" ng-show="agentForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newUser" class="md-block">\n <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newAgent" ng-click="vm.saveAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newAgent" ng-click="vm.addNewAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid" aria-label="ADD" translate="STAFF.ADD_AGENT" translate-attr-aria-label="STAFF.ADD_AGENT">\n ADD AGENT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newAgent" ng-click="vm.deleteAgent($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",'<md-dialog class="agent-dialog" aria-label="{{vm.name}}">\n <form name="agentForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="agentForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",'<md-dialog class="agent-dialog" aria-label="agent">\n <form name="agentForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>{{vm.title}}</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin" ng-if="vm.agent.role === \'agent\' && vm.isVoiceChannel()">\n <label translate="STAFF.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="agentForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",'<md-dialog class="agent-dialog" aria-label="agent">\n <form name="agentForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="STAFF.TEAMADD_AGENT">Add Team in AGENT</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/view.html",'<div id="staff-agent" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-agents-button md-icon-button" aria-label="Go to agents" ng-click="vm.gotoAgents()" translate translate-attr-aria-label="STAFF.GO_TO_AGENTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="agent-image" hide-xs>\n <img ng-src="assets/images/business/agents.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.agent.id}}\n <span ng-if="vm.agent.name">{{vm.agent.name}}</span>\n <span ng-if="vm.agent.exten">{{vm.agent.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.agent.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.agent.role !== \'admin\'">\n <md-fab-speed-dial md-direction="left" class="md-scale md-fab">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n <md-tooltip md-direction="top" md-visible="false"><span translate="STAFF.CHANNELS">Channels</span></md-tooltip>\n <md-icon md-font-icon="icon-stackoverflow" aria-label="queueadd"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <md-button aria-label="voice" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'inbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="VOICE.VOICE">Voice</span></md-tooltip>\n <md-icon md-font-icon="icon-phone" aria-label="voice"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.dialer" aria-label="motion bull" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'outbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MOTIONDIALER.MOTIONDIALER">Motion Bull</span></md-tooltip>\n <md-icon md-font-icon="icon-fire" aria-label="motion bull"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.chat" aria-label="chat" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'chat\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="CHAT.CHAT">Chat</span></md-tooltip>\n <md-icon md-font-icon="icon-hangouts" aria-label="chat"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.mail" aria-label="mail" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'mail\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MAIL.MAIL">Email</span></md-tooltip>\n <md-icon md-font-icon="icon-email" aria-label="mail"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.messaging" aria-label="sms" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'sms\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="SMS.SMS">Sms</span></md-tooltip>\n <md-icon md-font-icon="icon-message-text" aria-label="sms"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.openchannel" aria-label="openchannel" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'openchannel\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="OPENCHANNEL.OPENCHANNEL">Openchannel</span></md-tooltip>\n <md-icon md-font-icon="icon-google-earth" aria-label="openchannel"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.fax" aria-label="fax" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'fax\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="FAX.FAX">Fax</span></md-tooltip>\n <md-icon md-font-icon="icon-deskphone" aria-label="fax"></md-icon>\n </md-button>\n </md-fab-actions>\n </md-fab-speed-dial>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.agent, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="STAFF.TEAMADD_AGENT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.changepassworddialog(vm.agent, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_AGENT"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveAgent()" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid) || (capacityForm.$invalid) || (settingsForm.$invalid) || (remote_controlForm.$invalid) || (sipForm.$invalid) || (callforwardingForm.$invalid) || (settings_webrtcForm.$invalid) || (sip_webrtcForm.$invalid) || (general_permissionsForm.$invalid) || (permissionsForm.$invalid)"\n translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="agent-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="personal_infoForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus>\n <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="true">\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.agent.alias">\n <div ng-messages="personal_infoForm[\'alias\'].$error" ng-show="personal_infoForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.agent.email" ng-required="true">\n <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.agent.phone">\n <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.agent.mobile">\n <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n <md-select name="showWebBar" ng-model="vm.agent.showWebBar">\n <md-option ng-value="0">Phonebar</md-option>\n <md-option ng-value="1">External</md-option>\n <md-option ng-value="2">WebRTC (rc-1)</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'showWebBar\'].$error" ng-show="personal_infoForm[\'showWebBar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.loginInPause" aria-label="LoginInPause"><span translate="STAFF.LOGININPAUSE">LoginInPause</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.agent.description">\n <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n </div>\n <form name="security_suiteForm" novalidate>\n <md-input-container ng-if="vm.agent.passwordResetAt != null" class="md-block">\n <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" autofocus ng-disabled="true">\n <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.passwordResetAt == null" class="md-block">\n <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" ng-disabled="true">\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n </div>\n <div ng-controller="Agentchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.agent)" class="agent-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="agent-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()"\n flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="change_avatarimage in vm_ca.agent.images" ng-switch="change_avatarimage.type">\n <div class="agent-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="change_avatarimage.file">\n </div>\n\n <div class="agent-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{change_avatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="agent-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" autofocus ng-disabled="true">\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar != 2" class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.agent.transport" multiple>\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'" ng-if="vm.agent.showWebBar == 1">ws</md-option>\n <md-option ng-value="\'wss\'" ng-if="vm.agent.showWebBar == 1">wss</md-option>\n <md-option ng-value="\'tls\'" ng-if="vm.agent.showWebBar == 1">tls</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.HOST">Host</label>\n <input type="text" name="host" ng-model="vm.agent.host" ng-required="true">\n <div class="hint"><span translate="STAFF.HELP.HOST"></span></div>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.agent.nat" required multiple>\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TYPE">Type</label>\n <md-select name="type" ng-model="vm.agent.type">\n <md-option ng-value="\'friend\'">Friend</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n <md-option ng-value="\'peer\'">Peer</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TYPE"></span></div>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.agent.allow" required multiple>\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLERID">CallerId</label>\n <input type="text" name="callerid" ng-model="vm.agent.callerid">\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.agent.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.agent.callgroup">\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.agent.pickupgroup">\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.chanspy" aria-label="chanSpy"><span translate="STAFF.CHANSPY">chanSpy</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MONITOREXTENSION">MonitorExtension</label>\n <md-select name="extensionMonitor" ng-model="vm.agent.extensionMonitor" required>\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div ng-messages="generalForm[\'extensionMonitor\'].$error" ng-show="generalForm[\'extensionMonitor\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MONITOREXTENSION_REQUIRED">MonitorExtension field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.OTHER_CHANNELS">OTHER_CHANNELS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="agent-detail-form-container capacity md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CAPACITY">CAPACITY</div>\n </div>\n <form name="capacityForm" novalidate>\n <md-input-container ng-if="vm.license.chat" class="md-block">\n <label translate="STAFF.CHATCAPACITY">ChatCapacity</label>\n <input type="number" name="chatCapacity" ng-model="vm.agent.chatCapacity" min="0" ng-required="true" autofocus>\n <div class="hint"><span translate="STAFF.HELP.CHATCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'chatCapacity\'].$error" ng-show="capacityForm[\'chatCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CHATCAPACITY_REQUIRED">ChatCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ChatCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.mail" class="md-block">\n <label translate="STAFF.MAILCAPACITY">MailCapacity</label>\n <input type="number" name="mailCapacity" ng-model="vm.agent.mailCapacity" min="0" ng-required="true">\n <div class="hint"><span translate="STAFF.HELP.MAILCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'mailCapacity\'].$error" ng-show="capacityForm[\'mailCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MAILCAPACITY_REQUIRED">MailCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MailCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.fax" class="md-block">\n <label translate="STAFF.FAXCAPACITY">FaxCapacity</label>\n <input type="number" name="faxCapacity" ng-model="vm.agent.faxCapacity" min="0" ng-required="true">\n <div class="hint"><span translate="STAFF.HELP.FAXCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'faxCapacity\'].$error" ng-show="capacityForm[\'faxCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FAXCAPACITY_REQUIRED">FaxCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FaxCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.messaging" class="md-block">\n <label translate="STAFF.SMSCAPACITY">SMSCapacity</label>\n <input type="number" name="smsCapacity" ng-model="vm.agent.smsCapacity" min="0" ng-required="true">\n <div class="hint"><span translate="STAFF.HELP.SMSCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'smsCapacity\'].$error" ng-show="capacityForm[\'smsCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SMSCAPACITY_REQUIRED">SMSCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.SMSCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">SMSCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.openchannel" class="md-block">\n <label translate="STAFF.OPENCHANNELCAPACITY">OpenchannelCapacity</label>\n <input type="number" name="openchannelCapacity" ng-model="vm.agent.openchannelCapacity" min="0" ng-required="true">\n <div class="hint"><span translate="STAFF.HELP.OPENCHANNELCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'openchannelCapacity\'].$error" ng-show="capacityForm[\'openchannelCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_REQUIRED">OpenchannelCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OpenchannelCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.agent.showWebBar == 0">\n <md-tab-label>\n <span translate="STAFF.MOTIONBAR">MOTIONBAR</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="agent-detail-form-container settings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SETTINGS">SETTINGS</div>\n </div>\n <form name="settingsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" ng-required="true">\n <div ng-messages="settingsForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settingsForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRingInUse" aria-label="RingInUse"><span translate="STAFF.RINGINUSE">RingInUse</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarDnd" aria-label="Dnd"><span translate="STAFF.DND">Dnd</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarUnansweredCallBadge" aria-label="UnansweredCallBadge"><span translate="STAFF.UNANSWEREDCALLBADGE">UnansweredCallBadge</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableJaws" aria-label="EnableJawsIntegration"><span translate="STAFF.ENABLEJAWSINTEGRATION">EnableJawsIntegration</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container remote_control md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.REMOTE_CONTROL">REMOTE_CONTROL</div>\n </div>\n <form name="remote_controlForm" novalidate>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" ng-required="true">\n <div ng-messages="remote_controlForm[\'phoneBarRemoteControlPort\'].$error" ng-show="remote_controlForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container sip md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SIP">SIP</div>\n </div>\n <form name="sipForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus>\n <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n <div ng-messages="sipForm[\'phoneBarExpires\'].$error" ng-show="sipForm[\'phoneBarExpires\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPPORT">SipPort</label>\n <input type="number" name="phoneBarListenPort" ng-model="vm.agent.phoneBarListenPort" ng-required="true">\n <div class="hint"><span translate="STAFF.HELP.SIPPORT"></span></div>\n <div ng-messages="sipForm[\'phoneBarListenPort\'].$error" ng-show="sipForm[\'phoneBarListenPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPPORT_REQUIRED">SipPort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container callforwarding md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CALLFORWARDING">CALLFORWARDING</div>\n </div>\n <form name="callforwardingForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarUnconditional" aria-label="Unconditional"><span translate="STAFF.UNCONDITIONAL">Unconditional</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarUnconditional" class="md-block">\n <label translate="STAFF.UNCONDITIONALNUMBER">UnconditionalNumber</label>\n <input type="text" name="phoneBarUnconditionalNumber" ng-model="vm.agent.phoneBarUnconditionalNumber" ng-required="true">\n <div ng-messages="callforwardingForm[\'phoneBarUnconditionalNumber\'].$error" ng-show="callforwardingForm[\'phoneBarUnconditionalNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.UNCONDITIONALNUMBER_REQUIRED">UnconditionalNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.agent.showWebBar == 2">\n <md-tab-label>\n <span translate="STAFF.WEBRTC">WEBRTC</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="agent-detail-form-container settings_webrtc md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SETTINGS_WEBRTC">SETTINGS_WEBRTC</div>\n </div>\n <form name="settings_webrtcForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.DTLSCERTFILE">dtlscertfile</label>\n <input type="text" name="dtlscertfile" ng-model="vm.agent.dtlscertfile" ng-required="true" autofocus>\n <div class="hint"><span translate="STAFF.HELP.DTLSCERTFILE"></span></div>\n <div ng-messages="settings_webrtcForm[\'dtlscertfile\'].$error" ng-show="settings_webrtcForm[\'dtlscertfile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DTLSCERTFILE_REQUIRED">dtlscertfile field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DTLSPRIVATEKEY">dtlsprivatekey</label>\n <input type="text" name="dtlsprivatekey" ng-model="vm.agent.dtlsprivatekey" ng-required="true">\n <div class="hint"><span translate="STAFF.HELP.DTLSPRIVATEKEY"></span></div>\n <div ng-messages="settings_webrtcForm[\'dtlsprivatekey\'].$error" ng-show="settings_webrtcForm[\'dtlsprivatekey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DTLSPRIVATEKEY_REQUIRED">dtlsprivatekey field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" ng-required="true">\n <div ng-messages="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container sip_webrtc md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SIP_WEBRTC">SIP_WEBRTC</div>\n </div>\n <form name="sip_webrtcForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus>\n <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n <div ng-messages="sip_webrtcForm[\'phoneBarExpires\'].$error" ng-show="sip_webrtcForm[\'phoneBarExpires\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="agent-detail-form-container general_permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL_PERMISSIONS">GENERAL_PERMISSIONS</div>\n </div>\n <form name="general_permissionsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.allowmessenger" aria-label="EnableMessenger"><span translate="STAFF.ENABLEMESSENGER">EnableMessenger</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERMISSIONS">PERMISSIONS</div>\n </div>\n <div ng-controller="AgentPermissionsController as vm_pc" ng-init="vm_pc.init(vm.agent)" class="agent-detail-form-container">\n <md-list ng-repeat="father in vm_pc.navigation[0].children" ng-include="\'permission-nested.html\'" ng-if="vm_pc.agent.role !== \'admin\' && !father.hidden()"></md-list>\n\n \x3c!-- Nested navigation template --\x3e\n <script type="text/ng-template" id="permission-nested.html">\n <md-list-item>\n <md-icon md-font-icon="{{father.icon}}"></md-icon>\n <p translate="{{father.translate}}">{{ father.title }}</p>\n <md-switch class="md-secondary" ng-model="father.enabled" ng-change="vm_pc.onChange(father)" ng-init="father.enabled = vm_pc.agent.permissions.includes(father.id)"></md-switch>\n </md-list-item>\n\n <md-divider></md-divider>\n\n <md-list>\n <md-list-item ng-repeat="child in father.children">\n <md-icon ng-if="child.icon" md-font-icon="{{child.icon}}"></md-icon>\n <p translate="{{child.translate}}">{{ child.title }}</p>\n <md-switch class="md-secondary" ng-model="child.enabled" ng-change="vm_pc.onChange(father, child)" ng-init="child.enabled = vm_pc.agent.permissions.includes(child.id)"></md-switch>\n </md-list-item>\n </md-list>\n <\/script>\n \x3c!-- / Nested navigation template --\x3e\n\n <span ng-if="vm_pc.agent.role === \'admin\'" class="md-headline" translate="STAFF.ALL_MODULES_AVAILABLE">All modules are already available.</span>\n\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/teams/create/dialog.html",'<md-dialog class="team-dialog" aria-label="New Team">\n <form name="teamForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.team.name" ng-required="true" autofocus>\n <div ng-messages="teamForm[\'name\'].$error" ng-show="teamForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.team.description">\n <div ng-messages="teamForm[\'description\'].$error" ng-show="teamForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newTeam" ng-click="vm.saveTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid || teamForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newTeam" ng-click="vm.addNewTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TEAM" translate-attr-aria-label="STAFF.ADD_TEAM">\n ADD TEAM\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newTeam" ng-click="vm.deleteTeam($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",'<md-dialog class="team-dialog" aria-label="team">\n <form name="teamForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="STAFF.AGENTADD_TEAM">Add Agent to team</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/teams.html",'<div id="teams" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.TEAMS">Teams</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTeams.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTeams =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-teams-count">\n <span>{{vm.selectedTeams.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TEAMS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTeams()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTeams()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTeams" csv-label="true" filename="teams.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedTeams($event)" aria-label="delete selected" translate translate-attr-label="TEAMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- TEAM TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTeams" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTeams">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'STAFF.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'STAFF.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.teams.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="team" md-select-id="id" ng-repeat="team in vm.teams.rows">\n <td md-cell ng-if="team.userpic"><img class="avatar" alt="{{team.name}}" ng-src="api/users/{{team.id}}/avatar" /></td>\n <td md-cell ng-if="!team.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{team.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="id ">{{team.id}}</td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="name ">{{team.name}}</td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="description ">{{team.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(team, $event)" translate="STAFF.EDIT_TEAM">\n Edit Team\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(team, $event)" translate="STAFF.AGENTADD_TEAM">\n AgentAdd Team\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(team, $event)" translate="STAFF.DELETE_TEAM">\n Delete Team\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.teams.count}}" md-on-paginate="vm.getTeams" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TEAM TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TEAM BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-team-button" ng-click="vm.createOrEditTeam($event)" aria-label="add team" translate translate-attr-aria-label="STAFF.ADD_TEAM">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TEAM BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/telephones/create/dialog.html",'<md-dialog class="telephone-dialog" aria-label="New Telephone">\n <form name="telephoneForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus>\n <div ng-messages="telephoneForm[\'fullname\'].$error" ng-show="telephoneForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newTelephone">\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="telephoneForm[\'name\'].$error" ng-show="telephoneForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true">\n <div ng-messages="telephoneForm[\'email\'].$error" ng-show="telephoneForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newTelephone">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.telephone.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="telephoneForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newTelephone && (vm.newTelephone)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.telephone.description">\n <div ng-messages="telephoneForm[\'description\'].$error" ng-show="telephoneForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newTelephone" class="md-block">\n <md-switch ng-model="vm.telephone.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" ng-disabled="!vm.newTelephone">\n <div ng-messages="telephoneForm[\'internal\'].$error" ng-show="telephoneForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newTelephone" class="md-block">\n <md-switch ng-model="vm.telephone.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newTelephone" ng-click="vm.saveTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newTelephone" ng-click="vm.addNewTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TELEPHONE" translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n ADD TELEPHONE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newTelephone" ng-click="vm.deleteTelephone($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",'<md-dialog class="telephone-dialog" aria-label="{{vm.name}}">\n <form name="telephoneForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="telephoneForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/view.html",'<div id="staff-telephone" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-telephones-button md-icon-button" aria-label="Go to telephones" ng-click="vm.gotoTelephones()" translate translate-attr-aria-label="STAFF.GO_TO_TELEPHONES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="telephone-image" hide-xs>\n <img ng-src="assets/images/business/telephones.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.telephone.id}}\n <span ng-if="vm.telephone.name">{{vm.telephone.name}}</span>\n <span ng-if="vm.telephone.exten">{{vm.telephone.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.telephone.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.changepassworddialog(vm.telephone, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_TELEPHONE"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTelephone()" class="send-button md-accent md-raised" ng-disabled="(accountForm.$invalid) || (generalForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="telephone-detail-form-container account md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.ACCOUNT">ACCOUNT</div>\n </div>\n <form name="accountForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus>\n <div ng-messages="accountForm[\'fullname\'].$error" ng-show="accountForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="true">\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="accountForm[\'name\'].$error" ng-show="accountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true">\n <div ng-messages="accountForm[\'email\'].$error" ng-show="accountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.telephone.description">\n <div ng-messages="accountForm[\'description\'].$error" ng-show="accountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.telephone.phone">\n <div ng-messages="accountForm[\'phone\'].$error" ng-show="accountForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.telephone.mobile">\n <div ng-messages="accountForm[\'mobile\'].$error" ng-show="accountForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="telephone-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" autofocus ng-disabled="true">\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.telephone.transport" required multiple>\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.telephone.nat" required multiple>\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.telephone.allow" required multiple>\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLERID">CallerId</label>\n <input type="text" name="callerid" ng-model="vm.telephone.callerid">\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.telephone.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.telephone.callgroup">\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.telephone.pickupgroup">\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ENCRYPTION">Encryption</label>\n <md-select name="encryption" ng-model="vm.telephone.encryption" required>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ENCRYPTION"></span></div>\n <div ng-messages="generalForm[\'encryption\'].$error" ng-show="generalForm[\'encryption\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ENCRYPTION_REQUIRED">Encryption field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/telephones/telephones.html",'<div id="telephones" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.TELEPHONES">Telephones</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTelephones.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTelephones =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-telephones-count">\n <span>{{vm.selectedTelephones.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TELEPHONES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTelephones()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTelephones()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTelephones" csv-label="true" filename="telephones.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedTelephones($event)" aria-label="delete selected" translate translate-attr-label="TELEPHONES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- TELEPHONE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTelephones" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="fullname">{{ \'STAFF.ACCOUNTNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.telephones.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="telephone" md-select-id="id" ng-repeat="telephone in vm.telephones.rows">\n <td md-cell ng-if="telephone.userpic"><img class="avatar" alt="{{telephone.name}}" ng-src="api/users/{{telephone.id}}/avatar" /></td>\n <td md-cell ng-if="!telephone.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{telephone.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTelephone($event, telephone)" md-cell class="fullname font-weight-600">{{telephone.fullname}}</td>\n <td ng-click="vm.createOrEditTelephone($event, telephone)" md-cell class="name ">{{telephone.name}}</td>\n <td ng-click="vm.createOrEditTelephone($event, telephone)" md-cell class="email ">{{telephone.email}}</td>\n <td ng-click="vm.createOrEditTelephone($event, telephone)" md-cell class="internal ">{{telephone.internal}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(telephone, $event)" translate="STAFF.EDIT_TELEPHONE">\n Edit Telephone\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(telephone, $event)" translate="STAFF.DELETE_TELEPHONE">\n Delete Telephone\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.telephones.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TELEPHONE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TELEPHONE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-telephone-button" ng-click="vm.createOrEditTelephone($event)" aria-label="add telephone" translate translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TELEPHONE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/users/create/dialog.html",'<md-dialog class="user-dialog" aria-label="New User">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.ROLE">Role</label>\n <md-select name="role" ng-model="vm.user.role" required autofocus ng-disabled="!vm.newUser">\n <md-option ng-value="\'admin\'">Admin</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n </md-select>\n <div ng-messages="userForm[\'role\'].$error" ng-show="userForm[\'role\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true">\n <div ng-messages="userForm[\'fullname\'].$error" ng-show="userForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newUser">\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="userForm[\'name\'].$error" ng-show="userForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.user.email" ng-required="true">\n <div ng-messages="userForm[\'email\'].$error" ng-show="userForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newUser">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.user.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="userForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newUser && (vm.newUser)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.user.description">\n <div ng-messages="userForm[\'description\'].$error" ng-show="userForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newUser" class="md-block">\n <md-switch ng-model="vm.user.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" ng-disabled="!vm.newUser">\n <div ng-messages="userForm[\'internal\'].$error" ng-show="userForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newUser" ng-click="vm.saveUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newUser" ng-click="vm.addNewUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid" aria-label="ADD" translate="STAFF.ADD_USER" translate-attr-aria-label="STAFF.ADD_USER">\n ADD USER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newUser" ng-click="vm.deleteUser($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="userForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/queueadd/queueadd.html",'<md-dialog class="user-dialog" aria-label="user">\n <form name="userForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>{{vm.title}}</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin" ng-if="vm.user.role === \'agent\' && vm.isVoiceChannel()">\n <label translate="STAFF.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="userForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/view.html",'<div id="staff-user" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-users-button md-icon-button" aria-label="Go to users" ng-click="vm.gotoUsers()" translate translate-attr-aria-label="STAFF.GO_TO_USERS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="user-image" hide-xs>\n <img ng-src="assets/images/business/users.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.user.id}}\n <span ng-if="vm.user.name">{{vm.user.name}}</span>\n <span ng-if="vm.user.exten">{{vm.user.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.user.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.user.role !== \'admin\'">\n <md-fab-speed-dial md-direction="left" class="md-scale md-fab">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n <md-tooltip md-direction="top" md-visible="false"><span translate="STAFF.CHANNELS">Channels</span></md-tooltip>\n <md-icon md-font-icon="icon-eye" aria-label="queueadd"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <md-button aria-label="voice" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.user, \'voice\', $event, \'inbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="VOICE.VOICE">Voice</span></md-tooltip>\n <md-icon md-font-icon="icon-phone" aria-label="voice"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.dialer" aria-label="motion bull" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.user, \'voice\', $event, \'outbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MOTIONDIALER.MOTIONDIALER">Motion Bull</span></md-tooltip>\n <md-icon md-font-icon="icon-fire" aria-label="motion bull"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.chat" aria-label="chat" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.user, \'chat\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="CHAT.CHAT">Chat</span></md-tooltip>\n <md-icon md-font-icon="icon-hangouts" aria-label="chat"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.mail" aria-label="mail" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.user, \'mail\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MAIL.MAIL">Email</span></md-tooltip>\n <md-icon md-font-icon="icon-email" aria-label="mail"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.messaging" aria-label="sms" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.user, \'sms\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="SMS.SMS">Sms</span></md-tooltip>\n <md-icon md-font-icon="icon-message-text" aria-label="sms"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.openchannel" aria-label="openchannel" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.user, \'openchannel\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="OPENCHANNEL.OPENCHANNEL">Openchannel</span></md-tooltip>\n <md-icon md-font-icon="icon-google-earth" aria-label="openchannel"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.fax" aria-label="fax" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.user, \'fax\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="FAX.FAX">Fax</span></md-tooltip>\n <md-icon md-font-icon="icon-deskphone" aria-label="fax"></md-icon>\n </md-button>\n </md-fab-actions>\n </md-fab-speed-dial>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.changepassworddialog(vm.user, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_USER"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveUser()" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid) || (general_permissionsForm.$invalid) || (permissionsForm.$invalid)"\n translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="user-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="personal_infoForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.ROLE">Role</label>\n <md-select name="role" ng-model="vm.user.role" required autofocus ng-disabled="true">\n <md-option ng-value="\'admin\'">Admin</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'role\'].$error" ng-show="personal_infoForm[\'role\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true">\n <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="true">\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.user.email" ng-required="true">\n <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.user.phone">\n <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.user.mobile">\n <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.user.description">\n <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="user-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n </div>\n <form name="security_suiteForm" novalidate>\n <md-input-container ng-if="vm.user.passwordResetAt != null" class="md-block">\n <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" autofocus ng-disabled="true">\n <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.user.passwordResetAt == null" class="md-block">\n <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" ng-disabled="true">\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="user-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n </div>\n <div ng-controller="Userchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.user)" class="user-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="user-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()"\n flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="change_avatarimage in vm_ca.user.images" ng-switch="change_avatarimage.type">\n <div class="user-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="change_avatarimage.file">\n </div>\n\n <div class="user-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{change_avatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="user-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" autofocus ng-disabled="true">\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.user.transport" required multiple>\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.user.nat" required multiple>\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.user.allow" required multiple>\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.user.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.user.callgroup">\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.user.pickupgroup">\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div ng-if="vm.currentUser.role === \'admin\' && vm.user.role !== \'admin\'" class="user-detail-form-container general_permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL_PERMISSIONS">GENERAL_PERMISSIONS</div>\n </div>\n <form name="general_permissionsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.EDITPERMISSIONS">EditPermissions</label>\n <md-select name="crudPermissions" ng-model="vm.user.crudPermissions" autofocus>\n\n <md-option ng-value="0"> {{ \'STAFF.READANDEDITANDDELETE\' | translate }}</md-option>\n\n <md-option ng-value="1"> {{ \'STAFF.READANDEDIT\' | translate }}</md-option>\n </md-select>\n <div ng-messages="general_permissionsForm[\'crudPermissions\'].$error" ng-show="general_permissionsForm[\'crudPermissions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EDITPERMISSIONS_REQUIRED">EditPermissions field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="user-detail-form-container permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERMISSIONS">PERMISSIONS</div>\n </div>\n <div ng-controller="UserPermissionsController as vm_pc" ng-init="vm_pc.init(vm.user)" class="user-detail-form-container">\n <md-list ng-repeat="father in vm_pc.navigation[0].children" ng-include="\'permission-nested.html\'" ng-if="vm_pc.user.role !== \'admin\' && !father.hidden()"></md-list>\n\n \x3c!-- Nested navigation template --\x3e\n <script type="text/ng-template" id="permission-nested.html">\n <md-list-item>\n <md-icon md-font-icon="{{father.icon}}"></md-icon>\n <p translate="{{father.translate}}">{{ father.title }}</p>\n <md-switch class="md-secondary" ng-model="father.enabled" ng-change="vm_pc.onChange(father)" ng-init="father.enabled = vm_pc.user.permissions.includes(father.id)"></md-switch>\n </md-list-item>\n\n <md-divider></md-divider>\n\n <md-list>\n <md-list-item ng-repeat="child in father.children">\n <md-icon ng-if="child.icon" md-font-icon="{{child.icon}}"></md-icon>\n <p translate="{{child.translate}}">{{ child.title }}</p>\n <md-switch class="md-secondary" ng-model="child.enabled" ng-change="vm_pc.onChange(father, child)" ng-init="child.enabled = vm_pc.user.permissions.includes(child.id)"></md-switch>\n </md-list-item>\n </md-list>\n <\/script>\n \x3c!-- / Nested navigation template --\x3e\n\n <span ng-if="vm_pc.user.role === \'admin\'" class="md-headline" translate="STAFF.ALL_MODULES_AVAILABLE">All modules are already available.</span>\n\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/users/users.html",'<div id="users" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.USERS">Users</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedUsers.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedUsers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-users-count">\n <span>{{vm.selectedUsers.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="USERS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllUsers()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectUsers()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedUsers" csv-label="true" filename="users.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- USER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedUsers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getUsers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="role">{{ \'STAFF.ROLE\' | translate }}</th>\n <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.users.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="user" md-select-id="id" ng-repeat="user in vm.users.rows">\n <td md-cell ng-if="user.userpic"><img class="avatar" alt="{{user.name}}" ng-src="api/users/{{user.id}}/avatar" /></td>\n <td md-cell ng-if="!user.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{user.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditUser($event, user)" md-cell class="role ">{{ vm.arrayrole[user.role].option }}</td>\n <td ng-click="vm.createOrEditUser($event, user)" md-cell class="fullname font-weight-600">{{user.fullname}}</td>\n <td ng-click="vm.createOrEditUser($event, user)" md-cell class="name ">{{user.name}}</td>\n <td ng-click="vm.createOrEditUser($event, user)" md-cell class="email ">{{user.email}}</td>\n <td ng-click="vm.createOrEditUser($event, user)" md-cell class="phone ">{{user.phone}}</td>\n <td ng-click="vm.createOrEditUser($event, user)" md-cell class="mobile ">{{user.mobile}}</td>\n <td ng-click="vm.createOrEditUser($event, user)" md-cell class="internal ">{{user.internal}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(user, $event)" translate="STAFF.EDIT_USER">\n Edit User\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.role === \'admin\' && user.id !== vm.currentUser.id">\n <md-button ng-click="vm.deleteconfirm(user, $event)" translate="STAFF.DELETE_USER">\n Delete User\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.users.count}}" md-on-paginate="vm.getUsers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USER BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-user-button" ng-click="vm.createOrEditUser($event)" aria-label="add user" translate translate-attr-aria-label="STAFF.ADD_USER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",'<div id="cannedAnswers" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.CANNEDANSWERS">CannedAnswers</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCannedAnswers.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCannedAnswers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-cannedAnswers-count">\n <span>{{vm.selectedCannedAnswers.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CANNEDANSWERS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCannedAnswers()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCannedAnswers()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCannedAnswers" csv-label="true" filename="cannedAnswers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="CANNEDANSWERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- CANNEDANSWER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCannedAnswers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCannedAnswers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'TOOLS.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.cannedAnswers.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="cannedAnswer" md-select-id="id" ng-repeat="cannedAnswer in vm.cannedAnswers.rows">\n <td md-cell ng-if="cannedAnswer.userpic"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="api/users/{{cannedAnswer.id}}/avatar" /></td>\n <td md-cell ng-if="!cannedAnswer.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="id ">{{cannedAnswer.id}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="key ">{{cannedAnswer.key}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="value ">{{cannedAnswer.value}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="description ">{{cannedAnswer.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(cannedAnswer, $event)" translate="TOOLS.EDIT_CANNEDANSWER">\n Edit CannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(cannedAnswer, $event)" translate="TOOLS.DELETE_CANNEDANSWER">\n Delete CannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.cannedAnswers.count}}" md-on-paginate="vm.getCannedAnswers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CANNEDANSWER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CANNEDANSWER BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-cannedAnswer-button" ng-click="vm.createOrEditCannedAnswer($event)" aria-label="add cannedAnswer" translate translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CANNEDANSWER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/create/dialog.html",'<md-dialog class="cannedAnswer-dialog" aria-label="New CannedAnswer">\n <form name="cannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.cannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n <div ng-messages="cannedAnswerForm[\'key\'].$error" ng-show="cannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 255}\'>Key must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <textarea name="value" ng-model="vm.cannedAnswer.value" required></textarea>\n\n <div ng-messages="cannedAnswerForm[\'value\'].$error" ng-show="cannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.cannedAnswer.description">\n <div ng-messages="cannedAnswerForm[\'description\'].$error" ng-show="cannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newCannedAnswer" ng-click="vm.saveCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid || cannedAnswerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newCannedAnswer" ng-click="vm.addNewCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CANNEDANSWER" translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n ADD CANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newCannedAnswer" ng-click="vm.deleteCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/create/dialog.html",'<md-dialog class="customDashboard-dialog" aria-label="New CustomDashboard">\n <form name="customDashboardForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.customDashboard.description">\n <div ng-messages="customDashboardForm[\'description\'].$error" ng-show="customDashboardForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newCustomDashboard" ng-click="vm.saveCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid || customDashboardForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newCustomDashboard" ng-click="vm.addNewCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n ADD CUSTOMDASHBOARD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newCustomDashboard" ng-click="vm.deleteCustomDashboard($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/customDashboards.html",'<div id="customDashboards" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.CUSTOMDASHBOARDS">CustomDashboards</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCustomDashboards.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCustomDashboards =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-customDashboards-count">\n <span>{{vm.selectedCustomDashboards.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CUSTOMDASHBOARDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCustomDashboards()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCustomDashboards()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCustomDashboards" csv-label="true" filename="customDashboards.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedCustomDashboards($event)" aria-label="delete selected" translate translate-attr-label="CUSTOMDASHBOARDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- CUSTOMDASHBOARD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCustomDashboards" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCustomDashboards">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.customDashboards.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="customDashboard" md-select-id="id" ng-repeat="customDashboard in vm.customDashboards.rows">\n <td md-cell ng-if="customDashboard.userpic"><img class="avatar" alt="{{customDashboard.name}}" ng-src="api/users/{{customDashboard.id}}/avatar" /></td>\n <td md-cell ng-if="!customDashboard.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{customDashboard.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="id ">{{customDashboard.id}}</td>\n <td ng-click="vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="name ">{{customDashboard.name}}</td>\n <td ng-click="vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="description ">{{customDashboard.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(customDashboard, $event)" translate="TOOLS.EDIT_CUSTOMDASHBOARD">\n Edit CustomDashboard\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.role == \'admin\'">\n <md-button ng-click="vm.useradddialog(customDashboard, $event)" translate="TOOLS.USERADD_CUSTOMDASHBOARD">\n useradd CustomDashboard\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.clonedialog(customDashboard, $event)" translate="TOOLS.CLONE_CUSTOMDASHBOARD">\n clone CustomDashboard\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotodashboardgoto(customDashboard, $event)" translate="TOOLS.GOTODASHBOARD_CUSTOMDASHBOARD">\n goToDashboard CustomDashboard\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(customDashboard, $event)" translate="TOOLS.DELETE_CUSTOMDASHBOARD">\n Delete CustomDashboard\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.customDashboards.count}}" md-on-paginate="vm.getCustomDashboards" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CUSTOMDASHBOARD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CUSTOMDASHBOARD BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-customDashboard-button" ng-click="vm.createOrEditCustomDashboard($event)" aria-label="add customDashboard" translate translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CUSTOMDASHBOARD BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/customDashboards/edit/clone/clone.html",'<md-dialog class="customDashboard-dialog" aria-label="Clone CustomDashboard">\n <form name="customDashboardForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="CLONE" translate="TOOLS.CLONE_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.CLONE_CUSTOMDASHBOARD">\n CLONE CUSTOMDASHBOARD\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",'<md-dialog class="dashboarditem-dialog" aria-label="New DashboardItem">\n <form name="dashboarditemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.dashboarditem.type" autofocus ng-disabled="!vm.newDashboardItem">\n\n <md-option ng-value="\'counter\'"> {{ \'TOOLS.COUNTER\' | translate }}</md-option>\n\n <md-option ng-value="\'multibar-chart\'"> {{ \'TOOLS.MULTIBARCHART\' | translate }}</md-option>\n\n <md-option ng-value="\'pie-chart\'"> {{ \'TOOLS.PIECHART\' | translate }}</md-option>\n\n <md-option ng-value="\'web-report\'"> {{ \'TOOLS.WEBREPORT\' | translate }}</md-option>\n\n <md-option ng-value="\'iframe\'"> {{ \'TOOLS.IFRAME\' | translate }}</md-option>\n\n <md-option ng-value="\'clock\'"> {{ \'TOOLS.CLOCK\' | translate }}</md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'TOOLS.CUSTOMTYPE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'type\'].$error" ng-show="dashboarditemForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TITLE">Title</label>\n <input type="text" name="title" ng-model="vm.dashboarditem.title" ng-required="true">\n <div ng-messages="dashboarditemForm[\'title\'].$error" ng-show="dashboarditemForm[\'title\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TITLE_REQUIRED">Title field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'iframe\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="attrUrl" ng-model="vm.dashboarditem.attrUrl" ng-required="true">\n <div ng-messages="dashboarditemForm[\'attrUrl\'].$error" ng-show="dashboarditemForm[\'attrUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'custom\'" class="md-block">\n <label translate="TOOLS.PATH">Path</label>\n <input type="text" name="attrPath" ng-model="vm.dashboarditem.attrPath" ng-required="true">\n <div ng-messages="dashboarditemForm[\'attrPath\'].$error" ng-show="dashboarditemForm[\'attrPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PATH_REQUIRED">Path field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n <label translate="TOOLS.FORMAT">Format</label>\n <input type="text" name="attrHourFormat" ng-model="vm.dashboarditem.attrHourFormat" ng-required="true">\n <div ng-messages="dashboarditemForm[\'attrHourFormat\'].$error" ng-show="dashboarditemForm[\'attrHourFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n <label translate="TOOLS.TIMEZONE">Timezone</label>\n <md-select name="attrTimezone" ng-model="vm.dashboarditem.attrTimezone" required>\n <md-option ng-value="\'-12.00\'">GMT-12.00</md-option>\n <md-option ng-value="\'-11.00\'">GMT-11.00</md-option>\n <md-option ng-value="\'-10.00\'">GMT-10.00</md-option>\n <md-option ng-value="\'-9.00\'">GMT-9.00</md-option>\n <md-option ng-value="\'-8.00\'">GMT-8.00</md-option>\n <md-option ng-value="\'-7.00\'">GMT-7.00</md-option>\n <md-option ng-value="\'-6.00\'">GMT-6.00</md-option>\n <md-option ng-value="\'-5.00\'">GMT-5.00</md-option>\n <md-option ng-value="\'-4.00\'">GMT-4.00</md-option>\n <md-option ng-value="\'-3.30\'">GMT-3.30</md-option>\n <md-option ng-value="\'-3.00\'">GMT-3.00</md-option>\n <md-option ng-value="\'-2.00\'">GMT-2.00</md-option>\n <md-option ng-value="\'-1.00\'">GMT-1.00</md-option>\n <md-option ng-value="\'0.00\'">GMT 0.00</md-option>\n <md-option ng-value="\'1.00\'">GMT+1.00</md-option>\n <md-option ng-value="\'2.00\'">GMT+2.00</md-option>\n <md-option ng-value="\'3.00\'">GMT+3.00</md-option>\n <md-option ng-value="\'3.30\'">GMT+3.30</md-option>\n <md-option ng-value="\'4.00\'">GMT+4.00</md-option>\n <md-option ng-value="\'4.30\'">GMT+4.30</md-option>\n <md-option ng-value="\'5.00\'">GMT+5.00</md-option>\n <md-option ng-value="\'5.30\'">GMT+5.30</md-option>\n <md-option ng-value="\'5.45\'">GMT+5.45</md-option>\n <md-option ng-value="\'6.00\'">GMT+6.00</md-option>\n <md-option ng-value="\'6.30\'">GMT+6.30</md-option>\n <md-option ng-value="\'7.00\'">GMT+7.00</md-option>\n <md-option ng-value="\'8.00\'">GMT+8.00</md-option>\n <md-option ng-value="\'9.00\'">GMT+9.00</md-option>\n <md-option ng-value="\'9.30\'">GMT+9.30</md-option>\n <md-option ng-value="\'10.00\'">GMT+10.00</md-option>\n <md-option ng-value="\'11.00\'">GMT+11.00</md-option>\n <md-option ng-value="\'12.00\'">GMT+12.00</md-option>\n <md-option ng-value="\'13.00\'">GMT+13.00</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrTimezone\'].$error" ng-show="dashboarditemForm[\'attrTimezone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'counter\'" class="md-block">\n <label translate="TOOLS.METRIC">Metric</label>\n <md-select name="attrMetric" ng-model="vm.dashboarditem.attrMetric" required>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }}</md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }}</md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }}</md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }}</md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }}</md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrMetric\'].$error" ng-show="dashboarditemForm[\'attrMetric\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE1">Serie1</label>\n <md-select name="attrSerie1" ng-model="vm.dashboarditem.attrSerie1" required>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }}</md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }}</md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }}</md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }}</md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }}</md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie1\'].$error" ng-show="dashboarditemForm[\'attrSerie1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE1_REQUIRED">Serie1 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE2">Serie2</label>\n <md-select name="attrSerie2" ng-model="vm.dashboarditem.attrSerie2">\n\n <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }}</md-option>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }}</md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }}</md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }}</md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }}</md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }}</md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie2\'].$error" ng-show="dashboarditemForm[\'attrSerie2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE2_REQUIRED">Serie2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE3">Serie3</label>\n <md-select name="attrSerie3" ng-model="vm.dashboarditem.attrSerie3">\n\n <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }}</md-option>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }}</md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }}</md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }}</md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }}</md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }}</md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie3\'].$error" ng-show="dashboarditemForm[\'attrSerie3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE3_REQUIRED">Serie3 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n <label translate="TOOLS.REFRESH">Refresh</label>\n <input type="number" name="attrRefresh" ng-model="vm.dashboarditem.attrRefresh" min="5" ng-required="true">\n <div ng-messages="dashboarditemForm[\'attrRefresh\'].$error" ng-show="dashboarditemForm[\'attrRefresh\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REFRESH_REQUIRED">Refresh field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLS.ERRORS.REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Refresh must be a valid greater or equal than</span> <span>5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n <label translate="TOOLS.REPORT">Report</label>\n <md-select name="attrReport" ng-model="vm.dashboarditem.attrReport" required>\n <md-option ng-value="attrReport.id" ng-repeat="attrReport in vm.customReports">{{ attrReport.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrReport\'].$error" ng-show="dashboarditemForm[\'attrReport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\', \'counter\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.FILTERVOICEQUEUES">FilterVoiceQueues</label>\n <md-select name="attrVoiceQueues" ng-model="vm.dashboarditem.attrVoiceQueues" multiple>\n <md-option ng-value="attrVoiceQueues.id" ng-repeat="attrVoiceQueues in vm.voiceQueues">{{ attrVoiceQueues.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrVoiceQueues\'].$error" ng-show="dashboarditemForm[\'attrVoiceQueues\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTERVOICEQUEUES_REQUIRED">FilterVoiceQueues field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'counter\', \'clock\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.FONTSIZE">FontSize</label>\n <input type="number" name="attrFontSize" ng-model="vm.dashboarditem.attrFontSize" min="12" max="40" ng-required="true">\n <div ng-messages="dashboarditemForm[\'attrFontSize\'].$error" ng-show="dashboarditemForm[\'attrFontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FONTSIZE_REQUIRED">FontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>12</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>40</span>\n </div>\n </div>\n </md-input-container>\n <div flex md-color-picker ng-model="vm.dashboarditem.foreground" label="{{\'TOOLS.FOREGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false"\n open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.dashboarditem.background" label="{{\'TOOLS.BACKGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false"\n open-on-input="true"></div>\n <md-input-container class="md-block">\n <label translate="TOOLS.LINK">link</label>\n <input type="url" name="link" ng-model="vm.dashboarditem.link">\n <div ng-messages="dashboarditemForm[\'link\'].$error" ng-show="dashboarditemForm[\'link\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LINK_REQUIRED">link field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.LINK_MUST_VALID_URL">link must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newDashboardItem" ng-click="vm.saveDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid || dashboarditemForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newDashboardItem" ng-click="vm.addNewDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_DASHBOARDITEM" translate-attr-aria-label="TOOLS.ADD_DASHBOARDITEM">\n ADD DASHBOARDITEM\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newDashboardItem" ng-click="vm.deleteDashboardItem($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/useradd/useradd.html",'<md-dialog class="customDashboard-dialog" aria-label="customDashboard">\n <form name="customDashboardForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="TOOLS.USERADD_CUSTOMDASHBOARD">Add User to customDashboard</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/view.html",'<div id="tools-customDashboard" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-customDashboards-button md-icon-button" aria-label="Go to customDashboards" ng-click="vm.gotoCustomDashboards()" translate translate-attr-aria-label="TOOLS.GO_TO_CUSTOMDASHBOARDS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="customDashboard-image" hide-xs>\n <img ng-src="assets/images/business/customDashboards.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.customDashboard.id}}\n <span ng-if="vm.customDashboard.name">{{vm.customDashboard.name}}</span>\n <span ng-if="vm.customDashboard.exten">{{vm.customDashboard.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.customDashboard.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.useradddialog(vm.customDashboard, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="useradd" ng-if="vm.currentUser.role == \'admin\'">\n <md-tooltip><span translate="TOOLS.USERADD_CUSTOMDASHBOARD"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.clonedialog(vm.customDashboard, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="TOOLS.CLONE_CUSTOMDASHBOARD"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.customDashboard, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="TOOLS.GOTO_CUSTOMDASHBOARD"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (dashboardForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="customDashboard-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.customDashboard.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.DASHBOARD">DASHBOARD</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="customDashboard-detail-form-container dashboard md-background-bg md-whiteframe-1dp">\n <div ng-controller="CustomDashboardItemsController as vm_cd" ng-init="vm_cd.init(vm.customDashboard)" class="customDashboard-detail-form-container no-padding no-margin" layout="column">\n <div ng-if="vm_cd.customDashboard.widgets.length">\n <md-button class="md-fab md-mini md-accent" ng-click="vm_cd.createOrEditWidget()" aria-label="add item">\n <md-tooltip>{{ \'TOOLS.ADD_WIDGET\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-content flex>\n <ms-widget-engine config="vm_cd.customDashboard" on-edit="vm_cd.createOrEditWidget(widget)" on-delete="vm_cd.deleteWidget(widget)"></ms-widget-engine>\n </md-content>\n </div>\n <div ng-if="!vm_cd.customDashboard.widgets.length" layout="row" layout-align="center center" flex>\n <md-button class="width-130 height-130 md-accent md-raised" ng-click="vm_cd.createOrEditWidget()" aria-label="add item" layout="column">\n <md-icon md-font-icon="icon-plus-circle" class="s50"></md-icon>\n <span layout-wrap translate="TOOLS.ADD_WIDGET"></span>\n </md-button>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/intervals/create/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.interval.description">\n <div ng-messages="intervalForm[\'description\'].$error" ng-show="intervalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input ng-model="vm.interval.name" type="text" name="name" placeholder="{{\'TOOLS.NAME\' | translate}}" md-autofocus required>\n <div ng-messages="intervalForm.name.$error" ng-show="intervalForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/intervals/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/view.html",'<div id="tools-interval" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-intervals-button md-icon-button" aria-label="Go to intervals" ng-click="vm.gotoIntervals()" translate translate-attr-aria-label="TOOLS.GO_TO_INTERVALS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="interval-image" hide-xs>\n <img ng-src="assets/images/business/intervals.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.interval.id}}\n <span ng-if="vm.interval.name">{{vm.interval.name}}</span>\n <span ng-if="vm.interval.exten">{{vm.interval.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.interval.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (intervalsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="interval-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.interval.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.INTERVALS">INTERVALS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="interval-detail-form-container intervals md-background-bg md-whiteframe-1dp">\n <div ng-controller="IntervalIntervalsController as vm_dc" ng-init="vm_dc.init(vm.interval)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIntervalIntervals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.INTERVALS">Intervals</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditIntervalInterval($event)" aria-label="add interval" translate translate-attr-label="TOOLS.ADD_INTERVAL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIntervalIntervals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIntervalIntervals.length}} {{vm_dc.selectedIntervalIntervals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIntervalIntervals" csv-label="true" filename="intervals.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedIntervalIntervals($event)" aria-label="delete selected" translate translate-attr-label="INTERVALS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIntervalIntervals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIntervalIntervals">\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="interval">{{ \'TOOLS.INTERVAL\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_dc.sortableTable">\n <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm_dc.intervalIntervals.rows">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.id}}</td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.name}}</td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.interval}}</td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" translate="TOOLS.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(interval, $event)" translate="TOOLS.DELETE_INTERVAL">\n Delete Interval\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.intervalIntervals.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="TOOLS.NO_INTERVALS_AVAILABLE">No intervals available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/intervals/intervals.html",'<div id="intervals" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.INTERVALS">Intervals</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedIntervals.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedIntervals =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-intervals-count">\n <span>{{vm.selectedIntervals.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTERVALS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllIntervals()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectIntervals()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedIntervals" csv-label="true" filename="intervals.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedIntervals($event)" aria-label="delete selected" translate translate-attr-label="INTERVALS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- INTERVAL TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedIntervals" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIntervals">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.intervals.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm.intervals.rows">\n <td md-cell ng-if="interval.userpic"><img class="avatar" alt="{{interval.name}}" ng-src="api/users/{{interval.id}}/avatar" /></td>\n <td md-cell ng-if="!interval.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{interval.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditInterval($event, interval)" md-cell class="id ">{{interval.id}}</td>\n <td ng-click="vm.createOrEditInterval($event, interval)" md-cell class="name ">{{interval.name}}</td>\n <td ng-click="vm.createOrEditInterval($event, interval)" md-cell class="description ">{{interval.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(interval, $event)" translate="TOOLS.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(interval, $event)" translate="TOOLS.DELETE_INTERVAL">\n Delete Interval\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.intervals.count}}" md-on-paginate="vm.getIntervals" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / INTERVAL TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD INTERVAL BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-interval-button" ng-click="vm.createOrEditInterval($event)" aria-label="add interval" translate translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD INTERVAL BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/pauses/create/dialog.html",'<md-dialog class="pause-dialog" aria-label="New Pause">\n <form name="pauseForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.pause.name" ng-required="true" autofocus>\n <div ng-messages="pauseForm[\'name\'].$error" ng-show="pauseForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.pause.description">\n <div ng-messages="pauseForm[\'description\'].$error" ng-show="pauseForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newPause" ng-click="vm.savePause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid || pauseForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newPause" ng-click="vm.addNewPause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_PAUSE" translate-attr-aria-label="TOOLS.ADD_PAUSE">\n ADD PAUSE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newPause" ng-click="vm.deletePause($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/pauses/pauses.html",'<div id="pauses" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.PAUSES">Pauses</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedPauses.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedPauses =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-pauses-count">\n <span>{{vm.selectedPauses.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="PAUSES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllPauses()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectPauses()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedPauses" csv-label="true" filename="pauses.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedPauses($event)" aria-label="delete selected" translate translate-attr-label="PAUSES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- PAUSE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedPauses" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getPauses">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.pauses.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="pause" md-select-id="id" ng-repeat="pause in vm.pauses.rows">\n <td md-cell ng-if="pause.userpic"><img class="avatar" alt="{{pause.name}}" ng-src="api/users/{{pause.id}}/avatar" /></td>\n <td md-cell ng-if="!pause.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{pause.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="id ">{{pause.id}}</td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="name ">{{pause.name}}</td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="description ">{{pause.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(pause, $event)" translate="TOOLS.EDIT_PAUSE">\n Edit Pause\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(pause, $event)" translate="TOOLS.DELETE_PAUSE">\n Delete Pause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.pauses.count}}" md-on-paginate="vm.getPauses" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PAUSE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PAUSE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-pause-button" ng-click="vm.createOrEditPause($event)" aria-label="add pause" translate translate-attr-aria-label="TOOLS.ADD_PAUSE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PAUSE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/schedules/create/dialog.html",'<md-dialog class="schedule-dialog" aria-label="New Schedule">\n <form name="scheduleForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.schedule.name" ng-required="true" autofocus>\n <div ng-messages="scheduleForm[\'name\'].$error" ng-show="scheduleForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.REPORTTYPE">ReportType</label>\n <md-select name="type" ng-model="vm.schedule.type" required>\n <md-option ng-value="\'default\'">Default</md-option>\n <md-option ng-value="\'custom\'">Custom</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'type\'].$error" ng-show="scheduleForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORTTYPE_REQUIRED">ReportType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.type == \'default\'" class="md-block">\n <label translate="TOOLS.REPORT">Report</label>\n <md-select name="DefaultReportId" ng-model="vm.schedule.DefaultReportId" required>\n <md-option ng-value="DefaultReportId.id" ng-repeat="DefaultReportId in vm.defaultReports">{{ DefaultReportId.name }}</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'DefaultReportId\'].$error" ng-show="scheduleForm[\'DefaultReportId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.type == \'custom\'" class="md-block">\n <label translate="TOOLS.REPORT">Report</label>\n <md-select name="CustomReportId" ng-model="vm.schedule.CustomReportId" required>\n <md-option ng-value="CustomReportId.id" ng-repeat="CustomReportId in vm.customReports">{{ CustomReportId.name }}</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'CustomReportId\'].$error" ng-show="scheduleForm[\'CustomReportId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OUTPUT">Output</label>\n <md-select name="output" ng-model="vm.schedule.output" required>\n <md-option ng-value="\'csv\'">CSV</md-option>\n <md-option ng-value="\'pdf\'">PDF</md-option>\n <md-option ng-value="\'xlsx\'">Excel</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'output\'].$error" ng-show="scheduleForm[\'output\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTPUT_REQUIRED">Output field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.schedule.active" aria-label="Active"><span translate="TOOLS.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label translate="TOOLS.VALIDITYSTART">ValidityStart</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="startAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="startAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <div class="md-block">\n <label translate="TOOLS.VALIDITYEND">ValidityEnd</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="endAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="endAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <div flex class="md-block">\n <label> {{ \'TOOLS.CRON\' | translate }} ({{vm.schedule.cron}})</label>\n <cron-selection name="cron" ng-model="vm.schedule.cron" template="assets/angular-cron-jobs/template.html" required></cron-selection>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.LAST">Last</label>\n <input type="number" name="subtractNumber" ng-model="vm.schedule.subtractNumber" ng-required="true">\n <div ng-messages="scheduleForm[\'subtractNumber\'].$error" ng-show="scheduleForm[\'subtractNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LAST_REQUIRED">Last field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.LASTUNIT">LastUnit</label>\n <md-select name="subtractUnit" ng-model="vm.schedule.subtractUnit" required>\n <md-option ng-value="\'minutes\'">Minutes</md-option>\n <md-option ng-value="\'hours\'">Hours</md-option>\n <md-option ng-value="\'days\'">Days</md-option>\n <md-option ng-value="\'weeks\'">Weeks</md-option>\n <md-option ng-value="\'months\'">Months</md-option>\n <md-option ng-value="\'quarters\'">Quarters</md-option>\n <md-option ng-value="\'years\'">Years</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'subtractUnit\'].$error" ng-show="scheduleForm[\'subtractUnit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LASTUNIT_REQUIRED">LastUnit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.schedule.sendMail" aria-label="SendMail"><span translate="TOOLS.SENDMAIL">SendMail</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.MAILACCOUNT">MailAccount</label>\n <md-select name="MailAccountId" ng-model="vm.schedule.MailAccountId" required>\n <md-option ng-value="MailAccountId.id" ng-repeat="MailAccountId in vm.mailAccounts">{{ MailAccountId.name }}</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'MailAccountId\'].$error" ng-show="scheduleForm[\'MailAccountId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.MAILACCOUNT_REQUIRED">MailAccount field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.EMAILADDRESS">EmailAddress</label>\n <input type="text" name="email" ng-model="vm.schedule.email" ng-required="true">\n <div class="hint"><span translate="TOOLS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="scheduleForm[\'email\'].$error" ng-show="scheduleForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.schedule.description">\n <div ng-messages="scheduleForm[\'description\'].$error" ng-show="scheduleForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSchedule" ng-click="vm.saveSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid || scheduleForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSchedule" ng-click="vm.addNewSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SCHEDULE" translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n ADD SCHEDULE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSchedule" ng-click="vm.deleteSchedule($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/schedules/schedules.html",'<div id="schedules" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.SCHEDULER">Scheduler</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedScheduler.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedScheduler =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-schedules-count">\n <span>{{vm.selectedScheduler.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SCHEDULER.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllScheduler()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectScheduler()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedScheduler" csv-label="true" filename="schedules.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedScheduler($event)" aria-label="delete selected" translate translate-attr-label="SCHEDULER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- SCHEDULE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedScheduler" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScheduler">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="startAt">{{ \'TOOLS.VALIDITYSTART\' | translate }}</th>\n <th md-column md-order-by="endAt">{{ \'TOOLS.VALIDITYEND\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.schedules.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="schedule" md-select-id="id" ng-repeat="schedule in vm.schedules.rows">\n <td md-cell ng-if="schedule.userpic"><img class="avatar" alt="{{schedule.name}}" ng-src="api/users/{{schedule.id}}/avatar" /></td>\n <td md-cell ng-if="!schedule.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{schedule.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="id ">{{schedule.id}}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="name ">{{schedule.name}}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="active ">\n <md-icon md-colors="{color: {{schedule.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{schedule.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="startAt ">{{schedule.startAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="endAt ">{{schedule.endAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="description ">{{schedule.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(schedule, $event)" translate="TOOLS.EDIT_SCHEDULE">\n Edit Schedule\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(schedule, $event)" translate="TOOLS.DELETE_SCHEDULE">\n Delete Schedule\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.schedules.count}}" md-on-paginate="vm.getScheduler" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SCHEDULE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SCHEDULE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-schedule-button" ng-click="vm.createOrEditSchedule($event)" aria-label="add schedule" translate translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SCHEDULE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/create/dialog.html",'<md-dialog class="sound-dialog" aria-label="New Sound">\n <form name="soundForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sound.name" ng-required="true" autofocus>\n <div ng-messages="soundForm[\'name\'].$error" ng-show="soundForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sound.description">\n <div ng-messages="soundForm[\'description\'].$error" ng-show="soundForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSound" ng-click="vm.saveSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid || soundForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSound" ng-click="vm.addNewSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SOUND" translate-attr-aria-label="TOOLS.ADD_SOUND">\n ADD SOUND\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSound" ng-click="vm.deleteSound($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/sounds/sounds.html",'<div id="sounds" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.SOUNDS">Sounds</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSounds.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSounds =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-sounds-count">\n <span>{{vm.selectedSounds.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SOUNDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSounds()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSounds()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSounds" csv-label="true" filename="sounds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedSounds($event)" aria-label="delete selected" translate translate-attr-label="SOUNDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- SOUND TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSounds" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSounds">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'TOOLS.AUDIO\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.sounds.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="sound" md-select-id="id" ng-repeat="sound in vm.sounds.rows">\n <td md-cell ng-if="sound.userpic"><img class="avatar" alt="{{sound.name}}" ng-src="api/users/{{sound.id}}/avatar" /></td>\n <td md-cell ng-if="!sound.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sound.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="id ">{{sound.id}}</td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="name ">{{sound.name}}</td>\n <td md-cell class="audio ">\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="sound.id" model="\'sound\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="description ">{{sound.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(sound, $event)" translate="TOOLS.EDIT_SOUND">\n Edit Sound\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(sound, $event)" translate="TOOLS.DOWNLOAD_SOUND">\n Download Sound\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(sound, $event)" translate="TOOLS.DELETE_SOUND">\n Delete Sound\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.sounds.count}}" md-on-paginate="vm.getSounds" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SOUND TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SOUND BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-sound-button" ng-click="vm.uploadSound($event)" aria-label="add sound" translate translate-attr-aria-label="SOUNDS.ADD_SOUND">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SOUND BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/uploadsound/dialog.html",'<md-dialog class="upload-dialog" aria-label="Upload Sound">\n <form name="uploadForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="sound-uploader" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)" flow-complete="vm.uploadComplete()" flow-drop\n flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="TOOLS.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="TOOLS.DROP_TO_UPLOAD_MESSAGE">You can also drop audio here to upload. Only MP3, WAV, GSM - Max. 15MB</span>\n </div>\n\n <div layout="row" layout-align="start start">\n <div ng-repeat="sound in vm.uploadSounds | orderBy:\'-\'" ng-switch="sound.type">\n <div class="sound-image" ng-switch-when="uploading" flex>\n <img class="media" src="assets/images/music-player/uploading.png">\n <md-progress-linear md-mode="indeterminate"></md-progress-linear>\n <span class="text-truncate">{{sound.file.name}}</span>\n </div>\n <div class="sound-image" ng-switch-when="sound" flex>\n <img class="media" src="assets/images/music-player/success.png">\n <span class="text-truncate">{{sound.file.name}}</span>\n </div>\n </div>\n </div>\n\n\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center"></div>\n <div layout="row">\n <md-button ng-click="vm.closeDialog()" class="md-accent md-raised" aria-label="FINISH" translate="TOOLS.FINISH" translate-attr-aria-label="TOOLS.FINISH">\n FINISH\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/create/dialog.html",'<md-dialog class="tag-dialog" aria-label="New Tag">\n <form name="tagForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.tag.name" ng-required="true" autofocus>\n <div ng-messages="tagForm[\'name\'].$error" ng-show="tagForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.tag.description">\n <div ng-messages="tagForm[\'description\'].$error" ng-show="tagForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <div flex md-color-picker ng-model="vm.tag.color" label="{{\'TOOLS.COLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newTag" ng-click="vm.saveTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid || tagForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newTag" ng-click="vm.addNewTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TAG" translate-attr-aria-label="TOOLS.ADD_TAG">\n ADD TAG\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newTag" ng-click="vm.deleteTag($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/tags.html",'<div id="tags" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TAGS">Tags</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTags.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTags =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-tags-count">\n <span>{{vm.selectedTags.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TAGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTags()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTags()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTags" csv-label="true" filename="tags.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedTags($event)" aria-label="delete selected" translate translate-attr-label="TAGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- TAG TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTags" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTags">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="color">{{ \'TOOLS.COLOR\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.tags.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="tag" md-select-id="id" ng-repeat="tag in vm.tags.rows">\n <td md-cell ng-if="tag.userpic"><img class="avatar" alt="{{tag.name}}" ng-src="api/users/{{tag.id}}/avatar" /></td>\n <td md-cell ng-if="!tag.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{tag.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="id ">{{tag.id}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="name ">{{tag.name}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="description ">{{tag.description}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="color ">{{tag.color}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(tag, $event)" translate="TOOLS.EDIT_TAG">\n Edit Tag\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(tag, $event)" translate="TOOLS.DELETE_TAG">\n Delete Tag\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.tags.count}}" md-on-paginate="vm.getTags" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TAG TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TAG BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-tag-button" ng-click="vm.createOrEditTag($event)" aria-label="add tag" translate translate-attr-aria-label="TOOLS.ADD_TAG">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TAG BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/templates/create/dialog.html",'<md-dialog class="template-dialog" aria-label="New Template">\n <form name="templateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.template.name" ng-required="true" autofocus>\n <div ng-messages="templateForm[\'name\'].$error" ng-show="templateForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="TOOLS.CONTENT">Content</label>\n <textarea aria-label="Content html" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.template.html"></textarea>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.template.description">\n <div ng-messages="templateForm[\'description\'].$error" ng-show="templateForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newTemplate" ng-click="vm.saveTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid || templateForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newTemplate" ng-click="vm.addNewTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TEMPLATE" translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n ADD TEMPLATE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newTemplate" ng-click="vm.deleteTemplate($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/templates/templates.html",'<div id="templates" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TEMPLATES">Templates</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTemplates.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTemplates =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-templates-count">\n <span>{{vm.selectedTemplates.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TEMPLATES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTemplates()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTemplates()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTemplates" csv-label="true" filename="templates.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedTemplates($event)" aria-label="delete selected" translate translate-attr-label="TEMPLATES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- TEMPLATE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTemplates" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTemplates">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.templates.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="template" md-select-id="id" ng-repeat="template in vm.templates.rows">\n <td md-cell ng-if="template.userpic"><img class="avatar" alt="{{template.name}}" ng-src="api/users/{{template.id}}/avatar" /></td>\n <td md-cell ng-if="!template.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{template.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="id ">{{template.id}}</td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="name ">{{template.name}}</td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="description ">{{template.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(template, $event)" translate="TOOLS.EDIT_TEMPLATE">\n Edit Template\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(template, $event)" translate="TOOLS.DELETE_TEMPLATE">\n Delete Template\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.templates.count}}" md-on-paginate="vm.getTemplates" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TEMPLATE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TEMPLATE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-template-button" ng-click="vm.createOrEditTemplate($event)" aria-label="add template" translate translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TEMPLATE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/triggers/create/dialog.html",'<md-dialog class="trigger-dialog" aria-label="New Trigger">\n <form name="triggerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trigger.name" ng-required="true" autofocus>\n <div ng-messages="triggerForm[\'name\'].$error" ng-show="triggerForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.trigger.channel" required ng-disabled="!vm.newTrigger">\n\n <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }}</md-option>\n\n <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel"> {{ \'TOOLS.OPENCHANNEL\' | translate }}</md-option>\n\n <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }}</md-option>\n\n <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }}</md-option>\n\n <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }}</md-option>\n\n <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }}</md-option>\n </md-select>\n <div ng-messages="triggerForm[\'channel\'].$error" ng-show="triggerForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trigger.status" aria-label="Status"><span translate="TOOLS.STATUS">Status</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trigger.description">\n <div ng-messages="triggerForm[\'description\'].$error" ng-show="triggerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newTrigger" ng-click="vm.saveTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid || triggerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newTrigger" ng-click="vm.addNewTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRIGGER" translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n ADD TRIGGER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newTrigger" ng-click="vm.deleteTrigger($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/actions/dialog.html",'<md-dialog class="action-dialog" aria-label="New Action">\n <form name="actionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.ACTION">Action</label>\n <md-select name="action" ng-model="vm.action.action" required autofocus ng-disabled="!vm.newAction">\n\n <md-option ng-value="\'contactManager\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CONTACT_MANAGER\' | translate }}</md-option>\n\n <md-option ng-value="\'integration\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.INTEGRATIONS\' | translate }}</md-option>\n\n <md-option ng-value="\'motionbar\'"> {{ \'TOOLS.MOTION_BAR\' | translate }}</md-option>\n\n <md-option ng-value="\'jscripty\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.JSCRIPTY\' | translate }}</md-option>\n\n <md-option ng-value="\'urlForward\'"> {{ \'TOOLS.URL_FORWARD\' | translate }}</md-option>\n\n <md-option ng-value="\'browser\'"> {{ \'TOOLS.BROWSER\' | translate }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'action\'].$error" ng-show="actionForm[\'action\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACTION_REQUIRED">Action field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'jscripty\'" class="md-block">\n <label translate="TOOLS.PROJECT">Project</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.projects">{{ data1.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'0\'">Popup</md-option>\n <md-option ng-value="\'1\'">CTI URL</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.LIST">List</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.lists">{{ data1.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.AUTOCREATECONTACT">AutoCreateContact</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n\n <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.AUTOCREATECONTACT_REQUIRED">AutoCreateContact field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'GET\'">GET</md-option>\n <md-option ng-value="\'POST\'">POST</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\'" class="md-block">\n <label translate="TOOLS.INTEGRATION">Integration</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'zendesk\'">Zendesk</md-option>\n <md-option ng-value="\'salesforce\'">Salesforce</md-option>\n <md-option ng-value="\'sugarcrm\'">SugarCRM</md-option>\n <md-option ng-value="\'freshdesk\'">Freshdesk</md-option>\n <md-option ng-value="\'desk\'">Desk</md-option>\n <md-option ng-value="\'zoho\'">Zoho</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.INTEGRATION_REQUIRED">Integration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zendesk\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.zendeskAccounts">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'desk\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.deskAccounts">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zoho\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.zohoAccounts">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'salesforce\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.salesforceAccounts">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'sugarcrm\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.sugarcrmAccounts">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'freshdesk\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.freshdeskAccounts">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zendesk\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.zendeskConfigurations | filter:{AccountId:vm.action.data2}">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'desk\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.deskConfigurations | filter:{AccountId:vm.action.data2}">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zoho\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.zohoConfigurations | filter:{AccountId:vm.action.data2}">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'salesforce\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.salesforceConfigurations | filter:{AccountId:vm.action.data2}">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'sugarcrm\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.sugarcrmConfigurations | filter:{AccountId:vm.action.data2}">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'freshdesk\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.freshdeskConfigurations | filter:{AccountId:vm.action.data2}">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'0\'">Popup</md-option>\n <md-option ng-value="\'1\'">CTI URL</md-option>\n <md-option ng-value="\'2\'">Windows App</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n <label translate="TOOLS.APPLICATION">Application</label>\n <input type="text" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n <label translate="TOOLS.ARGUMENTS">Arguments</label>\n <input type="text" name="data3" ng-model="vm.action.data3">\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'0\'" class="md-block">\n <label translate="TOOLS.TEMPLATE">Template</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'0\'" class="md-block">\n <label translate="TOOLS.TEMPLATE">Template</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.action.action == \'motionbar\' || vm.action.action == \'browser\') && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.EVENTVARIABLES">EventVariables</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n\n <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.EVENTVARIABLES"></span></div>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EVENTVARIABLES_REQUIRED">EventVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.LOCATION">Location</label>\n <md-select name="data4" ng-model="vm.action.data4" required>\n\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NEW_TAB\' | translate }}</md-option>\n\n <md-option ng-value="\'1\'"> {{ \'TOOLS.NEW_WINDOW\' | translate }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data4\'].$error" ng-show="actionForm[\'data4\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LOCATION_REQUIRED">Location field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n <label translate="TOOLS.WINDOWWIDTH">WindowWidth</label>\n <input type="text" name="data5" ng-model="vm.action.data5">\n <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.WINDOWWIDTH_REQUIRED">WindowWidth field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n <label translate="TOOLS.WINDOWHEIGHT">WindowHeight</label>\n <input type="text" name="data6" ng-model="vm.action.data6">\n <div ng-messages="actionForm[\'data6\'].$error" ng-show="actionForm[\'data6\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.WINDOWHEIGHT_REQUIRED">WindowHeight field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newAction" ng-click="vm.saveAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid || actionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newAction" ng-click="vm.addNewAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ACTION" translate-attr-aria-label="TOOLS.ADD_ACTION">\n ADD ACTION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newAction" ng-click="vm.deleteAction($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/allconditions/dialog.html",'<md-dialog class="allCondition-dialog" aria-label="New AllCondition">\n <form name="allConditionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.FIELD">Field</label>\n <md-select name="field" ng-model="vm.allCondition.field" required autofocus>\n\n <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }}</md-option>\n\n <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }}</md-option>\n\n <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }}</md-option>\n\n <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.INTERACTION\' | translate }}</md-option>\n\n <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'field\'].$error" ng-show="allConditionForm[\'field\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OPERATOR">Operator</label>\n <md-select name="operator" ng-model="vm.allCondition.operator" required>\n\n <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }}</md-option>\n\n <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'operator\'].$error" ng-show="allConditionForm[\'operator\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'chat\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.chatAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'mail\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.mailAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'sms\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.smsAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'fax\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.faxAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'openchannel\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.openchannelAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.QUEUE">Queue</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.queues">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.outboundRoutes">{{ value.exten }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'lastevent\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'abandoned\'">Abandon</md-option>\n <md-option ng-value="\'complete\'">Hangup</md-option>\n <md-option ng-value="\'rejected\'">Reject</md-option>\n <md-option ng-value="\'called\'">Ring</md-option>\n <md-option ng-value="\'connect\'">Answer</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'opened\'">Opened</md-option>\n <md-option ng-value="\'closed\'">Closed</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'in\'">Incoming</md-option>\n <md-option ng-value="\'out\'">Outgoing</md-option>\n <md-option ng-value="\'accept\'">Accepted</md-option>\n <md-option ng-value="\'reject\'">Rejected</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newAllCondition" ng-click="vm.saveAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid || allConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newAllCondition" ng-click="vm.addNewAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ALLCONDITION" translate-attr-aria-label="TOOLS.ADD_ALLCONDITION">\n ADD ALLCONDITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newAllCondition" ng-click="vm.deleteAllCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/anyconditions/dialog.html",'<md-dialog class="anyCondition-dialog" aria-label="New AnyCondition">\n <form name="anyConditionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.FIELD">Field</label>\n <md-select name="field" ng-model="vm.anyCondition.field" required autofocus>\n\n <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }}</md-option>\n\n <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }}</md-option>\n\n <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }}</md-option>\n\n <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.INTERACTION\' | translate }}</md-option>\n\n <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'field\'].$error" ng-show="anyConditionForm[\'field\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OPERATOR">Operator</label>\n <md-select name="operator" ng-model="vm.anyCondition.operator" required>\n\n <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }}</md-option>\n\n <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'operator\'].$error" ng-show="anyConditionForm[\'operator\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'chat\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.chatAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'mail\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.mailAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'sms\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.smsAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'fax\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.faxAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'openchannel\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.openchannelAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.QUEUE">Queue</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.queues">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.outboundRoutes">{{ value.exten }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'lastevent\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'abandoned\'">Abandon</md-option>\n <md-option ng-value="\'complete\'">Hangup</md-option>\n <md-option ng-value="\'rejected\'">Reject</md-option>\n <md-option ng-value="\'called\'">Ring</md-option>\n <md-option ng-value="\'connect\'">Answer</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'opened\'">Opened</md-option>\n <md-option ng-value="\'closed\'">Closed</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'in\'">Incoming</md-option>\n <md-option ng-value="\'out\'">Outgoing</md-option>\n <md-option ng-value="\'accept\'">Accepted</md-option>\n <md-option ng-value="\'reject\'">Rejected</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newAnyCondition" ng-click="vm.saveAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid || anyConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newAnyCondition" ng-click="vm.addNewAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ANYCONDITION" translate-attr-aria-label="TOOLS.ADD_ANYCONDITION">\n ADD ANYCONDITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newAnyCondition" ng-click="vm.deleteAnyCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/view.html",'<div id="tools-trigger" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-triggers-button md-icon-button" aria-label="Go to triggers" ng-click="vm.gotoTriggers()" translate translate-attr-aria-label="TOOLS.GO_TO_TRIGGERS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="trigger-image" hide-xs>\n <img ng-src="assets/images/business/triggers.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.trigger.id}}\n <span ng-if="vm.trigger.name">{{vm.trigger.name}}</span>\n <span ng-if="vm.trigger.exten">{{vm.trigger.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.trigger.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveTrigger()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (allconditionsForm.$invalid) || (anyconditionsForm.$invalid) || (actionsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="trigger-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trigger.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.trigger.channel" required ng-disabled="true">\n\n <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }}</md-option>\n\n <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel"> {{ \'TOOLS.OPENCHANNEL\' | translate }}</md-option>\n\n <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }}</md-option>\n\n <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }}</md-option>\n\n <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }}</md-option>\n\n <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'channel\'].$error" ng-show="generalForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trigger.status" aria-label="Status"><span translate="TOOLS.STATUS">Status</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trigger.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.CONDITIONS&ACTIONS">CONDITIONS&ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="trigger-detail-form-container allconditions md-background-bg md-whiteframe-1dp">\n <div ng-controller="TriggerAllConditionsController as vm_dc" ng-init="vm_dc.init(vm.trigger)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerAllConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ALLCONDITIONS">AllConditions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAllCondition($event)" aria-label="add allCondition" translate translate-attr-label="TOOLS.ADD_ALLCONDITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerAllConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedTriggerAllConditions.length}} {{vm_dc.selectedTriggerAllConditions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerAllConditions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerAllConditions($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerAllConditions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerAllConditions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="field">{{ \'TOOLS.FIELD\' | translate }}</th>\n <th md-column md-order-by="operator">{{ \'TOOLS.OPERATOR\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="allCondition" md-select-id="id" ng-repeat="allCondition in vm_dc.triggerAllConditions.rows">\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{allCondition.id}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayfield[allCondition.field].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayoperator[allCondition.operator].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="!allCondition.value" md-cell>{{allCondition.value}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'chat\' && allCondition.field == \'account\'" md-cell>{{ value = vm_dc.chatAccounts[allCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'mail\' && allCondition.field == \'account\'" md-cell>{{ value = vm_dc.mailAccounts[allCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'sms\' && allCondition.field == \'account\'" md-cell>{{ value = vm_dc.smsAccounts[allCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'fax\' && allCondition.field == \'account\'" md-cell>{{ value = vm_dc.faxAccounts[allCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'openchannel\' && allCondition.field == \'account\'" md-cell>{{ value = vm_dc.openchannelAccounts[allCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'queue\'" md-cell>{{ value = vm_dc.queues[allCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'routeId\'" md-cell>{{ value = vm_dc.outboundRoutes[allCondition.value]; value.exten }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'lastevent\'" md-cell>{{ vm_dc.callStatusValues[allCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'interaction\'" md-cell>{{ vm_dc.interactionStatusValues[allCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'message\'" md-cell>{{ vm_dc.messageStatusValues[allCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{allCondition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" translate="TOOLS.EDIT_ALLCONDITION">\n Edit AllCondition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(allCondition, $event)" translate="TOOLS.DELETE_ALLCONDITION">\n Delete AllCondition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.triggerAllConditions.rows.length">\n <td md-cell colspan="17">\n <span class="text-boxed-ligth" translate="TOOLS.NO_ALLCONDITION_AVAILABLE">No allcondition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.triggerAllConditions.count}}" md-on-paginate="vm_dc.getTriggerAllConditions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n <div class="trigger-detail-form-container anyconditions md-background-bg md-whiteframe-1dp">\n <div ng-controller="TriggerAnyConditionsController as vm_dc" ng-init="vm_dc.init(vm.trigger)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerAnyConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ANYCONDITIONS">AnyConditions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAnyCondition($event)" aria-label="add anyCondition" translate translate-attr-label="TOOLS.ADD_ANYCONDITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerAnyConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedTriggerAnyConditions.length}} {{vm_dc.selectedTriggerAnyConditions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerAnyConditions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerAnyConditions($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerAnyConditions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerAnyConditions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="field">{{ \'TOOLS.FIELD\' | translate }}</th>\n <th md-column md-order-by="operator">{{ \'TOOLS.OPERATOR\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="anyCondition" md-select-id="id" ng-repeat="anyCondition in vm_dc.triggerAnyConditions.rows">\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{anyCondition.id}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayfield[anyCondition.field].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayoperator[anyCondition.operator].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="!anyCondition.value" md-cell>{{anyCondition.value}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'chat\' && anyCondition.field == \'account\'" md-cell>{{ value = vm_dc.chatAccounts[anyCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'mail\' && anyCondition.field == \'account\'" md-cell>{{ value = vm_dc.mailAccounts[anyCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'sms\' && anyCondition.field == \'account\'" md-cell>{{ value = vm_dc.smsAccounts[anyCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'fax\' && anyCondition.field == \'account\'" md-cell>{{ value = vm_dc.faxAccounts[anyCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'openchannel\' && anyCondition.field == \'account\'" md-cell>{{ value = vm_dc.openchannelAccounts[anyCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'queue\'" md-cell>{{ value = vm_dc.queues[anyCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'routeId\'" md-cell>{{ value = vm_dc.outboundRoutes[anyCondition.value]; value.exten }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'lastevent\'" md-cell>{{ vm_dc.callStatusValues[anyCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'interaction\'" md-cell>{{ vm_dc.interactionStatusValues[anyCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'message\'" md-cell>{{ vm_dc.messageStatusValues[anyCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{anyCondition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" translate="TOOLS.EDIT_ANYCONDITION">\n Edit AnyCondition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(anyCondition, $event)" translate="TOOLS.DELETE_ANYCONDITION">\n Delete AnyCondition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.triggerAnyConditions.rows.length">\n <td md-cell colspan="17">\n <span class="text-boxed-ligth" translate="TOOLS.NO_ANYCONDITION_AVAILABLE">No anycondition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.triggerAnyConditions.count}}" md-on-paginate="vm_dc.getTriggerAnyConditions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n <div class="trigger-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="TriggerActionsController as vm_dc" ng-init="vm_dc.init(vm.trigger)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ACTIONS">Actions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAction($event)" aria-label="add action" translate translate-attr-label="TOOLS.ADD_ACTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedTriggerActions.length}} {{vm_dc.selectedTriggerActions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerActions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerActions($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerActions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerActions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="action">{{ \'TOOLS.ACTION\' | translate }}</th>\n <th md-column md-order-by="data1">{{ \'TOOLS.TYPE\' | translate }}</th>\n <th md-column md-order-by="data2">{{ \'TOOLS.INFO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="action" md-select-id="id" ng-repeat="action in vm_dc.triggerActions.rows">\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>{{action.id}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayaction[action.action].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'jscripty\'" md-cell>{{ data1 = vm_dc.projects[action.data1]; data1.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\'" md-cell>{{ vm_dc.browserValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>{{ data1 = vm_dc.lists[action.data1]; data1.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>{{ \'TOOLS.\' + vm_dc.autoCreateContact[action.data2].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>{{ vm_dc.urlForwardValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="!action.data2" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\'" md-cell>{{ vm_dc.integrationValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zendesk\'" md-cell>{{ data2 = vm_dc.zendeskAccounts[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'desk\'" md-cell>{{ data2 = vm_dc.deskAccounts[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zoho\'" md-cell>{{ data2 = vm_dc.zohoAccounts[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'salesforce\'" md-cell>{{ data2 = vm_dc.salesforceAccounts[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'sugarcrm\'" md-cell>{{ data2 = vm_dc.sugarcrmAccounts[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'freshdesk\'" md-cell>{{ data2 = vm_dc.freshdeskAccounts[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\'" md-cell>{{ vm_dc.motionbarValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 == \'1\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 == \'2\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 == \'0\'" md-cell>{{ data2 = vm_dc.templates[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 == \'0\'" md-cell>{{ data2 = vm_dc.templates[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 == \'1\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>{{action.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditTriggerAction($event, action)" translate="TOOLS.EDIT_ACTION">\n Edit Action\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(action, $event)" translate="TOOLS.DELETE_ACTION">\n Delete Action\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.triggerActions.rows.length">\n <td md-cell colspan="36">\n <span class="text-boxed-ligth" translate="TOOLS.NO_ACTION_AVAILABLE">No action available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.triggerActions.count}}" md-on-paginate="vm_dc.getTriggerActions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/triggers/triggers.html",'<div id="triggers" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TRIGGERS">Triggers</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTriggers.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTriggers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-triggers-count">\n <span>{{vm.selectedTriggers.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TRIGGERS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTriggers()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTriggers()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTriggers" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedTriggers($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- TRIGGER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTriggers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTriggers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="channel">{{ \'TOOLS.CHANNEL\' | translate }}</th>\n <th md-column md-order-by="status">{{ \'TOOLS.STATUS\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.triggers.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="trigger" md-select-id="id" ng-repeat="trigger in vm.triggers.rows">\n <td md-cell ng-if="trigger.userpic"><img class="avatar" alt="{{trigger.name}}" ng-src="api/users/{{trigger.id}}/avatar" /></td>\n <td md-cell ng-if="!trigger.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{trigger.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="id ">{{trigger.id}}</td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="name ">{{trigger.name}}</td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="channel ">{{ \'TOOLS.\' + vm.arraychannel[trigger.channel].option | uppercase | translate }}</td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="status ">\n <md-icon md-colors="{color: {{trigger.status ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{trigger.status ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="description ">{{trigger.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(trigger, $event)" translate="TOOLS.EDIT_TRIGGER">\n Edit Trigger\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(trigger, $event)" translate="TOOLS.DELETE_TRIGGER">\n Delete Trigger\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.triggers.count}}" md-on-paginate="vm.getTriggers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TRIGGER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TRIGGER BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-trigger-button" ng-click="vm.createOrEditTrigger($event)" aria-label="add trigger" translate translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TRIGGER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/trunks/create/dialog.html",'<md-dialog class="trunk-dialog" aria-label="New Trunk">\n <form name="trunkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newTrunk">\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="trunkForm[\'name\'].$error" ng-show="trunkForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.HOST">host</label>\n <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true">\n <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n <div ng-messages="trunkForm[\'host\'].$error" ng-show="trunkForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SECRET">secret</label>\n <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n <div ng-messages="trunkForm[\'secret\'].$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser">\n <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n <div ng-messages="trunkForm[\'defaultuser\'].$error" ng-show="trunkForm[\'defaultuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.REGISTRY">registry</label>\n <input type="text" name="registry" ng-model="vm.trunk.registry">\n <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n <div ng-messages="trunkForm[\'registry\'].$error" ng-show="trunkForm[\'registry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trunk.description">\n <div ng-messages="trunkForm[\'description\'].$error" ng-show="trunkForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newTrunk" ng-click="vm.saveTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid || trunkForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newTrunk" ng-click="vm.addNewTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRUNK" translate-attr-aria-label="TOOLS.ADD_TRUNK">\n ADD TRUNK\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newTrunk" ng-click="vm.deleteTrunk($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/trunks/edit/view.html",'<div id="tools-trunk" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-trunks-button md-icon-button" aria-label="Go to trunks" ng-click="vm.gotoTrunks()" translate translate-attr-aria-label="TOOLS.GO_TO_TRUNKS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="trunk-image" hide-xs>\n <img ng-src="assets/images/business/trunks.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.trunk.id}}\n <span ng-if="vm.trunk.name">{{vm.trunk.name}}</span>\n <span ng-if="vm.trunk.exten">{{vm.trunk.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.trunk.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.trunk, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="TOOLS.GOTO_TRUNK"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTrunk()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (otherFieldsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="trunk-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.HOST">host</label>\n <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true">\n <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SECRET">secret</label>\n <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n <div ng-messages="generalForm[\'secret\'].$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser">\n <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n <div ng-messages="generalForm[\'defaultuser\'].$error" ng-show="generalForm[\'defaultuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CONTEXT">context</label>\n <md-select name="context" ng-model="vm.trunk.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.CONTEXT"></span></div>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONTEXT_REQUIRED">context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALLERID">callerid</label>\n <input type="text" name="callerid" ng-model="vm.trunk.callerid" ng-required="true">\n <div class="hint"><span translate="TOOLS.HELP.CALLERID"></span></div>\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALLERID_REQUIRED">callerid field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.trunk.type" required>\n <md-option ng-value="\'friend\'">Friend</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n <md-option ng-value="\'peer\'">Peer</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TYPE"></span></div>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DTMFMODE">dtmfmode</label>\n <md-select name="dtmfmode" ng-model="vm.trunk.dtmfmode" required>\n <md-option ng-value="\'rfc2833\'">rfc2833</md-option>\n <md-option ng-value="\'info\'">info</md-option>\n <md-option ng-value="\'shortinfo\'">shortinfo</md-option>\n <md-option ng-value="\'inband\'">inband</md-option>\n <md-option ng-value="\'auto\'">auto</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.DTMFMODE"></span></div>\n <div ng-messages="generalForm[\'dtmfmode\'].$error" ng-show="generalForm[\'dtmfmode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DTMFMODE_REQUIRED">dtmfmode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAT">nat</label>\n <md-select name="nat" ng-model="vm.trunk.nat" required multiple>\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAT_REQUIRED">nat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.QUALIFY">qualify</label>\n <md-select name="qualify" ng-model="vm.trunk.qualify" required>\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.QUALIFY"></span></div>\n <div ng-messages="generalForm[\'qualify\'].$error" ng-show="generalForm[\'qualify\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUALIFY_REQUIRED">qualify field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.trunk.allow" required multiple>\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g723\'">g723</md-option>\n <md-option ng-value="\'g726\'">g726</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'ilbc\'">ilbc</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.INSECURE">insecure</label>\n <md-select name="insecure" ng-model="vm.trunk.insecure" required multiple>\n <md-option ng-value="\'port\'">port</md-option>\n <md-option ng-value="\'invite\'">invite</md-option>\n <md-option ng-value="\'very\'">very</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.INSECURE"></span></div>\n <div ng-messages="generalForm[\'insecure\'].$error" ng-show="generalForm[\'insecure\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.INSECURE_REQUIRED">insecure field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALL_LIMIT">call_limit</label>\n <input type="number" name="call_limit" ng-model="vm.trunk.call_limit">\n <div class="hint"><span translate="TOOLS.HELP.CALL_LIMIT"></span></div>\n <div ng-messages="generalForm[\'call_limit\'].$error" ng-show="generalForm[\'call_limit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALL_LIMIT_REQUIRED">call_limit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trunk.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="trunk-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.REGISTRY">registry</label>\n <input type="text" name="registry" ng-model="vm.trunk.registry" autofocus>\n <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n <div ng-messages="advancedForm[\'registry\'].$error" ng-show="advancedForm[\'registry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DIRECTMEDIA">directmedia</label>\n <md-select name="directmedia" ng-model="vm.trunk.directmedia" required>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'nonat\'">nonat</md-option>\n <md-option ng-value="\'update\'">update</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.DIRECTMEDIA"></span></div>\n <div ng-messages="advancedForm[\'directmedia\'].$error" ng-show="advancedForm[\'directmedia\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DIRECTMEDIA_REQUIRED">directmedia field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALLCOUNTER">callcounter</label>\n <md-select name="callcounter" ng-model="vm.trunk.callcounter" required>\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.CALLCOUNTER"></span></div>\n <div ng-messages="advancedForm[\'callcounter\'].$error" ng-show="advancedForm[\'callcounter\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALLCOUNTER_REQUIRED">callcounter field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.FROMDOMAIN">fromdomain</label>\n <input type="text" name="fromdomain" ng-model="vm.trunk.fromdomain">\n <div class="hint"><span translate="TOOLS.HELP.FROMDOMAIN"></span></div>\n <div ng-messages="advancedForm[\'fromdomain\'].$error" ng-show="advancedForm[\'fromdomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FROMDOMAIN_REQUIRED">fromdomain field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.FROMUSER">fromuser</label>\n <input type="text" name="fromuser" ng-model="vm.trunk.fromuser">\n <div class="hint"><span translate="TOOLS.HELP.FROMUSER"></span></div>\n <div ng-messages="advancedForm[\'fromuser\'].$error" ng-show="advancedForm[\'fromuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FROMUSER_REQUIRED">fromuser field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OUTBOUNDPROXY">outboundproxy</label>\n <input type="text" name="outboundproxy" ng-model="vm.trunk.outboundproxy">\n <div class="hint"><span translate="TOOLS.HELP.OUTBOUNDPROXY"></span></div>\n <div ng-messages="advancedForm[\'outboundproxy\'].$error" ng-show="advancedForm[\'outboundproxy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDPROXY_REQUIRED">outboundproxy field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ADD_PHONE_TO_URI">Add_phone_to_URI</label>\n <md-select name="usereqphone" ng-model="vm.trunk.usereqphone" required>\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ADD_PHONE_TO_URI"></span></div>\n <div ng-messages="advancedForm[\'usereqphone\'].$error" ng-show="advancedForm[\'usereqphone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ADD_PHONE_TO_URI_REQUIRED">Add_phone_to_URI field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TRUST_REMOTE_PARTY_ID">Trust_Remote_Party_ID</label>\n <md-select name="trustrpid" ng-model="vm.trunk.trustrpid" required>\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TRUST_REMOTE_PARTY_ID"></span></div>\n <div ng-messages="advancedForm[\'trustrpid\'].$error" ng-show="advancedForm[\'trustrpid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TRUST_REMOTE_PARTY_ID_REQUIRED">Trust_Remote_Party_ID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SEND_REMOTE_PARTY_ID_HEADER">Send_Remote_Party_ID_header</label>\n <md-select name="sendrpid" ng-model="vm.trunk.sendrpid" required>\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n\n <md-option ng-value="\'pai\'"> {{ \'TOOLS.PAI\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.SEND_REMOTE_PARTY_ID_HEADER"></span></div>\n <div ng-messages="advancedForm[\'sendrpid\'].$error" ng-show="advancedForm[\'sendrpid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SEND_REMOTE_PARTY_ID_HEADER_REQUIRED">Send_Remote_Party_ID_header field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ENCRYPTION">encryption</label>\n <md-select name="encryption" ng-model="vm.trunk.encryption" required>\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ENCRYPTION"></span></div>\n <div ng-messages="advancedForm[\'encryption\'].$error" ng-show="advancedForm[\'encryption\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ENCRYPTION_REQUIRED">encryption field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.PORT">port</label>\n <input type="number" name="port" ng-model="vm.trunk.port">\n <div class="hint"><span translate="TOOLS.HELP.PORT"></span></div>\n <div ng-messages="advancedForm[\'port\'].$error" ng-show="advancedForm[\'port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PORT_REQUIRED">port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.trunk.transport" required multiple>\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TRANSPORT"></span></div>\n <div ng-messages="advancedForm[\'transport\'].$error" ng-show="advancedForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.T38PT_UDPTL">t38pt_udptl</label>\n <input type="string" name="t38pt_udptl" ng-model="vm.trunk.t38pt_udptl">\n <div class="hint"><span translate="TOOLS.HELP.T38PT_UDPTL"></span></div>\n <div ng-messages="advancedForm[\'t38pt_udptl\'].$error" ng-show="advancedForm[\'t38pt_udptl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.T38PT_UDPTL_REQUIRED">t38pt_udptl field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.OTHERFIELDS">OTHERFIELDS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="trunk-detail-form-container otherfields md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.OTHERFIELDS">OTHERFIELDS</div>\n </div>\n <form name="otherFieldsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.OTHERFIELDS">otherFields</label>\n <textarea name="otherFields" ng-model="vm.trunk.otherFields" autofocus></textarea>\n <div class="hint"><span translate="TOOLS.HELP.OTHERFIELDS"></span></div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/trunks/trunks.html",'<div id="trunks" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TRUNKS">Trunks</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTrunks.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTrunks =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-trunks-count">\n <span>{{vm.selectedTrunks.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TRUNKS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTrunks()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTrunks()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTrunks" csv-label="true" filename="trunks.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedTrunks($event)" aria-label="delete selected" translate translate-attr-label="TRUNKS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- TRUNK TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTrunks" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="host">{{ \'TOOLS.HOST\' | translate }}</th>\n <th md-column md-order-by="registry">{{ \'TOOLS.REGISTRY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="trunk" md-select-id="id" ng-repeat="trunk in vm.trunks.rows">\n <td md-cell ng-if="trunk.userpic"><img class="avatar" alt="{{trunk.name}}" ng-src="api/users/{{trunk.id}}/avatar" /></td>\n <td md-cell ng-if="!trunk.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{trunk.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTrunk($event, trunk)" md-cell class="id ">{{trunk.id}}</td>\n <td ng-click="vm.createOrEditTrunk($event, trunk)" md-cell class="name ">{{trunk.name}}</td>\n <td ng-click="vm.createOrEditTrunk($event, trunk)" md-cell class="active ">\n <md-icon md-colors="{color: {{trunk.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{trunk.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditTrunk($event, trunk)" md-cell class="host ">{{trunk.host}}</td>\n <td ng-click="vm.createOrEditTrunk($event, trunk)" md-cell class="registry ">{{trunk.registry}}</td>\n <td ng-click="vm.createOrEditTrunk($event, trunk)" md-cell class="description ">{{trunk.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(trunk, $event)" translate="TOOLS.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(trunk, $event)" translate="TOOLS.GOTOREALTIME_TRUNK">\n goToRealtime Trunk\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(trunk, $event)" translate="TOOLS.DELETE_TRUNK">\n Delete Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.trunks.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TRUNK TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TRUNK BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-trunk-button" ng-click="vm.createOrEditTrunk($event)" aria-label="add trunk" translate translate-attr-aria-label="TOOLS.ADD_TRUNK">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TRUNK BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/variables/create/dialog.html",'<md-dialog class="variable-dialog" aria-label="New Variable">\n <form name="variableForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.variable.name" ng-required="true" autofocus>\n <div ng-messages="variableForm[\'name\'].$error" ng-show="variableForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.variable.description">\n <div ng-messages="variableForm[\'description\'].$error" ng-show="variableForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newVariable" ng-click="vm.saveVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid || variableForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newVariable" ng-click="vm.addNewVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_VARIABLE" translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n ADD VARIABLE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newVariable" ng-click="vm.deleteVariable($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/variables/variables.html",'<div id="variables" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.VARIABLES">Variables</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVariables.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVariables =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-variables-count">\n <span>{{vm.selectedVariables.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VARIABLES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVariables()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVariables()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVariables" csv-label="true" filename="variables.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedVariables($event)" aria-label="delete selected" translate translate-attr-label="VARIABLES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- VARIABLE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVariables" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVariables">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.variables.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="variable" md-select-id="id" ng-repeat="variable in vm.variables.rows">\n <td md-cell ng-if="variable.userpic"><img class="avatar" alt="{{variable.name}}" ng-src="api/users/{{variable.id}}/avatar" /></td>\n <td md-cell ng-if="!variable.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{variable.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="id ">{{variable.id}}</td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="name ">{{variable.name}}</td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="description ">{{variable.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(variable, $event)" translate="TOOLS.EDIT_VARIABLE">\n Edit Variable\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(variable, $event)" translate="TOOLS.DELETE_VARIABLE">\n Delete Variable\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.variables.count}}" md-on-paginate="vm.getVariables" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VARIABLE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VARIABLE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-variable-button" ng-click="vm.createOrEditVariable($event)" aria-label="add variable" translate translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VARIABLE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/chanSpies/chanSpies.html",'<div id="chanSpies" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.CHANSPIES">ChanSpies</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChanSpies.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChanSpies =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chanSpies-count">\n <span>{{vm.selectedChanSpies.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHANSPIES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChanSpies()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChanSpies()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChanSpies" csv-label="true" filename="chanSpies.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedChanSpies($event)" aria-label="delete selected" translate translate-attr-label="CHANSPIES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- CHANSPY TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChanSpies" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChanSpies">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="prefix">{{ \'VOICE.PREFIX\' | translate }}</th>\n <th md-column md-order-by="auth">{{ \'VOICE.AUTH\' | translate }}</th>\n <th md-column md-order-by="record">{{ \'VOICE.RECORD\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chanSpies.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chanSpy" md-select-id="id" ng-repeat="chanSpy in vm.chanSpies.rows">\n <td md-cell ng-if="chanSpy.userpic"><img class="avatar" alt="{{chanSpy.name}}" ng-src="api/users/{{chanSpy.id}}/avatar" /></td>\n <td md-cell ng-if="!chanSpy.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chanSpy.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="id ">{{chanSpy.id}}</td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="name ">{{chanSpy.name}}</td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="prefix ">{{chanSpy.prefix}}</td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="auth ">\n <md-icon md-colors="{color: {{chanSpy.auth ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.auth ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="record ">\n <md-icon md-colors="{color: {{chanSpy.record ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.record ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="description ">{{chanSpy.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(chanSpy, $event)" translate="VOICE.EDIT_CHANSPY">\n Edit chanSpy\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(chanSpy, $event)" translate="VOICE.DELETE_CHANSPY">\n Delete chanSpy\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.chanSpies.count}}" md-on-paginate="vm.getChanSpies" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHANSPY TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHANSPY BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-chanSpy-button" ng-click="vm.createOrEditchanSpy($event)" aria-label="add chanSpy" translate translate-attr-aria-label="VOICE.ADD_CHANSPY">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHANSPY BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/chanSpies/create/dialog.html",'<md-dialog class="chanSpy-dialog" aria-label="New chanSpy">\n <form name="chanSpyForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chanSpy.name" ng-required="true" autofocus>\n <div ng-messages="chanSpyForm[\'name\'].$error" ng-show="chanSpyForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PREFIX">Prefix</label>\n <input type="text" name="prefix" ng-model="vm.chanSpy.prefix" ng-required="true">\n <div ng-messages="chanSpyForm[\'prefix\'].$error" ng-show="chanSpyForm[\'prefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <md-select name="options" ng-model="vm.chanSpy.options" required multiple>\n <md-option ng-value="\'b\'">b: Only spy on channels involved in a bridged call.</md-option>\n <md-option ng-value="\'B\'">B: Instead of whispering on a single channel barge in on both channels involved in the call.</md-option>\n <md-option ng-value="\'E\'">E: Exit when the spied-on channel hangs up.</md-option>\n <md-option ng-value="\'o\'">o: Only listen to audio coming from this channel.</md-option>\n <md-option ng-value="\'q\'">q: Don\'t play a beep when beginning to spy on a channel, or speak the selected channel name.</md-option>\n <md-option ng-value="\'s\'">s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.</md-option>\n <md-option ng-value="\'S\'">S: Stop when no more channels are left to spy on.</md-option>\n <md-option ng-value="\'w\'">w: Enable whisper mode, so the spying channel can talk to the spied-on channel.</md-option>\n <md-option ng-value="\'W\'">W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.</md-option>\n </md-select>\n <div ng-messages="chanSpyForm[\'options\'].$error" ng-show="chanSpyForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chanSpy.auth" aria-label="Auth"><span translate="VOICE.AUTH">Auth</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.chanSpy.auth">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.chanSpy.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="chanSpyForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chanSpy.record" aria-label="Record"><span translate="VOICE.RECORD">Record</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chanSpy.record" class="md-block">\n <label translate="VOICE.RECORDINGFORMAT">recordingFormat</label>\n <md-select name="recordingFormat" ng-model="vm.chanSpy.recordingFormat" required>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n </md-select>\n <div ng-messages="chanSpyForm[\'recordingFormat\'].$error" ng-show="chanSpyForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDINGFORMAT_REQUIRED">recordingFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chanSpy.description">\n <div ng-messages="chanSpyForm[\'description\'].$error" ng-show="chanSpyForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newchanSpy" ng-click="vm.savechanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid || chanSpyForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newchanSpy" ng-click="vm.addNewchanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CHANSPY" translate-attr-aria-label="VOICE.ADD_CHANSPY">\n ADD CHANSPY\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newchanSpy" ng-click="vm.deletechanSpy($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/contexts/contexts.html",'<div id="contexts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.CONTEXTS">Contexts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedContexts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedContexts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-contexts-count">\n <span>{{vm.selectedContexts.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTEXTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllContexts()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectContexts()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedContexts" csv-label="true" filename="contexts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedContexts($event)" aria-label="delete selected" translate translate-attr-label="CONTEXTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- CONTEXT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedContexts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContexts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contexts.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="context" md-select-id="id" ng-repeat="context in vm.contexts.rows">\n <td md-cell ng-if="context.userpic"><img class="avatar" alt="{{context.name}}" ng-src="api/users/{{context.id}}/avatar" /></td>\n <td md-cell ng-if="!context.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{context.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="id ">{{context.id}}</td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="name ">{{context.name}}</td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="description ">{{context.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(context, $event)" translate="VOICE.EDIT_CONTEXT">\n Edit Context\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(context, $event)" translate="VOICE.DELETE_CONTEXT">\n Delete Context\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.contexts.count}}" md-on-paginate="vm.getContexts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CONTEXT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CONTEXT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-context-button" ng-click="vm.createOrEditContext($event)" aria-label="add context" translate translate-attr-aria-label="VOICE.ADD_CONTEXT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CONTEXT BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/contexts/create/dialog.html",'<md-dialog class="context-dialog" aria-label="New Context">\n <form name="contextForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.context.name" ng-required="true" autofocus>\n <div ng-messages="contextForm[\'name\'].$error" ng-show="contextForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.context.description">\n <div ng-messages="contextForm[\'description\'].$error" ng-show="contextForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newContext" ng-click="vm.saveContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid || contextForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newContext" ng-click="vm.addNewContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CONTEXT" translate-attr-aria-label="VOICE.ADD_CONTEXT">\n ADD CONTEXT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newContext" ng-click="vm.deleteContext($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/create/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.inboundroute.exten" ng-required="true" autofocus>\n <div ng-messages="inboundrouteForm[\'exten\'].$error" ng-show="inboundrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.inboundroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteForm[\'context\'].$error" ng-show="inboundrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.inboundroute.description">\n <div ng-messages="inboundrouteForm[\'description\'].$error" ng-show="inboundrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInboundRoute" ng-click="vm.saveInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid || inboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInboundRoute" ng-click="vm.addNewInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n ADD INBOUNDROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newInboundRoute" ng-click="vm.deleteInboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/agi/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PROJECT">Project</label>\n <md-select name="project" ng-model="vm.agi.project" required autofocus>\n <md-option ng-value="\'agi://127.0.0.1/square,{{project.name}}\'" ng-repeat="project in vm.projects">{{ project.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'project\'].$error" ng-show="inboundrouteFormApp[\'project\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/custom/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n <input type="text" name="app" ng-model="vm.custom.app" ng-required="true" autofocus>\n <div ng-messages="inboundrouteFormApp[\'app\'].$error" ng-show="inboundrouteFormApp[\'app\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ARGUMENTS">Arguments</label>\n <input type="text" name="appdata" ng-model="vm.custom.appdata">\n <div ng-messages="inboundrouteFormApp[\'appdata\'].$error" ng-show="inboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/dial/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TECHNOLOGY/RESOURCE">Technology/Resource</label>\n <input type="text" name="tech" ng-model="vm.dial.tech" ng-required="true" autofocus>\n <div ng-messages="inboundrouteFormApp[\'tech\'].$error" ng-show="inboundrouteFormApp[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TECHNOLOGY/RESOURCE_REQUIRED">Technology/Resource field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.dial.timeout" min="0">\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.dial.options">\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.dial.url">\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/externaldial/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.externaldial.trunk" required autofocus>\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks">{{ trunk.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'trunk\'].$error" ng-show="inboundrouteFormApp[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.externaldial.phone" ng-required="true">\n <div ng-messages="inboundrouteFormApp[\'phone\'].$error" ng-show="inboundrouteFormApp[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.externaldial.timeout" min="0">\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.externaldial.options">\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.externaldial.url">\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/goto/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.goto.context" required autofocus>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'context\'].$error" ng-show="inboundrouteFormApp[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EXTENSION">Extension</label>\n <input type="text" name="extension" ng-model="vm.goto.extension" ng-required="true">\n <div ng-messages="inboundrouteFormApp[\'extension\'].$error" ng-show="inboundrouteFormApp[\'extension\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EXTENSION_REQUIRED">Extension field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PRIORITY">Priority</label>\n <input type="text" name="priority" ng-model="vm.goto.priority" ng-required="true">\n <div ng-messages="inboundrouteFormApp[\'priority\'].$error" ng-show="inboundrouteFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/hangup/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.HANGUP_CAUSE">Hangup_Cause</label>\n <md-select name="appdata" ng-model="vm.hangup.appdata" required autofocus>\n\n <md-option ng-value="\'1\'"> {{ \'VOICE.HANGUPCAUSE_1\' | translate }}</md-option>\n\n <md-option ng-value="\'16\'"> {{ \'VOICE.HANGUPCAUSE_16\' | translate }}</md-option>\n\n <md-option ng-value="\'17\'"> {{ \'VOICE.HANGUPCAUSE_17\' | translate }}</md-option>\n\n <md-option ng-value="\'18\'"> {{ \'VOICE.HANGUPCAUSE_18\' | translate }}</md-option>\n\n <md-option ng-value="\'21\'"> {{ \'VOICE.HANGUPCAUSE_21\' | translate }}</md-option>\n\n <md-option ng-value="\'22\'"> {{ \'VOICE.HANGUPCAUSE_22\' | translate }}</md-option>\n\n <md-option ng-value="\'27\'"> {{ \'VOICE.HANGUPCAUSE_27\' | translate }}</md-option>\n\n <md-option ng-value="\'38\'"> {{ \'VOICE.HANGUPCAUSE_38\' | translate }}</md-option>\n\n <md-option ng-value="\'41\'"> {{ \'VOICE.HANGUPCAUSE_41\' | translate }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'appdata\'].$error" ng-show="inboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.HANGUP_CAUSE_REQUIRED">Hangup_Cause field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/internaldial/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="user" ng-model="vm.internaldial.user" required autofocus>\n <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users">{{ user.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'user\'].$error" ng-show="inboundrouteFormApp[\'user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.internaldial.timeout" min="0">\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.internaldial.options">\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.internaldial.url">\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/playback/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.AUDIO_FILES">Audio_Files</label>\n <md-select name="appdata" ng-model="vm.playback.appdata" required autofocus>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}\'" ng-repeat="appdata in vm.sounds">{{ appdata.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'appdata\'].$error" ng-show="inboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUDIO_FILES_REQUIRED">Audio_Files field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.playback.options">\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.playback.answer" aria-label="Answer"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/queue/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" required autofocus>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'queue\'].$error" ng-show="inboundrouteFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.queue.options">\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="URL" ng-model="vm.queue.URL">\n <div ng-messages="inboundrouteFormApp[\'URL\'].$error" ng-show="inboundrouteFormApp[\'URL\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCE_OVERRIDES">Announce_Overrides</label>\n <md-select name="sound" ng-model="vm.queue.sound">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds">{{ sound.name }}</md-option>\n <md-option ng-value="\'\'">None</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'sound\'].$error" ng-show="inboundrouteFormApp[\'sound\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCE_OVERRIDES_REQUIRED">Announce_Overrides field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0">\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AGI">Agi</label>\n <input type="text" name="agi" ng-model="vm.queue.agi">\n <div ng-messages="inboundrouteFormApp[\'agi\'].$error" ng-show="inboundrouteFormApp[\'agi\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AGI_REQUIRED">Agi field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MACRO">Macro</label>\n <input type="text" name="macro" ng-model="vm.queue.macro">\n <div ng-messages="inboundrouteFormApp[\'macro\'].$error" ng-show="inboundrouteFormApp[\'macro\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MACRO_REQUIRED">Macro field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.GOSUB">GoSub</label>\n <input type="text" name="gosub" ng-model="vm.queue.gosub">\n <div ng-messages="inboundrouteFormApp[\'gosub\'].$error" ng-show="inboundrouteFormApp[\'gosub\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.GOSUB_REQUIRED">GoSub field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RULE">Rule</label>\n <input type="text" name="rule" ng-model="vm.queue.rule">\n <div ng-messages="inboundrouteFormApp[\'rule\'].$error" ng-show="inboundrouteFormApp[\'rule\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RULE_REQUIRED">Rule field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.POSITION">Position</label>\n <input type="number" name="position" ng-model="vm.queue.position" min="0">\n <div ng-messages="inboundrouteFormApp[\'position\'].$error" ng-show="inboundrouteFormApp[\'position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.POSITION_REQUIRED">Position field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Position must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queue.answer" aria-label="Answer"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/ringgroup/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="multipleUsers" ng-model="vm.ringgroup.multipleUsers" required autofocus multiple>\n <md-option ng-value="\'SIP/{{multipleUsers.name}}\'" ng-repeat="multipleUsers in vm.users">{{ multipleUsers.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'multipleUsers\'].$error" ng-show="inboundrouteFormApp[\'multipleUsers\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.ringgroup.timeout" min="0">\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.ringgroup.options">\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.ringgroup.url">\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/set/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.VARIABLE">Variable</label>\n <md-select name="name" ng-model="vm.set.name" required autofocus>\n <md-option ng-value="name.name" ng-repeat="name in vm.variables">{{ name.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'name\'].$error" ng-show="inboundrouteFormApp[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.set.value" ng-required="true">\n <div ng-messages="inboundrouteFormApp[\'value\'].$error" ng-show="inboundrouteFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/voicemail/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX@CONTEXT">Mailbox@Context</label>\n <md-select name="voiceMail" ng-model="vm.voicemail.voiceMail" required autofocus>\n <md-option ng-value="\'{{voiceMail.mailbox}}@from-voicemail\'" ng-repeat="voiceMail in vm.voiceMails">{{ voiceMail.mailbox }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'voiceMail\'].$error" ng-show="inboundrouteFormApp[\'voiceMail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX@CONTEXT_REQUIRED">Mailbox@Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.voicemail.options">\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/view.html",'<div id="voice-inboundroute" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-inboundroutes-button md-icon-button" aria-label="Go to inboundroutes" ng-click="vm.gotoInboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INBOUNDROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="inboundroute-image" hide-xs>\n <img ng-src="assets/images/business/inboundroutes.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.inboundroute.id}}\n <span ng-if="vm.inboundroute.name">{{vm.inboundroute.name}}</span>\n <span ng-if="vm.inboundroute.exten">{{vm.inboundroute.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.inboundroute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveInboundRoute()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="inboundroute-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.inboundroute.exten" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.inboundroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.inboundroute.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="inboundroute-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="InboundRouteActionsController as vm_ac" ng-init="vm_ac.init(vm.inboundroute)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedInboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedInboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedInboundRouteApps.length}} {{vm_ac.selectedInboundRouteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedInboundRouteApps($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedInboundRouteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.inboundrouteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editInboundRouteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editInboundRouteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editInboundRouteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.inboundrouteApps.rows.length">\n <td md-cell colspan="6">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="6">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/inboundroutes/inboundroutes.html",'<div id="inboundroutes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.INBOUNDROUTES">InboundRoutes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedInboundRoutes.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedInboundRoutes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-inboundroutes-count">\n <span>{{vm.selectedInboundRoutes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INBOUNDROUTES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllInboundRoutes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectInboundRoutes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedInboundRoutes" csv-label="true" filename="inboundroutes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedInboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="INBOUNDROUTES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- INBOUNDROUTE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedInboundRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInboundRoutes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.inboundroutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="inboundroute" md-select-id="id" ng-repeat="inboundroute in vm.inboundroutes.rows">\n <td md-cell ng-if="inboundroute.userpic"><img class="avatar" alt="{{inboundroute.name}}" ng-src="api/users/{{inboundroute.id}}/avatar" /></td>\n <td md-cell ng-if="!inboundroute.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{inboundroute.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditInboundRoute($event, inboundroute)" md-cell class="id ">{{inboundroute.id}}</td>\n <td ng-click="vm.createOrEditInboundRoute($event, inboundroute)" md-cell class="exten ">{{inboundroute.exten}}</td>\n <td ng-click="vm.createOrEditInboundRoute($event, inboundroute)" md-cell class="description ">{{inboundroute.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(inboundroute, $event)" translate="VOICE.EDIT_INBOUNDROUTE">\n Edit InboundRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(inboundroute, $event)" translate="VOICE.DELETE_INBOUNDROUTE">\n Delete InboundRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.inboundroutes.count}}" md-on-paginate="vm.getInboundRoutes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / INBOUNDROUTE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD INBOUNDROUTE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-inboundroute-button" ng-click="vm.createOrEditInboundRoute($event)" aria-label="add inboundroute" translate translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD INBOUNDROUTE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/internalroutes/create/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.internalroute.exten" ng-required="true" autofocus>\n <div ng-messages="internalrouteForm[\'exten\'].$error" ng-show="internalrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.internalroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteForm[\'context\'].$error" ng-show="internalrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.internalroute.description">\n <div ng-messages="internalrouteForm[\'description\'].$error" ng-show="internalrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInternalRoute" ng-click="vm.saveInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid || internalrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInternalRoute" ng-click="vm.addNewInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INTERNALROUTE" translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n ADD INTERNALROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newInternalRoute" ng-click="vm.deleteInternalRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/agi/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PROJECT">Project</label>\n <md-select name="project" ng-model="vm.agi.project" required autofocus>\n <md-option ng-value="\'agi://127.0.0.1/square,{{project.name}}\'" ng-repeat="project in vm.projects">{{ project.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'project\'].$error" ng-show="internalrouteFormApp[\'project\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/custom/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n <input type="text" name="app" ng-model="vm.custom.app" ng-required="true" autofocus>\n <div ng-messages="internalrouteFormApp[\'app\'].$error" ng-show="internalrouteFormApp[\'app\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ARGUMENTS">Arguments</label>\n <input type="text" name="appdata" ng-model="vm.custom.appdata">\n <div ng-messages="internalrouteFormApp[\'appdata\'].$error" ng-show="internalrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/dial/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TECHNOLOGY/RESOURCE">Technology/Resource</label>\n <input type="text" name="tech" ng-model="vm.dial.tech" ng-required="true" autofocus>\n <div ng-messages="internalrouteFormApp[\'tech\'].$error" ng-show="internalrouteFormApp[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TECHNOLOGY/RESOURCE_REQUIRED">Technology/Resource field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.dial.timeout" min="0">\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.dial.options">\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.dial.url">\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/externaldial/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.externaldial.trunk" required autofocus>\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks">{{ trunk.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'trunk\'].$error" ng-show="internalrouteFormApp[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.externaldial.phone">\n <div ng-messages="internalrouteFormApp[\'phone\'].$error" ng-show="internalrouteFormApp[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.externaldial.timeout" min="0">\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.externaldial.options">\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.externaldial.url">\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/goto/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.goto.context" required autofocus>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'context\'].$error" ng-show="internalrouteFormApp[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EXTENSION">Extension</label>\n <input type="text" name="extension" ng-model="vm.goto.extension" ng-required="true">\n <div ng-messages="internalrouteFormApp[\'extension\'].$error" ng-show="internalrouteFormApp[\'extension\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EXTENSION_REQUIRED">Extension field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PRIORITY">Priority</label>\n <input type="text" name="priority" ng-model="vm.goto.priority" ng-required="true">\n <div ng-messages="internalrouteFormApp[\'priority\'].$error" ng-show="internalrouteFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/hangup/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.HANGUP_CAUSE">Hangup_Cause</label>\n <md-select name="appdata" ng-model="vm.hangup.appdata" required autofocus>\n\n <md-option ng-value="\'1\'"> {{ \'VOICE.HANGUPCAUSE_1\' | translate }}</md-option>\n\n <md-option ng-value="\'16\'"> {{ \'VOICE.HANGUPCAUSE_16\' | translate }}</md-option>\n\n <md-option ng-value="\'17\'"> {{ \'VOICE.HANGUPCAUSE_17\' | translate }}</md-option>\n\n <md-option ng-value="\'18\'"> {{ \'VOICE.HANGUPCAUSE_18\' | translate }}</md-option>\n\n <md-option ng-value="\'21\'"> {{ \'VOICE.HANGUPCAUSE_21\' | translate }}</md-option>\n\n <md-option ng-value="\'22\'"> {{ \'VOICE.HANGUPCAUSE_22\' | translate }}</md-option>\n\n <md-option ng-value="\'27\'"> {{ \'VOICE.HANGUPCAUSE_27\' | translate }}</md-option>\n\n <md-option ng-value="\'38\'"> {{ \'VOICE.HANGUPCAUSE_38\' | translate }}</md-option>\n\n <md-option ng-value="\'41\'"> {{ \'VOICE.HANGUPCAUSE_41\' | translate }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'appdata\'].$error" ng-show="internalrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.HANGUP_CAUSE_REQUIRED">Hangup_Cause field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/internaldial/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="user" ng-model="vm.internaldial.user" required autofocus>\n <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users">{{ user.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'user\'].$error" ng-show="internalrouteFormApp[\'user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.internaldial.timeout" min="0">\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.internaldial.options">\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.internaldial.url">\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/playback/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.AUDIO_FILES">Audio_Files</label>\n <md-select name="appdata" ng-model="vm.playback.appdata" required autofocus>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}\'" ng-repeat="appdata in vm.sounds">{{ appdata.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'appdata\'].$error" ng-show="internalrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUDIO_FILES_REQUIRED">Audio_Files field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.playback.options">\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.playback.answer" aria-label="Answer"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/queue/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" required autofocus>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'queue\'].$error" ng-show="internalrouteFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.queue.options">\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="URL" ng-model="vm.queue.URL">\n <div ng-messages="internalrouteFormApp[\'URL\'].$error" ng-show="internalrouteFormApp[\'URL\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCE_OVERRIDES">Announce_Overrides</label>\n <md-select name="sound" ng-model="vm.queue.sound">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds">{{ sound.name }}</md-option>\n <md-option ng-value="\'\'">None</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'sound\'].$error" ng-show="internalrouteFormApp[\'sound\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCE_OVERRIDES_REQUIRED">Announce_Overrides field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0">\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AGI">Agi</label>\n <input type="text" name="agi" ng-model="vm.queue.agi">\n <div ng-messages="internalrouteFormApp[\'agi\'].$error" ng-show="internalrouteFormApp[\'agi\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AGI_REQUIRED">Agi field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MACRO">Macro</label>\n <input type="text" name="macro" ng-model="vm.queue.macro">\n <div ng-messages="internalrouteFormApp[\'macro\'].$error" ng-show="internalrouteFormApp[\'macro\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MACRO_REQUIRED">Macro field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.GOSUB">GoSub</label>\n <input type="text" name="gosub" ng-model="vm.queue.gosub">\n <div ng-messages="internalrouteFormApp[\'gosub\'].$error" ng-show="internalrouteFormApp[\'gosub\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.GOSUB_REQUIRED">GoSub field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RULE">Rule</label>\n <input type="text" name="rule" ng-model="vm.queue.rule">\n <div ng-messages="internalrouteFormApp[\'rule\'].$error" ng-show="internalrouteFormApp[\'rule\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RULE_REQUIRED">Rule field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.POSITION">Position</label>\n <input type="number" name="position" ng-model="vm.queue.position" min="0">\n <div ng-messages="internalrouteFormApp[\'position\'].$error" ng-show="internalrouteFormApp[\'position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.POSITION_REQUIRED">Position field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Position must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queue.answer" aria-label="Answer"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/ringgroup/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="multipleUsers" ng-model="vm.ringgroup.multipleUsers" required autofocus multiple>\n <md-option ng-value="\'SIP/{{multipleUsers.name}}\'" ng-repeat="multipleUsers in vm.users">{{ multipleUsers.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'multipleUsers\'].$error" ng-show="internalrouteFormApp[\'multipleUsers\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.ringgroup.timeout" min="0">\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.ringgroup.options">\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.ringgroup.url">\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/set/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.VARIABLE">Variable</label>\n <md-select name="name" ng-model="vm.set.name" required autofocus>\n <md-option ng-value="name.name" ng-repeat="name in vm.variables">{{ name.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'name\'].$error" ng-show="internalrouteFormApp[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.set.value" ng-required="true">\n <div ng-messages="internalrouteFormApp[\'value\'].$error" ng-show="internalrouteFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/voicemail/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX@CONTEXT">Mailbox@Context</label>\n <md-select name="voiceMail" ng-model="vm.voicemail.voiceMail" required autofocus>\n <md-option ng-value="\'{{voiceMail.mailbox}}@from-voicemail\'" ng-repeat="voiceMail in vm.voiceMails">{{ voiceMail.mailbox }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'voiceMail\'].$error" ng-show="internalrouteFormApp[\'voiceMail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX@CONTEXT_REQUIRED">Mailbox@Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.voicemail.options">\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/view.html",'<div id="voice-internalroute" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-internalroutes-button md-icon-button" aria-label="Go to internalroutes" ng-click="vm.gotoInternalRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INTERNALROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="internalroute-image" hide-xs>\n <img ng-src="assets/images/business/internalroutes.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.internalroute.id}}\n <span ng-if="vm.internalroute.name">{{vm.internalroute.name}}</span>\n <span ng-if="vm.internalroute.exten">{{vm.internalroute.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.internalroute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveInternalRoute()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="internalroute-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.internalroute.exten" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.internalroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.internalroute.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="internalroute-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="InternalRouteActionsController as vm_ac" ng-init="vm_ac.init(vm.internalroute)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedInternalRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedInternalRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedInternalRouteApps.length}} {{vm_ac.selectedInternalRouteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedInternalRouteApps($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedInternalRouteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.internalrouteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editInternalRouteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editInternalRouteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editInternalRouteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.internalrouteApps.rows.length">\n <td md-cell colspan="6">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="6">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/internalroutes/internalroutes.html",'<div id="internalroutes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.INTERNALROUTES">InternalRoutes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedInternalRoutes.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedInternalRoutes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-internalroutes-count">\n <span>{{vm.selectedInternalRoutes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTERNALROUTES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllInternalRoutes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectInternalRoutes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedInternalRoutes" csv-label="true" filename="internalroutes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedInternalRoutes($event)" aria-label="delete selected" translate translate-attr-label="INTERNALROUTES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- INTERNALROUTE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedInternalRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInternalRoutes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.internalroutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="internalroute" md-select-id="id" ng-repeat="internalroute in vm.internalroutes.rows">\n <td md-cell ng-if="internalroute.userpic"><img class="avatar" alt="{{internalroute.name}}" ng-src="api/users/{{internalroute.id}}/avatar" /></td>\n <td md-cell ng-if="!internalroute.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{internalroute.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditInternalRoute($event, internalroute)" md-cell class="id ">{{internalroute.id}}</td>\n <td ng-click="vm.createOrEditInternalRoute($event, internalroute)" md-cell class="exten ">{{internalroute.exten}}</td>\n <td ng-click="vm.createOrEditInternalRoute($event, internalroute)" md-cell class="description ">{{internalroute.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(internalroute, $event)" translate="VOICE.EDIT_INTERNALROUTE">\n Edit InternalRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(internalroute, $event)" translate="VOICE.DELETE_INTERNALROUTE">\n Delete InternalRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.internalroutes.count}}" md-on-paginate="vm.getInternalRoutes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / INTERNALROUTE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD INTERNALROUTE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-internalroute-button" ng-click="vm.createOrEditInternalRoute($event)" aria-label="add internalroute" translate translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD INTERNALROUTE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/musiconholds/create/dialog.html",'<md-dialog class="musiconhold-dialog" aria-label="New MusicOnHold">\n <form name="musiconholdForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus ng-disabled="!vm.newMusicOnHold">\n <div ng-messages="musiconholdForm[\'name\'].$error" ng-show="musiconholdForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MODE">Mode</label>\n <md-select name="mode" ng-model="vm.musiconhold.mode" required ng-disabled="!vm.newMusicOnHold">\n\n <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }}</md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }}</md-option>\n </md-select>\n <div ng-messages="musiconholdForm[\'mode\'].$error" ng-show="musiconholdForm[\'mode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.DIRECTORY">Directory</label>\n <input type="" name="directory" ng-model="vm.musiconhold.directory">\n <div ng-messages="musiconholdForm[\'directory\'].$error" ng-show="musiconholdForm[\'directory\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.APPLICATION">Application</label>\n <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true">\n <div ng-messages="musiconholdForm[\'application\'].$error" ng-show="musiconholdForm[\'application\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n <label translate="VOICE.SORT">Sort</label>\n <md-select name="sort" ng-model="vm.musiconhold.sort">\n\n <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }}</md-option>\n\n <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="musiconholdForm[\'sort\'].$error" ng-show="musiconholdForm[\'sort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMusicOnHold" ng-click="vm.saveMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid || musiconholdForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMusicOnHold" ng-click="vm.addNewMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MUSICONHOLD" translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n ADD MUSICONHOLD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMusicOnHold" ng-click="vm.deleteMusicOnHold($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",'<md-dialog class="mohSound-dialog" aria-label="New MohSound">\n <form name="mohSoundForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.FILE">File</label>\n <md-select name="id" ng-model="vm.mohSound.id" autofocus>\n <md-option ng-value="id.id" ng-repeat="id in vm.sounds">{{ id.name }}</md-option>\n </md-select>\n <div ng-messages="mohSoundForm[\'id\'].$error" ng-show="mohSoundForm[\'id\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FILE_REQUIRED">File field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMohSound" ng-click="vm.saveMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid || mohSoundForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMohSound" ng-click="vm.addNewMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MOHSOUND" translate-attr-aria-label="VOICE.ADD_MOHSOUND">\n ADD MOHSOUND\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMohSound" ng-click="vm.deleteMohSound($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/view.html",'<div id="voice-musiconhold" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-musiconholds-button md-icon-button" aria-label="Go to musiconholds" ng-click="vm.gotoMusicOnHolds()" translate translate-attr-aria-label="VOICE.GO_TO_MUSICONHOLDS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="musiconhold-image" hide-xs>\n <img ng-src="assets/images/business/musiconholds.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.musiconhold.id}}\n <span ng-if="vm.musiconhold.name">{{vm.musiconhold.name}}</span>\n <span ng-if="vm.musiconhold.exten">{{vm.musiconhold.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.musiconhold.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (mohSoundsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="musiconhold-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus ng-disabled="true">\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MODE">Mode</label>\n <md-select name="mode" ng-model="vm.musiconhold.mode" required ng-disabled="true">\n\n <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }}</md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'mode\'].$error" ng-show="generalForm[\'mode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.DIRECTORY">Directory</label>\n <input type="" name="directory" ng-model="vm.musiconhold.directory">\n <div ng-messages="generalForm[\'directory\'].$error" ng-show="generalForm[\'directory\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.APPLICATION">Application</label>\n <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true">\n <div ng-messages="generalForm[\'application\'].$error" ng-show="generalForm[\'application\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n <label translate="VOICE.SORT">Sort</label>\n <md-select name="sort" ng-model="vm.musiconhold.sort">\n\n <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }}</md-option>\n\n <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'sort\'].$error" ng-show="generalForm[\'sort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.AUDIOFILES">AUDIOFILES</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="musiconhold-detail-form-container mohsounds md-background-bg md-whiteframe-1dp">\n <div ng-controller="MusicOnHoldMohSoundsController as vm_dc" ng-init="vm_dc.init(vm.musiconhold)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMusicOnHoldMohSounds.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.MOHSOUNDS">MohSounds</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditMusicOnHoldMohSound($event)" aria-label="add mohSound" translate translate-attr-label="VOICE.ADD_MOHSOUND">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMusicOnHoldMohSounds.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMusicOnHoldMohSounds.length}} {{vm_dc.selectedMusicOnHoldMohSounds.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMusicOnHoldMohSounds" csv-label="true" filename="musiconholds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedMusicOnHoldMohSounds($event)" aria-label="delete selected" translate translate-attr-label="MUSICONHOLDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMusicOnHoldMohSounds" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMusicOnHoldMohSounds">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mohSound" md-select-id="id" ng-repeat="mohSound in vm_dc.musiconholdMohSounds.rows">\n <td md-cell>{{mohSound.id}}</td>\n <td md-cell>\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="mohSound.id" model="\'sound\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td md-cell>{{mohSound.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.voiceMusicOnHoldDownload(mohSound, $event)" translate="VOICE.DOWNLOAD_MOHSOUND">\n Download MohSound\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(mohSound, $event)" translate="VOICE.DELETE_MOHSOUND">\n Delete MohSound\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.musiconholdMohSounds.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="VOICE.NO_MOHSOUND_AVAILABLE">No mohsound available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.musiconholdMohSounds.count}}" md-on-paginate="vm_dc.getMusicOnHoldMohSounds" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/musiconholds/musiconholds.html",'<div id="musiconholds" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.MUSICONHOLDS">MusicOnHolds</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMusicOnHolds.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMusicOnHolds =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-musiconholds-count">\n <span>{{vm.selectedMusicOnHolds.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MUSICONHOLDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMusicOnHolds()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMusicOnHolds()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMusicOnHolds" csv-label="true" filename="musiconholds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedMusicOnHolds($event)" aria-label="delete selected" translate translate-attr-label="MUSICONHOLDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- MUSICONHOLD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMusicOnHolds" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMusicOnHolds">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="mode">{{ \'VOICE.MODE\' | translate }}</th>\n <th md-column md-order-by="sort">{{ \'VOICE.SORT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.musiconholds.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="musiconhold" md-select-id="id" ng-repeat="musiconhold in vm.musiconholds.rows">\n <td md-cell ng-if="musiconhold.userpic"><img class="avatar" alt="{{musiconhold.name}}" ng-src="api/users/{{musiconhold.id}}/avatar" /></td>\n <td md-cell ng-if="!musiconhold.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{musiconhold.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="id ">{{musiconhold.id}}</td>\n <td ng-click="vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="name ">{{musiconhold.name}}</td>\n <td ng-click="vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="mode ">{{ \'VOICE.\' + vm.arraymode[musiconhold.mode].option | uppercase | translate }}</td>\n <td ng-click="vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="sort ">{{ \'VOICE.\' + vm.arraysort[musiconhold.sort].option | uppercase | translate }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(musiconhold, $event)" translate="VOICE.EDIT_MUSICONHOLD">\n Edit MusicOnHold\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(musiconhold, $event)" translate="VOICE.DELETE_MUSICONHOLD">\n Delete MusicOnHold\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.musiconholds.count}}" md-on-paginate="vm.getMusicOnHolds" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MUSICONHOLD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MUSICONHOLD BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-musiconhold-button" ng-click="vm.createOrEditMusicOnHold($event)" aria-label="add musiconhold" translate translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MUSICONHOLD BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/outboundroutes/create/dialog.html",'<md-dialog class="outboundroute-dialog" aria-label="New OutboundRoute">\n <form name="outboundrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.outboundroute.exten" ng-required="true" autofocus>\n <div ng-messages="outboundrouteForm[\'exten\'].$error" ng-show="outboundrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.outboundroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="outboundrouteForm[\'context\'].$error" ng-show="outboundrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RECORDING">Recording</label>\n <md-select name="recordingFormat" ng-model="vm.outboundroute.recordingFormat" required>\n <md-option ng-value="\'none\'">none</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n <div ng-messages="outboundrouteForm[\'recordingFormat\'].$error" ng-show="outboundrouteForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CUTDIGITS">CutDigits</label>\n <input type="number" name="cutdigits" ng-model="vm.outboundroute.cutdigits" min="0">\n <div ng-messages="outboundrouteForm[\'cutdigits\'].$error" ng-show="outboundrouteForm[\'cutdigits\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.outboundroute.description">\n <div ng-messages="outboundrouteForm[\'description\'].$error" ng-show="outboundrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newOutboundRoute" ng-click="vm.saveOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid || outboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newOutboundRoute" ng-click="vm.addNewOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_OUTBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n ADD OUTBOUNDROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newOutboundRoute" ng-click="vm.deleteOutboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/apps/custom/dialog.html",'<md-dialog class="outboundroute-dialog" aria-label="New OutboundRoute">\n <form name="outboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n <input type="text" name="app" ng-model="vm.custom.app" ng-required="true" autofocus>\n <div ng-messages="outboundrouteFormApp[\'app\'].$error" ng-show="outboundrouteFormApp[\'app\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ARGUMENTS">Arguments</label>\n <input type="text" name="appdata" ng-model="vm.custom.appdata">\n <div ng-messages="outboundrouteFormApp[\'appdata\'].$error" ng-show="outboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOutboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="outboundrouteFormApp.$invalid || outboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/apps/outbounddial/dialog.html",'<md-dialog class="outboundroute-dialog" aria-label="New OutboundRoute">\n <form name="outboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.outbounddial.trunk" required autofocus>\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks">{{ trunk.name }}</md-option>\n </md-select>\n <div ng-messages="outboundrouteFormApp[\'trunk\'].$error" ng-show="outboundrouteFormApp[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CALLER_ID">Caller_ID</label>\n <input type="text" name="callerID" ng-model="vm.outbounddial.callerID">\n <div ng-messages="outboundrouteFormApp[\'callerID\'].$error" ng-show="outboundrouteFormApp[\'callerID\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CALLER_ID_REQUIRED">Caller_ID field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PREFIX">Prefix</label>\n <input type="text" name="prefix" ng-model="vm.outbounddial.prefix">\n <div ng-messages="outboundrouteFormApp[\'prefix\'].$error" ng-show="outboundrouteFormApp[\'prefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TAGS">Tags</label>\n <md-select name="tag" ng-model="vm.outbounddial.tag">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags">{{ tag.name }}</md-option>\n <md-option ng-value="\'--\'">None</md-option>\n </md-select>\n <div ng-messages="outboundrouteFormApp[\'tag\'].$error" ng-show="outboundrouteFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TAGS_REQUIRED">Tags field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.outbounddial.timeout" min="0">\n <div ng-messages="outboundrouteFormApp[\'timeout\'].$error" ng-show="outboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.outbounddial.options">\n <div ng-messages="outboundrouteFormApp[\'options\'].$error" ng-show="outboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.outbounddial.url">\n <div ng-messages="outboundrouteFormApp[\'url\'].$error" ng-show="outboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOutboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="outboundrouteFormApp.$invalid || outboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/view.html",'<div id="voice-outboundroute" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-outboundroutes-button md-icon-button" aria-label="Go to outboundroutes" ng-click="vm.gotoOutboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_OUTBOUNDROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="outboundroute-image" hide-xs>\n <img ng-src="assets/images/business/outboundroutes.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.outboundroute.id}}\n <span ng-if="vm.outboundroute.name">{{vm.outboundroute.name}}</span>\n <span ng-if="vm.outboundroute.exten">{{vm.outboundroute.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.outboundroute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="outboundroute-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.outboundroute.exten" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.outboundroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RECORDING">Recording</label>\n <md-select name="recordingFormat" ng-model="vm.outboundroute.recordingFormat" required>\n <md-option ng-value="\'none\'">none</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n <div ng-messages="generalForm[\'recordingFormat\'].$error" ng-show="generalForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CUTDIGITS">CutDigits</label>\n <input type="number" name="cutdigits" ng-model="vm.outboundroute.cutdigits" min="0">\n <div ng-messages="generalForm[\'cutdigits\'].$error" ng-show="generalForm[\'cutdigits\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.outboundroute.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="outboundroute-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OutboundRouteActionsController as vm_ac" ng-init="vm_ac.init(vm.outboundroute)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedOutboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedOutboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedOutboundRouteApps.length}} {{vm_ac.selectedOutboundRouteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedOutboundRouteApps($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedOutboundRouteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.outboundrouteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editOutboundRouteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editOutboundRouteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editOutboundRouteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.outboundrouteApps.rows.length">\n <td md-cell colspan="6">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="6">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/outboundroutes/outboundroutes.html",'<div id="outboundroutes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.OUTBOUNDROUTES">OutboundRoutes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOutboundRoutes.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOutboundRoutes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-outboundroutes-count">\n <span>{{vm.selectedOutboundRoutes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OUTBOUNDROUTES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOutboundRoutes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOutboundRoutes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOutboundRoutes" csv-label="true" filename="outboundroutes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedOutboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="OUTBOUNDROUTES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- OUTBOUNDROUTE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOutboundRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOutboundRoutes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.outboundroutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="outboundroute" md-select-id="id" ng-repeat="outboundroute in vm.outboundroutes.rows">\n <td md-cell ng-if="outboundroute.userpic"><img class="avatar" alt="{{outboundroute.name}}" ng-src="api/users/{{outboundroute.id}}/avatar" /></td>\n <td md-cell ng-if="!outboundroute.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{outboundroute.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditOutboundRoute($event, outboundroute)" md-cell class="id ">{{outboundroute.id}}</td>\n <td ng-click="vm.createOrEditOutboundRoute($event, outboundroute)" md-cell class="exten ">{{outboundroute.exten}}</td>\n <td ng-click="vm.createOrEditOutboundRoute($event, outboundroute)" md-cell class="description ">{{outboundroute.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(outboundroute, $event)" translate="VOICE.EDIT_OUTBOUNDROUTE">\n Edit OutboundRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(outboundroute, $event)" translate="VOICE.DELETE_OUTBOUNDROUTE">\n Delete OutboundRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.outboundroutes.count}}" md-on-paginate="vm.getOutboundRoutes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OUTBOUNDROUTE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OUTBOUNDROUTE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-outboundroute-button" ng-click="vm.createOrEditOutboundRoute($event)" aria-label="add outboundroute" translate translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OUTBOUNDROUTE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/realtime/abandonedcalls/view.html",'<md-toolbar class="md-table-toolbar md-default table-header">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 black-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getContacts()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.lastAssignedTo" ng-change="vm.getContacts()">\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents.rows">{{agent.name}}</md-option>\n </md-select>\n </div>\n <div ng-if="vm.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.queue" ng-change="vm.getContacts()">\n <md-option ng-value="undefined" ng-if="vm.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshContacts($event)" aria-label="refresh Contacts" translate translate-attr-label="DASHBOARDS.REFRESH_CONTACTS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n</md-toolbar>\n<md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td md-cell class="id">{{contact.id}}</td>\n <td md-cell class="firstName">{{contact.calleridname}}</td>\n <td md-cell class="list">{{contact.calleridnum}}</td>\n <td md-cell class="list">{{vm.queuesMap[contact.queue]}}</td>\n <td md-cell class="list">{{contact.queuecallerabandonAt ? (contact.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.lastAssignedTo}}</td>\n <td md-cell class="list">{{contact.disposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">Assigned a</md-button>\n <md-menu-content>\n <md-menu-item ng-if="contact.lastAssignedTo">\n <md-button ng-click="vm.assignedA(contact)"><em translate="DASHBOARDS.NONE">Not Assigned</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.assignedA(contact,agent)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, null)"><em translate="DASHBOARDS.NONE">NONE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'fax\')"><em translate="DASHBOARDS.FAX">FAX</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Answer Machine\')"><em translate="DASHBOARDS.ANSWER_MACHINE">ANSWER_MACHINE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Interested\')"><em translate="DASHBOARDS.INTERESTED">INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Not Interested\')"><em translate="DASHBOARDS.NOT_INTERESTED">NOT_INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Sold\')"><em translate="DASHBOARDS.SOLD">SOLD</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Special\')"><em translate="DASHBOARDS.SPECIAL">SPECIAL</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.disposition.length" ng-repeat="disposition in vm.disposition">\n <md-button ng-click="vm.disposed(contact, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>'),e.put("app/main/apps/voice/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'VOICE.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'VOICE.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'VOICE.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'VOICE.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'VOICE.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="3">{{ \'VOICE.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n \x3c!-- <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSE\' | translate }}</th>\n <th md-column width="10px"></th> --\x3e\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'VOICE.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatusTime">{{ \'VOICE.TIMER\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'VOICE.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'busy\':\'indigo-100-bg\',\'*pause\':\'amber-50-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].globalStatus]">{{ vm.isPause(vm.agents[value].globalStatus) ? \'\' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? \'*\'+vm.agents[value].pauseType || \'DEFAULT PAUSE\' : vm.agents[value].pauseType || \'DEFAULT PAUSE\') : \'\'}}</span>\n </td>\n <td class="bt custom-column">\n <timer start-time="vm.agents[value].globalStatusTime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class="bt bl">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'talking\':\'indigo-100-bg\',\'ringing\':\'orange-400-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt bl">\n <div layout="column">\n <span ng-if="vm.agents[value].queue" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].queue }}</span>\n <span ng-if="vm.agents[value].destconnectedlinenum" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class="padding-5" ng-if="vm.agents[value].queue || vm.agents[value].destconnectedlinenum">\n <timer start-time="vm.agents[value].voiceStatusTime" interval="1000" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n \x3c!-- <td class="bt">--</td>\n <td class="bt">--</td> --\x3e\n <td class="bt bl" ng-if="vm.license.chat">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n \x3c!-- <td class="bt padding-5 text-center">{{ agent.chatCurrentCapacity }}/{{ agent.chatCapacity > 0 ? agent.chatCapacity : \'∞\' }}</td> --\x3e\n <td md-number class="bt text-center font-size-20" ng-if="vm.license.chat" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.mail">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.mail" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.messaging">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.messaging" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.openchannel">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">4</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">89</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.openchannel" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.fax">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">7</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">2</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.fax" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class="bl bt padding-5 text-center">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.logout(vm.agents[value], $event)" translate="VOICE.LOGOUT">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.queueAdd(vm.agents[value], $event)" translate="VOICE.AGENTADD_QUEUE">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="VOICE.PAUSE">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=" vm.agents[value].voicePause && \'DEFAULT PAUSE\' === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value])"><em translate="VOICE.DEFAULT_PAUSE">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.pauses.rows.length" ng-repeat="pause in vm.pauses.rows">\n <md-button ng-disabled="vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value], pause.name)">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="vm.isPause(vm.agents[value].globalStatus)">\n <md-button ng-click="vm.unPause(vm.agents[value])" translate="VOICE.UNPAUSE">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.filteredAgents.length}}" md-on-paginate="vm.onInit" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/outbound_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.OUTBOUND_CALLS">Ooutbound Calls</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- OUTBOUNDS TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'VOICE.SOURCE\' | translate }}</th>\n <th md-column>{{ \'VOICE.DESTINATION\' | translate }}</th>\n <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.calls.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="call in vm.calls.rows | filter: vm.query.filter | limitTo: vm.query.limit: (vm.query.page - 1) * vm.query.limit">\n <td md-cell>\n <i ng-class="vm.channelStatus[call.channelstatedesc.toLowerCase()]"></i>\n </td>\n <td md-cell>\n {{call.calleridname}}, {{call.calleridnum}} <span class="text-boxed" ng-if="call.answered"><timer ng-if="call.answertime" start-time="call.answertime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span>\n </td>\n <td md-cell>{{call.exten}}</td>\n <td md-cell>\n <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() !== \'hangup\'">\n <timer ng-if="call.starttime" start-time="call.starttime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() === \'hangup\'" translate="VOICE.CLOSING">Closing</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.calls.count}}"></md-table-pagination>\n\x3c!-- / OUTBOUNDS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queue_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n \x3c!-- <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUES TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column>{{ \'VOICE.AGENT\' | translate }}</th>\n <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.getSize(vm.rpcVoiceQueuesChannels)">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm.rpcVoiceQueuesChannels | limitObjectFromTo: vm.queryChannels.limit:(vm.queryChannels.page - 1) * vm.queryChannels.limit">\n <td md-cell>\n <md-icon ng-if="channel.queuecallerleaveAt" md-font-icon="icon-phone-in-talk green-fg"></md-icon>\n <md-icon ng-if="!channel.queuecallerleaveAt" md-font-icon="icon-phone-incoming md-accent"></md-icon>\n </td>\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n <td md-cell>\n <span ng-if="channel.queuecallerleaveAt">\n {{channel.connectedlinename}}, {{channel.connectedlinenum}}\n <span class="text-boxed">\n <timer start-time="channel.queuecallerleaveAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n <span ng-if="!channel.queuecallerleaveAt" class="text-boxed">\n {{ \'VOICE.WAITING_FOR_AGENT\' | translate }}\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell>\n <span class="text-boxed">\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.hangup(channel.uniqueid)" translate="VOICE.HANGUP">\n Hangup\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.redirectToNumber($event, channel.uniqueid)" translate="VOICE.REDIRECT_TO_NUMBER">\n Number\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" translate="VOICE.REDIRECT_TO_AGENT">Redirect to Agent</md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.redirectToAgent(channel.uniqueid, agent.name)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n \x3c!-- <tr md-row ng-repeat="call in vm.calls.rows | filter: vm.query.filter | limitTo: vm.query.limit: (vm.query.page - 1) * vm.query.limit">\n <td md-cell>\n <i ng-class="vm.channelStatusClass[call.status.toLowerCase()]"></i>\n </td>\n <td md-cell>{{call.exten}}</td>\n <td md-cell>{{call.queue}}</td>\n <td md-cell><span ng-if="call.calleridname">{{call.calleridname}}, </span>{{call.calleridnum}}</td>\n <td md-cell>\n <span ng-if="call.queuecallerleaveAt">\n {{call.connectedlinename}}, {{call.connectedlinenum}}\n <span class="text-boxed">\n <timer start-time="call.queuecallerleaveAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n <span ng-if="!call.queuecallerleaveAt" class="text-boxed" translate="VOICE.WAITING_FOR_AGENT">\n Waiting for agent...\n <span class="text-boxed">\n <timer start-time="call.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n </td>\n <td md-cell>\n <span class="text-boxed">\n <timer ng-if="call.queuecallerjoinAt" start-time="call.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <span ng-if="call.queuecallercomplete || call.queuecallerabandon || call.queuecallerexit" translate="VOICE.CLOSING">Closing</span>\n </span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical" ></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.hangup(call.uniqueid)" translate="VOICE.HANGUP">\n Hangup\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.redirectToNumber($event, call.uniqueid)" translate="VOICE.REDIRECT_TO_NUMBER">\n Number\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" translate="VOICE.REDIRECT_TO_AGENT">Redirect to Agent</md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.redirectToAgent(call.uniqueid, agent.name)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr> --\x3e\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.queryChannels.limit" md-page="vm.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-total="{{vm.getSize(vm.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n\x3c!-- / QUEUES TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column>{{\' VOICE.NAME\' | translate}}</th>\n <th md-column>{{\' VOICE.TOTAL_OFFERED\' | translate}}</th>\n <th md-column>{{\' VOICE.ANSWERED\' | translate}}</th>\n <th md-column>{{\' VOICE.ABANDONED\' | translate}}</th>\n <th md-column>{{\' VOICE.UNMANAGED\' | translate}}</th>\n <th md-column>{{\' VOICE.AVG_HOLD_TIME\' | translate}}</th>\n <th md-column>{{\' VOICE.AVG_DURATION\' | translate}}</th>\n <th md-column>{{\' VOICE.AVG_BILLABLE\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, queue) in vm.queues">\n <td md-cell>\n <span>{{queue.name}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{queue.total || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.total) ? (queue.answered || 0) * 100/queue.total : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{(queue.total - queue.answered - queue.unmanaged) || 0}} ({{(queue.total) ? ((queue.total - queue.answered - queue.unmanaged) || 0) * 100/queue.total : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.unmanaged || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumHoldTime / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumDuration / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSED\' | translate }}</th>\n <th md-column>{{ \'VOICE.READY\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th md-column>{{ \'VOICE.TALKING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{(vm.queues[value].talking || 0) }}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditVoiceQueue($event, vm.queues[value])" translate="VOICE.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="VOICE.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.TELEPHONES">Telephones</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.TRUNKS">Trunks</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ABANDONEDCALLS">Abandoned Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUE_PARAMS">Queue Parameters</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.OUTBOUND_CALLS">Outbound Calls</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/realtime/telephones/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.TELEPHONES">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n <tr md-row>\n <th md-column md-order-by="fullname">{{ \'VOICE.ACCOUNTNAME\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'VOICE.INTERNAL\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.telephones">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="telephone" md-select-id="id" ng-repeat="(id, telephone) in vm.telephones">\n <td md-cell>{{telephone.fullname}}</td>\n <td md-cell>{{telephone.internal}}</td>\n <td md-cell>\n <i ng-class="vm.stateClass[telephone.state]">\n <md-tooltip>{{\'VOICE.\' + telephone.state | uppercase | translate}}</md-tooltip>\n </i>\n </td>\n <td md-cell>\n <i ng-class="vm.statusClass[telephone.status]">\n <md-tooltip>{{\'VOICE.\' + telephone.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="telephone.status === \'registered\'" class="text-boxed">{{telephone.address}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.TRUNKS">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'FAX.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head>\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.TRUNK_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.REGISTRY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n <td md-cell>{{trunk.name}}</td>\n <td md-cell>\n <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n <md-tooltip>{{\'VOICE.\' + trunk.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n </td>\n <td md-cell>\n <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n <md-tooltip>{{\'VOICE.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n <span ng-if="!trunk.registry" translate="VOICE.NO_REGISTRY">\n No Registry\n </span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToTrunk($event, trunk)" translate="VOICE.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/voicemails/create/dialog.html",'<md-dialog class="voicemail-dialog" aria-label="New Voicemail">\n <form name="voicemailForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.FULLNAME">FullName</label>\n <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus>\n <div ng-messages="voicemailForm[\'fullname\'].$error" ng-show="voicemailForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'">\n <div ng-messages="voicemailForm[\'email\'].$error" ng-show="voicemailForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="voicemailForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="voicemailForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX">MailBox</label>\n <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" ng-disabled="!vm.newVoicemail">\n <div ng-messages="voicemailForm[\'mailbox\'].$error" ng-show="voicemailForm[\'mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ATTACH">Attach</label>\n <md-select name="attach" ng-model="vm.voicemail.attach">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div ng-messages="voicemailForm[\'attach\'].$error" ng-show="voicemailForm[\'attach\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newVoicemail" ng-click="vm.saveVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid || voicemailForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newVoicemail" ng-click="vm.addNewVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEMAIL" translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n ADD VOICEMAIL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newVoicemail" ng-click="vm.deleteVoicemail($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicemails/edit/view.html",'<div id="voice-voicemail" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-voicemails-button md-icon-button" aria-label="Go to voicemails" ng-click="vm.gotoVoicemails()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEMAILS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="voicemail-image" hide-xs>\n <img ng-src="assets/images/business/voicemails.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.voicemail.id}}\n <span ng-if="vm.voicemail.name">{{vm.voicemail.name}}</span>\n <span ng-if="vm.voicemail.exten">{{vm.voicemail.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voicemail.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveVoicemail()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (messagesForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="voicemail-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.FULLNAME">FullName</label>\n <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'fullname\'].$error" ng-show="generalForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'">\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="generalForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX">MailBox</label>\n <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" ng-disabled="true">\n <div ng-messages="generalForm[\'mailbox\'].$error" ng-show="generalForm[\'mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.VOICEMAIL_CONTEXT">Voicemail_Context</label>\n <md-select name="context" ng-model="vm.voicemail.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.VOICEMAIL_CONTEXT"></span></div>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VOICEMAIL_CONTEXT_REQUIRED">Voicemail_Context field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="voicemail-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEZONE">TimeZone</label>\n <input type="text" name="tz" ng-model="vm.voicemail.tz" ng-required="true" autofocus>\n <div ng-messages="advancedForm[\'tz\'].$error" ng-show="advancedForm[\'tz\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEZONE_REQUIRED">TimeZone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ATTACH">Attach</label>\n <md-select name="attach" ng-model="vm.voicemail.attach">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'attach\'].$error" ng-show="advancedForm[\'attach\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ENVELOPE">Envelope</label>\n <md-select name="envelope" ng-model="vm.voicemail.envelope">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'envelope\'].$error" ng-show="advancedForm[\'envelope\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ENVELOPE_REQUIRED">Envelope field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DELETE">Delete</label>\n <md-select name="delete" ng-model="vm.voicemail.delete">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'delete\'].$error" ng-show="advancedForm[\'delete\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DELETE_REQUIRED">Delete field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAILBODY">EmailBody</label>\n <input type="text" name="emailbody" ng-model="vm.voicemail.emailbody">\n <div ng-messages="advancedForm[\'emailbody\'].$error" ng-show="advancedForm[\'emailbody\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAILBODY_REQUIRED">EmailBody field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAILSUBJECT">EmailSubject</label>\n <input type="text" name="emailsubject" ng-model="vm.voicemail.emailsubject">\n <div ng-messages="advancedForm[\'emailsubject\'].$error" ng-show="advancedForm[\'emailsubject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAILSUBJECT_REQUIRED">EmailSubject field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXSECONDS">MaxSeconds</label>\n <input type="number" name="maxsecs" ng-model="vm.voicemail.maxsecs" min="0">\n <div ng-messages="advancedForm[\'maxsecs\'].$error" ng-show="advancedForm[\'maxsecs\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXSECONDS_REQUIRED">MaxSeconds field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxSeconds must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXMESSAGES">MaxMessages</label>\n <input type="number" name="maxmsg" ng-model="vm.voicemail.maxmsg" min="0" max="9999">\n <div ng-messages="advancedForm[\'maxmsg\'].$error" ng-show="advancedForm[\'maxmsg\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXMESSAGES_REQUIRED">MaxMessages field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.MESSAGES">MESSAGES</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="voicemail-detail-form-container messages md-background-bg md-whiteframe-1dp">\n <div ng-controller="VoicemailMessagesController as vm_dc" ng-init="vm_dc.init(vm.voicemail)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedVoicemailMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.MESSAGES">Messages</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedVoicemailMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedVoicemailMessages.length}} {{vm_dc.selectedVoicemailMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedVoicemailMessages" csv-label="true" filename="voicemails.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedVoicemailMessages($event)" aria-label="delete selected" translate translate-attr-label="VOICEMAILS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedVoicemailMessages" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getVoicemailMessages">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="callerid">{{ \'VOICE.CALLER_ID\' | translate }}</th>\n <th md-column md-order-by="duration">{{ \'VOICE.DURATION\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="stamp">{{ \'VOICE.RECEIVED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="message" md-select-id="id" ng-repeat="message in vm_dc.voicemailMessages.rows">\n <td md-cell>{{message.id}}</td>\n <td md-cell>{{message.callerid}}</td>\n <td md-cell>{{message.duration}}</td>\n <td md-cell>\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="message.id" model="\'voiceMailMessage\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td md-cell>{{message.stamp | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.voiceMailMessageDownload(message, $event)" translate="VOICE.DOWNLOAD_MESSAGE">\n Download Message\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(message, $event)" translate="VOICE.DELETE_MESSAGE">\n Delete Message\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.voicemailMessages.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="VOICE.NO_MESSAGE_AVAILABLE">No message available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.voicemailMessages.count}}" md-on-paginate="vm_dc.getVoicemailMessages" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voicemails/voicemails.html",'<div id="voicemails" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEMAILS">Voicemails</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoicemails.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoicemails =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voicemails-count">\n <span>{{vm.selectedVoicemails.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICEMAILS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoicemails()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoicemails()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoicemails" csv-label="true" filename="voicemails.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedVoicemails($event)" aria-label="delete selected" translate translate-attr-label="VOICEMAILS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- VOICEMAIL TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoicemails" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoicemails">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="fullname">{{ \'VOICE.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'VOICE.EMAIL\' | translate }}</th>\n <th md-column md-order-by="mailbox">{{ \'VOICE.MAILBOX\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voicemails.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voicemail" md-select-id="id" ng-repeat="voicemail in vm.voicemails.rows">\n <td md-cell ng-if="voicemail.userpic"><img class="avatar" alt="{{voicemail.name}}" ng-src="api/users/{{voicemail.id}}/avatar" /></td>\n <td md-cell ng-if="!voicemail.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voicemail.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditVoicemail($event, voicemail)" md-cell class="id ">{{voicemail.id}}</td>\n <td ng-click="vm.createOrEditVoicemail($event, voicemail)" md-cell class="fullname ">{{voicemail.fullname}}</td>\n <td ng-click="vm.createOrEditVoicemail($event, voicemail)" md-cell class="email ">{{voicemail.email}}</td>\n <td ng-click="vm.createOrEditVoicemail($event, voicemail)" md-cell class="mailbox ">{{voicemail.mailbox}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(voicemail, $event)" translate="VOICE.EDIT_VOICEMAIL">\n Edit Voicemail\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(voicemail, $event)" translate="VOICE.DELETE_VOICEMAIL">\n Delete Voicemail\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.voicemails.count}}" md-on-paginate="vm.getVoicemails" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEMAIL TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEMAIL BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-voicemail-button" ng-click="vm.createOrEditVoicemail($event)" aria-label="add voicemail" translate translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEMAIL BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/create/dialog.html",'<md-dialog class="voiceQueue-dialog" aria-label="New VoiceQueue">\n <form name="voiceQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newVoiceQueue">\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="voiceQueueForm[\'name\'].$error" ng-show="voiceQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required>\n <md-option ng-value="\'ringall\'">Ringall</md-option>\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'">Random</md-option>\n <md-option ng-value="\'linear\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="voiceQueueForm[\'strategy\'].$error" ng-show="voiceQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voiceQueue.description">\n <div ng-messages="voiceQueueForm[\'description\'].$error" ng-show="voiceQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newVoiceQueue" ng-click="vm.saveVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid || voiceQueueForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newVoiceQueue" ng-click="vm.addNewVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEQUEUE" translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n ADD VOICEQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newVoiceQueue" ng-click="vm.deleteVoiceQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue">\n <form name="voiceQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.AGENTADD_VOICEQUEUE">Add Agent to voiceQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="VOICE.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue">\n <form name="voiceQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.TEAMADD_VOICEQUEUE">Add Team in VOICEQUEUE</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="VOICE.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/view.html",'<div id="voice-voiceQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-voiceQueues-button md-icon-button" aria-label="Go to voiceQueues" ng-click="vm.gotoVoiceQueues()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="voiceQueue-image" hide-xs>\n <img ng-src="assets/images/business/voiceQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.voiceQueue.id}}\n <span ng-if="vm.voiceQueue.name">{{vm.voiceQueue.name}}</span>\n <span ng-if="vm.voiceQueue.exten">{{vm.voiceQueue.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voiceQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.voiceQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="VOICE.TEAMADD_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.voiceQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="VOICE.AGENTADD_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.voiceQueue, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="VOICE.GOTO_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (settingsForm.$invalid) || (announcementsForm.$invalid) || (advancedForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="voiceQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required>\n <md-option ng-value="\'ringall\'">Ringall</md-option>\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'">Random</md-option>\n <md-option ng-value="\'linear\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.voiceQueue.timeout" min="0" ng-required="true">\n <div class="hint"><span translate="VOICE.HELP.TIMEOUT"></span></div>\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXLENGTH">MaxLength</label>\n <input type="number" name="maxlen" ng-model="vm.voiceQueue.maxlen" min="0">\n <div class="hint"><span translate="VOICE.HELP.MAXLENGTH"></span></div>\n <div ng-messages="generalForm[\'maxlen\'].$error" ng-show="generalForm[\'maxlen\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXLENGTH_REQUIRED">MaxLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RETRY">Retry</label>\n <input type="number" name="retry" ng-model="vm.voiceQueue.retry" min="0">\n <div class="hint"><span translate="VOICE.HELP.RETRY"></span></div>\n <div ng-messages="generalForm[\'retry\'].$error" ng-show="generalForm[\'retry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WRAPUPTIME">WrapupTime</label>\n <input type="number" name="wrapuptime" ng-model="vm.voiceQueue.wrapuptime" min="0">\n <div class="hint"><span translate="VOICE.HELP.WRAPUPTIME"></span></div>\n <div ng-messages="generalForm[\'wrapuptime\'].$error" ng-show="generalForm[\'wrapuptime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WEIGHT">Weight</label>\n <input type="number" name="weight" ng-model="vm.voiceQueue.weight" min="0">\n <div class="hint"><span translate="VOICE.HELP.WEIGHT"></span></div>\n <div ng-messages="generalForm[\'weight\'].$error" ng-show="generalForm[\'weight\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.JOINWHENEMPTY">JoinWhenEmpty</label>\n <md-select name="joinempty" ng-model="vm.voiceQueue.joinempty" multiple>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'strict\'">strict</md-option>\n <md-option ng-value="\'loose\'">loose</md-option>\n <md-option ng-value="\'paused\'">paused</md-option>\n <md-option ng-value="\'penalty\'">penalty</md-option>\n <md-option ng-value="\'inuse\'">inuse</md-option>\n <md-option ng-value="\'ringing\'">ringing</md-option>\n <md-option ng-value="\'unavailable\'">unavailable</md-option>\n <md-option ng-value="\'invalid\'">invalid</md-option>\n <md-option ng-value="\'unknown\'">unknoww</md-option>\n <md-option ng-value="\'wrapup\'">wrapup</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.JOINWHENEMPTY"></span></div>\n <div ng-messages="generalForm[\'joinempty\'].$error" ng-show="generalForm[\'joinempty\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.JOINWHENEMPTY_REQUIRED">JoinWhenEmpty field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.LEAVEWHENEMPTY">LeaveWhenEmpty</label>\n <md-select name="leavewhenempty" ng-model="vm.voiceQueue.leavewhenempty" multiple>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'strict\'">strict</md-option>\n <md-option ng-value="\'loose\'">loose</md-option>\n <md-option ng-value="\'paused\'">paused</md-option>\n <md-option ng-value="\'penalty\'">penalty</md-option>\n <md-option ng-value="\'inuse\'">inuse</md-option>\n <md-option ng-value="\'ringing\'">ringing</md-option>\n <md-option ng-value="\'unavailable\'">unavailable</md-option>\n <md-option ng-value="\'invalid\'">invalid</md-option>\n <md-option ng-value="\'unknown\'">unknoww</md-option>\n <md-option ng-value="\'wrapup\'">wrapup</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.LEAVEWHENEMPTY"></span></div>\n <div ng-messages="generalForm[\'leavewhenempty\'].$error" ng-show="generalForm[\'leavewhenempty\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.LEAVEWHENEMPTY_REQUIRED">LeaveWhenEmpty field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MUSICONHOLD">MusicOnHold</label>\n <md-select name="musiconhold" ng-model="vm.voiceQueue.musiconhold">\n <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds">{{ musiconhold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MUSICONHOLD"></span></div>\n <div ng-messages="generalForm[\'musiconhold\'].$error" ng-show="generalForm[\'musiconhold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCETOAGENT">AnnounceToAgent</label>\n <md-select name="announce" ng-model="vm.voiceQueue.announce">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + announce.save_name" ng-repeat="announce in vm.sounds">{{ announce.name }}</md-option>\n <md-option ng-value="\'FALSE\'">None</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCETOAGENT"></span></div>\n <div ng-messages="generalForm[\'announce\'].$error" ng-show="generalForm[\'announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCETOAGENT_REQUIRED">AnnounceToAgent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voiceQueue.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="voiceQueue-detail-form-container settings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.SETTINGS">SETTINGS</div>\n </div>\n <form name="settingsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEFREQUENCY">AnnounceFrequency</label>\n <input type="number" name="announce_frequency" ng-model="vm.voiceQueue.announce_frequency" min="0" autofocus>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'announce_frequency\'].$error" ng-show="settingsForm[\'announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_REQUIRED">AnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINANNOUNCEFREQUENCY">MinAnnounceFrequency</label>\n <input type="number" name="min_announce_frequency" ng-model="vm.voiceQueue.min_announce_frequency" min="0">\n <div class="hint"><span translate="VOICE.HELP.MINANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'min_announce_frequency\'].$error" ng-show="settingsForm[\'min_announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_REQUIRED">MinAnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MinAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PERIODICANNOUNCEFREQUENCY">PeriodicAnnounceFrequency</label>\n <input type="number" name="periodic_announce_frequency" ng-model="vm.voiceQueue.periodic_announce_frequency" min="0">\n <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'periodic_announce_frequency\'].$error" ng-show="settingsForm[\'periodic_announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_REQUIRED">PeriodicAnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">PeriodicAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RANDOMPERIODICANNOUNCE">RandomPeriodicAnnounce</label>\n <md-select name="random_periodic_announce" ng-model="vm.voiceQueue.random_periodic_announce">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RANDOMPERIODICANNOUNCE"></span></div>\n <div ng-messages="settingsForm[\'random_periodic_announce\'].$error" ng-show="settingsForm[\'random_periodic_announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RANDOMPERIODICANNOUNCE_REQUIRED">RandomPeriodicAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEHOLDTIME">AnnounceHoldtime</label>\n <md-select name="announce_holdtime" ng-model="vm.voiceQueue.announce_holdtime">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'once\'">Once</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEHOLDTIME"></span></div>\n <div ng-messages="settingsForm[\'announce_holdtime\'].$error" ng-show="settingsForm[\'announce_holdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEHOLDTIME_REQUIRED">AnnounceHoldtime field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCECALLERPOSITION">AnnounceCallerPosition</label>\n <md-select name="announce_position" ng-model="vm.voiceQueue.announce_position">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'limit\'">Limit</md-option>\n <md-option ng-value="\'more\'">More</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCECALLERPOSITION"></span></div>\n <div ng-messages="settingsForm[\'announce_position\'].$error" ng-show="settingsForm[\'announce_position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCECALLERPOSITION_REQUIRED">AnnounceCallerPosition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEPOSITIONLIMIT">AnnouncePositionLimit</label>\n <input type="number" name="announce_position_limit" ng-model="vm.voiceQueue.announce_position_limit">\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEPOSITIONLIMIT"></span></div>\n <div ng-messages="settingsForm[\'announce_position_limit\'].$error" ng-show="settingsForm[\'announce_position_limit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEPOSITIONLIMIT_REQUIRED">AnnouncePositionLimit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.REPORTHOLDTIMEAGENT">ReportHoldtimeAgent</label>\n <md-select name="reportholdtime" ng-model="vm.voiceQueue.reportholdtime">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.REPORTHOLDTIMEAGENT"></span></div>\n <div ng-messages="settingsForm[\'reportholdtime\'].$error" ng-show="settingsForm[\'reportholdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.REPORTHOLDTIMEAGENT_REQUIRED">ReportHoldtimeAgent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="voiceQueue-detail-form-container announcements md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</div>\n </div>\n <form name="announcementsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PERIODICANNOUNCE">PeriodicAnnounce</label>\n <md-select name="periodic_announce" ng-model="vm.voiceQueue.periodic_announce" autofocus multiple>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + periodic_announce.save_name" ng-repeat="periodic_announce in vm.sounds">{{ periodic_announce.name }}</md-option>\n <md-option ng-value="\'\'">Default</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'periodic_announce\'].$error" ng-show="announcementsForm[\'periodic_announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCE_REQUIRED">PeriodicAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.HOLDTIMEANNOUNCE">HoldTimeAnnounce</label>\n <md-select name="queue_reporthold" ng-model="vm.voiceQueue.queue_reporthold">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_reporthold.save_name" ng-repeat="queue_reporthold in vm.sounds">{{ queue_reporthold.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.HOLDTIMEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_reporthold\'].$error" ng-show="announcementsForm[\'queue_reporthold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.HOLDTIMEANNOUNCE_REQUIRED">HoldTimeAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.YOUARENEXTANNOUNCE">YouareNextAnnounce</label>\n <md-select name="queue_youarenext" ng-model="vm.voiceQueue.queue_youarenext">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_youarenext.save_name" ng-repeat="queue_youarenext in vm.sounds">{{ queue_youarenext.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.YOUARENEXTANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_youarenext\'].$error" ng-show="announcementsForm[\'queue_youarenext\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.YOUARENEXTANNOUNCE_REQUIRED">YouareNextAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.THEREAREANNOUNCE">ThereareAnnounce</label>\n <md-select name="queue_thereare" ng-model="vm.voiceQueue.queue_thereare">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thereare.save_name" ng-repeat="queue_thereare in vm.sounds">{{ queue_thereare.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.THEREAREANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_thereare\'].$error" ng-show="announcementsForm[\'queue_thereare\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.THEREAREANNOUNCE_REQUIRED">ThereareAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WAITINGCALLSANNOUNCE">WaitingCallsAnnounce</label>\n <md-select name="queue_callswaiting" ng-model="vm.voiceQueue.queue_callswaiting">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_callswaiting.save_name" ng-repeat="queue_callswaiting in vm.sounds">{{ queue_callswaiting.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.WAITINGCALLSANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_callswaiting\'].$error" ng-show="announcementsForm[\'queue_callswaiting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WAITINGCALLSANNOUNCE_REQUIRED">WaitingCallsAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ESTIMATEDHOLDTIMEANNOUNCE">EstimatedHoldTimeAnnounce</label>\n <md-select name="queue_holdtime" ng-model="vm.voiceQueue.queue_holdtime">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_holdtime.save_name" ng-repeat="queue_holdtime in vm.sounds">{{ queue_holdtime.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ESTIMATEDHOLDTIMEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_holdtime\'].$error" ng-show="announcementsForm[\'queue_holdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ESTIMATEDHOLDTIMEANNOUNCE_REQUIRED">EstimatedHoldTimeAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINUTESANNOUNCE">MinutesAnnounce</label>\n <md-select name="queue_minutes" ng-model="vm.voiceQueue.queue_minutes">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minutes.save_name" ng-repeat="queue_minutes in vm.sounds">{{ queue_minutes.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MINUTESANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_minutes\'].$error" ng-show="announcementsForm[\'queue_minutes\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINUTESANNOUNCE_REQUIRED">MinutesAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINUTEANNOUNCE">MinuteAnnounce</label>\n <md-select name="queue_minute" ng-model="vm.voiceQueue.queue_minute">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minute.save_name" ng-repeat="queue_minute in vm.sounds">{{ queue_minute.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MINUTEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_minute\'].$error" ng-show="announcementsForm[\'queue_minute\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINUTEANNOUNCE_REQUIRED">MinuteAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SECONDSANNOUNCE">SecondsAnnounce</label>\n <md-select name="queue_seconds" ng-model="vm.voiceQueue.queue_seconds">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_seconds.save_name" ng-repeat="queue_seconds in vm.sounds">{{ queue_seconds.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SECONDSANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_seconds\'].$error" ng-show="announcementsForm[\'queue_seconds\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SECONDSANNOUNCE_REQUIRED">SecondsAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.THANKYOUANNOUNCE">ThankYouAnnounce</label>\n <md-select name="queue_thankyou" ng-model="vm.voiceQueue.queue_thankyou">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thankyou.save_name" ng-repeat="queue_thankyou in vm.sounds">{{ queue_thankyou.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.THANKYOUANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_thankyou\'].$error" ng-show="announcementsForm[\'queue_thankyou\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.THANKYOUANNOUNCE_REQUIRED">ThankYouAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="voiceQueue-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.voiceQueue.acw" aria-label="AfterCallWork"><span translate="VOICE.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.voiceQueue.acw" class="md-block">\n <label translate="VOICE.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.voiceQueue.acwTimeout" min="0" ng-required="true">\n <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AUTOPAUSE">AutoPause</label>\n <md-select name="autopause" ng-model="vm.voiceQueue.autopause">\n\n <md-option ng-value="\'all\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.AUTOPAUSE"></span></div>\n <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RINGINUSE">RingInUse</label>\n <md-select name="ringinuse" ng-model="vm.voiceQueue.ringinuse">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RINGINUSE"></span></div>\n <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MEMBERDELAY">MemberDelay</label>\n <input type="number" name="memberdelay" ng-model="vm.voiceQueue.memberdelay" min="0">\n <div class="hint"><span translate="VOICE.HELP.MEMBERDELAY"></span></div>\n <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUTRESTART">TimeoutRestart</label>\n <md-select name="timeoutrestart" ng-model="vm.voiceQueue.timeoutrestart">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.TIMEOUTRESTART"></span></div>\n <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.voiceQueue.monitor_format">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <input type="text" name="context" ng-model="vm.voiceQueue.context">\n <div class="hint"><span translate="VOICE.HELP.CONTEXT"></span></div>\n <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n <md-select name="setinterfacevar" ng-model="vm.voiceQueue.setinterfacevar">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETINTERFACEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETQUEUEVARIABLES">SetQueueVariables</label>\n <md-select name="setqueuevar" ng-model="vm.voiceQueue.setqueuevar">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETQUEUEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n <md-select name="setqueueentryvar" ng-model="vm.voiceQueue.setqueueentryvar">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/voiceQueues.html",'<div id="voiceQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEQUEUES">VoiceQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoiceQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoiceQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voiceQueues-count">\n <span>{{vm.selectedVoiceQueues.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICEQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoiceQueues()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoiceQueues()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceQueues" csv-label="true" filename="voiceQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedVoiceQueues($event)" aria-label="delete selected" translate translate-attr-label="VOICEQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- VOICEQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoiceQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'VOICE.STRATEGY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceQueues.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voiceQueue" md-select-id="id" ng-repeat="voiceQueue in vm.voiceQueues.rows">\n <td md-cell ng-if="voiceQueue.userpic"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="api/users/{{voiceQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!voiceQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="id ">{{voiceQueue.id}}</td>\n <td ng-click="vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="name ">{{voiceQueue.name}}</td>\n <td ng-click="vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="strategy ">{{ vm.arraystrategy[voiceQueue.strategy].option }}</td>\n <td ng-click="vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="description ">{{voiceQueue.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(voiceQueue, $event)" translate="VOICE.EDIT_VOICEQUEUE">\n Edit VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(voiceQueue, $event)" translate="VOICE.TEAMADD_VOICEQUEUE">\n teamadd VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(voiceQueue, $event)" translate="VOICE.AGENTADD_VOICEQUEUE">\n agentadd VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(voiceQueue, $event)" translate="VOICE.DELETE_VOICEQUEUE">\n Delete VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(voiceQueue, $event)" translate="VOICE.GOTOREALTIME_VOICEQUEUE">\n goToRealtime VoiceQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.voiceQueues.count}}" md-on-paginate="vm.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEQUEUE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-voiceQueue-button" ng-click="vm.createOrEditVoiceQueue($event)" aria-label="add voiceQueue" translate translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceRecordings/create/dialog.html",'<md-dialog class="voiceRecording-dialog" aria-label="New VoiceRecording">\n <form name="voiceRecordingForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.RATING">Rating</label>\n <md-select name="rating" ng-model="vm.voiceRecording.rating" autofocus>\n <md-option ng-value="null">{{\'VOICE.NO_RATING\' | translate}}</md-option>\n <md-option value="1">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n </md-option>\n <md-option value="2">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n </md-option>\n <md-option value="3">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n </md-option>\n <md-option value="4">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n </md-option>\n <md-option value="5">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n </md-option>\n </md-select>\n <div ng-messages="voiceRecordingForm[\'rating\'].$error" ng-show="voiceRecordingForm[rating].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RATING_REQUIRED">Rating field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newVoiceRecording" ng-click="vm.saveVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid || voiceRecordingForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newVoiceRecording" ng-click="vm.addNewVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICERECORDING" translate-attr-aria-label="VOICE.ADD_VOICERECORDING">\n ADD VOICERECORDING\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newVoiceRecording" ng-click="vm.deleteVoiceRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",'<div id="voiceRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICERECORDINGS">VoiceRecordings</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n \x3c!-- DATE FILTER --\x3e\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE_RANGE">Select Date Range</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearDateFilter()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.CLEAR\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getVoiceRecordings()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n \x3c!-- /DATE FILTER --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoiceRecordings.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoiceRecordings =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voiceRecordings-count">\n <span>{{vm.selectedVoiceRecordings.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICERECORDINGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoiceRecordings()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoiceRecordings()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceRecordings" csv-label="true" filename="voiceRecordings.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedVoiceRecordings($event)" aria-label="delete selected" translate translate-attr-label="VOICERECORDINGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- VOICERECORDING TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoiceRecordings" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column md-order-by="membername">{{ \'VOICE.AGENT\' | translate }}</th>\n <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voiceRecording" md-select-id="id" ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n <td md-cell ng-if="voiceRecording.userpic"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="api/users/{{voiceRecording.id}}/avatar" /></td>\n <td md-cell ng-if="!voiceRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="type ">{{voiceRecording.type}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="uniqueid ">{{voiceRecording.uniqueid}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="calleridnum ">{{voiceRecording.calleridnum}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="exten ">{{voiceRecording.exten}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="connectedlinenum ">{{voiceRecording.connectedlinenum}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="queue ">{{voiceRecording.queue}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="membername ">{{voiceRecording.membername}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="rating ">\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span></td>\n <td md-cell class="audio " ng-switch="voiceRecording.format">\n \x3c!-- audio recording directive --\x3e\n <ms-recording ng-switch-when=".wav" id="voiceRecording.id"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n <span ng-switch-when=".gsm|.WAV" ng-switch-when-separator="|">\n <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n </span>\n </td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userDisposition ">{{voiceRecording.userDisposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(voiceRecording, $event)" translate="VOICE.DOWNLOAD_VOICERECORDING">\n Download VoiceRecording\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(voiceRecording, $event)" translate="VOICE.DELETE_VOICERECORDING">\n Delete VoiceRecording\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICERECORDING TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/navigation/layouts/horizontal-navigation/navigation.html",'<div layout="row" layout-align="start center">\n <ms-navigation-horizontal></ms-navigation-horizontal>\n</div>'),e.put("app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html",'<ms-navigation class="scrollable" folded="vm.folded" ms-scroll="vm.msScrollOptions">\n</ms-navigation>'),e.put("app/navigation/layouts/vertical-navigation/navigation.html",'<md-toolbar class="navigation-header md-whiteframe-1dp" layout="row" layout-align="space-between center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n \x3c!-- <span class="logo-image"><img src="assets/images/logos/whisker_32x32.png" alt="motion_whisker_32x32" /></span> --\x3e\n <span class="logo-text text-truncate">{{vm.getLogo() | uppercase}}</span>\n </div>\n <md-icon class="fold-toggle s18" md-font-icon="icon-backburger" hide show-gt-sm ng-click="vm.toggleMsNavigationFolded()"></md-icon>\n</md-toolbar>\n\n<ms-navigation class="scrollable" folded="vm.folded" ms-scroll="vm.msScrollOptions"></ms-navigation>'),e.put("app/quick-panel/quick-panel.html",'<md-content>\n <md-tabs md-no-pagination md-swipe-content md-stretch-tabs="always">\n <md-tab>\n <md-tab-label>\n <span translate="QUICKPANEL.TODAY">TODAY</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="today-tab scrollable" ms-scroll ng-include="\'app/quick-panel/tabs/today/today-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'" ng-controller="ChatInternalController as vm_ct" ng-init="vm_ct.init(vm.license)" md-on-deselect="vm_ct.user = undefined">\n <md-tab-label>\n <div ng-if="vm.unreadTotalMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalMessages}}</div>\n <span>MESSENGER</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="chat-tab scrollable" ms-scroll ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'" ng-controller="ChatGroupController as vm_cg" ng-init="vm_cg.init(vm.license)" md-on-deselect="vm_cg.group = undefined">\n <md-tab-label>\n <div ng-if="vm.unreadTotalGroupMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalGroupMessages}}</div>\n <span translate="QUICKPANEL.GROUPS">GROUPS</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="group-tab scrollable" ms-scroll ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n</md-content>'),e.put("app/quick-panel/tabs/activity/activity-tab.html",'<md-list class="friends">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.FRIENDS">Friends</span>\n </md-subheader>\n\n <md-list-item class="friend md-3-line" ng-repeat="friend in vm.activities.friends">\n <img ng-src="{{friend.avatar}}" class="md-avatar" alt="{{friend.name}}" />\n\n <div class="status {{friend.status}}"></div>\n\n <div ng-if="contact.unread" class="md-accent-bg unread-message-count">{{contact.unread}}</div>\n\n <div class="md-list-item-text">\n <h3 class="message">{{friend.message}}</h3>\n <p class="time">{{friend.time}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="servers">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.APP_SERVERS">Application Servers</span>\n </md-subheader>\n\n <md-list-item class="server md-3-line" ng-repeat="server in vm.activities.servers">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s16 status" ng-class="server.status"></md-icon>\n\n <div class="md-list-item-text">\n <h3>{{server.location}}</h3>\n <p>{{server.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="stats">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.USER_STATS">User Stats</span>\n </md-subheader>\n\n <md-list-item class="stat md-2-line" ng-repeat="stat in vm.activities.stats">\n <div class="md-list-item-text">\n <span>{{stat.title}} ({{stat.current}} / {{stat.total}})</span>\n <md-progress-linear ng-class="stat.status" md-mode="determinate" value="{{stat.percent}}"></md-progress-linear>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/quick-panel/tabs/chat/chat-tab.html",'<div class="main animate-slide-left" ng-hide="vm_ct.user">\n <md-subheader class="md-no-sticky">\n <div class="search" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n <input class="search-input" ng-model="vm_ct.search.$" type="text" placeholder="Search by fullname.." translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n <md-select ng-model="vm_ct.search.online" class="height-50 no-padding no-margin">\n <md-option ng-value="undefined">All</md-option>\n <md-option ng-value="true">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 green-fg"></md-icon>Online</md-option>\n <md-option ng-value="false">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 red-fg"></md-icon>Offline</md-option>\n </md-select>\n </div>\n </md-subheader>\n \x3c!-- <select ng-model="vm_ct.filterOnline" class="height-50 no-padding no-margin">\n <option ng-value="undefined">All</option>\n <option ng-value="true"><md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 green-fg"></md-icon>Online</option>\n <option ng-value="false"><md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 red-fg"></md-icon>Offline</option>\n </select> --\x3e\n <md-divider></md-divider>\n <md-list class="recent">\n <md-list-item class="contact md-3-line" ng-if="user.id != vm_ct.currentUser.id" ng-repeat="user in vm_ct.users.rows | orderBy: \'-lastMessageAt\' | filter:vm_ct.search" ng-click="vm_ct.toggleChat(user)">\n <md-divider></md-divider>\n <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="md-avatar" alt="{{user.fullname}}" />\n <div class="status" ng-class="{true: \'online\', false: \'offline\'}[user.online]"></div>\n <div ng-if="vm_ct.unreadMessage[user.id]" class="md-accent-bg unread-message-count">{{vm_ct.unreadMessage[user.id]}}</div>\n <div class="md-list-item-text">\n <div layout="row">\n <h3>{{user.fullname}}</h3>\n <md-icon ng-if="!user.allowmessenger && user.role === \'agent\'" class="s16 margin-left-5" ng-style="{\'color\': \'red\' }" md-font-icon="icon-block-helper"></md-icon>\n </div>\n <p>{{user.name}} <{{user.internal}}></p>\n <div layout="row" layout-align="start center">\n <md-icon ng-if="!user.lastMessage.read && user.lastMessage.FromId === vm_ct.currentUser.id" class="s16 no-margin" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="user.lastMessage.read && user.lastMessage.FromId === vm_ct.currentUser.id" class="s16 no-margin" md-font-icon="icon-check-all md-accent"></md-icon>\n <p>{{user.lastMessage.body | limitTo:20 }}{{user.lastMessage.body.length > 20 ? \'...\' : \'\' }}</p>\n <span flex></span>\n <p class="last-message" ng-if="user.lastMessageAt != vm_ct.standardDate">{{user.lastMessageAt | formatdate}}</p>\n </div>\n </div>\n </md-list-item>\n </md-list>\n</div>\n\n<div class="chat animate-slide-right" ng-show="vm_ct.user" layout="column">\n <md-toolbar class="md-accent">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n\n <div layout="row" layout-align="start center">\n <md-button class="md-icon-button" ng-click="vm_ct.toggleChat()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK">\n <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n </md-button>\n <h4>\n <span>{{vm_ct.user.fullname}}</span>\n </h4>\n </div>\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm_ct.license.webrtc && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 2 && vm_ct.user.role === \'agent\'" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="vm_ct.webcall(vm_ct.user.name)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n <md-menu ng-if="vm_ct.currentUser.phoneBarRemoteControl && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 0 && vm_ct.user.role === \'agent\'">\n <md-button class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n <md-button ng-click="vm_ct.call(vm_ct.user.name)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{vm_ct.user.name}})\n </md-button>\n </md-menu-item>\n <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n <md-button ng-click="vm_ct.transfer(vm_ct.user.name)">\n {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} ({{vm_ct.user.name}})\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n\n \x3c!-- <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="QUICKPANEL.MORE">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button> --\x3e\n </div>\n </div>\n\n </md-toolbar>\n <md-content flex layout-paddings ms-scroll id="chat-dialog">\n <div layout="row" ng-repeat="message in vm_ct.user.messages.rows" class="md-padding message-row" ng-class="message.FromId === vm_ct.currentUser.id ? \'user\' : \'contact\'">\n <img ng-if="message.FromId === vm_ct.user.id" ng-src="{{vm_ct.user.userpic ? \'api/users/\' + vm_ct.user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="avatar" alt="{{vm_ct.user.fullname}}" />\n <img ng-if="message.FromId === vm_ct.currentUser.id" class="avatar" ng-src="{{vm_ct.currentUser.userpic ? \'api/users/\' + vm_ct.currentUser.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}">\n <div class="bubble" flex>\n <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n <div layout="row" layout-align="end center">\n <span class="time secondary-text">{{message.createdAt | formatdate }}</span>\n <md-icon ng-if="!message.read && message.FromId === vm_ct.currentUser.id" class="s16 margin-5" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read && message.FromId === vm_ct.currentUser.id" class="s16 margin-5" md-font-icon="icon-check-all md-accent"></md-icon>\n </div>\n </div>\n </div>\n </md-content>\n\n <form ng-submit="vm_ct.reply()" layout="row" class="reply" layout-align="start center">\n <textarea ng-keyup="$event.keyCode == 13 && !vm_ct.disabled? vm_ct.reply() : null" flex ng-model="vm_ct.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n\n <md-button ng-disable="vm_ct.disabled" class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n <md-icon md-font-icon="icon-send"></md-icon>\n </md-button>\n </form>\n</div>'),e.put("app/quick-panel/tabs/groups/create/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n <form name="groupForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n \x3c!--START Error--\x3e\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n \x3c!--END Error--\x3e\n\n \x3c!--START NAME--\x3e\n <md-input-container class="md-block">\n <label translate="QUICKPANEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.group.name" required autofocus>\n <div ng-messages="groupForm[\'name\'].$error" ng-show="groupForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="QUICKPANEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="QUICKPANEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n \x3c!--END NAME--\x3e\n\n \x3c!--START Members--\x3e\n <md-input-container class="md-block">\n <label translate="QUICKPANEL.MEMBERS">Members</label>\n <md-contact-chips ng-model="vm.group.members" md-contacts="vm.querySearch($query)" md-contact-name="name" md-contact-image="image" md-require-match="true" md-highlight-flags="i" placeholder="{{\'QUICKPANEL.MEMBERS\' | translate}}">\n </md-contact-chips>\n <div ng-messages="groupForm[\'strategy\'].$error" ng-show="groupForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="QUICKPANEL.ERRORS.MEMBERS_REQUIRED">Members field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!--END Members--\x3e\n\n \x3c!--START Writing--\x3e\n <md-input-container class="md-block">\n <md-switch ng-model="vm.group.write" aria-label="Write">\n {{\'QUICKPANEL.ENABLE_WRITING\' | translate}}\n </md-switch>\n </md-input-container>\n \x3c!--END Writing--\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.newChatGroup" ng-click="vm.saveChatGroup()" class="send-button md-accent md-raised" ng-disabled="groupForm.$invalid || groupForm.$pristine || (vm.group.members.length < 1)" aria-label="SAVE" translate="QUICKPANEL.SAVE"\n translate-attr-aria-label="QUICKPANEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/groups/group-tab.html",'<div class="main animate-slide-left" ng-if="!vm_cg.group">\n <md-subheader>\n <div layout="row">\n \x3c!-- START Search --\x3e\n <div class="search" layout="row" layout-align="start center" flex>\n <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n <input ng-model="vm_cg.search" type="text" translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n </div>\n \x3c!-- END Search --\x3e\n\n \x3c!-- START New Group --\x3e\n <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-icon-button" aria-label="New" ng-click="vm_cg.addGroup(null, $event)">\n <md-icon md-font-icon="icon-account-multiple-plus" class="icon"></md-icon>\n </md-button>\n \x3c!-- END New Group --\x3e\n </div>\n </md-subheader>\n\n <md-divider></md-divider>\n\n \x3c!-- START Groups --\x3e\n <md-list class="recent no-padding">\n \x3c!-- START Group --\x3e\n <md-list-item class="contact" ng-repeat="group in vm_cg.groupsToArray() | filter:vm_cg.search" ng-click="vm_cg.toggleChat(group)">\n <img src="assets/images/avatars/group.png" class="md-avatar" alt="{{group.name}}" />\n <div ng-if="group.unreadGroupMessages" class="md-accent-bg unread-message-count">{{group.unreadGroupMessages}}</div>\n <div class="md-list-item-text">\n <div layout="row">\n <h3>{{group.name}}</h3>\n </div>\n </div>\n\n <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-secondary md-icon-button" aria-label="Remove" ng-click="vm_cg.deleteGroup(group, $event)">\n <md-icon md-font-icon="icon-delete" class="icon s18"></md-icon>\n </md-button>\n\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n <md-list-item>\n <div ng-if="!vm_cg.groupsToArray().length" layout="row" layout-align="center center" flex>\n <span>{{\'QUICKPANEL.NO_AVAILABLE_GROUPS\' | translate}}</span>\n </div>\n </md-list-item>\n \x3c!-- END Group --\x3e\n </md-list>\n \x3c!-- END Groups --\x3e\n</div>\n\n<div class="chat animate-slide-right" ng-if="vm_cg.group" layout="column">\n <md-toolbar class="md-accent">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n\n <div layout="row" layout-align="start center">\n <md-button class="md-icon-button" ng-click="vm_cg.back()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK">\n <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n </md-button>\n <h4>\n <span translate="QUICKPANEL.YOU" translate-values=\'{participants: vm_cg.participants}\'></span>\n </h4>\n </div>\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm_cg.license.webrtc && vm_cg.currentUser.role === \'agent\' && vm_cg.currentUser.showWebBar === 2 && vm_cg.user.role === \'agent\' && vm_cg.user.showWebBar === 2" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL"\n ng-click="vm_cg.webcall(vm_cg.user.name)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n </div>\n\n </md-toolbar>\n <md-content flex layout-paddings ms-scroll id="chat-group-dialog">\n <div layout="row" ng-repeat="message in vm_cg.group.messages" class="message-row" ng-class="message.FromId === vm_cg.currentUser.id ? \'user\' : \'contact\'">\n <img ng-if="message.FromId !== vm_cg.currentUser.id" ng-src="{{\'api/users/\' + message.FromId + \'/avatar\'}}" class="avatar" alt="{{vm_cg.user.fullname}}" />\n <img ng-if="message.FromId === vm_cg.currentUser.id" class="avatar" ng-src="{{vm_cg.currentUser.userpic ? \'api/users/\' + vm_cg.currentUser.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}">\n <div class="bubble" flex>\n <div ng-if="message.FromId !== vm_cg.currentUser.id">\n <span style="font-size: 12px;">{{vm_cg.group.membersByKeys[message.FromId].fullname}}</span>\n </div>\n <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n <div layout="row" layout-align="end center">\n <span class="time secondary-text" style="margin-top: 0px;">{{message.createdAt | formatdate }}</span>\n <md-icon ng-if="message.FromId === vm_cg.currentUser.id" class="s16 margin-5" style="cursor: pointer;" md-font-icon="icon-information-outline" ng-click="vm_cg.showMessageInfo($event, message)"></md-icon>\n </div>\n </div>\n </div>\n </md-content>\n\n <form ng-if="(vm_cg.currentUser.role !== \'agent\') || vm_cg.group.write" ng-submit="vm_cg.reply()" layout="row" class="reply" layout-align="start center">\n <textarea ng-keyup="$event.keyCode == 13 ? vm_cg.reply() : null" flex ng-model="vm_cg.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n\n <md-button class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n <md-icon md-font-icon="icon-send"></md-icon>\n </md-button>\n </form>\n</div>'),e.put("app/quick-panel/tabs/groups/info/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n <form name="groupForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div ng-if="vm.data.messages[$index].FromId !== vm.data.messages[$index].ToId" ng-repeat="user in vm.data.users" layout-margin>\n <div layout="row">\n <div layout="row" layout-align="start center">\n <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="avatar" alt="{{user.fullname}}" />\n <span>{{user.fullname}}</span>\n </div>\n <div layout="row" layout-align="end center" flex>\n <md-icon class="s16 margin-5" md-font-icon="{{vm.data.messages[$index].read ? \'icon-check-all md-accent\' : \'icon-check\'}}"></md-icon>\n <span class="time secondary-text">{{vm.data.messages[$index].updatedAt | formatdate }}</span>\n </div>\n </div>\n <div>\n <md-divider ng-if="!$last"></md-divider>\n </div>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/today/today-tab.html",'<md-list class="date">\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.TODAY">Today</span></md-subheader>\n <md-list-item class="md-display-1 md-2-line">\n <div class="secondary-text">\n <div translate="QUICKPANEL.{{ (vm.date | date:\'EEEE\').toUpperCase() }}"></div>\n <div layout="row" layout-align="start start">\n <span> {{vm.date | date:\'d\'}}</span>\n <span class="md-subhead">th</span>\n <span translate="QUICKPANEL.{{ (vm.date | date:\'MMMM\').toUpperCase() }}"></span>\n </div>\n </div>\n </md-list-item>\n</md-list>\n\n\x3c!-- <md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.EVENTS">Events</span></md-subheader>\n\n <md-list-item class="md-2-line" ng-repeat="event in vm.events" ng-click="dummyFunction()">\n <div class="md-list-item-text">\n <h3>{{event.title}}</h3>\n\n <p>{{event.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.NOTES">Notes</span></md-subheader>\n <md-list-item class="md-2-line" ng-repeat="note in vm.notes" ng-click="dummyFunction()">\n <div class="md-list-item-text">\n <h3>{{note.title}}</h3>\n\n <p>{{note.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.QUICK_SETTINGS">Quick Settings</span></md-subheader>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.NOTIFICATIONS">Notifications</h3>\n <md-switch class="md-secondary" ng-model="vm.settings.notify" aria-label="Notifications" translate\n translate-attr-aria-label="QUICKPANEL.NOTIFICATIONS"></md-switch>\n </md-list-item>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.CLOUD_SYNC">Cloud Sync</h3>\n <md-switch class="md-secondary" ng-model="vm.settings.cloud" aria-label="Cloud Sync" translate\n translate-attr-aria-label="QUICKPANEL.CLOUD_SYNC"></md-switch>\n </md-list-item>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.RETRO_THRUSTERS">Retro Thrusters</h3>\n <md-switch class="md-secondary md-warn" ng-model="vm.settings.retro" aria-label="Retro Thrusters" translate\n translate-attr-aria-label="QUICKPANEL.RETRO_THRUSTERS"></md-switch>\n </md-list-item>\n</md-list> --\x3e'),e.put("app/reset/reset.html",'<div id="reset-password" class="flex-scrollable" layout="column" ng-init="vm.onInit()" ms-scroll>\n <div id="reset-password-form-wrapper" layout="column" layout-align="center center">\n <div id="reset-password-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n <div class="title" translate="RESETPASSWORD.TITLE">Reset your password</div>\n\n <form name="resetPasswordForm" novalidate>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="password" ng-model="vm.form.password" ng-pattern="vm.passwordPattern" placeholder="Password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD" required>\n <div ng-messages="resetPasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="RESETPASSWORD.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="RESETPASSWORD.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="passwordConfirm" ng-model="vm.form.passwordConfirm" placeholder="Password (Confirm)" match-password="password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD_CONFIRM">\n <div ng-messages="resetPasswordForm.passwordConfirm.$error" role="alert">\n <div ng-message="passwordMatch">\n <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-button type="button" ng-click="vm.resetPassword()" class="md-raised md-accent submit-button" aria-label="UPDATE MY PASSWORD" ng-disabled="resetPasswordForm.$invalid || resetPasswordForm.$pristine" translate="RESETPASSWORD.UPDATE_PASSWORD" translate-attr-aria-label="RESETPASSWORD.UPDATE_PASSWORD">\n RESET MY PASSWORD\n </md-button>\n </form>\n </div>\n </div>\n</div>'),e.put("app/toolbar/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="changePasswordForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="vm.reset" class="title" translate="TOOLBAR.RESETPASSWORD">Reset Password</span>\n <span ng-if="!vm.reset" class="title" translate="TOOLBAR.CHANGEPASSWORD">Change Password</span>\n <md-button ng-if="!vm.reset" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="TOOLBAR.OLD_PASSWORD" required>\n <div ng-messages="changePasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="TOOLBAR.NEW_PASSWORD" required>\n <div ng-messages="changePasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLBAR.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="changePasswordForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="changePasswordForm.$invalid || changePasswordForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/toolbar/layouts/vertical-navigation/toolbar.html",'<div layout="row" layout-align="start center">\n <div layout="row" layout-align="start center" flex>\n <md-button id="navigation-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'navigation\')" hide-gt-sm aria-label="Toggle navigation" translate translate-attr-aria-label="TOOLBAR.TOGGLE_NAVIGATION">\n <md-icon md-font-icon="icon-menu" class="icon"></md-icon>\n </md-button>\n\n <ms-shortcuts ng-if="!vm.isAgent()"></ms-shortcuts>\n\n <div class="toolbar-separator"></div>\n\n <div ng-if="vm.license.demo" class="blink md-padding">\n <span class="md-warn-fg" translate="TOOLBAR.TRIAL_VERSION">Trial Version</span>\n </div>\n\n <div ng-if="vm.isAgent()" class="logo" layout-padding-left-8 layout="row" layout-align="start center">\n <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n <span ng-show="vm.isAgent() && (vm.user.showWebBar != 2)" class="logo-text text-truncate">{{ vm.getLogo() | uppercase }}</span>\n </div>\n\n \x3c!-- phonebar directive WebRtc type--\x3e\n <ms-phonebar class="ms-phonebar" ng-if="vm.isAgent() && (vm.user.showWebBar == 2)" conf="vm.conf" flex></ms-phonebar>\n \x3c!-- phonebar directive --\x3e\n </div>\n\n <div layout="row" layout-align="start center">\n\n <md-progress-circular id="toolbar-progress" ng-if="$root.loadingProgress" class="md-accent" md-diameter="32"></md-progress-circular>\n\n \x3c!-- Pause Management --\x3e\n <div ng-if="vm.isAgent() && (vm.user.showWebBar != 0)" layout="row" layout-align="end center">\n <div class="toolbar-separator"></div>\n\n <div class="border brad-5" layout="row" layout-align="center center" layout-margin>\n <md-button ng-if="vm.user.voicePause" class="md-icon-button no-margin" ng-click="vm.unpause()">\n <md-icon md-font-icon="icon-play-circle-outline" class="icon s24"></md-icon>\n <md-tooltip md-direction="bottom">{{\'TOOLBAR.RESUME\' | translate}}</md-tooltip>\n </md-button>\n\n <md-button ng-disabled="vm.user.voicePause && \'DEFAULT PAUSE\' === vm.user.pauseType" class="md-icon-button no-margin" ng-click="vm.pause()">\n <md-icon md-font-icon="icon-pause-circle-outline" class="icon s24"></md-icon>\n <md-tooltip md-direction="bottom">{{\'TOOLBAR.PAUSE\' | translate}}</md-tooltip>\n </md-button>\n\n <md-menu>\n <md-button aria-label="Pauses" class="md-icon-button no-margin" ng-click="$mdOpenMenu($event)">\n <md-icon md-menu-origin md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="4">\n <md-menu-item ng-if="!vm.pauses.length">\n <md-button disabled="disabled">\n <md-icon md-font-icon="icon-pause-octagon" md-menu-align-target></md-icon>\n {{\'TOOLBAR.NO_PAUSES_AVAILABLE\' | translate}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-repeat="pause in vm.pauses">\n <md-button ng-disabled="vm.user.voicePause && pause.name === vm.user.pauseType" ng-click="vm.pause(pause.name)">\n <md-icon md-font-icon="icon-pause-circle" md-menu-align-target></md-icon>\n {{pause.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n \x3c!-- Pause Management --\x3e\n\n <div class="h5 padding-10" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)">\n <div layout="row" layout-align="space-between center">\n <timer ng-if="vm.user.lastLoginAt" start-time="vm.user.lastLoginAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <md-tooltip>{{\'TOOLBAR.LOGIN_TIME\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-timelapse" class="icon s16"></md-icon>\n </div>\n <div layout="row" layout-align="center center" ng-if="vm.user.voicePause">\n <timer start-time="vm.user.lastPauseAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <md-tooltip>{{\'TOOLBAR.PAUSE_TIME\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-coffee" class="icon s16"></md-icon>\n </div>\n <div ng-if="vm.user.voicePause">\n <span class="blink red-fg">{{vm.user.pauseType || \'default\' | uppercase}}</span>\n </div>\n </div>\n\n <div class="toolbar-separator" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)"></div>\n\n <md-menu-bar id="user-menu">\n <md-menu md-position-mode="left bottom">\n <md-button class="user-button" ng-click="$mdOpenMenu()" aria-label="User settings" translate translate-attr-aria-label="TOOLBAR.USER_SETTINGS">\n <div layout="row" layout-align="space-between center">\n <div class="avatar-wrapper">\n <img md-menu-align-target class="avatar" src="assets/images/avatars/profile.png" ng-if="!vm.user.userpic">\n <img md-menu-align-target class="avatar" ng-src="api/users/{{vm.user.id}}/avatar" ng-if="vm.user.userpic">\n <md-icon md-font-icon ng-class="vm.userStatus.icon" ng-style="{\'color\': vm.userStatus.color }" class="icon status s16"></md-icon>\n </div>\n <div layout="column" layout-align="center center" class="padding-horizontal-5">\n <span class="font-size-14 md-subhead">{{vm.user.fullname}}</span>\n <span class="font-size-12 md-subhead">{{vm.user.name}} <{{vm.user.internal}}></span>\n </div>\n\n <md-icon md-font-icon="icon-chevron-down" class="icon s16" hide-xs></md-icon>\n </div>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.user.showWebBar == 2 && vm.user.phoneBarEnableSettings" class="md-indent">\n <md-icon md-font-icon="icon-cog" class="icon"></md-icon>\n <md-button ng-click="vm.openSettings($event)" ng-disabled="!vm.license.webrtc"><span translate="TOOLBAR.SETTINGS">SETTINGS</span></md-button>\n </md-menu-item>\n\n <md-menu-item class="md-indent">\n <md-icon md-font-icon="icon-key-variant" class="icon"></md-icon>\n <md-button ng-click="vm.changePassword($event)"><span translate="TOOLBAR.CHANGEPASSWORD">Change Password</span></md-button>\n </md-menu-item>\n\n <md-menu-divider></md-menu-divider>\n\n <md-menu-item class="md-indent">\n <md-icon md-font-icon="icon-logout" class="icon"></md-icon>\n <md-button ng-click="vm.logout()">Logout</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-bar>\n\n <div class="toolbar-separator"></div>\n\n <md-button ng-if="vm.user.role === \'agent\' && vm.license.dialer" class="preview-button no-margin" ng-disabled="vm.disable" ng-click="vm.preview($event)" aria-label="Language" md-menu-origin md-menu-align-target>\n <div ng-if="vm.contacts" class="md-accent-bg open-contact-count">{{vm.contacts > 99 ? \'99+\' : vm.contacts}}</div>\n <md-icon md-font-icon="icon-fire" class="icon red-900-fg"></md-icon>\n <md-tooltip><span translate="TOOLBAR.PREVIEW">Preview</span></md-tooltip>\n </md-button>\n\n <ms-search-bar ng-if="vm.user.role !== \'agent\'" on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300" collapse-on-blur="true"></ms-search-bar>\n\n <md-menu id="language-menu" md-offset="0 72" md-position-mode="target-right target" layout="column" layout-align="center center">\n <md-button class="md-icon-button no-margin" ng-click="$mdOpenMenu()" aria-label="Language" md-menu-origin md-menu-align-target>\n <div layout="row" layout-align="center center">\n <img class="flag" ng-src="assets/images/flags/{{vm.selectedLanguage.flag}}.png">\n </div>\n </md-button>\n\n <md-menu-content width="3" id="language-menu-content">\n <md-menu-item ng-repeat="(iso, lang) in vm.languages">\n <md-button ng-click="vm.changeLanguage(lang)" aria-label="{{lang.title}}" translate translate-attr-aria-label="{{lang.title}}">\n <span layout="row" layout-align="start center">\n <img class="flag" ng-src="assets/images/flags/{{lang.flag}}.png">\n <span translate="{{lang.translation}}">{{lang.title}}</span>\n </span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n\n <div class="toolbar-separator"></div>\n\n <md-button ng-if="vm.license.gray && vm.user.role !== \'agent\'" class="md-icon-button" ui-sref="app.settings.license" aria-label="Toggle quick panel">\n <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.gray && vm.user.role === \'agent\'" class="md-icon-button" aria-label="Toggle quick panel">\n <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n </md-button>\n\n <div ng-if="vm.license.gray" class="toolbar-separator"></div>\n\n <md-button id="quick-panel-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'quick-panel\')" aria-label="Toggle quick panel" translate translate-attr-aria-label="TOOLBAR.TOGGLE_QUICK_PANEL">\n <div ng-if="(vm.unreadTotalMessages + vm.unreadTotalGroupMessages)" class="md-accent-bg unread-message-count">{{vm.unreadTotalMessages + vm.unreadTotalGroupMessages}}</div>\n <md-icon md-font-icon="icon-format-list-bulleted" class="icon"></md-icon>\n </md-button>\n </div>\n</div>'),e.put("app/toolbar/preview/dialog.html",'<md-dialog class="preview-dialog" aria-label="preview">\n <form name="previewForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">Preview</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div layout="row" ng-if="vm.preview">\n <div class="md-padding" layout="column" flex="30">\n <md-input-container ng-if="vm.preview.Queue.name" class="md-block">\n <label translate="VOICE.QUEUE">Queue</label>\n <input type="text" ng-model="vm.preview.Queue.name" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.List.name" class="md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <input type="text" ng-model="vm.preview.List.name" disabled="true">\n </md-input-container>\n </div>\n <md-divider></md-divider>\n <div class="md-padding" layout="column" flex="70">\n <md-input-container ng-if="vm.preview.Contact.firstName" class="md-block">\n <label translate="CONTACTMANAGER.FIRSTNAME">FirstName</label>\n <input type="text" ng-model="vm.preview.Contact.firstName" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Contact.lastName" class="md-block">\n <label translate="CONTACTMANAGER.LASTNAME">LastName</label>\n <input type="text" ng-model="vm.preview.Contact.lastName" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Contact.phone" class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input type="text" ng-model="vm.preview.Contact.phone" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Contact.email" class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input type="text" ng-model="vm.preview.Contact.email" disabled="true">\n </md-input-container>\n </div>\n </div>\n <div layout="row" ng-if="!vm.preview">\n <span>no contacts available</span>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" style="padding-right: 16px;">\n <md-button type="submit" ng-disabled="vm.disable" ng-click="vm.originatePreview($event)" class="send-button md-accent md-raised" aria-label="CALL" translate="TOOLS.CALL" translate-attr-aria-label="TOOLS.CALL">\n CALL\n </md-button>\n <md-button type="submit" ng-disabled="vm.disableGetContact" ng-click="vm.nextContact($event)" class="send-button md-accent md-raised" aria-label="NEXTCONTACT" translate="TOOLS.NEXTCONTACT" translate-attr-aria-label="TOOLS.NEXTCONTACT">\n NEXTCONTACT\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>')}]);
\ No newline at end of file
+!function(){"use strict";angular.module("app.auth",[])}(),function(){"use strict";angular.module("app.core",["ngAnimate","ngAria","ngCookies","ngMessages","ngResource","ngSanitize","ngMaterial","pascalprecht.translate","ui.router","gridster","ds.clock","angucomplete-alt"])}(),function(){"use strict";function e(e,t){e.state("app.errors_error-404",{url:"/errors/error-404",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-404":{templateUrl:"app/errors/404/error-404.html",controller:"Error404Controller as vm"}},params:{status:404,statusText:"",data:{},config:{}},bodyClass:"error-404"}),t.addPart("app/errors/404")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-404",[]).config(e)}(),function(){"use strict";function e(e,t){e.state("app.errors_error-500",{url:"/errors/error-500",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-500":{templateUrl:"app/errors/500/error-500.html",controller:"Error500Controller as vm"}},params:{status:500,statusText:"",data:{},config:{}},bodyClass:"error-500"}),t.addPart("app/errors/500")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-500",[]).config(e)}(),function(){"use strict";angular.module("app.errors",["app.errors.error-404","app.errors.error-500"])}(),function(){"use strict";function e(e){e.addPart("app/footer")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.footer",[]).config(e)}(),function(){"use strict";function e(e,t){e.state("app.forgot",{url:"/forgot",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.forgot":{templateUrl:"app/forgot/forgot.html",controller:"ForgotPasswordController as vm"}},bodyClass:"forgot"}),t.addPart("app/forgot")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.forgot",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/header")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.header",[]).config(e)}(),function(){"use strict";angular.module("motion",["angular-toasty","app.core","app.auth","app.navigation","app.toolbar","app.quick-panel","app.header","app.footer","app.dashboards","app.staff","app.contactmanager","app.voice","app.chat","app.mail","app.sms","app.openchannel","app.fax","app.tools","app.callysquare","app.analytics","app.integrations","app.settings","app.help","app.motiondialer","app.jscripty","app.login","app.forgot","app.reset","app.errors"])}(),function(){"use strict";function e(e,t){e.state("app.login",{url:"/login?token&userId",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.login":{templateUrl:"app/login/login.html",controller:"LoginController as vm"}},bodyClass:"login"}),t.addPart("app/login")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.login",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.analytics",{abstract:!0,url:"/analytics"}).state("app.analytics.metrics",{url:"/metrics",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/metrics/metrics.html",controller:"MetricsController as vm"}},resolve:{metrics:["apiResolver",function(e){return e.resolve("analyticMetric@get",{fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1201,bodyClass:"analytics"}).state("app.analytics.extractedReports",{url:"/extractedReports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/extractedReports/extractedReports.html",controller:"ExtractedReportsController as vm"}},resolve:{extractedReports:["apiResolver",function(e){return e.resolve("analyticExtractedReport@get",{fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,createdAt,status,output",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1202,bodyClass:"analytics"}),t.addPart("app/main/apps/analytics")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.analytics",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.analytics.reports"]).config(e)}(),function(){"use strict";function e(e){e.state("app.analytics.reports",{url:"/reports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/reports.html",controller:"ReportsController as vm"}},resolve:{treeReports:["apiResolver",function(e){return e.resolve("analyticTreeReport@get",{fields:"id,tree",limit:10,offset:0})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"}).state("app.analytics.reports.edit",{url:"/:id?tab",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/edit/view.html",controller:"ReportController as vm"}},resolve:{report:["apiResolver","$stateParams","$q","describeTable",function(e,t,a,i){var o;return e.resolve("analyticCustomReport@get",{fields:"createdAt,updatedAt,id,name,description,table,conditions,joins",id:t.id}).then(function(e){var t=[];if((o=e).joins)try{o.joins=JSON.parse(o.joins);for(var n=0;n<o.joins.length;n+=1)t.push(i.getColumns(o.joins[n].foreignTable))}catch(e){console.log(e)}return a.all(t)}).then(function(e){for(var t=0;t<e.length;t+=1)o.joins[t].foreignTableFields=_.difference(_.keys(e[t]),["$promise","$resolved"]);return o})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"})}e.$inject=["$stateProvider"],angular.module("app.analytics.reports",["ngJsTree"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.callysquare",{abstract:!0,url:"/callysquare"}).state("app.callysquare.odbcs",{url:"/odbcs",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/odbcs/odbcs.html",controller:"OdbcsController as vm"}},resolve:{odbcs:["apiResolver",function(e){return e.resolve("squareOdbc@get",{fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1101,bodyClass:"callysquare"}).state("app.callysquare.squareRecordings",{url:"/squareRecordings",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",controller:"SquareRecordingsController as vm"}},resolve:{squareRecordings:["apiResolver",function(e){return e.resolve("squareRecording@get",{fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,createdAt",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1102,bodyClass:"callysquare"}),t.addPart("app/main/apps/callysquare")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.callysquare",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.callysquare.projects"]).config(e)}(),function(){"use strict";function e(e){e.state("app.callysquare.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/projects.html",controller:"ProjectsController as vm"}},resolve:{projects:["apiResolver",function(e){return e.resolve("squareProject@get",{fields:"id,name,description,notes",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"}).state("app.callysquare.projects.edit",{url:"/:id?tab",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/edit/view.html",controller:"ProjectController as vm"}},resolve:{project:["apiResolver","$stateParams",function(e,t){return e.resolve("squareProject@get",{id:t.id})}],users:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,fullname,role",sort:"name",nolimit:!0})}],trunks:["apiResolver",function(e){return e.resolve("trunk@get",{fields:"id,name",sort:"name",nolimit:!0})}],queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"name",nolimit:!0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,type:"inbound",fields:"id,name",sort:"name",nolimit:!0,channel:"voice"})}],sounds:["apiResolver",function(e){return e.resolve("sound@get",{fields:"id,name",sort:"name",nolimit:!0})}],variables:["apiResolver",function(e){return e.resolve("variable@get",{fields:"id,name",sort:"name",nolimit:!0})}],databases:["apiResolver",function(e){return e.resolve("squareOdbc@get",{fields:"id,name",sort:"name",nolimit:!0})}],projects:["apiResolver",function(e){return e.resolve("squareProject@get",{fields:"id,name",sort:"name",nolimit:!0})}],contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"id,name",sort:"name",nolimit:!0})}],intervals:["apiResolver",function(e){return e.resolve("interval@get",{fields:"id,name,IntervalId",sort:"name",nolimit:!0})}],mailAccounts:["apiResolver",function(e){return e.resolve("mailAccount@get",{fields:"id,name",sort:"name",nolimit:!0})}],templates:["apiResolver",function(e){return e.resolve("template@get",{fields:"id,name",sort:"name",nolimit:!0})}],lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0})}],smsAccounts:["apiResolver",function(e){return e.resolve("smsAccount@get",{fields:"id,name",sort:"name",nolimit:!0})}],pauses:["apiResolver",function(e){return e.resolve("pause@get",{fields:"id,name",sort:"name",nolimit:!0})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"})}e.$inject=["$stateProvider"],angular.module("app.callysquare.projects",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.chat",{abstract:!0,url:"/chat"}).state("app.chat.chatQueues",{url:"/chatQueues",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/chatQueues.html",controller:"ChatQueuesController as vm"}},resolve:{chatQueues:["apiResolver",function(e){return e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatQueues.edit",{url:"/:id?tab",params:{chatQueue:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/edit/view.html",controller:"ChatQueueController as vm"}},resolve:{chatQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatWebsites",{url:"/chatWebsites",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/chatWebsites.html",controller:"ChatWebsitesController as vm"}},resolve:{chatWebsites:["apiResolver",function(e){return e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,fontSize,header_shape,showAgentAvatar,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,header_offline,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardTranscript,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}).state("app.chat.chatWebsites.edit",{url:"/:id?tab",params:{chatWebsite:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/edit/view.html",controller:"ChatWebsiteController as vm"}},resolve:{chatWebsite:["apiResolver","$stateParams",function(e,t){return e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,fontSize,header_shape,showAgentAvatar,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,header_offline,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardTranscript,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",id:t.id})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}),t.addPart("app/main/apps/chat")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.chat",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.chat.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.chat.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/chat/views/realtime/realtime.html",controller:"ChatRealtimeController as vm"}},authenticate:!0,permissionId:510}).state("app.chat.realtime.agents",{url:"/agents",controller:"AgentsChatRealtimeController as vm",templateUrl:"app/main/apps/chat/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:510}).state("app.chat.realtime.queues",{url:"/queues",controller:"QueuesChatRealtimeController as vm",templateUrl:"app/main/apps/chat/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("chatQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"chat",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getChatQueues")}]},authenticate:!0,permissionId:510})}e.$inject=["$stateProvider"],angular.module("app.chat.realtime",["timer"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.contactmanager",{abstract:!0,url:"/contactmanager"}).state("app.contactmanager.lists",{url:"/lists",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/lists.html",controller:"ListsController as vm"}},resolve:{lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.lists.edit",{url:"/:id?tab",params:{list:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/edit/view.html",controller:"ListController as vm"}},resolve:{list:["apiResolver","$stateParams",function(e,t){return e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",id:t.id})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.companies",{url:"/companies",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/companies.html",controller:"CompaniesController as vm"}},resolve:{companies:["apiResolver",function(e){return e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.companies.edit",{url:"/:id?tab",params:{company:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/edit/view.html",controller:"CompanyController as vm"}},resolve:{company:["apiResolver","$stateParams",function(e,t){return e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",id:t.id})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.globalCustomFields",{url:"/globalCustomFields",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",controller:"GlobalCustomFieldsController as vm"}},resolve:{globalCustomFields:["apiResolver",function(e){return e.resolve("cmCustomField@get",{fields:"createdAt,updatedAt,id,alias,type,values,required",sort:"-updatedAt",ListId:"null",limit:10,offset:0})}]},authenticate:!0,permissionId:304,bodyClass:"contactmanager"}),t.addPart("app/main/apps/contactmanager")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.contactmanager",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.contactmanager.contacts"]).config(e)}(),function(){"use strict";function e(e){e.state("app.contactmanager.contacts",{url:"/contacts?ListId&CompanyId",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/contacts.html",controller:"ContactsController as vm"}},resolve:{contacts:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@get",_.merge({sort:"-updatedAt",limit:10,offset:0},t))}],lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0})}],listsMap:["lists",function(e){for(var t={},n=0;n<e.rows.length;n++)t[e.rows[n].id]=e.rows[n].name;return t}],companies:["apiResolver",function(e){return e.resolve("cmCompany@get",{fields:"id,name",sort:"name",nolimit:!0})}],companiesMap:["companies",function(e){for(var t={},n=0;n<e.rows.length;n++)t[e.rows[n].id]=e.rows[n].name;return t}],tags:["apiResolver",function(e){return e.resolve("tag@get",{fields:"id,name",sort:"name",nolimit:!0})}]},authenticate:!0,permissionId:300,bodyClass:"contactmanager"}).state("app.contactmanager.contacts.edit",{url:"/:id?tab",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/edit/view.html",controller:"ContactController as vm"}},resolve:{contact:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@get",{id:t.id}).then(function(e){return e.dateOfBirth&&(e.dateOfBirth=new Date(e.dateOfBirth)),e}).catch(function(e){console.error(e)})}],hoppers:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getHoppers",{id:t.id,fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,offset:0})}],finals:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getHopperFinals",{id:t.id,fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-updatedAt",limit:10,offset:0})}],histories:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getHopperHistories",{id:t.id,fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,offset:0})}],jscriptySessions:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getJscriptySessions",{id:t.id,fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,offset:0})}],companies:["apiResolver","$stateParams",function(e,t){return e.resolve("cmCompany@get")}],lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0})}],customFields:["apiResolver","contact",function(e,t){return t.ListId?e.resolve("cmList@getCustomFields",{id:t.ListId}):null}],tags:["apiResolver","$stateParams",function(e,t){return e.resolve("tag@get")}]},authenticate:!0,permissionId:300,bodyClass:"contactmanager"})}e.$inject=["$stateProvider"],angular.module("app.contactmanager.contacts",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.dashboards",{abstract:!0,url:"/dashboards"}),t.addPart("app/main/apps/dashboards")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.dashboards",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.dashboards.general","app.dashboards.custom"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.custom",{url:"/custom/:id",views:{"content@app":{templateUrl:"app/main/apps/dashboards/views/custom/custom.html",controller:"DashboardCustomController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(t,e){var a;return(e.hasRole("admin")?t.resolve("voiceQueue@get",{fields:"id,name",nolimit:!0}):t.resolve("user@getQueues",{id:e.getCurrentUser().id,fields:"id,name",channel:"voice",nolimit:!0})).then(function(e){return a=e,t.resolve("rpc@getVoiceQueues")}).then(function(e){if(e)for(var t,n=0;n<e.rows.length;n+=1)(t=_.find(a.rows,{id:e.rows[n].id}))&&_.merge(t,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return a})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.custom",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general",{url:"/general",data:{selectedTab:0},views:{"content@app":{templateProvider:["$stateParams","$templateFactory","Auth",function(e,t,n){var a=n.getCurrentUser();return a&&"agent"===a.role?t.fromUrl("app/main/apps/dashboards/views/general/agent/agent.general.html",e):t.fromUrl("app/main/apps/dashboards/views/general/user/user.general.html",e)}],controllerProvider:["Auth",function(e){var t=e.getCurrentUser();return t&&"agent"===t.role?"AgentDashboardGeneralController as vm":"UserDashboardGeneralController as vm"}]}},resolve:{globalUserLists:["apiResolver","Auth",function(e,t){return e.resolve("user@getLists",{id:t.getCurrentUser().id,sort:"name",nolimit:!0})}],globalLists:["apiResolver","Auth",function(e,t){return e.resolve("cmList@get",{sort:"name",nolimit:!0})}],globalTags:["apiResolver",function(e){return e.resolve("tag@get",{sort:"name",nolimit:!0})}],globalCompanies:["apiResolver",function(e){return e.resolve("cmCompany@get",{sort:"name",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general",["ngMaterialDateRangePicker","app.dashboards.general.user"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general.voice",{url:"/voice",data:{selectedTab:0},views:{voice:{templateUrl:"app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",controller:"UserVoiceDashboardGeneralController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],inboundQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"inbound",nolimit:!0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0})}],outbound:["apiResolver",function(e){return e.resolve("rpc@getOutbound")}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.dialer",{url:"/dialer",data:{selectedTab:1},views:{dialer:{templateUrl:"app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",controller:"UserVoiceDashboardDialerController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],outboundQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"outbound",nolimit:!0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general.user",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.fax",{abstract:!0,url:"/fax"}).state("app.fax.faxQueues",{url:"/faxQueues",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/faxQueues.html",controller:"FaxQueuesController as vm"}},resolve:{faxQueues:["apiResolver",function(e){return e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxQueues.edit",{url:"/:id?tab",params:{faxQueue:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/edit/view.html",controller:"FaxQueueController as vm"}},resolve:{faxQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxAccounts",{url:"/faxAccounts",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/faxAccounts.html",controller:"FaxAccountsController as vm"}},resolve:{faxAccounts:["apiResolver",function(e){return e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}).state("app.fax.faxAccounts.edit",{url:"/:id?tab",params:{faxAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/edit/view.html",controller:"FaxAccountController as vm"}},resolve:{faxAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,notificationSound,notificationShake,notificationTemplate",id:t.id})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}),t.addPart("app/main/apps/fax")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.fax",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.fax.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.fax.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/fax/views/realtime/realtime.html",controller:"FaxRealtimeController as vm"}},authenticate:!0,permissionId:910}).state("app.fax.realtime.agents",{url:"/agents",controller:"AgentsFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.trunks",{url:"/trunks",controller:"TrunksFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver",function(e){return e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.queues",{url:"/queues",controller:"QueuesFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("faxQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"fax",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getFaxQueues")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.accounts",{url:"/accounts",controller:"FaxAccountsRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/accounts/view.html",resolve:{faxAccounts:["apiResolver",function(e){return e.resolve("faxAccount@get",{sort:"-name",limit:10,offset:0})}],rpcFaxAccounts:["apiResolver",function(e){return e.resolve("rpc@getFaxAccounts")}]},authenticate:!0,permissionId:910})}e.$inject=["$stateProvider"],angular.module("app.fax.realtime",["timer"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.help",{abstract:!0,url:"/help"}),t.addPart("app/main/apps/help")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.help",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.help.about"]).config(e)}(),function(){"use strict";function e(e){e.state("app.help.about",{url:"/about",views:{"content@app":{templateUrl:"app/main/apps/help/views/about/about.html",controller:"AboutController as vm"}},resolve:{info:["apiResolver",function(e){return e.resolve("version@get")}]},authenticate:!0,permissionId:1405,bodyClass:"help"})}e.$inject=["$stateProvider"],angular.module("app.help.about",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.integrations",{abstract:!0,url:"/integrations"}).state("app.integrations.zendeskAccounts",{url:"/zendeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",controller:"ZendeskAccountsController as vm"}},resolve:{zendeskAccounts:["apiResolver",function(e){return e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",limit:10,offset:0})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.zendeskAccounts.edit",{url:"/:id?tab",params:{zendeskAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/view.html",controller:"ZendeskAccountController as vm"}},resolve:{zendeskAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",id:t.id})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts",{url:"/salesforceAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",controller:"SalesforceAccountsController as vm"}},resolve:{salesforceAccounts:["apiResolver",function(e){return e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",limit:10,offset:0})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts.edit",{url:"/:id?tab",params:{salesforceAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/view.html",controller:"SalesforceAccountController as vm"}},resolve:{salesforceAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",id:t.id})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts",{url:"/freshdeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",controller:"FreshdeskAccountsController as vm"}},resolve:{freshdeskAccounts:["apiResolver",function(e){return e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",limit:10,offset:0})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts.edit",{url:"/:id?tab",params:{freshdeskAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",controller:"FreshdeskAccountController as vm"}},resolve:{freshdeskAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",id:t.id})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts",{url:"/sugarcrmAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",controller:"SugarcrmAccountsController as vm"}},resolve:{sugarcrmAccounts:["apiResolver",function(e){return e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",limit:10,offset:0})}]},authenticate:!0,permissionId:1304,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts.edit",{url:"/:id?tab",params:{sugarcrmAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",controller:"SugarcrmAccountController as vm"}},resolve:{sugarcrmAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",id:t.id})}]},authenticate:!0,permissionId:1304,bodyClass:"integrations"}).state("app.integrations.deskAccounts",{url:"/deskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/deskAccounts.html",controller:"DeskAccountsController as vm"}},resolve:{deskAccounts:["apiResolver",function(e){return e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",limit:10,offset:0})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.deskAccounts.edit",{url:"/:id?tab",params:{deskAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/view.html",controller:"DeskAccountController as vm"}},resolve:{deskAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",id:t.id})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.zohoAccounts",{url:"/zohoAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",controller:"ZohoAccountsController as vm"}},resolve:{zohoAccounts:["apiResolver",function(e){return e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,authToken,serverUrl,description",limit:10,offset:0})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.zohoAccounts.edit",{url:"/:id?tab",params:{zohoAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/view.html",controller:"ZohoAccountController as vm"}},resolve:{zohoAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,authToken,serverUrl,description",id:t.id})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}),t.addPart("app/main/apps/integrations")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.integrations",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.jscripty",{abstract:!0,url:"/jscripty"}).state("app.jscripty.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/projects.html",controller:"JscriptyProjectsController as vm"}},resolve:{projects:["apiResolver",function(e){return e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,description,createdAt,formData",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}).state("app.jscripty.projects.edit",{url:"/:id?tab",params:{project:void 0},views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/edit/view.html",controller:"JscriptyProjectController as vm"}},resolve:{project:["apiResolver","$stateParams",function(e,t){return e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,description,createdAt,formData",id:t.id})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}),t.addPart("app/main/apps/jscripty")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.jscripty",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.mail",{abstract:!0,url:"/mail"}).state("app.mail.mailQueues",{url:"/mailQueues",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/mailQueues.html",controller:"MailQueuesController as vm"}},resolve:{mailQueues:["apiResolver",function(e){return e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailQueues.edit",{url:"/:id?tab",params:{mailQueue:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/edit/view.html",controller:"MailQueueController as vm"}},resolve:{mailQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailAccounts",{url:"/mailAccounts",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/mailAccounts.html",controller:"MailAccountsController as vm"}},resolve:{mailAccounts:["apiResolver",function(e){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailAccounts.edit",{url:"/:id?tab",params:{mailAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/edit/view.html",controller:"MailAccountController as vm"}},resolve:{mailAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",id:t.id})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailSubtatuses",{url:"/mailSubtatuses",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",controller:"MailSubstatusesController as vm"}},resolve:{mailSubtatuses:["apiResolver",function(e){return e.resolve("mailSubstatus@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:603,bodyClass:"mail"}),t.addPart("app/main/apps/mail")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.mail",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.mail.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.mail.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/mail/views/realtime/realtime.html",controller:"MailRealtimeController as vm"}},authenticate:!0,permissionId:610}).state("app.mail.realtime.agents",{url:"/agents",controller:"AgentsMailRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.queues",{url:"/queues",controller:"QueuesMailRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("mailQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"mail",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getMailQueues")}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.accounts",{url:"/accounts",controller:"MailAccountsRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/accounts/view.html",resolve:{mailAccounts:["apiResolver",function(e){return e.resolve("mailAccount@get",{sort:"-name",limit:10,offset:0})}],rpcMailAccounts:["apiResolver",function(e){return e.resolve("rpc@getMailAccounts")}]},authenticate:!0,permissionId:610})}e.$inject=["$stateProvider"],angular.module("app.mail.realtime",["timer"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.motiondialer",{abstract:!0,url:"/motiondialer"}).state("app.motiondialer.queueCampaigns",{url:"/queueCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",controller:"QueueCampaignsController as vm"}},resolve:{queueCampaigns:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.queueCampaigns.edit",{url:"/:id?tab",params:{queueCampaign:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",controller:"QueueCampaignController as vm"}},resolve:{queueCampaign:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description",id:t.id})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns",{url:"/ivrCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",controller:"IvrCampaignsController as vm"}},resolve:{ivrCampaigns:["apiResolver",function(e){return e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns.edit",{url:"/:id?tab",params:{ivrCampaign:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",controller:"IvrCampaignController as vm"}},resolve:{ivrCampaign:["apiResolver","$stateParams",function(e,t){return e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",id:t.id})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}),t.addPart("app/main/apps/motiondialer")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.motiondialer",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.motiondialer.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.motiondialer.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/realtime/realtime.html",controller:"MotionDialerRealtimeController as vm"}},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.agents",{url:"/agents",controller:"AgentsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queues",{url:"/queues",controller:"QueuesMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"voice",type:"outbound",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_calls",{url:"/queue_calls",controller:"QueueCallsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queue_calls/view.html",resolve:{agents:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,name,role",role:"agent",nolimit:!0})}],rpcVoiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,name,role",role:"agent",nolimit:!0})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"voice",type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.ivr_campaigns",{url:"/ivr_campaigns",controller:"IvrCampaignsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",resolve:{campaigns:["apiResolver",function(e){return e.resolve("campaign@get",{sort:"-updatedAt",limit:10,offset:0})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,permissionId:1510})}e.$inject=["$stateProvider"],angular.module("app.motiondialer.realtime",["timer"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.openchannel",{abstract:!0,url:"/openchannel"}).state("app.openchannel.openchannelQueues",{url:"/openchannelQueues",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",controller:"OpenchannelQueuesController as vm"}},resolve:{openchannelQueues:["apiResolver",function(e){return e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelQueues.edit",{url:"/:id?tab",params:{openchannelQueue:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/view.html",controller:"OpenchannelQueueController as vm"}},resolve:{openchannelQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts",{url:"/openchannelAccounts",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",controller:"OpenchannelAccountsController as vm"}},resolve:{openchannelAccounts:["apiResolver",function(e){return e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,replyUri,ListId,waitForTheAssignedAgent,description,receiveUri,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts.edit",{url:"/:id?tab",params:{openchannelAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",controller:"OpenchannelAccountController as vm"}},resolve:{openchannelAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,replyUri,ListId,waitForTheAssignedAgent,description,receiveUri,notificationSound,notificationShake,notificationTemplate",id:t.id})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}),t.addPart("app/main/apps/openchannel")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.openchannel",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.openchannel.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.openchannel.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/realtime/realtime.html",controller:"OpenchannelRealtimeController as vm"}},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.agents",{url:"/agents",controller:"AgentsOpenchannelRealtimeController as vm",templateUrl:"app/main/apps/openchannel/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.queues",{url:"/queues",controller:"QueuesOpenchannelRealtimeController as vm",templateUrl:"app/main/apps/openchannel/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("openchannelQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"openchannel",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getOpenchannelQueues")}]},authenticate:!0,permissionId:810})}e.$inject=["$stateProvider"],angular.module("app.openchannel.realtime",["timer"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.settings",{abstract:!0,url:"/settings"}).state("app.settings.generals",{url:"/generals",views:{"content@app":{templateUrl:"app/main/apps/settings/views/generals/generals.html",controller:"GeneralsController as vm"}},resolve:{generals:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,min_internal,securePassword,callRecordingEncryption,stunaddr,turnaddr,turnusername,turnpassword,phoneBarAutoUpdater,phoneBarAutoUpdaterUrl",limit:10,offset:0})}]},authenticate:!0,permissionId:1401,bodyClass:"settings"}).state("app.settings.smtps",{url:"/smtps",views:{"content@app":{templateUrl:"app/main/apps/settings/views/smtps/smtps.html",controller:"SmtpController as vm"}},resolve:{smtps:["apiResolver",function(e){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,service,name,email,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,description",service:"1",limit:10,offset:0})}]},authenticate:!0,permissionId:1402,bodyClass:"settings"}).state("app.settings.networks",{url:"/networks",views:{"content@app":{templateUrl:"app/main/apps/settings/views/networks/networks.html",controller:"NetworksController as vm"}},resolve:{networks:["apiResolver",function(e){return e.resolve("network@get",{fields:"createdAt,updatedAt,id,type,value,value,createdAt",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1403,bodyClass:"settings"}).state("app.settings.customizations",{url:"/customizations",views:{"content@app":{templateUrl:"app/main/apps/settings/views/customizations/customizations.html",controller:"CustomizationsController as vm"}},resolve:{customizations:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,defaultLogo,defaultLoginLogo,defaultHeaderWhiteLabel,headerWhiteLabel,defaultPageTitle,pageTitle",limit:10,offset:0})}]},authenticate:!0,permissionId:1407,bodyClass:"settings"}),t.addPart("app/main/apps/settings")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.settings",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.settings.updates","app.settings.license","app.settings.system"]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.license",{url:"/license",views:{"content@app":{templateUrl:"app/main/apps/settings/views/license/license.html",controller:"LicenseController as vm"}},authenticate:!0,permissionId:1405,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.license",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.system",{url:"/system?tab",views:{"content@app":{templateUrl:"app/main/apps/settings/views/system/system.html",controller:"SystemController as vm"}},resolve:{system:["apiResolver",function(e){return e.resolve("system@get")}],processes:["apiResolver",function(e){return e.resolve("pm2@get")}]},authenticate:!0,permissionId:1406,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.system",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.updates",{url:"/updates",views:{"content@app":{templateUrl:"app/main/apps/settings/views/updates/updates.html",controller:"UpdatesController as vm"}},resolve:{version:["apiResolver",function(e){return e.resolve("version@get",{latest:!0})}]},authenticate:!0,permissionId:1404,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.updates",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.sms",{abstract:!0,url:"/sms"}).state("app.sms.smsQueues",{url:"/smsQueues",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/smsQueues.html",controller:"SmsQueuesController as vm"}},resolve:{smsQueues:["apiResolver",function(e){return e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsQueues.edit",{url:"/:id?tab",params:{smsQueue:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/edit/view.html",controller:"SmsQueueController as vm"}},resolve:{smsQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsAccounts",{url:"/smsAccounts",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/smsAccounts.html",controller:"SmsAccountsController as vm"}},resolve:{smsAccounts:["apiResolver",function(e){return e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,smsMethod,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}).state("app.sms.smsAccounts.edit",{url:"/:id?tab",params:{smsAccount:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/edit/view.html",controller:"SmsAccountController as vm"}},resolve:{smsAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,smsMethod,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",id:t.id})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}),t.addPart("app/main/apps/sms")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.sms",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.sms.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.sms.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/sms/views/realtime/realtime.html",controller:"SmsRealtimeController as vm"}},authenticate:!0,permissionId:710}).state("app.sms.realtime.agents",{url:"/agents",controller:"AgentsSmsRealtimeController as vm",templateUrl:"app/main/apps/sms/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:710}).state("app.sms.realtime.queues",{url:"/queues",controller:"QueuesSmsRealtimeController as vm",templateUrl:"app/main/apps/sms/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("smsQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"sms",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getSmsQueues")}]},authenticate:!0,permissionId:710})}e.$inject=["$stateProvider"],angular.module("app.sms.realtime",["timer"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.staff",{abstract:!0,url:"/staff"}).state("app.staff.users",{url:"/users",views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/users.html",controller:"UsersController as vm"}},resolve:{users:["apiResolver",function(e){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,permissions,crudPermissions,passwordResetAt,passwordResetAt",role:"admin,user",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.users.edit",{url:"/:id?tab",params:{user:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/edit/view.html",controller:"UserController as vm"}},resolve:{user:["apiResolver","$stateParams",function(e,t){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,permissions,crudPermissions,passwordResetAt,passwordResetAt",id:t.id})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.agents",{url:"/agents",views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/agents.html",controller:"AgentsController as vm"}},resolve:{agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,email,phone,mobile,userpic,password,showWebBar,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,voicemail,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,passwordResetAt,passwordResetAt",role:"agent",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"createdAt,updatedAt,id,role,fullname,name,alias,email,phone,mobile,userpic,password,showWebBar,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,voicemail,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,passwordResetAt,passwordResetAt",role:"agent",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.agents.edit",{url:"/:id?tab",params:{agent:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/edit/view.html",controller:"AgentController as vm"}},resolve:{agent:["apiResolver","$stateParams",function(e,t){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,email,phone,mobile,userpic,password,showWebBar,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,voicemail,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,passwordResetAt,passwordResetAt",id:t.id})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.telephones",{url:"/telephones",views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/telephones.html",controller:"TelephonesController as vm"}},resolve:{telephones:["apiResolver",function(e){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.telephones.edit",{url:"/:id?tab",params:{telephone:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/edit/view.html",controller:"TelephoneController as vm"}},resolve:{telephone:["apiResolver","$stateParams",function(e,t){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,encryption,phone,mobile",id:t.id})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.teams",{url:"/teams",views:{"content@app":{templateUrl:"app/main/apps/staff/views/teams/teams.html",controller:"TeamsController as vm"}},resolve:{teams:["apiResolver",function(e){return e.resolve("team@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:204,bodyClass:"staff"}),t.addPart("app/main/apps/staff")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.staff",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.tools",{abstract:!0,url:"/tools"}).state("app.tools.cannedAnswers",{url:"/cannedAnswers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",controller:"CannedAnswersController as vm"}},resolve:{cannedAnswers:["apiResolver",function(e){return e.resolve("cannedAnswer@get",{fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,offset:0})}]},authenticate:!0,permissionId:1002,bodyClass:"tools"}).state("app.tools.customDashboards",{url:"/customDashboards",views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/customDashboards.html",controller:"CustomDashboardsController as vm"}},resolve:{customDashboards:["apiResolver",function(e){return e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.customDashboards.edit",{url:"/:id?tab",params:{customDashboard:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/edit/view.html",controller:"CustomDashboardController as vm"}},resolve:{customDashboard:["apiResolver","$stateParams",function(e,t){return e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",id:t.id})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.intervals",{url:"/intervals",views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/intervals.html",controller:"IntervalsController as vm"}},resolve:{intervals:["apiResolver",function(e){return e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,offset:0})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.intervals.edit",{url:"/:id?tab",params:{interval:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/edit/view.html",controller:"IntervalController as vm"}},resolve:{interval:["apiResolver","$stateParams",function(e,t){return e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",id:t.id})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.pauses",{url:"/pauses",views:{"content@app":{templateUrl:"app/main/apps/tools/views/pauses/pauses.html",controller:"PausesController as vm"}},resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1005,bodyClass:"tools"}).state("app.tools.schedules",{url:"/schedules",views:{"content@app":{templateUrl:"app/main/apps/tools/views/schedules/schedules.html",controller:"SchedulesController as vm"}},resolve:{schedules:["apiResolver",function(e){return e.resolve("schedule@get",{fields:"createdAt,updatedAt,id,name,type,DefaultReportId,CustomReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:42,bodyClass:"tools"}).state("app.tools.sounds",{url:"/sounds",views:{"content@app":{templateUrl:"app/main/apps/tools/views/sounds/sounds.html",controller:"SoundsController as vm"}},resolve:{sounds:["apiResolver",function(e){return e.resolve("sound@get",{fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1006,bodyClass:"tools"}).state("app.tools.tags",{url:"/tags",views:{"content@app":{templateUrl:"app/main/apps/tools/views/tags/tags.html",controller:"TagsController as vm"}},resolve:{tags:["apiResolver",function(e){return e.resolve("tag@get",{fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1007,bodyClass:"tools"}).state("app.tools.templates",{url:"/templates",views:{"content@app":{templateUrl:"app/main/apps/tools/views/templates/templates.html",controller:"TemplatesController as vm"}},resolve:{templates:["apiResolver",function(e){return e.resolve("template@get",{fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1008,bodyClass:"tools"}).state("app.tools.triggers",{url:"/triggers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/triggers.html",controller:"TriggersController as vm"}},resolve:{triggers:["apiResolver",function(e){return e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1009,bodyClass:"tools"}).state("app.tools.triggers.edit",{url:"/:id?tab",params:{trigger:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/edit/view.html",controller:"TriggerController as vm"}},resolve:{trigger:["apiResolver","$stateParams",function(e,t){return e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",id:t.id})}]},authenticate:!0,permissionId:1009,bodyClass:"tools"}).state("app.tools.trunks",{url:"/trunks",views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/trunks.html",controller:"TrunksController as vm"}},resolve:{trunks:["apiResolver",function(e){return e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,otherFields",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"}).state("app.tools.trunks.edit",{url:"/:id?tab",params:{trunk:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/edit/view.html",controller:"TrunkController as vm"}},resolve:{trunk:["apiResolver","$stateParams",function(e,t){return e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,otherFields",id:t.id})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"}).state("app.tools.variables",{url:"/variables",views:{"content@app":{templateUrl:"app/main/apps/tools/views/variables/variables.html",controller:"VariablesController as vm"}},resolve:{variables:["apiResolver",function(e){return e.resolve("variable@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1011,bodyClass:"tools"}),t.addPart("app/main/apps/tools")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.tools",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/voice/views/realtime/realtime.html",controller:"VoiceRealtimeController as vm"}},authenticate:!0,permissionId:410}).state("app.voice.realtime.agents",{url:"/agents",controller:"AgentsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("user@getAgents",{id:t.getCurrentUser().id,fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:410}).state("app.voice.realtime.telephones",{url:"/telephones",controller:"TelephonesVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/telephones/view.html",resolve:{telephones:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,fullname,userpic,internal",role:"telephone",sort:"-updatedAt",limit:10,offset:0})}],rpcTelephones:["apiResolver",function(e){return e.resolve("rpc@getTelephones")}]},authenticate:!0,permissionId:410}).state("app.voice.realtime.trunks",{url:"/trunks",controller:"TrunksVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver",function(e){return e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:410}).state("app.voice.realtime.queues",{url:"/queues",controller:"QueuesVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"voice",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:410}).state("app.voice.realtime.queue_calls",{url:"/queue_calls",controller:"QueueCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queue_calls/view.html",resolve:{agents:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,name,role",role:"agent",nolimit:!0})}],rpcVoiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels")}]},authenticate:!0,permissionId:410}).state("app.voice.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,name,role",role:"agent",nolimit:!0})}]},authenticate:!0,permissionId:410}).state("app.voice.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,channel:"voice",type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:410}).state("app.voice.realtime.outbound_calls",{url:"/outbound_calls",controller:"OutboundCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/outbound_calls/view.html",resolve:{rpcCalls:["apiResolver",function(e){return e.resolve("rpc@getOutboundChannels")}]},authenticate:!0,permissionId:410})}e.$inject=["$stateProvider"],angular.module("app.voice.realtime",["timer"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.voice",{abstract:!0,url:"/voice"}).state("app.voice.voiceQueues",{url:"/voiceQueues",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/voiceQueues.html",controller:"VoiceQueuesController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("user@getQueues",{id:t.getCurrentUser().id,fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.voiceQueues.edit",{url:"/:id?tab",params:{voiceQueue:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/edit/view.html",controller:"VoiceQueueController as vm"}},resolve:{voiceQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar",id:t.id})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.inboundroutes",{url:"/inboundroutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundroutes/inboundroutes.html",controller:"InboundRoutesController as vm"}},resolve:{inboundroutes:["apiResolver",function(e){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}]},authenticate:!0,permissionId:402,bodyClass:"voice"}).state("app.voice.inboundroutes.edit",{url:"/:id?tab",params:{inboundroute:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundroutes/edit/view.html",controller:"InboundRouteController as vm"}},resolve:{inboundroute:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",id:t.id})}]},authenticate:!0,permissionId:402,bodyClass:"voice"}).state("app.voice.outboundroutes",{url:"/outboundroutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundroutes/outboundroutes.html",controller:"OutboundRoutesController as vm"}},resolve:{outboundroutes:["apiResolver",function(e){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,recordingFormat,cutdigits,description",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}]},authenticate:!0,permissionId:403,bodyClass:"voice"}).state("app.voice.outboundroutes.edit",{url:"/:id?tab",params:{outboundroute:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundroutes/edit/view.html",controller:"OutboundRouteController as vm"}},resolve:{outboundroute:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,recordingFormat,cutdigits,description",id:t.id})}]},authenticate:!0,permissionId:403,bodyClass:"voice"}).state("app.voice.internalroutes",{url:"/internalroutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalroutes/internalroutes.html",controller:"InternalRoutesController as vm"}},resolve:{internalroutes:["apiResolver",function(e){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}]},authenticate:!0,permissionId:404,bodyClass:"voice"}).state("app.voice.internalroutes.edit",{url:"/:id?tab",params:{internalroute:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalroutes/edit/view.html",controller:"InternalRouteController as vm"}},resolve:{internalroute:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",id:t.id})}]},authenticate:!0,permissionId:404,bodyClass:"voice"}).state("app.voice.contexts",{url:"/contexts",views:{"content@app":{templateUrl:"app/main/apps/voice/views/contexts/contexts.html",controller:"ContextsController as vm"}},resolve:{contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,offset:0})}]},authenticate:!0,permissionId:405,bodyClass:"voice"}).state("app.voice.voicemails",{url:"/voicemails",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/voicemails.html",controller:"VoicemailsController as vm"}},resolve:{voicemails:["apiResolver",function(e){return e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.voicemails.edit",{url:"/:id?tab",params:{voicemail:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/edit/view.html",controller:"VoicemailController as vm"}},resolve:{voicemail:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",id:t.id})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.musiconholds",{url:"/musiconholds",views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/musiconholds.html",controller:"MusicOnHoldsController as vm"}},resolve:{musiconholds:["apiResolver",function(e){return e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,offset:0})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.musiconholds.edit",{url:"/:id?tab",params:{musiconhold:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/edit/view.html",controller:"MusicOnHoldController as vm"}},resolve:{musiconhold:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",id:t.id})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.voiceRecordings",{url:"/voiceRecordings",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",controller:"VoiceRecordingsController as vm"}},resolve:{voiceRecordings:["apiResolver",function(e){return e.resolve("voiceRecording@get",{fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,createdAt,userDisposition",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:408,bodyClass:"voice"}).state("app.voice.chanSpies",{url:"/chanSpies",views:{"content@app":{templateUrl:"app/main/apps/voice/views/chanSpies/chanSpies.html",controller:"ChanSpiesController as vm"}},resolve:{chanSpies:["apiResolver",function(e){return e.resolve("voiceChanSpy@get",{fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:409,bodyClass:"voice"}),t.addPart("app/main/apps/voice")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.voice",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.voice.realtime"]).config(e)}(),function(){"use strict";angular.module("app.navigation",[]).config(function(){})}(),function(){"use strict";function e(e,t){e.addPart("app/quick-panel")}e.$inject=["$translatePartialLoaderProvider","msApiProvider"],angular.module("app.quick-panel",[]).config(e)}(),function(){"use strict";function e(e,t){e.state("app.reset",{url:"/reset/:token",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.reset":{templateUrl:"app/reset/reset.html",controller:"ResetPasswordController as vm"}},bodyClass:"reset"}),t.addPart("app/reset")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.reset",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/toolbar")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.toolbar",[]).config(e)}(),function(){"use strict";function e(e){e.interceptors.push("authInterceptor")}e.$inject=["$httpProvider"],angular.module("app.auth").config(e)}(),function(){"use strict";function e(e,n,t,a){e.$on("$stateChangeStart",function(e,t){return t.hasOwnProperty("authenticate")&&t.authenticate&&!a.isLoggedIn()?(e.preventDefault(),n.go("app.login",{},{reload:!0,notify:!0})):a.isLoggedIn()&&t.hasOwnProperty("permissionId")&&t.permissionId&&!a.hasPermission(t.permissionId)&&!a.hasRole("admin")?(e.preventDefault(),n.go("app.dashboards.general",{},{reload:!0,notify:!0})):void 0})}e.$inject=["$rootScope","$state","$window","Auth"],angular.module("app.auth").run(e)}(),function(){"use strict";function e(e,a,i,o,t){var s,r=["id","role","fullname","name","internal","email","userpic","permissions","md5secret","phoneBarAutoAnswer","phoneBarAutoAnswerDelay","phoneBarEnableRecording","phoneBarEnableDtmfTone","voicePause","chatPause","mailPause","faxPause","smsPause","openchannelPause","phoneBarEnableSettings","phoneBarExpires","pauseType","showWebBar","phoneBarRemoteControlPort","phoneBarRemoteControl","lastLoginAt","lastPauseAt","crudPermissions","allowmessenger","passwordResetAt","alias"];function l(){var t=i.defer();return d("agent")&&0!==s.showWebBar?o.user.login({id:s.id}).$promise.then(function(){console.log("AGENT LOGGED IN"),t.resolve()}).catch(function(e){console.error(e),t.reject(e)}):d("admin")||d("user")?o.user.update({id:s.id},{online:!0,lastLoginAt:moment().format("YYYY-MM-DD HH:mm:ss")}).$promise.catch(function(e){console.error(e)}).finally(function(){t.resolve()}):t.resolve(),t.promise}function n(){if(a.remove("motion.user"),a.remove("motion.token"),s&&s.id){var e=s.id;s=null,t.localStorage.removeItem("motion.user:"+e)}}function d(e){return!!s&&s.role===e}function c(){return a.get("motion.token")}function m(e){return s=_.assign(s,_.pick(e,r)),a.put("motion.user",JSON.stringify(s)),s}return function(){if(a.get("motion.user"))s=JSON.parse(a.get("motion.user")),o.user.get({id:s.id,fields:r.join(",")}).$promise.then(function(e){if(e)return m(e)}).catch(function(e){console.log("Error retrieving user",e)})}(),{login:function(e){var t,n=i.defer();return o.auth.local(e).$promise.then(function(e){return t=e,a.put("motion.token",e.token),o.user.get({id:e.id,fields:r.join(",")}).$promise}).then(function(e){return(s=e).lastLoginAt=moment(),a.put("motion.user",JSON.stringify(e)),l()}).then(function(){n.resolve()}).catch(function(e){n.reject(e.data)}).finally(function(){return o.user.get({id:t.id,fields:r.join(",")}).$promise.then(function(e){s=e})}),n.promise},logout:function(e){var t;return i.defer(),e?(n(),i.resolve()):(t=i.defer(),d("agent")&&0!==s.showWebBar?o.user.logout({id:s.id}).$promise.then(function(){console.log("AGENT LOGGED OUT")}).catch(function(e){console.error(e)}).finally(function(){t.resolve()}):d("admin")||d("user")?o.user.update({id:s.id},{online:!1}).$promise.catch(function(e){console.error(e)}).finally(function(){t.resolve()}):t.resolve(),t.promise).then(n).catch(function(e){console.error(e)})},queueLogin:l,isLoggedIn:function(){return!(!s||!c())},hasRole:d,hasPermission:function(e){return!!s&&_.includes(s.permissions,e)},getToken:c,getCurrentUser:function(){return s},updateCurrentUser:m,removeCookies:n}}e.$inject=["$location","$cookies","$q","api","$window"],angular.module("app.auth").factory("Auth",e)}(),function(){"use strict";function e(e,t,n,a,i){var o;return{request:function(e){var t=n.get("motion.token");return e.headers=e.headers||{},i.isSameOrigin(e.url)&&t&&(e.headers.Authorization="Bearer "+t),e},responseError:function(e){switch(e.status){case 401:n.remove("motion.user"),n.remove("motion.token"),(o||(o=a.get("$state"))).go("app.login")}return t.reject(e)}}}e.$inject=["$rootScope","$q","$cookies","$injector","Util"],angular.module("app.auth").factory("authInterceptor",e)}(),function(){"use strict";function e(t){var n={safeCb:function(e){return angular.isFunction(e)?e:angular.noop},urlParse:function(e){var t=document.createElement("a");return t.href=e,""===t.host&&(t.href=t.href),t},isSameOrigin:function(i,e){return i=n.urlParse(i),(e=(e=e&&[].concat(e)||[]).map(n.urlParse)).push(t.location),1<=(e=e.filter(function(e){var t=i.hostname===e.hostname,n=i.protocol===e.protocol,a=i.port===e.port||""===e.port&&("80"===i.port||"443"===i.port);return t&&n&&a})).length}};return n}e.$inject=["$window"],angular.module("app.auth").factory("Util",e)}(),function(){"use strict";angular.module("app.core").provider("motionConfig",function(){var n={disableCustomScrollbars:!1,disableMdInkRippleOnMobile:!0,disableCustomScrollbarsOnMobile:!0};this.config=function(e){n=angular.extend({},n,e)},this.$get=function(){var e={getConfig:function(e){if(angular.isUndefined(n[e]))return!1;return n[e]},setConfig:function(e,t){n[e]=t}};return e}})}(),function(){"use strict";function e(e,t,n,a){t.debugEnabled(!0),e.config({tabindex:!1}),a.config({disableCustomScrollbars:!1,disableCustomScrollbarsOnMobile:!0,disableMdInkRippleOnMobile:!0}),n.config({wheelPropagation:!0})}e.$inject=["$ariaProvider","$logProvider","msScrollConfigProvider","motionConfigProvider"],angular.module("app.core").config(e)}(),function(){"use strict";function e(e,t,n){(t.generate(),n.getConfig("disableMdInkRippleOnMobile")&&e.isMobile())&&angular.element("body").attr("md-no-ink",!0);e.isMobile()&&angular.element("html").addClass("is-mobile");var a=e.detectBrowser();if(a){var i=a.browser+" "+a.version+" "+a.os;angular.element("html").addClass(i)}}e.$inject=["msUtils","motionGenerator","motionConfig"],angular.module("app.core").run(e)}(),function(){"use strict";function e(s,l,d){return{restrict:"E",compile:function(e,t){var o;return t.code||(o=e.html(),e.empty()),function(n,a,r){r.code&&(o=n.$eval(r.code));var i=n.$eval(r.shouldInterpolate);l.when(o).then(function(e){if(e){i&&(e=d(e)(n));var t=angular.element('<pre><code class="highlight" ng-non-bindable></code></pre>');a.append(t),s(function(){!function(e,t){var n=t.find("code"),a=e.split("\n"),i=(a=a.filter(function(e){return e.trim().length}))[0].match(/^\s*/)[0],o=new RegExp("^"+i);a=a.map(function(e){return e.replace(o,"").replace(/\s+$/,"")});var s=hljs.highlight(r.language||r.lang,a.join("\n"),!0);s.value=s.value.replace(/=<span class="hljs-value">""<\/span>/gi,"").replace("<head>","").replace("<head/>",""),n.append(s.value).addClass("highlight")}(e,t)},34,!1)}})}}}}e.$inject=["$timeout","$q","$interpolate"],angular.module("app.core").directive("hljs",e)}(),function(){"use strict";angular.module("app.core").directive("msCard",function(){return{restrict:"E",scope:{templatePath:"=template",card:"=ngModel",vm:"=viewModel"},template:'<div class="ms-card-content-wrapper" ng-include="templatePath" onload="cardTemplateLoaded()"></div>',compile:function(e){return e.addClass("ms-card"),function(e,t){e.cardTemplateLoaded=function(){e.$emit("msCard::cardTemplateLoaded",t)}}}}})}(),function(){"use strict";angular.module("app.core").directive("msClickToCall",function(){return{restrict:"E",scope:{type:"=",disabled:"=",target:"=",prefix:"=",license:"="},controller:["$scope","$rootScope","$http","$translate","Auth","toasty",function(t,n,a,i,e,o){function s(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function r(e){return a.get(e).success(function(){o.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(e){o.error({title:"PhoneBar API Error",msg:i.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}t.currentUser=e.getCurrentUser(),t.showMenu=function(){return t.target&&t.target.indexOf("@")<0&&t.target!=t.currentUser.internal&&t.target!=t.currentUser.name&&(0==t.currentUser.showWebBar&&t.currentUser.phoneBarRemoteControl||2==t.currentUser.showWebBar&&t.license.webrtc)&&!t.disabled},t.call=function(e){switch(t.currentUser.showWebBar){case 0:return r("http://127.0.0.1:"+(t.currentUser.phoneBarRemoteControlPort||"9888")+"/api/originate/"+s(e));case 2:n.$broadcast("webrtc::call",{target:s(e)})}},t.transfer=function(e){switch(t.currentUser.showWebBar){case 0:return r("http://127.0.0.1:"+(t.currentUser.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+s(e));case 2:n.$broadcast("webrtc::transfer",{target:s(e)})}}}],templateUrl:"app/core/directives/ms-click-to-call/ms-click-to-call.html"}})}(),function(){"use strict";function e(i){return{require:"ngModel",priority:1,link:function(e,t,n,a){a.$formatters.push(i.formatter),a.$parsers.push(i.parser)}}}e.$inject=["msDatepickerFixConfig"],angular.module("app.core").provider("msDatepickerFixConfig",function(){var t={formatter:function(e){return e?""===e?e:new Date(e):""},parser:function(e){return e?moment(e).add(moment(e).utcOffset(),"m").toDate():""}};this.config=function(e){t=angular.extend({},t,e)},this.$get=function(){return t}}).directive("msDatepickerFix",e)}(),function(){"use strict";angular.module("app.core").directive("msDualMultiselect",function(){return{restrict:"E",scope:{options:"="},controller:["$scope",function(s){s.transfer=function(e,t,n,a){var i=[];if(0<=n)i.push(e[n]),t.push(e[n]),e.splice(n,1);else{for(var o=0;o<e.length;o+=1)t.push(e[o]);e.length=0,i=t}s.options.transferCallback&&s.options.transferCallback(i,a)},s.getLine=function(e,t){var n="";if(_.isNil(t))return n;if(_.isArray(t)){for(var a=0;a<t.length;a++)n+=" "+(e[t[a]]?e[t[a]]:"");return n}return e[t]?e[t]:""}}],templateUrl:"app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html"}})}(),function(){"use strict";function e(e){return{restrict:"E",replace:!0,scope:{onReply:"&",setText:"&",getText:"&",pickerPosition:"=",search:"=",recentEmojis:"=",placeholder:"="},template:'<input class="emojionearea" type="text">',link:function(n,t){t.emojioneArea({pickerPosition:n.pickerPosition,search:n.search,recentEmojis:n.recentEmojis,placeholder:e.instant(n.placeholder||"Type a message"),events:{keyup:function(e,t){n.onReply({event:t,body:this.getText()})}}}),n.setText({dirFn:function(e){t[0].emojioneArea.setText(e||"")}}),n.getText({dirFn:function(){return t[0].emojioneArea.getText()}})}}}e.$inject=["$translate"],angular.module("app.core").directive("msEmojiArea",e)}(),function(){"use strict";angular.module("app.core").directive("msFontFamily",function(){return{restrict:"E",scope:{ngModel:"="},controller:["$scope",function(e){e.fonts=[{option:"Arial",value:"Arial,Helvetica,sans-serif"},{option:"Comic Sans MS",value:"Comic Sans MS,cursive"},{option:"Courier New",value:"Courier New,Courier,monospace"},{option:"Georgia",value:"Georgia,serif"},{option:"Lucida Sans Unicode",value:"Lucida Sans Unicode,Lucida Grande,sans-serif"},{option:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{option:"Times New Roman",value:"Times New Roman,Times,serif"},{option:"Trebuchet MS",value:"Trebuchet MS,Helvetica,sans-serif"},{option:"Verdana",value:"Verdana,Geneva,sans-serif"}]}],templateUrl:"app/core/directives/ms-font-family/ms-font-family.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsFormWizardController",function(){var t=this;function e(){return t.forms.length}function n(){return 0===t.selectedIndex}function a(){return t.selectedIndex===e()-1}t.forms=[],t.selectedIndex=0,t.registerForm=function(e){t.forms.push(e)},t.previousStep=function(){if(n())return;t.selectedIndex--},t.nextStep=function(){if(a())return;t.selectedIndex++},t.firstStep=function(){t.selectedIndex=0},t.lastStep=function(){t.selectedIndex=e()-1},t.totalSteps=e,t.isFirstStep=n,t.isLastStep=a,t.currentStepInvalid=function(){return angular.isDefined(t.forms[t.selectedIndex])&&t.forms[t.selectedIndex].$invalid},t.previousStepInvalid=function(){return 0<t.selectedIndex&&angular.isDefined(t.forms[t.selectedIndex-1])&&t.forms[t.selectedIndex-1].$invalid},t.formsIncomplete=function(){for(var e=0;e<t.forms.length;e++)if(t.forms[e].$invalid)return!0;return!1},t.resetForm=function(){for(var e=t.selectedIndex=0;e<t.forms.length;e++)t.forms[e].$setPristine(),t.forms[e].$setUntouched()}}).directive("msFormWizard",function(){return{restrict:"E",scope:!0,controller:"MsFormWizardController as msWizard",compile:function(e){return e.addClass("ms-form-wizard"),function(){}}}}).directive("msFormWizardForm",function(){return{restrict:"A",require:["form","^msFormWizard"],compile:function(e){return e.addClass("ms-form-wizard-form"),function(e,t,n,a){var i=a[0],o=a[1];o.registerForm(i)}}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{onClose:"&"},transclude:!0,templateUrl:"app/core/directives/ms-info-bar/ms-info-bar.html",link:function(e,t){var n=i.find("ms-info-bar-active"),a="ms-info-bar-active";n.addClass(a),e.removeInfoBar=function(){n.removeClass(a),t.remove(),e.onClose&&e.onClose(),e.$destroy()}}}}e.$inject=["$document"],angular.module("app.core").directive("msInfoBar",e)}(),function(){"use strict";function e(r,a,l,e){var d=this,t={columnCount:5,respectItemOrder:!1,reLayoutDebounce:400,responsive:{md:3,sm:2,xs:1}},n=!0;function i(){n&&e.cancel(n),n=e(function(){!function(){d.containerPos=d.container[0].getBoundingClientRect(),function(){d.columnCount=d.options.columnCount,l("gt-md")?d.columnCount=d.options.columnCount:l("md")?d.columnCount=d.columnCount>d.options.responsive.md?d.options.responsive.md:d.columnCount:l("sm")?d.columnCount=d.columnCount>d.options.responsive.sm?d.options.responsive.sm:d.columnCount:d.columnCount=d.options.responsive.xs;d.columnWidth=d.containerPos.width/d.columnCount}(),r.$broadcast("msMasonry:relayoutStarted"),d.items=d.container.find("ms-masonry-item");for(var e=Array.apply(null,new Array(d.columnCount)).map(function(){return 0}),t=0;t<d.items.length;t++){var n,a,i,o,s=d.items[t];(s=angular.element(s)).scope()&&s.scope().$broadcast("msMasonryItem:startReLayout"),s.css({width:d.columnWidth}),d.options.respectItemOrder?(i=t%d.columnCount,o=e[i]):(o=Math.min.apply(Math,e),i=e.indexOf(o)),e[i]=o+s[0].getBoundingClientRect().height,n=Math.round(i*d.columnWidth),a=o,s.css({transform:"translate3d("+n+"px,"+a+"px,0px)"}),s.addClass("placed"),s.scope()&&s.scope().$broadcast("msMasonryItem:finishReLayout")}}(),r.$broadcast("msMasonry:relayoutFinished")},d.options.reLayoutDebounce)}d.options=null,d.container=[],d.containerPos="",d.columnWidth="",d.items=[],d.reLayout=i,d.initialize=function(){d.options=d.options?angular.extend(t,d.options):t,r.$watch(function(){return d.container.width()},function(e,t){e!==t&&i()})},d.waitImagesLoaded=function(e,t){if("undefined"!=typeof imagesLoaded){var n=a.imagesLoaded(e);n.on("done",function(){t()})}else t()},r.$on("msMasonry:relayout",function(){i()})}function t(s){return{restrict:"AEC",controller:"msMasonryController",compile:function(i,o){return{pre:function(e,t,n,a){a.options=angular.fromJson(o.options||"{}"),a.container=i},post:function(e,t,n,a){s(function(){a.initialize()})}}}}}e.$inject=["$scope","$window","$mdMedia","$timeout"],t.$inject=["$timeout"],angular.module("app.core").controller("msMasonryController",e).directive("msMasonry",t).directive("msMasonryItem",function(){return{restrict:"AEC",require:"^msMasonry",priority:1,link:function(e,t,n,a){a.waitImagesLoaded(t,function(){a.reLayout()}),e.$on("msMasonryItem:finishReLayout",function(){e.$watch(function(){return t.height()},function(e,t){e!==t&&a.reLayout()})}),t.on("$destroy",function(){a.reLayout()})}}})}(),function(){"use strict";function e(n,e,a,i){var o=this;function s(e,t){o.selectedPalette=e,o.selectedHues=t}function r(){s(!(o.selectedColor={palette:"",hue:"",class:""}),!1),d()}function l(e,t){o.selectedColor={palette:e,hue:t,class:"md-"+e+"-"+t+"-bg",bgColorValue:i.rgba(o.palettes[e][t].value),fgColorValue:i.rgba(o.palettes[e][t].contrast)},"obj"!==o.msModelType||angular.equals(o.selectedColor,o.modelCtrl.$viewValue)||d(),s(e,o.palettes[e]),n.$selectedColor=o.selectedColor}function d(){"class"===o.msModelType?o.modelCtrl.$setViewValue(o.selectedColor.class):"obj"===o.msModelType&&o.modelCtrl.$setViewValue(o.selectedColor)}o.palettes=e,o.selectedPalette=!1,o.selectedHues=!1,n.$selectedColor={},o.activateHueSelection=s,o.selectColor=function(e,t){l(e,t),d(),a.hide()},o.removeColor=r,n.$watch("ngModel",function(){if(!o.modelCtrl.$viewValue||""===o.modelCtrl.$viewValue)return void r();var e,t;if("class"===o.msModelType){var n=o.modelCtrl.$viewValue.split("-");5<=n.length?(e=n[1]+"-"+n[2],t=n[3]):(e=n[1],t=n[2])}else"obj"===o.msModelType&&(e=o.modelCtrl.$viewValue.palette,t=o.modelCtrl.$viewValue.hue||500);l(e,t)})}e.$inject=["$scope","$mdColorPalette","$mdMenu","motionGenerator"],angular.module("app.core").controller("msMaterialColorPickerController",e).directive("msMaterialColorPicker",function(){return{require:["msMaterialColorPicker","ngModel"],restrict:"E",scope:{ngModel:"=",msModelType:"@?"},controller:"msMaterialColorPickerController as vm",transclude:!0,templateUrl:"app/core/directives/ms-material-color-picker/ms-material-color-picker.html",link:function(e,t,n,a,i){var o=a[0];o.modelCtrl=a[1],o.msModelType=e.msModelType||"class",i(e,function(e){(e=e.filter(function(e,t){return 1===t.nodeType})).length&&t.find("ms-color-picker-button").replaceWith(e)})}}})}(),function(){"use strict";function e(p,g,v){return{restrict:"A",link:function(e,t,n){var a="true"===n.msNavIsFolded,i=!1,o=angular.element(p[0].body),s=angular.element('<div id="ms-nav-fold-open-overlay"></div>'),r=angular.element('<div id="ms-nav-fold-close-overlay"></div>'),l=t.parent();function d(){o.addClass("ms-nav-folded"),g.$broadcast("msNav::forceCollapse"),t.scrollTop(0),l.append(s),s.on("mouseenter touchstart",function(e){c(e),i=!0})}function c(e){angular.isDefined(e)&&e.preventDefault(),o.addClass("ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),l.find(s).remove(),l.parent().append(r),r.on("mouseenter touchstart",function(e){m(e),i=!1})}function m(e){angular.isDefined(e)&&e.preventDefault(),g.$broadcast("msNav::forceCollapse"),t.scrollTop(0),o.removeClass("ms-nav-folded-open"),l.parent().find(r).remove(),l.append(s),s.on("mouseenter touchstart",function(e){c(e),i=!0})}function u(){o.removeClass("ms-nav-folded ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),t.off("mouseenter mouseleave")}v.setFoldable(e,t,a),a?d():u(),e.toggleFold=function(){(a=!a)?d():u()},e.openFolded=c,e.closeFolded=m,e.isNavFoldedOpen=function(){return i},e.$on("$destroy",function(){s.off("mouseenter touchstart"),r.off("mouseenter touchstart"),t.off("mouseenter mouseleave")})}}}function t(n,a,i){return{restrict:"E",scope:{},controller:"MsNavController",compile:function(e){return e.addClass("ms-nav"),function(e){n.$broadcast("msNav::expandMatchingToggles");var t=n.$on("$stateChangeSuccess",function(){n.$broadcast("msNav::expandMatchingToggles"),a.when("navigation").then(function(e){e.close(),i.isNavFoldedOpen()&&i.closeFolded()})});e.$on("$destroy",function(){t()})}}}}function n(m,u,p,g){return{restrict:"A",require:"^msNav",scope:!0,compile:function(e,t){return e.addClass("ms-nav-toggle"),angular.isUndefined(t.collapsed)&&(t.collapsed=!0),e.attr("collapsed",t.collapsed),function(a,i,e,n){var o={expanded:"expanded",expandAnimation:"expand-animation",collapseAnimation:"collapse-animation"},t=i.find("a"),s=[],r=/\(.*\)/g;function l(){return"true"===i.attr("collapsed")}function d(){var e=u.defer();if(!l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!1);var t=angular.element(i.find("ms-nav-toggle-items")[0]);t.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var n=t[0].offsetHeight;return t.css({position:"",visibility:"",display:"",height:""}),a.$evalAsync(function(){p.animate(t,{display:"block",height:"0px"},{height:n+"px"},o.expandAnimation).then(function(){t.addClass(o.expanded),t.css({height:""}),e.resolve({success:!0})})}),e.promise}function c(){var e=u.defer();if(l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!0);var t=angular.element(i.find("ms-nav-toggle-items")[0]),n=t[0].offsetHeight;return a.$evalAsync(function(){p.animate(t,{height:n+"px"},{height:"0px"},o.collapseAnimation).then(function(){t.removeClass(o.expanded),t.css({display:"",height:""}),e.resolve({success:!0})})}),e.promise}angular.forEach(t,function(e){var t=angular.element(e).attr("ui-sref");angular.isUndefined(t)||(t=t.replace(r,""),s.push(t))}),n.setToggleItem(i,a),i.children(".ms-nav-button").on("click",function(){if(n.isDisabled())return;n.disable(),l()?(n.clearLockedItems(),a.$emit("msNav::pushToLockedList"),m.$broadcast("msNav::collapse"),d().then(function(){n.enable()})):a.$broadcast("msNav::forceCollapse")}),a.$on("$destroy",function(){i.children(".ms-nav-button").off("click")}),a.$on("msNav::collapse",function(){var e=n.getLockedItems(),t=!1;angular.forEach(e,function(e){angular.equals(e.scope,a)&&(t=!0)}),t||c().then(function(){n.enable()})}),a.$on("msNav::forceCollapse",function(){c().then(function(){n.enable()})}),a.$on("msNav::expandMatchingToggles",function(){var t=g.current.name,n=!1;angular.forEach(s,function(e){t===e&&(n=!0)}),n?d():c()}),a.$on("msNav::pushToLockedList",function(){n.setLockedItem(i,a)})}}}}e.$inject=["$document","$rootScope","msNavFoldService"],t.$inject=["$rootScope","$mdComponentRegistry","msNavFoldService"],n.$inject=["$rootScope","$q","$animate","$state"],angular.module("app.core").factory("msNavFoldService",function(){var n={};return{setFoldable:function(e,t){n={scope:e,element:t}},isNavFoldedOpen:function(){return n.scope.isNavFoldedOpen()},toggleFold:function(){n.scope.toggleFold()},openFolded:function(){n.scope.openFolded()},closeFolded:function(){n.scope.closeFolded()}}}).directive("msNavIsFolded",e).controller("MsNavController",function(){var e=this,t=!1,n=[],a=[];e.isDisabled=function(){return t},e.enable=function(){t=!1},e.disable=function(){t=!0},e.setToggleItem=function(e,t){n.push({element:e,scope:t})},e.getLockedItems=function(){return a},e.setLockedItem=function(e,t){a.push({element:e,scope:t})},e.clearLockedItems=function(){a=[]}}).directive("msNav",t).directive("msNavTitle",function(){return{restrict:"A",compile:function(e){return e.addClass("ms-nav-title"),function(){}}}}).directive("msNavButton",function(){return{restrict:"AE",compile:function(e){return e.addClass("ms-nav-button"),function(){}}}}).directive("msNavToggle",n)}(),function(){"use strict";function e(e,t){e.root?this.navigation=t.getNavigation(e.root):this.navigation=t.getNavigation(),this.toggleHorizontalMobileMenu=function(){angular.element("body").toggleClass("ms-navigation-horizontal-mobile-menu-active")},t.sort()}function t(c,m,u,p){return{restrict:"E",scope:{folded:"=",root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/vertical.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation"),function(e,t){var n=angular.element("body"),a=angular.element('<div id="ms-navigation-fold-expander"></div>'),i=angular.element('<div id="ms-navigation-fold-collapser"></div>'),o=u("navigation");function s(e){if(p.setFolded(e),e)c.$broadcast("msNavigation::collapse"),n.addClass("ms-navigation-folded"),r();else{var t=p.getActiveItem();t&&t.scope.$emit("msNavigation::stateMatched"),n.removeClass("ms-navigation-folded ms-navigation-folded-open"),i.remove()}}function r(){t.parent().append(a),m(function(){a.on("mouseenter touchstart",l)})}function l(e){e&&e.preventDefault(),p.setFoldedOpen(!0);var t=p.getActiveItem();t&&t.scope.$emit("msNavigation::stateMatched"),n.addClass("ms-navigation-folded-open"),a.remove(),n.find("#main").append(i),i.on("mouseenter touchstart",d)}function d(e){e&&e.preventDefault(),p.setFoldedOpen(!1),c.$broadcast("msNavigation::collapse"),n.removeClass("ms-navigation-folded-open"),i.remove(),r()}p.setNavigationScope(e),function(){null===p.getFolded()&&p.setFolded(e.folded);p.getFolded()&&(m(function(){c.$broadcast("msNavigation::collapse")}),n.addClass("ms-navigation-folded"),r())}(),e.$watch(function(){return o.isLockedOpen()},function(e,t){if(!angular.isUndefined(e)&&!angular.equals(e,t)&&p.getFolded())if(e)c.$broadcast("msNavigation::collapse");else{var n=p.getActiveItem();n&&n.scope.$emit("msNavigation::stateMatched")}}),e.$watch("folded",function(e,t){angular.isUndefined(e)||angular.equals(e,t)||s(e)}),e.toggleFolded=function(){s(!p.getFolded())},e.$on("$stateChangeStart",function(){o.close()}),e.$on("$destroy",function(){i.off("mouseenter touchstart"),a.off("mouseenter touchstart")})}}}}function n(n,e,a,i,t,o){var s=this;s.element=e,s.node=n.node,s.hasChildren=void 0,s.collapsed=void 0,s.collapsable=void 0,s.group=void 0,s.animateHeightClass="animate-height",s.toggleCollapsed=function(){s.collapsed?s.expand():s.collapse()},s.collapse=function(){var e=s.element.children("ul"),t=e[0].offsetHeight;n.$evalAsync(function(){s.collapsed=!0,s.element.addClass("collapsing"),i.animate(e,{display:"block",height:t+"px"},{height:"0px"},s.animateHeightClass).then(function(){e.css({display:"",height:""}),s.element.removeClass("collapsing")}),n.$broadcast("msNavigation::collapse")})},s.expand=function(){var e=s.element.children("ul");e.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var t=e[0].offsetHeight;e.css({position:"",visibility:"",display:"",height:""}),n.$evalAsync(function(){s.collapsed=!1,s.element.addClass("expanding"),i.animate(e,{display:"block",height:"0px"},{height:t+"px"},s.animateHeightClass).then(function(){e.css({height:""}),s.element.removeClass("expanding")}),a.$broadcast("msNavigation::collapse",s.node._path)})},s.getClass=function(){return s.node.class},s.isHidden=function(){if(angular.isDefined(s.node.hidden)&&angular.isFunction(s.node.hidden))return s.node.hidden();return!1},function(){s.hasChildren=0<s.node.children.length,s.group=!(!angular.isDefined(s.node.group)||!0!==s.node.group),!s.hasChildren||s.group?s.collapsable=!1:s.collapsable=!(!angular.isUndefined(s.node.collapsable)&&"boolean"==typeof s.node.collapsable&&!0!==s.node.collapsable);s.collapsable?s.collapsed=!(!angular.isUndefined(s.node.collapsed)&&"boolean"==typeof s.node.collapsed&&!0!==s.node.collapsed):s.collapsed=!1;if(s.node.state===t.current.name||t.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(t.params)&&!angular.equals(s.node.stateParams,t.params))return;n.$emit("msNavigation::stateMatched"),o.setActiveItem(s.node,n)}n.$on("msNavigation::stateMatched",function(){s.collapsable&&s.collapsed&&n.$evalAsync(function(){s.collapsed=!1})}),n.$on("msNavigation::collapse",function(e,t){if(!s.collapsed&&s.collapsable)if(angular.isUndefined(t))s.collapse();else{var n=t.split("."),a=[],i=o.getActiveItem();if(i&&(a=i.node._path.split(".")),-1<n.indexOf(s.node._id))return;if(-1<a.indexOf(s.node._id))return;s.collapse()}}),n.$on("$stateChangeSuccess",function(){if(s.node.state===t.current.name){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(t.params)&&!angular.equals(s.node.stateParams,t.params))return;o.setActiveItem(s.node,n),a.$broadcast("msNavigation::collapse",s.node._path)}if(t.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(t.params)&&!angular.equals(s.node.stateParams,t.params))return;n.$emit("msNavigation::stateMatched")}})}()}function a(t){return{restrict:"E",scope:{root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/horizontal.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation-horizontal"),function(e){t.setNavigationScope(e)}}}}function i(n,e,t,a,i){var o=this;o.element=e,o.node=n.node,o.hasChildren=void 0,o.group=void 0,o.getClass=function(){return o.node.class},function(){if(o.isActive=!1,o.hasChildren=0<o.node.children.length,o.group=!(!angular.isDefined(o.node.group)||!0!==o.node.group),o.node.state===a.current.name||a.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(o.node.stateParams,a.params))return;n.$emit("msNavigation::stateMatched"),i.setActiveItem(o.node,n)}n.$on("msNavigation::stateMatched",function(){o.hasChildren&&n.$evalAsync(function(){o.isActive=!0})}),n.$on("msNavigation::clearActive",function(){if(o.hasChildren){var e=[],t=i.getActiveItem();t&&(e=t.node._path.split(".")),-1<e.indexOf(o.node._id)?n.$evalAsync(function(){o.isActive=!0}):n.$evalAsync(function(){o.isActive=!1})}}),n.$on("$stateChangeSuccess",function(){if(o.node.state===a.current.name||a.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(o.node.stateParams,a.params))return;i.setActiveItem(o.node,n),t.$broadcast("msNavigation::clearActive")}})}()}function o(i){return{restrict:"A",require:"^msNavigationHorizontalNode",compile:function(e){return e.addClass("ms-navigation-horizontal-item"),function(e,t,n,a){t.on("click",function(){if(!a.hasChildren||i("gt-md"))return;t.toggleClass("expanded")}),e.$on("$destroy",function(){t.off("click")})}}}}e.$inject=["$scope","msNavigationService"],t.$inject=["$rootScope","$timeout","$mdSidenav","msNavigationService"],n.$inject=["$scope","$element","$rootScope","$animate","$state","msNavigationService"],a.$inject=["msNavigationService"],i.$inject=["$scope","$element","$rootScope","$state","msNavigationService"],o.$inject=["$mdMedia"],angular.module("app.core").provider("msNavigationService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function s(e,t){if(angular.isString(e)){for(var n=e.split("."),a=n[n.length-1],i=function(e){var t=l;if(1===e.length)return t;e.pop();for(var n=0;n<e.length;n++){for(var a=e[n],i=!0,o=0;o<t.length;o++)if(t[o]._id===a){t=t[o].children,i=!1;break}if(i){var s={_id:a,_path:e.join("."),title:a,weight:1,children:[]};t.push(s),t=s.children}}return t}(n),o=!1,s=0;s<i.length;s++)if(i[s]._id===a){o=i[s];break}o?(angular.extend(o,t),o.uisref=m(o)):(t.children=[],!angular.isUndefined(t.weight)&&angular.isNumber(t.weight)||(t.weight=1),t._id=a,t._path=e,t.uisref=m(t),i.push(t))}else r.error("path must be a string (eg. `dashboard.project`)")}function d(e){if(angular.isString(e)){for(var t=l,n=e.split("."),a=0;a<n.length;a++)for(var i=n[a],o=0;o<t.length;o++)if(t[o]._id===i){if(t[o]._path===e)return t.splice(o,1),!0;t=t[o].children;break}return!1}r.error("path must be a string (eg. `dashboard.project`)")}function c(e){e||(e=l).sort(a);for(var t=0;t<e.length;t++){var n=e[t].children;1<n.length&&n.sort(a),0<n.length&&c(n)}}function a(e,t){return parseInt(e.weight)-parseInt(t.weight)}function m(e){var t="";return angular.isDefined(e.state)&&(t=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(t=t+"("+angular.toJson(e.stateParams)+")")),t}this.saveItem=s,this.deleteItem=d,this.sortByWeight=c,this.$get=function(){var n=null,t=null,a=null,i=null,e={saveItem:s,deleteItem:d,sort:c,clearNavigation:function(){l=[],t&&(t.vm.navigation=l)},setActiveItem:function(e,t){n={node:e,scope:t}},getActiveItem:function(){return n},getNavigation:o,getFlatNavigation:function(e){return function e(t){var n=[];for(var a=0;a<t.length;a++){var i=angular.copy(t[a]);i.children=[],n.push(i),0<t[a].children.length&&(n=n.concat(e(t[a].children)))}return n}(o(e))},setNavigationScope:function(e){t=e},setFolded:function(e){a=e},getFolded:function(){return a},setFoldedOpen:function(e){i=e},getFoldedOpen:function(){return i},toggleFolded:function(){t.toggleFolded()}};return e;function o(e){if(e){for(var t=0;t<l.length;t++)if(l[t]._id===e)return[l[t]];return null}return l}}}).controller("MsNavigationController",e).directive("msNavigation",t).controller("MsNavigationNodeController",n).directive("msNavigationNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationNode"},controller:"MsNavigationNodeController as vm",compile:function(e){return e.addClass("ms-navigation-node"),function(e,t,n,a){t.addClass(a.getClass()),a.group&&t.addClass("group")}}}}).directive("msNavigationItem",function(){return{restrict:"A",require:"^msNavigationNode",compile:function(e){return e.addClass("ms-navigation-item"),function(e,t,n,a){a.collapsable&&t.on("click",a.toggleCollapsed),e.$on("$destroy",function(){t.off("click")})}}}}).directive("msNavigationHorizontal",a).controller("MsNavigationHorizontalNodeController",i).directive("msNavigationHorizontalNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationHorizontalNode"},controller:"MsNavigationHorizontalNodeController as vm",compile:function(e){return e.addClass("ms-navigation-horizontal-node"),function(e,t,n,a){t.addClass(a.getClass()),a.group&&t.addClass("group")}}}}).directive("msNavigationHorizontalItem",o)}(),function(){"use strict";function e(i,t,o,e,n,s,a,r,l,d,c){var m=this,u=["ringingId","speakerId","microphoneId","ringingVolume","speakerVolume","microphoneVolume","ringingMute","speakerMute","microphoneMute"],p=JSON.parse(a.localStorage.getItem("motion2.user:"+m.conf.id))||{webrtc:{ringingVolume:.5,speakerVolume:.5,microphoneVolume:1,ringingMute:!1,speakerMute:!1,microphoneMute:!1}};function g(e){switch(e){case"ringing":m.conf.ringingMute&&m.soundPlayer.pause(),m.conf.ringingId&&m.soundPlayer.setSinkId(m.conf.ringingId).catch(function(e){console.info(e.message,m.conf.ringingId)});break;case"speaker":m.conf.speakerMute&&m.remotePlayer.pause(),m.conf.speakerId&&m.soundPlayer.setSinkId(m.conf.speakerId).catch(function(e){console.info(e.message,m.conf.speakerId)});break;case"microphone":if(m.conf.microphoneMute)for(var t=0;t<m.sessions.length;t+=1)m.sessions[t].mute();break;default:console.log("unknown device")}}function v(e,t,n){m.calls.unshift({target:e,fullname:n||e,inbound:t,time:moment().format("HH:mm")}),50<m.calls.length&&m.calls.pop()}function h(){return m.conf.license&&m.conf.isWebRTCSupported&&m.conf.hasMicrophone&&m.conf.hasSpeakers&&"https"===m.conf.protocol&&("chrome"===m.conf.browserName.toLowerCase()||"opera"===m.conf.browserName.toLowerCase()||"safari"===m.conf.browserName.toLowerCase())}function b(){p.webrtc=_.pick(m.conf,u),a.localStorage.setItem("motion2.user:"+m.conf.id,JSON.stringify(p))}function f(e){this.remotePlayer.srcObject=e.stream}function A(e){var t,n,a=e.session;switch(e.originator){case"local":a.outgoing=!0,a.name=e.request.ruri.user,a.user=e.request.ruri.user,v(a.user,!1);break;case"remote":a.incoming=!0,a.name=e.request.from.display_name,a.user=e.request.from.uri.user,t=e.session,n=t.name?t.name+" <"+t.user+">":t.user,c.create("Incoming call from: ",n,null,function(){t.answer(m.sessionConf)},function(){t.terminate()}).then(function(e){t.notification=e}).catch(function(e){console.error(e)}),v(e.session.user,!0),m.conf.autoAnswer&&o(function(){a.isInProgress()&&(a.autoAnswer=!0,m.conf.microphoneId?m.sessionConf.mediaConstraints.audio={deviceId:m.conf.microphoneId}:m.sessionConf.mediaConstraints.audio=!0,a.answer(m.sessionConf))},m.conf.autoAnswerDelay?1e3*m.conf.autoAnswerDelay:0)}a.call_id=e.request.call_id,a.connection&&(a.connection.onaddstream=f.bind(this)),a.on("progress",function(e,t){var n=!1;switch(t.originator){case"local":this.conf.ringingMute||(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/incoming-call.ogg"),n=!0);break;case"remote":this.putOtherCallsOnHold(e),this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/outgoing-call.ogg"),n=!0}n&&(this.soundPlayer.loop="loop",this.soundPlayer.play().catch(function(e){console.log(e.message)}))}.bind(this,a)),a.on("confirmed",function(n,e){return n.confirmed=!0,"remote"===e.originator&&n.connection&&(n.connection.onaddstream=f.bind(this),_.head(n.connection.getRemoteStreams())&&(this.remotePlayer.srcObject=_.head(n.connection.getRemoteStreams()))),this.soundPlayer.pause(),this.soundPlayer.loop=null,this.putOtherCallsOnHold(n),g("speaker"),g("microphone"),n.autoAnswer&&(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/beep.ogg"),this.soundPlayer.play().catch(function(e){console.log(e.message)})),d.rpc.getVoiceChannels().$promise.then(function(e){var t=_.find(e.rows,function(e){return e.sipcalllinkedid===n.call_id?e:e.sipcalluniqueid===n.call_id?e:null});t&&(n.monitor=t.monitor,n.uniqueid=t.uniqueid,n.monitors=t.monitors)}).catch(function(e){console.error(e)})}.bind(this,a)),a.on("hold",function(e,t){"local"===t.originator&&(e.localHold=!0)}.bind(this,a)),a.on("unhold",function(e,t){"local"===t.originator&&(e.localHold=!1)}.bind(this,a)),a.on("ended",function(e,t){_.remove(this.sessions,{id:e.id})}.bind(this,a)),a.on("failed",function(e,t){this.soundPlayer.pause(),this.soundPlayer.loop=null,e.notification&&e.notification.close(),_.remove(this.sessions,{id:e.id})}.bind(this,a)),this.sessions.push(a)}function E(){m.target="",document.getElementById("ms-target").blur(),document.getElementById("ms-target").value="",i.$broadcast("angucomplete-alt:clearInput","ms-target-wrap")}function y(e,t,n,a){return function(){s.show(s.simple().textContent(t).position(n).hideDelay(a)),e.terminate()}}e(function(){},999),m.direction="right",m.selectedMode="md-scale",m.target="",m.showDialpad=!1,m.soundPlayer=document.createElement("audio"),m.remotePlayer=document.getElementById(m.conf.remotePlayerId),m.soundPlayer.volume=1,m.sessionConf={mediaConstraints:{audio:!0,video:!1}},m.sessions=[],m.calls=[],m.ua=new JsSIP.UA({sockets:[new JsSIP.WebSocketInterface("wss://"+m.conf.host+":8089/ws")],uri:new JsSIP.URI("sip",m.conf.name,m.conf.host,5060,null,null).toString(),authorization_user:m.conf.name,ha1:m.conf.ha1,realm:m.conf.realm,user_agent:m.conf.ua,session_timers_refresh_method:"invite",register_expires:m.conf.phoneBarExpires||60,register:!0}),m.conf=_.merge(p.webrtc,m.conf),t.bind("keyup",function(e){switch(e.keyCode){case 27:o(function(){m.showDialpad=!1})}}),m.$onInit=function(){g("ringing"),g("speaker"),b(),this.ua.on("registered",function(){console.log("registered"),this.registered=!0}.bind(this)),this.ua.on("unregistered",function(){console.log("unregistered"),this.registered=!1}.bind(this)),this.ua.on("newRTCSession",A.bind(this)),DetectRTC.load(function(){this.conf.hasMicrophone=DetectRTC.hasMicrophone,this.conf.hasSpeakers="Chrome"!==DetectRTC.browser.name&&"Edge"!==DetectRTC.browser.name&&"Opera"!==DetectRTC.browser.name||DetectRTC.hasSpeakers,this.conf.isWebRTCSupported=DetectRTC.isWebRTCSupported,this.conf.osName=DetectRTC.osName,this.conf.osVersion=DetectRTC.osVersion,this.conf.browserName=DetectRTC.browser.name,this.conf.browserVersion=DetectRTC.browser.version,h()?this.ua.start():this.conf.license||l.warning({title:r.instant("TOOLBAR.WARNING"),msg:r.instant("TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"})}.bind(this))}.bind(this),m.type=function(e,t){var n=e;switch(m.target||(m.target=""),t&&(m.target+=e,i.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",m.target)),e){case"*":n="asterisk";break;case"#":n="pound"}m.conf.enableDtmfTone&&(m.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/dialpad/"+n+".ogg"),m.soundPlayer.play().catch(function(e){console.log(e.message)}));for(var a=0;a<m.sessions.length;a+=1)m.sessions[a].isEstablished()&&!m.sessions[a].isOnHold().local&&m.sessions[a].sendDTMF(e)},m.call=function(){if(m.target&&m.target!==m.conf.name&&m.target!==m.conf.internal){m.conf.microphoneId?m.sessionConf.mediaConstraints.audio={deviceId:m.conf.microphoneId}:m.sessionConf.mediaConstraints.audio=!0;var e=m.target.replace(/ /g,"");e=(e=e.replace(/\(/g,"")).replace(/\)/g,""),m.ua.call(e,m.sessionConf)}E()},m.hold=function(e){e.hold({useUpdate:!1})},m.refer=function(t){var e=n.prompt().title("Transfer").textContent("Type the target").placeholder("Target").ariaLabel("Target").ok("Transfer").cancel("Cancel");n.show(e).then(function(e){t.refer(e,{eventHandlers:{requestSucceeded:y(t,"requestSucceeded","top right",3e3),requestFailed:y(t,"requestFailed","top right",3e3)}})})},m.record=function(e){n.show({controller:"RecordDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/record/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{session:e,sessions:m.sessions}})},m.unhold=function(e){e.unhold({useUpdate:!1})},m.answer=function(e){e.answer(m.sessionConf)},m.terminate=function(e){e.terminate()},m.selectSession=function(e){e.unhold({useUpdate:!1}),m.putOtherCallsOnHold(e)},m.typeWrapper=function(e){switch(e.key.toLowerCase()){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"*":case"#":m.type(e.key);break;case"enter":m.call()}},m.toggleDialpad=function(){m.showDialpad=!m.showDialpad},m.referAttended=function(e){n.show({controller:"ReferAttendedDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/referAttended/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{session:e,sessions:_.reject(m.sessions,{id:e.id})}})},m.toggleVolume=function(e){switch(e){case"ringing":m.conf.ringingMute=!m.conf.ringingMute;break;case"speaker":m.conf.speakerMute?(m.conf.speakerMute=!1,m.remotePlayer.play().catch(function(e){console.log(e.message)})):(m.conf.speakerMute=!0,m.remotePlayer.pause());break;case"microphone":m.conf.microphoneMute=!m.conf.microphoneMute;for(var t=0;t<m.sessions.length;t+=1)m.conf.microphoneMute?m.sessions[t].mute():m.sessions[t].unmute();break;default:console.log("unknown device")}b()},m.closeDialpad=function(){m.showDialpad=!1},m.putOtherCallsOnHold=function(e){if(1<m.sessions.length)for(var t=0;t<m.sessions.length;t+=1)m.sessions[t].id===e.id||m.sessions[t].isOnHold().remote||m.sessions[t].hold({useUpdate:!1})},m.targetChanged=function(e){e?/^(\w|\.|\+|#|\*|\(|\)|\s|\-)*$/.test(e)?(m.target=e,i.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",m.target)):m.target?i.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",m.target):E():E()},m.targetSelected=function(e){e&&(m.target=e.originalObject.target,m.call(),E())},i.$on("webrtc::settings",function(e){n.show({controller:"SettingsController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/settings/settings.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{devices:function(){return navigator.mediaDevices.enumerateDevices()}},locals:{conf:m.conf}}).then(function(e){e&&(m.conf=e,g("ringing"),g("speaker"),b())})}),i.$on("webrtc::logout",function(){m.ua.stop()}),i.$on("webrtc::call",function(e,t){t.target&&(m.target=t.target,m.call())}),i.$on("webrtc::transfer",function(e,t){if(t.target)for(var n=0;n<m.sessions.length;n+=1)if(m.sessions[n].isEstablished()&&!m.sessions[n].isOnHold().local){m.sessions[n].refer(t.target,{eventHandlers:{requestSucceeded:y(m.sessions[n],"requestSucceeded","top right",3e3),requestFailed:y(m.sessions[n],"requestFailed","top right",3e3)}});break}})}e.$inject=["$scope","$document","$timeout","$interval","$mdDialog","$mdToast","$window","$translate","toasty","api","motNotification"],angular.module("app.core").controller("MsPhonebarController",e).directive("msPhonebar",function(){return{restrict:"E",scope:{conf:"="},require:"msPhonebar",controller:"MsPhonebarController",controllerAs:"vm_pb",bindToController:!0,templateUrl:"assets/ms-phonebar/ms-phonebar.html"}})}(),function(){"use strict";function e(i){return{restrict:"C",controller:["$scope","$element",function(e,t){function n(){t.css("display","inline"),i(a,1e3)}function a(){t.css("display","none"),i(n,1e3)}n()}],replace:!0}}function t(t,i,o,e,n){var s=this;function a(t,e){console.log("startMonitor");var n=i.defer(),a=(e||t.filename.replace(/^.*[\\\/]/,"")).split(".")[0];return o.rpc.startMonitor({uniqueid:s.session.uniqueid,filename:a,format:"wav"}).$promise.then(function(e){t.filename=a+".wav",t.mixmonitorid=e.mixmonitorid,t.status="rec",s.session.monitor=!0,n.resolve(t)}).catch(function(e){n.reject(e)}),n.promise}s.title="Record",s.sessions=e,s.session=n,s.closeDialog=function(){t.hide()},s.addRecording=function(){var e=t.prompt({skipHide:!0}).title("Start new recording").textContent("Type the file name.").placeholder("File name").ariaLabel("File name").initialValue(function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}()).ok("Start").cancel("Cancel");t.show(e).then(function(e){return a({},e)}).then(function(e){s.session.monitors.push(e)})},s.stop=function(t){return console.log("stopMonitor"),o.rpc.stopMonitor({uniqueid:s.session.uniqueid,mixmonitorid:t.mixmonitorid}).$promise.then(function(e){t.status="pause",s.session.monitor=_.includes(s.session.monitors,{status:"rec"})}).catch(function(e){console.error(e)})},s.start=a}e.$inject=["$timeout"],t.$inject=["$mdDialog","$q","api","sessions","session"],angular.module("app.core").directive("msBlink",e).controller("RecordDialogController",t)}(),function(){"use strict";function e(t,a,i,e){var o=this;function s(e){t.hide(e)}o.title="Refer Attended",o.sessions=i,o.session=e,o.sessionTarget=null,o.closeDialog=s,o.transfer=function(){var e,t,n=_.find(i,function(e){if(e.user===o.target)return e});n.outgoing?(e=n,t=o.session):(e=o.session,t=n);t.refer(e.user,{replaces:e,eventHandlers:{requestSucceeded:function(e){a.show(a.simple().textContent("requestSucceeded").position("top right").hideDelay(3e3)),s(),t.terminate()},requestFailed:function(e){a.show(a.simple().textContent("requestFailed").position("top right").hideDelay(3e3)),s(),t.terminate()}}})}}e.$inject=["$mdDialog","$mdToast","sessions","session"],angular.module("app.core").controller("ReferAttendedDialogController",e)}(),function(){"use strict";function e(e,o,t){var n=this;function a(e,t,n){var a;if(o[n]){if(a=_.find(e,function(e){return e.deviceId===o[n]}))return a.deviceId;var i=_.findIndex(e,function(e){return e.kind===t&&"default"!==e.deviceId});if(0<=i)return e[i].deviceId}else(a=_.find(e,function(e){return e.kind===t&&"default"!==e.deviceId}))&&(o[n]=a.deviceId);return o[n]||null}o.ringingId=a(t,"audiooutput","ringingId"),o.speakerId=a(t,"audiooutput","speakerId"),o.microphoneId=a(t,"audioinput","microphoneId"),o.ringingVolume=o.ringingVolume||.5,o.speakerVolume=o.speakerVolume||.5,o.microphoneVolume=o.microphoneVolume||1,o.ringingMute=o.ringingMute||!1,o.speakerMute=o.speakerMute||!1,o.microphoneMute=o.microphoneMute||!1,n.conf=angular.copy(o),n.devices=t,n.saveSettings=function(){e.hide(n.conf)},n.closeDialog=function(){e.hide()},n.isCompatibleBrowser=function(){return"chrome"===n.conf.browserName.toLowerCase()||"opera"===n.conf.browserName.toLowerCase()||"safari"===n.conf.browserName.toLowerCase()}}e.$inject=["$mdDialog","conf","devices"],angular.module("app.toolbar").controller("SettingsController",e)}(),function(){"use strict";angular.module("app.core").directive("msRandomClass",function(){return{restrict:"A",scope:{msRandomClass:"="},link:function(e,t){var n=e.msRandomClass[Math.floor(Math.random()*e.msRandomClass.length)];t.addClass(n)}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{id:"=",model:"=",download:"="},replace:!0,link:function(t,e){var n=!1,a=document.createElement("audio");t.download||a.setAttribute("controlsList","nodownload"),a.setAttribute("preload","none"),a.setAttribute("controls",""),a.setAttribute("style","width: 265px;"),a.setAttribute("src"," "),a.onplay=function(e){n||(n=!0,e.preventDefault(),i[t.model||"voiceRecording"].download({id:t.id}).$promise.then(function(e){var t=[e.buffer],n=new Blob(t,{type:e.type});a.setAttribute("type",e.type),a.setAttribute("src",URL.createObjectURL(n)),a.play()}).catch(function(e){console.error(e)}))},e.append(a)}}}e.$inject=["api"],angular.module("app.core").directive("msRecording",e)}(),function(){"use strict";angular.module("app.core").directive("msResponsiveTable",function(){return{restrict:"A",link:function(e,t){var n=angular.element('<div class="ms-responsive-table-wrapper"></div>');t.after(n),n.append(t)}}})}(),function(){"use strict";function e(o,s,t,n){return{restrict:"AE",compile:function(e){if(!(n.getConfig("disableCustomScrollbars")||n.getConfig("disableCustomScrollbarsOnMobile")&&t.isMobile()))return e.addClass("ms-scroll"),function(e,t,n){var a={};function i(){PerfectScrollbar.update(t[0])}n.msScroll&&(a=e.$eval(n.msScroll)),a=angular.extend({},s.getConfig(),a),o(function(){PerfectScrollbar.initialize(t[0],a)},0),t.on("mouseenter",i),e.$watch(function(){return t.prop("scrollHeight")},function(e,t){angular.isUndefined(e)||angular.equals(e,t)||i()}),e.$watch(function(){return t.prop("scrollWidth")},function(e,t){angular.isUndefined(e)||angular.equals(e,t)||i()}),e.$on("$destroy",function(){t.off("mouseenter"),PerfectScrollbar.destroy(t[0])})}}}}e.$inject=["$timeout","msScrollConfig","msUtils","motionConfig"],angular.module("app.core").provider("msScrollConfig",function(){var t={wheelSpeed:1,wheelPropagation:!1,swipePropagation:!0,minScrollbarLength:null,maxScrollbarLength:null,useBothWheelAxes:!1,useKeyboard:!0,suppressScrollX:!1,suppressScrollY:!1,scrollXMarginOffset:0,scrollYMarginOffset:0,stopPropagationOnClick:!0};this.config=function(e){t=angular.extend({},t,e)},this.$get=function(){var e={getConfig:function(){return t}};return e}}).directive("msScroll",e)}(),function(){"use strict";function e(o,i,e){var s=this;s.collapsed=!0,s.query="",s.queryOptions={debounce:s.debounce||0};var t=!(!s.collapseOnBlur||"true"!=s.collapseOnBlur);s.resultsLoading=!1,s.results=null,s.selectedResultIndex=0,s.ignoreMouseEvents=!1,s.populateResults=function(e){if(s.collapsed)return;var t=angular.isArray(e),n=null===e;if(!t&&!n)return;s.selectedResultIndex=0,s.results=e},s.expand=function(){s.collapsed=!1,o.expand(),s.onExpand&&angular.isFunction(s.onExpand)&&s.onExpand()},s.collapse=function(){s.query="",s.populateResults(null),s.collapsed=!0,o.collapse(),s.onCollapse&&angular.isFunction(s.onCollapse)&&s.onCollapse()},s.blurCollapse=function(){if(!t)return;s.collapse()},s.absorbEvent=function(e){e.preventDefault()},s.handleKeydown=function(e){var t=e.keyCode;-1<[27,38,40].indexOf(t)&&e.preventDefault();switch(t){case 13:if(!s.results)return;s.handleResultClick(s.results[s.selectedResultIndex]);break;case 27:s.collapse();break;case 38:0<=s.selectedResultIndex-1&&(s.selectedResultIndex--,s.ensureSelectedResultIsVisible());break;case 40:if(!s.results)return;s.selectedResultIndex+1<s.results.length&&(s.selectedResultIndex++,s.ensureSelectedResultIsVisible())}},s.handleMouseenter=function(e){if(s.ignoreMouseEvents)return;s.selectedResultIndex=e},s.temporarilyIgnoreMouseEvents=function(){s.ignoreMouseEvents=!0,e.cancel(s.mouseEventIgnoreTimeout),s.mouseEventIgnoreTimeout=e(function(){s.ignoreMouseEvents=!1},250)},s.handleResultClick=function(e){s.onResultClick&&s.onResultClick({item:e});s.collapse()},s.ensureSelectedResultIsVisible=function(){var e=i.find(".ms-search-bar-results"),t=angular.element(e.find(".result")[s.selectedResultIndex]);if(e&&t){var n=t.position().top-8,a=t.position().top+t.outerHeight()+8;s.temporarilyIgnoreMouseEvents(),e.scrollTop()>n&&e.scrollTop(n),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}},o.$watch("MsSearchBar.query",function(e,t){if(!angular.isUndefined(e)&&!angular.equals(e,t)&&!s.collapsed){var n=o.$parent.$eval(s.onSearch,{query:e}),a=angular.isArray(n),i=n&&!!n.then;a&&s.populateResults(n),i&&(s.resultsLoading=!0,n.then(function(e){s.populateResults(e)},function(){s.populateResults([])}).finally(function(){s.resultsLoading=!1}))}})}function t(i){return{restrict:"E",scope:{},require:"msSearchBar",controller:"MsSearchBarController as MsSearchBar",bindToController:{debounce:"=?",onSearch:"@",onResultClick:"&?",onExpand:"&?",onCollapse:"&?",collapseOnBlur:"@"},templateUrl:"app/core/directives/ms-search-bar/ms-search-bar.html",compile:function(e){return e.addClass("ms-search-bar"),function(e,t){var n,a=i.find("body");e.collapse=function(){t.removeClass("expanded"),a.removeClass("ms-search-bar-expanded")},e.expand=function(){t.addClass("expanded"),a.addClass("ms-search-bar-expanded"),n.focus()},n=t.find("#ms-search-bar-input")}}}}e.$inject=["$scope","$element","$timeout"],t.$inject=["$document"],angular.module("app.core").controller("MsSearchBarController",e).directive("msSearchBar",t)}(),function(){"use strict";function e(e,n,i,s,r,l){var d=this;d.query="",d.queryOptions={debounce:300},d.resultsLoading=!1,d.selectedResultIndex=0,d.ignoreMouseEvents=!1,d.mobileBarActive=!1,d.results=null,d.shortcuts=[],d.sortableOptions={ghostClass:"ghost",forceFallback:!0,fallbackClass:"dragging",onSort:function(){d.saveShortcuts()}},d.populateResults=function(){for(var e=[],t=l.getFlatNavigation(),n=r.defer(),a=0;a<t.length;a++)t[a].uisref&&e.push(t[a]);if(d.query){e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(d.query)))return!0});for(var i=0;i<e.length;i++){e[i].hasShortcut=!1;for(var o=0;o<d.shortcuts.length;o++)if(d.shortcuts[o]._id===e[i]._id){e[i].hasShortcut=!0;break}}}else 0<d.shortcuts.length&&(e=d.shortcuts);return d.selectedResultIndex=0,s(function(){n.resolve(e)},250),n.promise},d.loadShortcuts=function(){var e=r.defer(),t=angular.fromJson(n.get("motion.shortcuts"));angular.isUndefined(t)&&(t=[{title:"Agents",icon:"icon-account-multiple",state:"app.staff.agents",weight:5,children:[],uisref:"app.staff.agents",hasShortcut:!0},{title:"License",icon:"icon-cog",state:"app.settings.license",weight:10,children:[],uisref:"app.settings.license",hasShortcut:!0}],n.put("motion.shortcuts",angular.toJson(t)));return e.resolve(t),e.promise},d.saveShortcuts=function(){var e=r.defer();return n.put("motion.shortcuts",angular.toJson(d.shortcuts)),s(function(){e.resolve({success:!0})},250),e.promise},d.addShortcut=function(e){e.hasShortcut=!0,d.shortcuts.push(e),d.saveShortcuts()},d.removeShortcut=function(e){e.hasShortcut=!1;for(var t=0;t<d.shortcuts.length;t++)d.shortcuts[t]._id===e._id&&(d.shortcuts.splice(t,1),d.query||(0===d.shortcuts.length?d.results=null:t>=d.shortcuts.length&&(d.selectedResultIndex=d.shortcuts.length-1)));d.saveShortcuts()},d.handleResultClick=function(e){e.hasShortcut?d.removeShortcut(e):d.addShortcut(e)},d.absorbEvent=function(e){e.preventDefault()},d.handleKeydown=function(e){var t=e.keyCode;-1<[38,40].indexOf(t)&&e.preventDefault();switch(t){case 13:d.handleResultClick(d.results[d.selectedResultIndex]);break;case 38:0<=d.selectedResultIndex-1&&(d.selectedResultIndex--,d.ensureSelectedResultIsVisible());break;case 40:d.selectedResultIndex+1<d.results.length&&(d.selectedResultIndex++,d.ensureSelectedResultIsVisible())}},d.handleMouseenter=function(e){if(d.ignoreMouseEvents)return;d.selectedResultIndex=e},d.temporarilyIgnoreMouseEvents=function(){d.ignoreMouseEvents=!0,s.cancel(d.mouseEventIgnoreTimeout),d.mouseEventIgnoreTimeout=s(function(){d.ignoreMouseEvents=!1},250)},d.ensureSelectedResultIsVisible=function(){var e=i.find("#ms-shortcut-add-menu").find(".results"),t=angular.element(e.find(".result")[d.selectedResultIndex]);if(e&&t){var n=t.position().top-8,a=t.position().top+t.outerHeight()+8;d.temporarilyIgnoreMouseEvents(),e.scrollTop()>n&&e.scrollTop(n),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}},d.toggleMobileBar=function(){d.mobileBarActive=!d.mobileBarActive},d.loadShortcuts().then(function(e){d.shortcuts=e,0<d.shortcuts.length&&(d.results=e)}),e.$watch("MsShortcuts.query",function(e,t){angular.isUndefined(e)||angular.equals(e,t)||(d.resultsLoading=!0,d.populateResults().then(function(e){d.results=e},function(){d.results=[]}).finally(function(){d.resultsLoading=!1}))})}e.$inject=["$scope","$cookies","$document","$timeout","$q","msNavigationService"],angular.module("app.core").controller("MsShortcutsController",e).directive("msShortcuts",function(){return{restrict:"E",scope:{},require:"msShortcuts",controller:"MsShortcutsController as MsShortcuts",bindToController:{},templateUrl:"app/core/directives/ms-shortcuts/ms-shortcuts.html",compile:function(e){return e.addClass("ms-shortcuts"),function(e,t){}}}})}(),function(){"use strict";angular.module("app.core").directive("msSidenavHelper",function(){return{restrict:"A",require:"^mdSidenav",link:function(e,t,n,a){e.$watch(function(){return a.isOpen()&&!a.isLockedOpen()},function(e){angular.isUndefined(e)||(t.parent().toggleClass("full-height",e),angular.element("html").toggleClass("sidenav-open",e))})}}})}(),function(){"use strict";function e(a){return{restrict:"E",link:function(e,t){var n=e.$on("msSplashScreen::remove",function(){a.leave(t).then(function(){n(),e=t=null})})}}}e.$inject=["$animate"],angular.module("app.core").directive("msSplashScreen",e)}(),function(){"use strict";function e(e){var i=this;function t(){i.setCurrentStep(1)}function n(e){return s(e)?i.steps[e-1].scope.optionalStep:null}function a(e){return s(e)?!!i.steps[e-1].scope.hideStep:null}function o(e){return s(e)?!!n(e)||i.steps[e-1].form.$valid:null}function s(e){return!(angular.isUndefined(e)||e<1||e>i.steps.length)}i.mainForm=void 0,i.orientation="horizontal",i.steps=[],i.currentStep=void 0,i.currentStepNumber=1,i.setOrientation=function(e){i.orientation=e||"horizontal"},i.registerMainForm=function(e){i.mainForm=e},i.registerStep=function(e,t,n){var a={element:e,scope:t,form:n,stepNumber:t.step||i.steps.length+1,stepTitle:t.stepTitle,stepTitleTranslate:t.stepTitleTranslate};return i.steps.push(a),i.steps.sort(function(e,t){return e.stepNumber-t.stepNumber}),a},i.setupSteps=function(){i.setCurrentStep(i.currentStepNumber)},i.resetForm=function(){e(function(){for(var e=0;e<i.steps.length;e++)i.steps[e].form.$setPristine(),i.steps[e].form.$setUntouched();i.mainForm.$setPristine(),i.mainForm.$setUntouched(),t()})},i.setCurrentStep=function(e){if(!s(e))return;if(i.currentStepNumber=e,"horizontal"===i.orientation){for(var t=0;t<i.steps.length;t++)i.steps[t].element.hide();i.steps[i.currentStepNumber-1].element.show()}else if("vertical"===i.orientation){for(var n=0;n<i.steps.length;n++)i.steps[n].element.find(".ms-stepper-step-content").hide();i.steps[i.currentStepNumber-1].element.find(".ms-stepper-step-content").show()}},i.gotoStep=function(e){if(a(e))return;i.setCurrentStep(e)},i.gotoPreviousStep=function(){for(var e=i.currentStepNumber-1,t=e;1<=t;t--)if(!a(t)){e=t;break}i.setCurrentStep(e)},i.gotoNextStep=function(){for(var e=i.currentStepNumber+1,t=e;t<=i.steps.length;t++)if(!a(t)){e=t;break}i.setCurrentStep(e)},i.gotoFirstStep=t,i.gotoLastStep=function(){i.setCurrentStep(i.steps.length)},i.isFirstStep=function(){return 1===i.currentStepNumber},i.isLastStep=function(){return i.currentStepNumber===i.steps.length},i.isStepCurrent=function(e){if(!s(e))return null;return i.currentStepNumber===e},i.isStepDisabled=function(e){if(!s(e))return null;for(var t=!1,n=1;n<e;n++)if(!o(n)){t=!0;break}return t},i.isStepOptional=n,i.isStepHidden=a,i.filterHiddenStep=function(e){return!a(e.stepNumber)},i.isStepValid=o,i.isStepNumberValid=s,i.isFormValid=function(){return i.mainForm.$valid}}function t(s){return{restrict:"A",scope:{},require:["form","msVerticalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/vertical.html",compile:function(e){return e.addClass("ms-stepper"),function(e,t,n,a){var i=a[0],o=a[1];s(function(){o.setOrientation("vertical"),o.registerMainForm(i),o.setupSteps()})}}}}e.$inject=["$timeout"],t.$inject=["$timeout"],angular.module("app.core").controller("MsStepperController",e).directive("msHorizontalStepper",function(){return{restrict:"A",scope:{},require:["form","msHorizontalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/horizontal/horizontal.html",compile:function(e){return e.addClass("ms-stepper"),function(e,t,n,a){var i=a[0],o=a[1];o.setOrientation("horizontal"),o.registerMainForm(i),o.setupSteps()}}}}).directive("msHorizontalStepperStep",function(){return{restrict:"E",require:["form","^msHorizontalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},compile:function(e){return e.addClass("ms-stepper-step"),function(e,t,n,a){var i=a[0],o=a[1];e.optionalStep=angular.isDefined(n.optionalStep),o.registerStep(t,e,i),t.hide()}}}}).directive("msVerticalStepper",t).directive("msVerticalStepperStep",function(){return{restrict:"E",require:["form","^msVerticalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html",compile:function(e){return e.addClass("ms-stepper-step"),function(e,t,n,a){var i=a[0],o=a[1];e.optionalStep=angular.isDefined(n.optionalStep),e.stepInfo=o.registerStep(t,e,i),e.MsStepper=o,t.find(".ms-stepper-step-content").hide()}}}})}(),function(){"use strict";function e(m,u){return{scope:!0,require:"^msTimeline",compile:function(e){return e.addClass("ms-timeline-item").addClass("hidden"),function(e,n,t,a){var i=72,o=!1,s=!1,r=a.getScrollEl();!function(){n.find("ms-card")?e.$on("msCard::cardTemplateLoaded",function(e,t){var n=angular.element(t[0]);d(n).then(function(){m(function(){o=!0})})}):d(n).then(function(){m(function(){o=!0})});r.on("scroll",c),c()}();var l=e.$watch(function(){return o&&s},function(e,t){angular.equals(e,t)||e&&(n.removeClass("hidden").addClass("animate"),l())},!0);function d(e){var t=u.defer(),n=e.find("img");return 0<n.length?n.on("load",function(){t.resolve("Image is loaded")}):t.resolve("No images"),t.promise}function c(){r.scrollTop()+r.height()>n.position().top+i&&(m(function(){s=!0}),r.off("scroll",c))}}}}}e.$inject=["$timeout","$q"],angular.module("app.core").controller("MsTimelineController",function(){var t=this;t.scrollEl=void 0,t.setScrollEl=function(e){t.scrollEl=e},t.getScrollEl=function(){return t.scrollEl}}).directive("msTimeline",function(){return{scope:{msTimeline:"=?",loadMore:"&?msTimelineLoadMore"},controller:"MsTimelineController",compile:function(e){return e.addClass("ms-timeline"),function(e,t,n,a){var i=angular.element('<div class="ms-timeline-loader md-accent-bg md-whiteframe-4dp"><span class="spinner animate-rotate"></span></div>');t.append(i);var o={scrollEl:"#content"};o=angular.extend(o,e.msTimeline,{});var s=angular.element(o.scrollEl);a.setScrollEl(s);var r=144;function l(){s.scrollTop()+s.height()+r>i.position().top&&(i.addClass("show"),c(),e.loadMore().then(function(){i.removeClass("show"),d()},function(){i.remove()}))}function d(){s.on("scroll",l)}function c(){s.off("scroll",l)}d(),e.$on("$destroy",function(){c()})}}}}).directive("msTimelineItem",e)}(),function(){"use strict";angular.module("app.core").directive("msTimezone",function(){return{restrict:"E",scope:{ngModel:"="},controller:["$scope",function(e){e.timezone=[{name:"Europe/Andorra",utcOffset:60,offsetStr:"+01:00",countries:["AD"]},{name:"Asia/Dubai",utcOffset:240,offsetStr:"+04:00",countries:["AE","OM"]},{name:"Asia/Kabul",utcOffset:270,offsetStr:"+04:30",countries:["AF"]},{name:"Europe/Tirane",utcOffset:60,offsetStr:"+01:00",countries:["AL"]},{name:"Asia/Yerevan",utcOffset:240,offsetStr:"+04:00",countries:["AM"]},{name:"Antarctica/Rothera",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Palmer",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Mawson",utcOffset:300,offsetStr:"+05:00",countries:["AQ"]},{name:"Antarctica/Davis",utcOffset:420,offsetStr:"+07:00",countries:["AQ"]},{name:"Antarctica/Casey",utcOffset:480,offsetStr:"+08:00",countries:["AQ"]},{name:"Antarctica/Vostok",utcOffset:360,offsetStr:"+06:00",countries:["AQ"]},{name:"Antarctica/DumontDUrville",utcOffset:600,offsetStr:"+10:00",countries:["AQ"]},{name:"Antarctica/Syowa",utcOffset:180,offsetStr:"+03:00",countries:["AQ"]},{name:"Antarctica/Troll",utcOffset:0,offsetStr:"+00:00",countries:["AQ"]},{name:"America/Argentina/Buenos_Aires",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Cordoba",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Salta",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Jujuy",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Tucuman",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Catamarca",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/La_Rioja",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Juan",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Mendoza",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Luis",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Rio_Gallegos",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Ushuaia",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"Pacific/Pago_Pago",utcOffset:-660,offsetStr:"-11:00",countries:["AS","UM"]},{name:"Europe/Vienna",utcOffset:60,offsetStr:"+01:00",countries:["AT"]},{name:"Australia/Lord_Howe",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Antarctica/Macquarie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Hobart",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Currie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Melbourne",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Sydney",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Broken_Hill",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Brisbane",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Lindeman",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Adelaide",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Darwin",utcOffset:570,offsetStr:"+09:30",countries:["AU"]},{name:"Australia/Perth",utcOffset:480,offsetStr:"+08:00",countries:["AU"]},{name:"Australia/Eucla",utcOffset:525,offsetStr:"+08:45",countries:["AU"]},{name:"Asia/Baku",utcOffset:240,offsetStr:"+04:00",countries:["AZ"]},{name:"America/Barbados",utcOffset:-240,offsetStr:"-04:00",countries:["BB"]},{name:"Asia/Dhaka",utcOffset:360,offsetStr:"+06:00",countries:["BD"]},{name:"Europe/Brussels",utcOffset:60,offsetStr:"+01:00",countries:["BE"]},{name:"Europe/Sofia",utcOffset:120,offsetStr:"+02:00",countries:["BG"]},{name:"Atlantic/Bermuda",utcOffset:-240,offsetStr:"-04:00",countries:["BM"]},{name:"Asia/Brunei",utcOffset:480,offsetStr:"+08:00",countries:["BN"]},{name:"America/La_Paz",utcOffset:-240,offsetStr:"-04:00",countries:["BO"]},{name:"America/Noronha",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Belem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Fortaleza",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Recife",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Araguaina",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Maceio",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Bahia",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Sao_Paulo",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Campo_Grande",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Cuiaba",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Santarem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Porto_Velho",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Boa_Vista",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Manaus",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Eirunepe",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Rio_Branco",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Nassau",utcOffset:-300,offsetStr:"-05:00",countries:["BS"]},{name:"Asia/Thimphu",utcOffset:360,offsetStr:"+06:00",countries:["BT"]},{name:"Europe/Minsk",utcOffset:180,offsetStr:"+03:00",countries:["BY"]},{name:"America/Belize",utcOffset:-360,offsetStr:"-06:00",countries:["BZ"]},{name:"America/St_Johns",utcOffset:-210,offsetStr:"-03:30",countries:["CA"]},{name:"America/Halifax",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Glace_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Moncton",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Goose_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Blanc-Sablon",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Toronto",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Nipigon",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Thunder_Bay",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Iqaluit",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Pangnirtung",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Resolute",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Atikokan",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Rankin_Inlet",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Winnipeg",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Rainy_River",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Regina",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Swift_Current",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Edmonton",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Cambridge_Bay",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Yellowknife",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Inuvik",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Creston",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Dawson_Creek",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Fort_Nelson",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Vancouver",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Whitehorse",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Dawson",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"Indian/Cocos",utcOffset:390,offsetStr:"+06:30",countries:["CC"]},{name:"Europe/Zurich",utcOffset:60,offsetStr:"+01:00",countries:["CH","DE","LI"]},{name:"Africa/Abidjan",utcOffset:0,offsetStr:"+00:00",countries:["CI","BF","GM","GN","ML","MR","SH","SL","SN","ST","TG"]},{name:"Pacific/Rarotonga",utcOffset:-600,offsetStr:"-10:00",countries:["CK"]},{name:"America/Santiago",utcOffset:-180,offsetStr:"-03:00",countries:["CL"]},{name:"Pacific/Easter",utcOffset:-300,offsetStr:"-05:00",countries:["CL"]},{name:"Asia/Shanghai",utcOffset:480,offsetStr:"+08:00",countries:["CN"]},{name:"Asia/Urumqi",utcOffset:360,offsetStr:"+06:00",countries:["CN"]},{name:"America/Bogota",utcOffset:-300,offsetStr:"-05:00",countries:["CO"]},{name:"America/Costa_Rica",utcOffset:-360,offsetStr:"-06:00",countries:["CR"]},{name:"America/Havana",utcOffset:-300,offsetStr:"-05:00",countries:["CU"]},{name:"Atlantic/Cape_Verde",utcOffset:-60,offsetStr:"-01:00",countries:["CV"]},{name:"America/Curacao",utcOffset:-240,offsetStr:"-04:00",countries:["CW","AW","BQ","SX"]},{name:"Indian/Christmas",utcOffset:420,offsetStr:"+07:00",countries:["CX"]},{name:"Asia/Nicosia",utcOffset:120,offsetStr:"+02:00",countries:["CY"]},{name:"Europe/Prague",utcOffset:60,offsetStr:"+01:00",countries:["CZ","SK"]},{name:"Europe/Berlin",utcOffset:60,offsetStr:"+01:00",countries:["DE"]},{name:"Europe/Copenhagen",utcOffset:60,offsetStr:"+01:00",countries:["DK"]},{name:"America/Santo_Domingo",utcOffset:-240,offsetStr:"-04:00",countries:["DO"]},{name:"Africa/Algiers",utcOffset:60,offsetStr:"+01:00",countries:["DZ"]},{name:"America/Guayaquil",utcOffset:-300,offsetStr:"-05:00",countries:["EC"]},{name:"Pacific/Galapagos",utcOffset:-360,offsetStr:"-06:00",countries:["EC"]},{name:"Europe/Tallinn",utcOffset:120,offsetStr:"+02:00",countries:["EE"]},{name:"Africa/Cairo",utcOffset:120,offsetStr:"+02:00",countries:["EG"]},{name:"Africa/El_Aaiun",utcOffset:0,offsetStr:"+00:00",countries:["EH"]},{name:"Europe/Madrid",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Africa/Ceuta",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Atlantic/Canary",utcOffset:0,offsetStr:"+00:00",countries:["ES"]},{name:"Europe/Helsinki",utcOffset:120,offsetStr:"+02:00",countries:["FI","AX"]},{name:"Pacific/Fiji",utcOffset:720,offsetStr:"+12:00",countries:["FJ"]},{name:"Atlantic/Stanley",utcOffset:-180,offsetStr:"-03:00",countries:["FK"]},{name:"Pacific/Chuuk",utcOffset:600,offsetStr:"+10:00",countries:["FM"]},{name:"Pacific/Pohnpei",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Pacific/Kosrae",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Atlantic/Faroe",utcOffset:0,offsetStr:"+00:00",countries:["FO"]},{name:"Europe/Paris",utcOffset:60,offsetStr:"+01:00",countries:["FR"]},{name:"Europe/London",utcOffset:0,offsetStr:"+00:00",countries:["GB","GG","IM","JE"]},{name:"Asia/Tbilisi",utcOffset:240,offsetStr:"+04:00",countries:["GE"]},{name:"America/Cayenne",utcOffset:-180,offsetStr:"-03:00",countries:["GF"]},{name:"Africa/Accra",utcOffset:0,offsetStr:"+00:00",countries:["GH"]},{name:"Europe/Gibraltar",utcOffset:60,offsetStr:"+01:00",countries:["GI"]},{name:"America/Godthab",utcOffset:-180,offsetStr:"-03:00",countries:["GL"]},{name:"America/Danmarkshavn",utcOffset:0,offsetStr:"+00:00",countries:["GL"]},{name:"America/Scoresbysund",utcOffset:-60,offsetStr:"-01:00",countries:["GL"]},{name:"America/Thule",utcOffset:-240,offsetStr:"-04:00",countries:["GL"]},{name:"Europe/Athens",utcOffset:120,offsetStr:"+02:00",countries:["GR"]},{name:"Atlantic/South_Georgia",utcOffset:-120,offsetStr:"-02:00",countries:["GS"]},{name:"America/Guatemala",utcOffset:-360,offsetStr:"-06:00",countries:["GT"]},{name:"Pacific/Guam",utcOffset:600,offsetStr:"+10:00",countries:["GU","MP"]},{name:"Africa/Bissau",utcOffset:0,offsetStr:"+00:00",countries:["GW"]},{name:"America/Guyana",utcOffset:-240,offsetStr:"-04:00",countries:["GY"]},{name:"Asia/Hong_Kong",utcOffset:480,offsetStr:"+08:00",countries:["HK"]},{name:"America/Tegucigalpa",utcOffset:-360,offsetStr:"-06:00",countries:["HN"]},{name:"America/Port-au-Prince",utcOffset:-300,offsetStr:"-05:00",countries:["HT"]},{name:"Europe/Budapest",utcOffset:60,offsetStr:"+01:00",countries:["HU"]},{name:"Asia/Jakarta",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Pontianak",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Makassar",utcOffset:480,offsetStr:"+08:00",countries:["ID"]},{name:"Asia/Jayapura",utcOffset:540,offsetStr:"+09:00",countries:["ID"]},{name:"Europe/Dublin",utcOffset:0,offsetStr:"+00:00",countries:["IE"]},{name:"Asia/Jerusalem",utcOffset:120,offsetStr:"+02:00",countries:["IL"]},{name:"Asia/Kolkata",utcOffset:330,offsetStr:"+05:30",countries:["IN"]},{name:"Indian/Chagos",utcOffset:360,offsetStr:"+06:00",countries:["IO"]},{name:"Asia/Baghdad",utcOffset:180,offsetStr:"+03:00",countries:["IQ"]},{name:"Asia/Tehran",utcOffset:210,offsetStr:"+03:30",countries:["IR"]},{name:"Atlantic/Reykjavik",utcOffset:0,offsetStr:"+00:00",countries:["IS"]},{name:"Europe/Rome",utcOffset:60,offsetStr:"+01:00",countries:["IT","SM","VA"]},{name:"America/Jamaica",utcOffset:-300,offsetStr:"-05:00",countries:["JM"]},{name:"Asia/Amman",utcOffset:120,offsetStr:"+02:00",countries:["JO"]},{name:"Asia/Tokyo",utcOffset:540,offsetStr:"+09:00",countries:["JP"]},{name:"Africa/Nairobi",utcOffset:180,offsetStr:"+03:00",countries:["KE","DJ","ER","ET","KM","MG","SO","TZ","UG","YT"]},{name:"Asia/Bishkek",utcOffset:360,offsetStr:"+06:00",countries:["KG"]},{name:"Pacific/Tarawa",utcOffset:720,offsetStr:"+12:00",countries:["KI"]},{name:"Pacific/Enderbury",utcOffset:780,offsetStr:"+13:00",countries:["KI"]},{name:"Pacific/Kiritimati",utcOffset:840,offsetStr:"+14:00",countries:["KI"]},{name:"Asia/Pyongyang",utcOffset:510,offsetStr:"+08:30",countries:["KP"]},{name:"Asia/Seoul",utcOffset:540,offsetStr:"+09:00",countries:["KR"]},{name:"America/Cayman",utcOffset:-300,offsetStr:"-05:00",countries:["KY"]},{name:"Asia/Almaty",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Qyzylorda",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Aqtobe",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Aqtau",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Oral",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Beirut",utcOffset:120,offsetStr:"+02:00",countries:["LB"]},{name:"Asia/Colombo",utcOffset:330,offsetStr:"+05:30",countries:["LK"]},{name:"Africa/Monrovia",utcOffset:0,offsetStr:"+00:00",countries:["LR"]},{name:"Europe/Vilnius",utcOffset:120,offsetStr:"+02:00",countries:["LT"]},{name:"Europe/Luxembourg",utcOffset:60,offsetStr:"+01:00",countries:["LU"]},{name:"Europe/Riga",utcOffset:120,offsetStr:"+02:00",countries:["LV"]},{name:"Africa/Tripoli",utcOffset:120,offsetStr:"+02:00",countries:["LY"]},{name:"Africa/Casablanca",utcOffset:0,offsetStr:"+00:00",countries:["MA"]},{name:"Europe/Monaco",utcOffset:60,offsetStr:"+01:00",countries:["MC"]},{name:"Europe/Chisinau",utcOffset:120,offsetStr:"+02:00",countries:["MD"]},{name:"Pacific/Majuro",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Pacific/Kwajalein",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Asia/Rangoon",utcOffset:390,offsetStr:"+06:30",countries:["MM"]},{name:"Asia/Ulaanbaatar",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Hovd",utcOffset:420,offsetStr:"+07:00",countries:["MN"]},{name:"Asia/Choibalsan",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Macau",utcOffset:480,offsetStr:"+08:00",countries:["MO"]},{name:"America/Martinique",utcOffset:-240,offsetStr:"-04:00",countries:["MQ"]},{name:"Europe/Malta",utcOffset:60,offsetStr:"+01:00",countries:["MT"]},{name:"Indian/Mauritius",utcOffset:240,offsetStr:"+04:00",countries:["MU"]},{name:"Indian/Maldives",utcOffset:300,offsetStr:"+05:00",countries:["MV"]},{name:"America/Mexico_City",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Cancun",utcOffset:-300,offsetStr:"-05:00",countries:["MX"]},{name:"America/Merida",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Monterrey",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Matamoros",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Mazatlan",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Chihuahua",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Ojinaga",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Hermosillo",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Tijuana",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Santa_Isabel",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Bahia_Banderas",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"Asia/Kuala_Lumpur",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Asia/Kuching",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Africa/Maputo",utcOffset:120,offsetStr:"+02:00",countries:["MZ","BI","BW","CD","MW","RW","ZM","ZW"]},{name:"Africa/Windhoek",utcOffset:120,offsetStr:"+02:00",countries:["NA"]},{name:"Pacific/Noumea",utcOffset:660,offsetStr:"+11:00",countries:["NC"]},{name:"Pacific/Norfolk",utcOffset:660,offsetStr:"+11:00",countries:["NF"]},{name:"Africa/Lagos",utcOffset:60,offsetStr:"+01:00",countries:["NG","AO","BJ","CD","CF","CG","CM","GA","GQ","NE"]},{name:"America/Managua",utcOffset:-360,offsetStr:"-06:00",countries:["NI"]},{name:"Europe/Amsterdam",utcOffset:60,offsetStr:"+01:00",countries:["NL"]},{name:"Europe/Oslo",utcOffset:60,offsetStr:"+01:00",countries:["NO","SJ"]},{name:"Asia/Kathmandu",utcOffset:345,offsetStr:"+05:45",countries:["NP"]},{name:"Pacific/Nauru",utcOffset:720,offsetStr:"+12:00",countries:["NR"]},{name:"Pacific/Niue",utcOffset:-660,offsetStr:"-11:00",countries:["NU"]},{name:"Pacific/Auckland",utcOffset:780,offsetStr:"+13:00",countries:["NZ","AQ"]},{name:"Pacific/Chatham",utcOffset:825,offsetStr:"+13:45",countries:["NZ"]},{name:"America/Panama",utcOffset:-300,offsetStr:"-05:00",countries:["PA"]},{name:"America/Lima",utcOffset:-300,offsetStr:"-05:00",countries:["PE"]},{name:"Pacific/Tahiti",utcOffset:-600,offsetStr:"-10:00",countries:["PF"]},{name:"Pacific/Marquesas",utcOffset:-570,offsetStr:"-09:30",countries:["PF"]},{name:"Pacific/Gambier",utcOffset:-540,offsetStr:"-09:00",countries:["PF"]},{name:"Pacific/Port_Moresby",utcOffset:600,offsetStr:"+10:00",countries:["PG"]},{name:"Pacific/Bougainville",utcOffset:660,offsetStr:"+11:00",countries:["PG"]},{name:"Asia/Manila",utcOffset:480,offsetStr:"+08:00",countries:["PH"]},{name:"Asia/Karachi",utcOffset:300,offsetStr:"+05:00",countries:["PK"]},{name:"Europe/Warsaw",utcOffset:60,offsetStr:"+01:00",countries:["PL"]},{name:"America/Miquelon",utcOffset:-180,offsetStr:"-03:00",countries:["PM"]},{name:"Pacific/Pitcairn",utcOffset:-480,offsetStr:"-08:00",countries:["PN"]},{name:"America/Puerto_Rico",utcOffset:-240,offsetStr:"-04:00",countries:["PR"]},{name:"Asia/Gaza",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Asia/Hebron",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Europe/Lisbon",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Madeira",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Azores",utcOffset:-60,offsetStr:"-01:00",countries:["PT"]},{name:"Pacific/Palau",utcOffset:540,offsetStr:"+09:00",countries:["PW"]},{name:"America/Asuncion",utcOffset:-180,offsetStr:"-03:00",countries:["PY"]},{name:"Asia/Qatar",utcOffset:180,offsetStr:"+03:00",countries:["QA","BH"]},{name:"Indian/Reunion",utcOffset:240,offsetStr:"+04:00",countries:["RE","TF"]},{name:"Europe/Bucharest",utcOffset:120,offsetStr:"+02:00",countries:["RO"]},{name:"Europe/Belgrade",utcOffset:60,offsetStr:"+01:00",countries:["RS","BA","HR","ME","MK","SI"]},{name:"Europe/Kaliningrad",utcOffset:120,offsetStr:"+02:00",countries:["RU"]},{name:"Europe/Moscow",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Simferopol",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Volgograd",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Samara",utcOffset:240,offsetStr:"+04:00",countries:["RU"]},{name:"Asia/Yekaterinburg",utcOffset:300,offsetStr:"+05:00",countries:["RU"]},{name:"Asia/Omsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novosibirsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novokuznetsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Krasnoyarsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Irkutsk",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Chita",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Yakutsk",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Khandyga",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Vladivostok",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Sakhalin",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Ust-Nera",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Magadan",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Srednekolymsk",utcOffset:660,offsetStr:"+11:00",countries:["RU"]},{name:"Asia/Kamchatka",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Anadyr",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Riyadh",utcOffset:180,offsetStr:"+03:00",countries:["SA","KW","YE"]},{name:"Pacific/Guadalcanal",utcOffset:660,offsetStr:"+11:00",countries:["SB"]},{name:"Indian/Mahe",utcOffset:240,offsetStr:"+04:00",countries:["SC"]},{name:"Africa/Khartoum",utcOffset:180,offsetStr:"+03:00",countries:["SD","SS"]},{name:"Europe/Stockholm",utcOffset:60,offsetStr:"+01:00",countries:["SE"]},{name:"Asia/Singapore",utcOffset:480,offsetStr:"+08:00",countries:["SG"]},{name:"America/Paramaribo",utcOffset:-180,offsetStr:"-03:00",countries:["SR"]},{name:"America/El_Salvador",utcOffset:-360,offsetStr:"-06:00",countries:["SV"]},{name:"Asia/Damascus",utcOffset:120,offsetStr:"+02:00",countries:["SY"]},{name:"America/Grand_Turk",utcOffset:-240,offsetStr:"-04:00",countries:["TC"]},{name:"Africa/Ndjamena",utcOffset:60,offsetStr:"+01:00",countries:["TD"]},{name:"Indian/Kerguelen",utcOffset:300,offsetStr:"+05:00",countries:["TF"]},{name:"Asia/Bangkok",utcOffset:420,offsetStr:"+07:00",countries:["TH","KH","LA","VN"]},{name:"Asia/Dushanbe",utcOffset:300,offsetStr:"+05:00",countries:["TJ"]},{name:"Pacific/Fakaofo",utcOffset:780,offsetStr:"+13:00",countries:["TK"]},{name:"Asia/Dili",utcOffset:540,offsetStr:"+09:00",countries:["TL"]},{name:"Asia/Ashgabat",utcOffset:300,offsetStr:"+05:00",countries:["TM"]},{name:"Africa/Tunis",utcOffset:60,offsetStr:"+01:00",countries:["TN"]},{name:"Pacific/Tongatapu",utcOffset:780,offsetStr:"+13:00",countries:["TO"]},{name:"Europe/Istanbul",utcOffset:120,offsetStr:"+02:00",countries:["TR"]},{name:"America/Port_of_Spain",utcOffset:-240,offsetStr:"-04:00",countries:["TT","AG","AI","BL","DM","GD","GP","KN","LC","MF","MS","VC","VG","VI"]},{name:"Pacific/Funafuti",utcOffset:720,offsetStr:"+12:00",countries:["TV"]},{name:"Asia/Taipei",utcOffset:480,offsetStr:"+08:00",countries:["TW"]},{name:"Europe/Kiev",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Uzhgorod",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Zaporozhye",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Pacific/Wake",utcOffset:720,offsetStr:"+12:00",countries:["UM"]},{name:"America/New_York",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Detroit",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Louisville",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Monticello",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Indianapolis",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vincennes",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Winamac",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Marengo",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Petersburg",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vevay",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Chicago",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Tell_City",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Knox",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Menominee",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Center",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/New_Salem",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Beulah",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Denver",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Boise",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Phoenix",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Los_Angeles",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Metlakatla",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Anchorage",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Juneau",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Sitka",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Yakutat",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Nome",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Adak",utcOffset:-600,offsetStr:"-10:00",countries:["US"]},{name:"Pacific/Honolulu",utcOffset:-600,offsetStr:"-10:00",countries:["US","UM"]},{name:"America/Montevideo",utcOffset:-180,offsetStr:"-03:00",countries:["UY"]},{name:"Asia/Samarkand",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"Asia/Tashkent",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"America/Caracas",utcOffset:-270,offsetStr:"-04:30",countries:["VE"]},{name:"Asia/Ho_Chi_Minh",utcOffset:420,offsetStr:"+07:00",countries:["VN"]},{name:"Pacific/Efate",utcOffset:660,offsetStr:"+11:00",countries:["VU"]},{name:"Pacific/Wallis",utcOffset:720,offsetStr:"+12:00",countries:["WF"]},{name:"Pacific/Apia",utcOffset:840,offsetStr:"+14:00",countries:["WS"]},{name:"Africa/Johannesburg",utcOffset:120,offsetStr:"+02:00",countries:["ZA","LS","SZ"]}]}],templateUrl:"app/core/directives/ms-timezone/ms-timezone.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsWidgetEngineCounterController",function(){var a=this;a.filter=[],a.filtered=!1,a.fontSize=20,a.getCount=function(e){var t=0;if(e){a.fontSize=e.attrs[2]&&e.attrs[2].value?parseInt(e.attrs[2].value)-parseInt(e.attrs[2].value)%2:20,e.attrs[1].value&&e.attrs[1].value.length?(a.filtered=!0,a.filter=_.intersection(e.voiceQueuesSelected,e.attrs[1].value)):(a.filtered=!1,a.filter=e.voiceQueuesSelected);for(var n=0;n<e.voiceQueues.rows.length;n+=1)_.includes(a.filter,e.voiceQueues.rows[n].id)&&("abandoned"===e.attrs[0].value?t+=parseInt(e.voiceQueues.rows[n].total)-parseInt(e.voiceQueues.rows[n].answered)-parseInt(e.voiceQueues.rows[n].unmanaged):t+=e.voiceQueues.rows[n][e.attrs[0].value]?parseInt(e.voiceQueues.rows[n][e.attrs[0].value]):0)}return t}})}(),function(){"use strict";function e(s,e){var r=this;r.filter=[],r.filtered=!1,r.properties=[],r.multiBarChart={labels:["QUEUE_NAME"],series:["TOTAL"],data:[[50]],options:{responsive:!0,legend:{display:!0,fontColor:"#2196f3"},scales:{xAxes:[{gridLines:{display:!0},ticks:{fontColor:"#2196f3",stepSize:1,beginAtZero:!0}}],yAxes:[{gridLines:{display:!1},ticks:{fontColor:"#2196f3"}}]}}},r.getMultiBarChart=function(e){e&&(e.attrs&&function(e){r.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[3].value&&e.attrs[3].value.length?(r.filtered=!0,r.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(r.filtered=!1,r.filter=e.voiceQueuesSelected);if(r.multiBarChart.series.length>r.properties.length){var t=r.multiBarChart.series.length-r.properties.length;r.multiBarChart.series.splice(0,t),r.multiBarChart.data.splice(0,t)}for(var n=0;n<r.properties.length;n+=1){if(r.multiBarChart.series[n]=s.instant("TOOLS."+r.properties[n].toUpperCase()),_.isNil(r.multiBarChart.data[n])&&(r.multiBarChart.data[n]=[]),r.multiBarChart.labels.length>r.filter.length){var a=r.multiBarChart.labels.length-r.filter.length;r.multiBarChart.labels.splice(0,a),r.multiBarChart.data[n].splice(0,a)}for(var i=0,o=0;i<e.voiceQueues.rows.length;i+=1)_.includes(r.filter,e.voiceQueues.rows[i].id)&&(r.multiBarChart.labels[o]=e.voiceQueues.rows[i].name,"abandoned"===r.properties[n].toLowerCase()?r.multiBarChart.data[n][o]=parseInt(e.voiceQueues.rows[i].total)-parseInt(e.voiceQueues.rows[i].answered)-parseInt(e.voiceQueues.rows[i].unmanaged):r.multiBarChart.data[n][o]=e.voiceQueues.rows[i][r.properties[n]]?parseInt(e.voiceQueues.rows[i][r.properties[n]]):0,o+=1)}}(e),e.foreground&&function(e){r.multiBarChart.options.legend.fontColor=e.foreground;for(var t=0;t<r.multiBarChart.options.scales.xAxes.length;t+=1)r.multiBarChart.options.scales.xAxes[t].ticks.fontColor=e.foreground;for(var n=0;n<r.multiBarChart.options.scales.yAxes.length;n+=1)r.multiBarChart.options.scales.yAxes[n].ticks.fontColor=e.foreground}(e))}}e.$inject=["$translate","socket"],angular.module("app.core").controller("MsWidgetEngineMultibarChartController",e)}(),function(){"use strict";function e(o){var s=this;s.filter=[],s.filtered=!1,s.properties=[],s.pieChart={labels:["ANSWERED"],data:[30],options:{responsive:!0,legend:{display:!0}}},s.getPieChart=function(e){e&&(e.attrs&&function(e){s.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[3].value&&e.attrs[3].value.length?(s.filtered=!0,s.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(s.filtered=!1,s.filter=e.voiceQueuesSelected);if(s.pieChart.labels.length>s.properties.length){var t=s.pieChart.labels.length-s.properties.length;s.pieChart.labels.splice(0,t),s.pieChart.data.splice(0,t)}for(var n=0,a=0;n<s.properties.length;n+=1){s.pieChart.labels[n]=o.instant("TOOLS."+s.properties[n].toUpperCase());for(var i=0;i<e.voiceQueues.rows.length;i+=1)_.includes(s.filter,e.voiceQueues.rows[i].id)&&("abandoned"===s.properties[n].toLowerCase()?a+=parseInt(e.voiceQueues.rows[i].total)-parseInt(e.voiceQueues.rows[i].answered)-parseInt(e.voiceQueues.rows[i].unmanaged):a+=e.voiceQueues.rows[i][s.properties[n]]?parseInt(e.voiceQueues.rows[i][s.properties[n]]):0);s.pieChart.data[n]=a,a=0}}(e),e.foreground&&(t=e,s.pieChart.options.legend.fontColor=t.foreground));var t}}e.$inject=["$translate"],angular.module("app.core").controller("MsWidgetEnginePieChartController",e)}(),function(){"use strict";function e(e,n,a,i){var o=this;function t(e){o.results=e||{count:0,rows:[]}}function s(){o.query.offset=(o.query.page-1)*o.query.limit,o.promise=i.analyticCustomReport.run(o.query,t).$promise}o.countDown=0,o.refresh=0,o.title="",o.columns=[],o.results={rows:[],count:0},o.query={limit:10,page:1,startDate:moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),endDate:moment().endOf("day").format("YYYY-MM-DD HH:mm:ss"),output:"web"},o.onInit=function e(t){t&&t.attrs&&(t.attrs[0]&&t.attrs[0].value&&(o.query.id=t.attrs[0].value,i.analyticFieldReport.get({fields:"field,alias",nolimit:!0,CustomReportId:t.attrs[0].value}).$promise.then(function(e){return e&&e.rows&&(o.columns=e.rows),i.analyticCustomReport.get({id:t.attrs[0].value,fields:"id,name"}).$promise}).then(function(e){e&&e.name&&(o.title=e.name),s()}).catch(function(e){console.log(e)})),t.attrs[1]&&t.attrs[1].value&&(o.refresh=parseInt(t.attrs[1].value),!_.isNaN(o.refresh)&&0<o.refresh?(o.countDown=parseInt(t.attrs[1].value),o.interval=a(function(){o.countDown-=1},1e3,0),o.timeout=n(function(){o.interval&&a.cancel(o.interval),e(t)},1e3*o.refresh)):(o.interval&&a.cancel(o.interval),o.timeout&&n.cancel(o.timeout))))},o.getResults=s,o.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t},e.$on("$destroy",function(){o.interval&&a.cancel(o.interval),o.timeout&&n.cancel(o.timeout)})}e.$inject=["$scope","$timeout","$interval","api"],angular.module("app.core").controller("MsWidgetEngineWebReportController",e)}(),function(){"use strict";function e(e,t){this.getTrustedURL=function(e){return t.trustAsResourceUrl(e)}}function t(e){return{restrict:"E",scope:{config:"=?",onEdit:"&?",onDelete:"&?"},require:"msWidgetEngine",controller:"MsWidgetEngineController",controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-widget-engine/ms-widget-engine.html"}}e.$inject=["$mdDialog","$sce"],t.$inject=["$document"],angular.module("app.core").controller("MsWidgetEngineController",e).directive("msWidgetEngine",t)}(),function(){"use strict";function e(e,t){var n=this;n.flipped=!1,n.flip=function(){if(!angular.isDefined(e.flippable)||!0!==e.flippable)return;n.flipped=!n.flipped,t.toggleClass("flipped",n.flipped)}}e.$inject=["$scope","$element"],angular.module("app.core").controller("MsWidgetController",e).directive("msWidget",function(){return{restrict:"E",scope:{flippable:"=?"},controller:"MsWidgetController",transclude:!0,compile:function(e){return e.addClass("ms-widget"),function(e,t,n,a,i){i(function(e){t.empty(),t.append(e)})}}}}).directive("msWidgetFront",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-front"),function(e,t,n,a,i){i(function(e){t.empty(),t.append(e)}),e.flipWidget=a.flip}}}}).directive("msWidgetBack",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-back"),function(e,t,n,a,i){i(function(e){t.empty(),t.append(e)}),e.flipWidget=a.flip}}}})}(),function(){"use strict";angular.module("app.core").filter("altDate",function(){return function(e){var t=Date.now()-new Date(e);return t<36e5?moment(e).fromNow():t<864e5?moment(e).format("HH:mm"):t<6048e5?moment(e).format("dddd"):moment(e).calendar()}})}(),function(){"use strict";function e(t){return function(e){return t.trustAsHtml(e)}}e.$inject=["$sce"],angular.module("app.core").filter("toTrusted",e).filter("htmlToPlaintext",function(){return function(e){return String(e).replace(/<[^>]+>/gm,"")}}).filter("nospace",function(){return function(e){return e?e.replace(/ /g,""):""}}).filter("humanizeDoc",function(){return function(e){if(e)return"directive"===e.type?e.name.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()}):e.label||e.name}})}(),function(){"use strict";angular.module("app.core").filter("filterByIds",function(){return function(e,t){if(0===e.length||!t)return e;if(0===t.length)return[];for(var n=[],a=0;a<e.length;a++){for(var i=e[a],o=!1,s=0;s<t.length;s++){var r=t[s];if(i.id===r){o=!0;break}}o&&n.push(i)}return n}})}(),function(){"use strict";angular.module("app.core").filter("filterByPropIds",function(){return function(e,t,n){if(0===e.length||!n||0===n.length)return e;for(var a=[],i=0;i<e.length;i++){for(var o=e[i],s=!1,r=0;r<n.length;r++){var l=n[r];if(-1<o[t].indexOf(l)){s=!0;break}}s&&a.push(o)}return a}})}(),function(){"use strict";angular.module("app.core").filter("filterByTags",function(){return function(e,n){if(0===e.length||0===n.length)return e;var a=[];return e.forEach(function(e){var t=n.every(function(t){var n=!1;return e.tags.forEach(function(e){e.name!==t.name||(n=!0)}),n});t&&a.push(e)}),a}}).filter("filterSingleByTags",function(){return function(e,t){if(0!==e.length&&0!==t.length){if(e.length<t.length)return[];var n=[],a=t.every(function(t){var n=!1;return e.forEach(function(e){e.name!==t.name||(n=!0)}),n});return a&&n.push(e),n}}})}(),function(){"use strict";function c(e,t,n,a){this.id=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),this.title=e,this.body=t,this.accept=n,this.reject=a,this.close=i}function m(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}function i(){var n=this;navigator.serviceWorker.ready.then(function(e){e.getNotifications().then(function(e){var t=_.find(e,function(e){return e.data.id===n.id});t&&t.close()})})}angular.module("app.dashboards").provider("motNotification",function(){return{$get:[function(){var l,n,d=[];"serviceWorker"in navigator&&m()?navigator.serviceWorker.register("notification.js").then(function(e){(l=e).update(),l.installing?n=l.installing:l.waiting?n=l.waiting:l.active&&(n=l.active)}).catch(function(e){console.error("Service worker registration failed",e)}):console.error("Service Worker is not supported");return navigator.serviceWorker.addEventListener("message",function(e){if(e.source===n){var t=_.find(d,{id:e.data.id});if(t)switch(e.data.action){case"accept":t.accept&&t.accept();break;case"reject":t.reject&&t.reject()}}}),{create:function(e,i,o,s,r){return new Promise(function(t,n){var a;m()&&(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)?(a=new c(e||"MyTitle",i||"MyBody",s,r),d.push(a),a?window.Notification.requestPermission().then(function(e){if("granted"===e)return l.showNotification(a.title,{body:a.body,requireInteraction:!0,icon:o||"assets/images/business/queueCampaigns.jpg",data:{id:a.id},actions:[{action:"accept",title:"Accept"},{action:"reject",title:"Reject"}]})}).then(function(e){t(a)}).catch(function(e){n(e)}):n(new Error("Notification creating error"))):t()})}}}]}})}(),function(){"use strict";function e(l,d,c){return{resolve:function(e,t){var n=e.split("@"),a=n[0],i=n[1],o=t||{};if(!a||!i)return d.error("apiResolver.resolve requires correct action parameter (ResourceName@methodName)"),!1;var s=l.defer(),r=function(e){for(var t=e.split("."),n=c,a=0;a<t.length;a++){if(angular.isUndefined(n[t[a]])){d.error('Resource part "'+t[a]+'" is not defined!'),n=!1;break}n=n[t[a]]}if(!n)return!1;return n}(a);r?r[i](o,function(e){s.resolve(e)},function(e){s.reject(e)}):(d.error('Resource "'+a+'" is not defined in the api service!'),s.reject('Resource "'+a+'" is not defined in the api service!'));return s.promise}}}e.$inject=["$q","$log","api"],angular.module("app.core").factory("apiResolver",e)}(),function(){"use strict";angular.module("app.core").provider("msApi",function(){var n=angular.injector(["ng"]).get("$log"),a="",v=[];function t(e){a=e}function i(){return a}function o(e,t){angular.isString(e)?angular.isArray(t)?v[e]={url:a+(t[0]||""),paramDefaults:t[1]||[],actions:t[2]||[],options:t[3]||{}}:n.error('"resource" must be an array and it must follow $resource definition'):n.error('"path" must be a string (eg. `dashboard.project`)')}this.setBaseUrl=t,this.getBaseUrl=i,this.getApiObject=function(){return v},this.register=o,this.$get=["$log","$q","$resource","$rootScope",function(m,u,p,g){var e={setBaseUrl:t,getBaseUrl:i,register:o,resolve:function(e,t){g.$broadcast("msApi::resolveStart");var n=e.split("@"),a=n[0],i=n[1],o=t||{};if(!a||!i)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var s=u.defer(),r=v[a];if(r){var l=p(r.url,r.paramDefaults,r.actions,r.options);l[i](o,function(e){s.resolve(e),g.$broadcast("msApi::resolveSuccess")},function(e){s.reject(e),g.$broadcast("msApi::resolveError")})}else m.error('Resource "'+a+'" is not defined in the api service!'),s.reject('Resource "'+a+'" is not defined in the api service!');return s.promise},request:function(e,t,n,a){g.$broadcast("msApi::requestStart");var i=e.split("@"),o=i[0],s=i[1],r=t||{};if(!o||!s)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var l=u.defer(),d=v[o];if(d){var c=p(d.url,d.paramDefaults,d.actions,d.options);c[s](r,function(e){g.$broadcast("msApi::requestSuccess"),l.resolve(e),angular.isDefined(n)&&angular.isFunction(n)&&n(e)},function(e){g.$broadcast("msApi::requestError"),l.reject(e),angular.isDefined(a)&&angular.isFunction(a)&&a(e)})}else m.error('Resource "'+o+'" is not defined in the api service!'),l.reject('Resource "'+o+'" is not defined in the api service!');return l.promise}};return e}]})}(),function(){"use strict";function e(l){var e=new MobileDetect(l.navigator.userAgent),d=null;return{exists:function(e,t){return-1<t.indexOf(e)},detectBrowser:function(){if(d)return d;var e=[{string:l.navigator.userAgent,subString:"Edge",versionSearch:"Edge",identity:"Edge"},{string:l.navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:l.navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:l.navigator.vendor,subString:"Apple",versionSearch:"Version",identity:"Safari"},{prop:l.opera,identity:"Opera"},{string:l.navigator.vendor,subString:"iCab",identity:"iCab"},{string:l.navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:l.navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:l.navigator.vendor,subString:"Camino",identity:"Camino"},{string:l.navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:l.navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:l.navigator.userAgent,subString:"Trident/7",identity:"Explorer",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],t=[{string:l.navigator.platform,subString:"Win",identity:"Windows"},{string:l.navigator.platform,subString:"Mac",identity:"Mac"},{string:l.navigator.platform,subString:"Linux",identity:"Linux"},{string:l.navigator.platform,subString:"iPhone",identity:"iPhone"},{string:l.navigator.platform,subString:"iPod",identity:"iPod"},{string:l.navigator.platform,subString:"iPad",identity:"iPad"},{string:l.navigator.platform,subString:"Android",identity:"Android"}],i="";function n(e){for(var t=0;t<e.length;t++){var n=e[t].string,a=e[t].prop;if(i=e[t].versionSearch||e[t].identity,n){if(-1!==n.indexOf(e[t].subString))return e[t].identity}else if(a)return e[t].identity}}function a(e){var t=e.indexOf(i);if(-1!==t)return parseInt(e.substring(t+i.length+1))}var o=n(e)||"unknown-browser",s=a(l.navigator.userAgent)||a(l.navigator.appVersion)||"unknown-version",r=n(t)||"unknown-os";return o=o.toLowerCase(),s=o+"-"+s,r=r.toLowerCase(),d={browser:o,version:s,os:r}},guidGenerator:function(){var e=function(){return(65536*(1+Math.random())||0).toString(16).substring(1)};return e()+e()+e()+e()+e()+e()},isMobile:function(){return e.mobile()},toggleInArray:function(e,t){-1===t.indexOf(e)?t.push(e):t.splice(t.indexOf(e),1)}}}e.$inject=["$window"],angular.module("app.core").factory("msUtils",e)}(),function(){"use strict";function e(e,t){var n=this;n.themes=t.themes,n.layoutModes=[{label:"Boxed",value:"boxed"},{label:"Wide",value:"wide"}],n.layoutStyles=[{label:"Vertical Navigation",value:"verticalNavigation",figure:"/assets/images/theme-options/vertical-nav.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar",value:"verticalNavigationFullwidthToolbar",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar 2",value:"verticalNavigationFullwidthToolbar2",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar-2.jpg"},{label:"Horizontal Navigation",value:"horizontalNavigation",figure:"/assets/images/theme-options/horizontal-nav.jpg"},{label:"Content with Toolbar",value:"contentWithToolbar",figure:"/assets/images/theme-options/content-with-toolbar.jpg"},{label:"Content Only",value:"contentOnly",figure:"/assets/images/theme-options/content-only.jpg"}],n.layoutMode="wide",n.layoutStyle=e.get("motion.layoutStyle")||"verticalNavigation",n.setActiveTheme=function(e){t.setActiveTheme(e)},n.getActiveTheme=function(){return t.themes.active},n.updateLayoutMode=function(){angular.element("body").toggleClass("boxed","boxed"===n.layoutMode)},n.updateLayoutStyle=function(){e.put("motion.layoutStyle",n.layoutStyle),location.reload()}}function t(t){return{restrict:"E",scope:{},controller:"MsThemeOptionsController as vm",templateUrl:"app/core/theme-options/theme-options.html",compile:function(e){return e.addClass("ms-theme-options"),function(e){e.toggleOptionsSidenav=function(){t("motion-theme-options").toggle()}}}}}e.$inject=["$cookies","motionTheming"],t.$inject=["$mdSidenav"],angular.module("app.core").controller("MsThemeOptionsController",e).directive("msThemeOptions",t)}(),function(){"use strict";function e(i,a,o){var s={};return{generate:function(){var e=angular.copy(o.getRegisteredThemes()),a=angular.copy(o.getRegisteredPalettes());angular.forEach(e,function(n){s[n.name]={},angular.forEach(n.colors,function(e,t){s[n.name][t]={name:e.name,levels:{default:{color:l(a[e.name][e.hues.default].value),contrast1:l(a[e.name][e.hues.default].contrast,1),contrast2:l(a[e.name][e.hues.default].contrast,2),contrast3:l(a[e.name][e.hues.default].contrast,3),contrast4:l(a[e.name][e.hues.default].contrast,4)},hue1:{color:l(a[e.name][e.hues["hue-1"]].value),contrast1:l(a[e.name][e.hues["hue-1"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-1"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-1"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-1"]].contrast,4)},hue2:{color:l(a[e.name][e.hues["hue-2"]].value),contrast1:l(a[e.name][e.hues["hue-2"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-2"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-2"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-2"]].contrast,4)},hue3:{color:l(a[e.name][e.hues["hue-3"]].value),contrast1:l(a[e.name][e.hues["hue-3"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-3"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-3"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-3"]].contrast,4)}}}})}),function(e){var t=angular.copy(e);angular.forEach(t,function(n){angular.forEach(n,function(e,t){n[t]=e.levels,n[t].color=e.levels.default.color,n[t].contrast1=e.levels.default.contrast1,n[t].contrast2=e.levels.default.contrast2,n[t].contrast3=e.levels.default.contrast3,n[t].contrast4=e.levels.default.contrast4,delete n[t].default})}),o.setThemesList(t);var n=i.get("motion.selectedTheme");n?o.setActiveTheme(n):o.setActiveTheme("default")}(s);var r={};angular.forEach(s,function(e,t){var n,a,i,o,s;(r={})["@themeName"]=t,angular.forEach(e,function(e,a){angular.forEach(e.levels,function(e,n){angular.forEach(e,function(e,t){r["@"+a+d(n)+d(t)]=e})})}),n=r,a=new RegExp(Object.keys(n).join("|"),"gi"),i='/* Content hack because they wont fix */\n/* https://github.com/angular/material/pull/8067 */\n[md-theme="@themeName"] md-content.md-hue-1,\nmd-content.md-@themeName-theme.md-hue-1 {\n color: @backgroundHue1Contrast1;\n background-color: @backgroundHue1Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-2,\nmd-content.md-@themeName-theme.md-hue-2 {\n color: @backgroundHue2Contrast1;\n background-color: @backgroundHue2Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-3,\n md-content.md-@themeName-theme.md-hue-3 {\n color: @backgroundHue3Contrast1;\n background-color: @backgroundHue3Color;\n}\n\n/* Text Colors */\n[md-theme="@themeName"] a {\n color: @accentDefaultColor;\n}\n\n[md-theme="@themeName"] .secondary-text,\n[md-theme="@themeName"] .icon {\n color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .hint-text,\n[md-theme="@themeName"] .disabled-text {\n color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .fade-text,\n[md-theme="@themeName"] .divider {\n color: @backgroundDefaultContrast4;\n}\n\n/* Primary */\n[md-theme="@themeName"] .md-primary-bg {\n background-color: @primaryDefaultColor;\n color: @primaryDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg .secondary-text,\n[md-theme="@themeName"] .md-primary-bg .icon {\n color: @primaryDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg .hint-text,\n[md-theme="@themeName"] .md-primary-bg .disabled-text {\n color: @primaryDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg .fade-text,\n[md-theme="@themeName"] .md-primary-bg .divider {\n color: @primaryDefaultContrast4;\n}\n\n/* Primary, Hue-1 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 {\n background-color: @primaryHue1Color;\n color: @primaryHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .icon {\n color: @primaryHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .disabled-text {\n color: @primaryHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .divider {\n color: @primaryHue1Contrast4;\n}\n\n/* Primary, Hue-2 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 {\n background-color: @primaryHue2Color;\n color: @primaryHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .icon {\n color: @primaryHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .disabled-text {\n color: @primaryHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .divider {\n color: @primaryHue2Contrast4;\n}\n\n/* Primary, Hue-3 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 {\n background-color: @primaryHue3Color;\n color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .icon {\n color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .disabled-text {\n color: @primaryHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .divider {\n color: @primaryHue3Contrast4;\n}\n\n/* Primary foreground */\n[md-theme="@themeName"] .md-primary-fg {\n color: @primaryDefaultColor !important;\n}\n\n/* Primary foreground, Hue-1 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-1 {\n color: @primaryHue1Color !important;\n}\n\n/* Primary foreground, Hue-2 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-2 {\n color: @primaryHue2Color !important;\n}\n\n/* Primary foreground, Hue-3 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-3 {\n color: @primaryHue3Color !important;\n}\n\n/* Accent */\n[md-theme="@themeName"] .md-accent-bg {\n background-color: @accentDefaultColor;\n color: @accentDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg .secondary-text,\n[md-theme="@themeName"] .md-accent-bg .icon {\n color: @accentDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg .hint-text,\n[md-theme="@themeName"] .md-accent-bg .disabled-text {\n color: @accentDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg .fade-text,\n[md-theme="@themeName"] .md-accent-bg .divider {\n color: @accentDefaultContrast4;\n}\n\n/* Accent, Hue-1 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 {\n background-color: @accentHue1Color;\n color: @accentHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .icon {\n color: @accentHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .disabled-text {\n color: @accentHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .divider {\n color: @accentHue1Contrast4;\n}\n\n/* Accent, Hue-2 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 {\n background-color: @accentHue2Color;\n color: @accentHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .icon {\n color: @accentHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .disabled-text {\n color: @accentHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .divider {\n color: @accentHue2Contrast4;\n}\n\n/* Accent, Hue-3 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 {\n background-color: @accentHue3Color;\n color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .icon {\n color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .disabled-text {\n color: @accentHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .divider {\n color: @accentHue3Contrast4;\n}\n\n/* Accent foreground */\n[md-theme="@themeName"] .md-accent-fg {\n color: @accentDefaultColor !important;\n}\n\n/* Accent foreground, Hue-1 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-1 {\n color: @accentHue1Color !important;\n}\n\n/* Accent foreground, Hue-2 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-2 {\n color: @accentHue2Color !important;\n}\n\n/* Accent foreground, Hue-3 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-3 {\n color: @accentHue3Color !important;\n}\n\n/* Warn */\n[md-theme="@themeName"] .md-warn-bg {\n background-color: @warnDefaultColor;\n color: @warnDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg .secondary-text,\n[md-theme="@themeName"] .md-warn-bg .icon {\n color: @warnDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg .hint-text,\n[md-theme="@themeName"] .md-warn-bg .disabled-text {\n color: @warnDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg .fade-text,\n[md-theme="@themeName"] .md-warn-bg .divider {\n color: @warnDefaultContrast4;\n}\n\n/* Warn, Hue-1 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 {\n background-color: @warnHue1Color;\n color: @warnHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .icon {\n color: @warnHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .disabled-text {\n color: @warnHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .divider {\n color: @warnHue1Contrast4;\n}\n\n/* Warn, Hue-2 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 {\n background-color: @warnHue2Color;\n color: @warnHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .icon {\n color: @warnHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .disabled-text {\n color: @warnHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .divider {\n color: @warnHue2Contrast4;\n}\n\n/* Warn, Hue-3 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 {\n background-color: @warnHue3Color;\n color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .icon {\n color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .disabled-text {\n color: @warnHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .divider {\n color: @warnHue3Contrast4;\n}\n\n/* Warn foreground */\n[md-theme="@themeName"] .md-warn-fg {\n color: @warnDefaultColor !important;\n}\n\n/* Warn foreground, Hue-1 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-1 {\n color: @warnHue1Color !important;\n}\n\n/* Warn foreground, Hue-2 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-2 {\n color: @warnHue2Color !important;\n}\n\n/* Warn foreground, Hue-3 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-3 {\n color: @warnHue3Color !important;\n}\n\n/* Background */\n[md-theme="@themeName"] .md-background-bg {\n background-color: @backgroundDefaultColor;\n color: @backgroundDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg .secondary-text,\n[md-theme="@themeName"] .md-background-bg .icon {\n color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg .hint-text,\n[md-theme="@themeName"] .md-background-bg .disabled-text {\n color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg .fade-text,\n[md-theme="@themeName"] .md-background-bg .divider {\n color: @backgroundDefaultContrast4;\n}\n\n/* Background, Hue-1 */\n[md-theme="@themeName"] .md-background-bg.md-hue-1 {\n background-color: @backgroundHue1Color;\n color: @backgroundHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .icon {\n color: @backgroundHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .disabled-text {\n color: @backgroundHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .divider {\n color: @backgroundHue1Contrast4;\n}\n\n/* Background, Hue-2 */\n[md-theme="@themeName"] .md-background-bg.md-hue-2 {\n background-color: @backgroundHue2Color;\n color: @backgroundHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .icon {\n color: @backgroundHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .disabled-text {\n color: @backgroundHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .divider {\n color: @backgroundHue2Contrast4;\n}\n\n/* Background, Hue-3 */\n[md-theme="@themeName"] .md-background-bg.md-hue-3 {\n background-color: @backgroundHue3Color;\n color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .icon {\n color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .disabled-text {\n color: @backgroundHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .divider {\n color: @backgroundHue3Contrast4;\n}\n\n/* Background foreground */\n[md-theme="@themeName"] .md-background-fg {\n color: @backgroundDefaultColor !important;\n}\n\n/* Background foreground, Hue-1 */\n[md-theme="@themeName"] .md-background-fg.md-hue-1 {\n color: @backgroundHue1Color !important;\n}\n\n/* Background foreground, Hue-2 */\n[md-theme="@themeName"] .md-background-fg.md-hue-2 {\n color: @backgroundHue2Color !important;\n}\n\n/* Background foreground, Hue-3 */\n[md-theme="@themeName"] .md-background-fg.md-hue-3 {\n color: @backgroundHue3Color !important;\n}'.replace(a,function(e){return n[e]}),o=angular.element("head"),(s=angular.element('<style type="text/css"></style>')).html(i),o.append(s)})},rgba:l};function l(e,t){var n=t||!1;return 4===e.length&&255===e[0]&&255===e[1]&&255===e[2]&&e.splice(3,4),n&&(e=function(e,t){var n={white:{1:"1",2:"0.7",3:"0.3",4:"0.12"},black:{1:"0.87",2:"0.54",3:"0.26",4:"0.12"}};255===e[0]&&255===e[1]&&255===e[2]?e[3]=n.white[t]:0===e[0]&&0===e[1]&&0===e[2]&&(e[3]=n.black[t]);return e}(e,n)),3===e.length?"rgb("+e.join(",")+")":4===e.length?"rgba("+e.join(",")+")":void a.error("Invalid number of arguments supplied in the color array: "+e.length+"\nThe array must have 3 or 4 colors.")}function d(e){return e.charAt(0).toUpperCase()+e.slice(1)}}e.$inject=["$cookies","$log","motionTheming"],angular.module("app.core").factory("motionGenerator",e)}(),function(){"use strict";angular.module("app.core").constant("motionPalettes",[{name:"motion-blue",options:{50:"#ebf1fa",100:"#c2d4ef",200:"#9ab8e5",300:"#78a0dc",400:"#5688d3",500:"#3470ca",600:"#2e62b1",700:"#275498",800:"#21467e",900:"#1a3865",A100:"#c2d4ef",A200:"#9ab8e5",A400:"#5688d3",A700:"#275498",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}},{name:"motion-paleblue",options:{50:"#ececee",100:"#c5c6cb",200:"#9ea1a9",300:"#7d818c",400:"#5c616f",500:"#3c4252",600:"#353a48",700:"#2d323e",800:"#262933",900:"#1e2129",A100:"#c5c6cb",A200:"#9ea1a9",A400:"#5c616f",A700:"#2d323e",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}}])}(),function(){"use strict";angular.module("app.core").constant("motionThemes",{default:{primary:{name:"motion-paleblue",hues:{default:"700","hue-1":"500","hue-2":"600","hue-3":"400"}},accent:{name:"light-blue",hues:{default:"600","hue-1":"400","hue-2":"700","hue-3":"A100"}},warn:{name:"red"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},pinkTheme:{primary:{name:"blue-grey",hues:{default:"800","hue-1":"600","hue-2":"400","hue-3":"A100"}},accent:{name:"pink",hues:{default:"400","hue-1":"300","hue-2":"600","hue-3":"A100"}},warn:{name:"blue"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},tealTheme:{primary:{name:"motion-blue",hues:{default:"900","hue-1":"600","hue-2":"500","hue-3":"A100"}},accent:{name:"teal",hues:{default:"500","hue-1":"400","hue-2":"600","hue-3":"A100"}},warn:{name:"deep-orange"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}}})}(),function(){"use strict";function e(n,e,t){var a;angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.getObject("motion.customTheme");i&&(t.custom=i),n.alwaysWatchTheme(!0),angular.forEach(e,function(e){n.definePalette(e.name,e.options)}),angular.forEach(t,function(e,t){n.theme(t).primaryPalette(e.primary.name,e.primary.hues).accentPalette(e.accent.name,e.accent.hues).warnPalette(e.warn.name,e.warn.hues).backgroundPalette(e.background.name,e.background.hues)})}e.$inject=["$mdThemingProvider","motionPalettes","motionThemes"],angular.module("app.core").config(e)}(),function(){"use strict";function e(t,n,e){var a={getRegisteredPalettes:function(){return e.PALETTES},getRegisteredThemes:function(){return e.THEMES},setActiveTheme:function(e){if(angular.isUndefined(a.themes.list[e]))return angular.isUndefined(a.themes.list.default)?void n.error('You must have at least one theme named "default"'):(n.warn('The theme "'+e+'" does not exist! Falling back to the "default" theme.'),a.themes.active.name="default",a.themes.active.theme=a.themes.list.default,void t.put("motion.selectedTheme",a.themes.active.name));a.themes.active.name=e,a.themes.active.theme=a.themes.list[e],t.put("motion.selectedTheme",e)},setThemesList:function(e){a.themes.list=e},themes:{list:{},active:{name:"",theme:{}}}};return a}e.$inject=["$cookies","$log","$mdTheming"],angular.module("app.core").service("motionTheming",e)}(),function(){"use strict";function e(t,o,s,r){this.search=function(t){for(var e=[],n=r.getFlatNavigation(),a=s.defer(),i=0;i<n.length;i+=1)n[i].uisref&&e.push(n[i]);t&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(t)))return!0}));return o(function(){a.resolve(e)},1e3),a.promise},this.searchResultClick=function(e){e.uisref&&(e.stateParams?t.go(e.state,e.stateParams):t.go(e.state))}}e.$inject=["$state","$timeout","$q","msNavigationService"],angular.module("app.errors.error-404").controller("Error404Controller",e)}(),function(){"use strict";function e(e,t){var n=this;n.code="",n.send=!1,n.error=e.params,n.sendReport=function(){t.post("/api/jira",n.error).then(function(e){n.send=!0,e.data&&(n.code=e.data.id)},function(e){n.send=!1})}}e.$inject=["$state","$http"],angular.module("app.errors.error-500").controller("Error500Controller",e)}(),function(){"use strict";function e(e,t){var n=this;n.currentUser=e.getCurrentUser(),n.cookieAlertHide=t.get("motion.cookieAlertHide:"+n.currentUser.id)||!1,n.cookieAlertOnClose=function(){t.put("motion.cookieAlertHide:"+n.currentUser.id,!0)}}e.$inject=["Auth","$cookies"],angular.module("app.footer").controller("FooterController",e)}(),function(){"use strict";function e(e,t,n,a,i){var o=this;o.form={},o.forgotPassword=function(){return i.auth.forgot(o.form).$promise.then(function(){t.success({title:n.instant("FORGOTPASSWORD.LINK_SENT"),msg:n.instant("FORGOTPASSWORD.LINNK_SENT_MESSAGE")})}).catch(function(e){e&&t.error({title:n.instant("FORGOTPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},o.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general")}}e.$inject=["Auth","toasty","$translate","$state","api"],angular.module("app.forgot").controller("ForgotPasswordController",e)}(),function(){"use strict";function e(e,t){var n=this;n.currentUser=e.getCurrentUser(),n.newsAlertHide=t.get("motion.newsAlertHide:"+n.currentUser.id)||!1,n.newsAlertOnClose=function(){t.put("motion.newsAlertHide:"+n.currentUser.id,!0)}}e.$inject=["Auth","$cookies"],angular.module("app.header").controller("HeaderController",e)}(),function(){"use strict";function e(e){var t={baseUrl:"api/"};return t.auth=e(t.baseUrl+"auth/local",{},{local:{method:"post",url:t.baseUrl+"auth/local"},forgot:{method:"post",url:t.baseUrl+"auth/local/forgot"},reset:{method:"post",url:t.baseUrl+"auth/local/reset/:token",params:{token:"@token"}},google:{method:"post",url:t.baseUrl+"auth/google"}}),t.jira=e(t.baseUrl+"jira"),t.rpc=e(t.baseUrl+"rpc",{},{startMonitor:{method:"get",url:t.baseUrl+"rpc/voice/channels/:uniqueid/mixmonitor",params:{uniqueid:"@uniqueid"}},stopMonitor:{method:"get",url:t.baseUrl+"rpc/voice/channels/:uniqueid/stopmixmonitor",params:{uniqueid:"@uniqueid"}},getVoiceChannels:{method:"get",url:t.baseUrl+"rpc/voice/channels"},getVoiceQueues:{method:"get",url:t.baseUrl+"rpc/voice/queues"},getChatQueues:{method:"get",url:t.baseUrl+"rpc/chat/queues"},getMailQueues:{method:"get",url:t.baseUrl+"rpc/mail/queues"},getSmsQueues:{method:"get",url:t.baseUrl+"rpc/sms/queues"},getOpenchannelQueues:{method:"get",url:t.baseUrl+"rpc/openchannel/queues"},getFaxQueues:{method:"get",url:t.baseUrl+"rpc/fax/queues"},getVoiceQueuesPreview:{method:"get",url:t.baseUrl+"rpc/voice/queues/preview/:id"},getVoiceQueuesChannels:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels"},getVoiceQueuesChannel:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels/:uniqueid"},getVoiceQueuesChannelHangup:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels/:uniqueid/hangup"},getVoiceQueuesChannelRedirect:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels/:uniqueid/redirect/:exten"},getOutbound:{method:"get",url:t.baseUrl+"rpc/outbound"},getOutboundChannels:{method:"get",url:t.baseUrl+"rpc/outbound/channels"},getAgents:{method:"get",url:t.baseUrl+"rpc/agents"},setAgentCapacity:{method:"put",url:t.baseUrl+"rpc/agents/:id/capacity",params:{id:"@id"}},getTelephones:{method:"get",url:t.baseUrl+"rpc/telephones"},getTrunks:{method:"get",url:t.baseUrl+"rpc/trunks"},getCampaigns:{method:"get",url:t.baseUrl+"rpc/campaigns"},getMailAccounts:{method:"get",url:t.baseUrl+"rpc/mail/accounts"},getFaxAccounts:{method:"get",url:t.baseUrl+"rpc/fax/accounts"},getChatQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/chat/queues/waitinginteractions"},getMailQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/mail/queues/waitinginteractions"},getOpenchannelQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/openchannel/queues/waitinginteractions"},getSmsQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/sms/queues/waitinginteractions"},getFaxQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/fax/queues/waitinginteractions"}}),t.version=e(t.baseUrl+"version",{},{fetch:{method:"get",url:t.baseUrl+"version/fetch"},reset:{method:"get",url:t.baseUrl+"version/reset"},pull:{method:"get",url:t.baseUrl+"version/pull"},restart:{method:"get",url:t.baseUrl+"version/restart"},migrations:{method:"get",url:t.baseUrl+"version/migrations"}}),t.system=e(t.baseUrl+"system",{},{killProcess:{method:"get",url:t.baseUrl+"system/process/:pid/kill",params:{pid:"@pid"}}}),t.pm2=e(t.baseUrl+"pm2/:id",{id:"@id"},{update:{method:"put",isArray:!0}}),t.user=e(t.baseUrl+"users/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"users/describe"},clone:{method:"post",url:t.baseUrl+"users/:id/clone",params:{includeAll:"@includeAll"}},bulkCreate:{method:"post",url:t.baseUrl+"users/create_many",isArray:!0},addContacts:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/contacts"},changePassword:{isArray:!1,method:"put",url:t.baseUrl+"users/:id/password"},addQueues:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/queues"},addAvatar:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/avatar"},getAvatar:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/avatar"},getContacts:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/contacts"},getQueues:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/queues"},getVoiceQueuesRt:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/queues_rt"},getGroups:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/groups"},getRecordings:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/recordings"},getChatInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/chat/interactions"},getOpenchannelInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/openchannel/interactions"},getMailInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/mail/interactions"},getSmsInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/sms/interactions"},getFaxInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/fax/interactions"},login:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/login"},logout:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/logout"},pause:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/pause"},unpause:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/unpause"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/teams"},getLists:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/lists"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/agents"},addChatInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/chat_interactions"},removeChatInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/chat_interactions"},addMailInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/mail_interactions"},removeMailInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/mail_interactions"},addFaxInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/fax_interactions"},removeFaxInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/fax_interactions"},addSmsInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/sms_interactions"},removeSmsInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/sms_interactions"},addOpenchannelInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/openchannel_interactions"},removeOpenchannelInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/openchannel_interactions"}}),t.voiceChanSpy=e(t.baseUrl+"voice/chanspy/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/chanspy/describe"},clone:{method:"post",url:t.baseUrl+"voice/chanspy/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceContext=e(t.baseUrl+"voice/contexts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/contexts/describe"},clone:{method:"post",url:t.baseUrl+"voice/contexts/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceDisposition=e(t.baseUrl+"voice/dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/dispositions/describe"},clone:{method:"post",url:t.baseUrl+"voice/dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceExtension=e(t.baseUrl+"voice/extensions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/extensions/describe"},clone:{method:"post",url:t.baseUrl+"voice/extensions/:id/clone",params:{includeAll:"@includeAll"}},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"voice/extensions/:id/applications"}}),t.voiceMusicOnHold=e(t.baseUrl+"voice/mohs/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/mohs/describe"},clone:{method:"post",url:t.baseUrl+"voice/mohs/:id/clone",params:{includeAll:"@includeAll"}},addSound:{isArray:!1,method:"post",url:t.baseUrl+"voice/mohs/:id/sounds"},removeSound:{isArray:!1,method:"delete",url:t.baseUrl+"voice/mohs/:id/sounds/:id2"},getSounds:{isArray:!1,method:"get",url:t.baseUrl+"voice/mohs/:id/sounds"}}),t.voiceQueue=e(t.baseUrl+"voice/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/queues/describe"},clone:{method:"post",url:t.baseUrl+"voice/queues/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hopper_black"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"voice/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"voice/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/users"},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/members"},getLists:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/lists"},addLists:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/lists"},removeLists:{isArray:!0,method:"delete",url:t.baseUrl+"voice/queues/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:t.baseUrl+"voice/queues/:id/blacklists"}}),t.voiceRecording=e(t.baseUrl+"voice/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/recordings/describe"},clone:{method:"post",url:t.baseUrl+"voice/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"voice/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}},downloads:{isArray:!1,method:"get",url:t.baseUrl+"voice/recordings/:id/downloads"}}),t.voiceMail=e(t.baseUrl+"voice/mails/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/mails/describe"},clone:{method:"post",url:t.baseUrl+"voice/mails/:id/clone",params:{includeAll:"@includeAll"}},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"voice/mails/:id/messages"}}),t.voiceMailMessage=e(t.baseUrl+"voice/mails/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/mails/messages/describe"},clone:{method:"post",url:t.baseUrl+"voice/mails/messages/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"voice/mails/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.voiceCallReport=e(t.baseUrl+"voice/calls/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/calls/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/calls/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceDialReport=e(t.baseUrl+"voice/dials/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/dials/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/dials/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceAgentReport=e(t.baseUrl+"voice/agents/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/agents/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/agents/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceQueueReport=e(t.baseUrl+"voice/queues/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/queues/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/queues/reports/:id/clone",params:{includeAll:"@includeAll"}},getVoiceQueuesReport:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/reports/index"}}),t.memberReport=e(t.baseUrl+"members/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"members/reports/describe"},clone:{method:"post",url:t.baseUrl+"members/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.trunk=e(t.baseUrl+"trunks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"trunks/describe"},clone:{method:"post",url:t.baseUrl+"trunks/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceTransferReport=e(t.baseUrl+"voice/transfers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/transfers/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/transfers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailServerOut=e(t.baseUrl+"mail/out_servers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/out_servers/describe"},clone:{method:"post",url:t.baseUrl+"mail/out_servers/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailAccount=e(t.baseUrl+"mail/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/accounts/describe"},clone:{method:"post",url:t.baseUrl+"mail/accounts/:id/clone",params:{includeAll:"@includeAll"}},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/canned_answers"},getImap:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/in_servers"},addImap:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/in_servers"},removeImap:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/in_servers"},getSmtp:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/out_servers"},addSmtp:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/out_servers"},removeSmtp:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/out_servers"},addInteraction:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/applications"},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/dispositions"},addDispositions:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/dispositions"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/messages"},send:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/send"},verifySmtp:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/verify"}}),t.mailQueue=e(t.baseUrl+"mail/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/queues/describe"},clone:{method:"post",url:t.baseUrl+"mail/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"mail/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"mail/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"mail/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"mail/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"mail/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"mail/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"mail/queues/:id/users"}}),t.mailSubstatus=e(t.baseUrl+"mail/substatuses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/substatuses/describe"},clone:{method:"post",url:t.baseUrl+"mail/substatuses/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailInteraction=e(t.baseUrl+"mail/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/interactions/describe"},clone:{method:"post",url:t.baseUrl+"mail/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"mail/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"mail/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"mail/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"mail/interactions/:id/tags"}}),t.mailMessage=e(t.baseUrl+"mail/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/messages/describe"},clone:{method:"post",url:t.baseUrl+"mail/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"mail/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"mail/messages/:id/reject"}}),t.mailApplication=e(t.baseUrl+"mail/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/applications/describe"},clone:{method:"post",url:t.baseUrl+"mail/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailDisposition=e(t.baseUrl+"mail/dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/dispositions/describe"},clone:{method:"post",url:t.baseUrl+"mail/dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailQueueReport=e(t.baseUrl+"mail/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"mail/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.dashboard=e(t.baseUrl+"dashboards/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"dashboards/describe"},clone:{method:"post",url:t.baseUrl+"dashboards/:id/clone",params:{includeAll:"@includeAll"}},addItem:{isArray:!1,method:"post",url:t.baseUrl+"dashboards/:id/items"},getItems:{isArray:!1,method:"get",url:t.baseUrl+"dashboards/:id/items"}}),t.dashboardItem=e(t.baseUrl+"dashboards/items/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"dashboards/items/describe"},clone:{method:"post",url:t.baseUrl+"dashboards/items/:id/clone",params:{includeAll:"@includeAll"}}}),t.faxAccount=e(t.baseUrl+"fax/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/accounts/describe"},clone:{method:"post",url:t.baseUrl+"fax/accounts/:id/clone",params:{includeAll:"@includeAll"}},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"fax/accounts/:id/canned_answers"},addInteraction:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/applications"},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/dispositions"},addDispositions:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/dispositions"},addAccountApplications:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/addaccountapplications"},updateAccountApplications:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/updateaccountapplications"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/messages"},send:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/send"}}),t.faxApplication=e(t.baseUrl+"fax/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/applications/describe"},clone:{method:"post",url:t.baseUrl+"fax/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.faxDisposition=e(t.baseUrl+"fax/dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/dispositions/describe"},clone:{method:"post",url:t.baseUrl+"fax/dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),t.faxInteraction=e(t.baseUrl+"fax/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/interactions/describe"},clone:{method:"post",url:t.baseUrl+"fax/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"fax/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"fax/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"fax/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"fax/interactions/:id/tags"}}),t.faxMessage=e(t.baseUrl+"fax/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/messages/describe"},clone:{method:"post",url:t.baseUrl+"fax/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"fax/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"fax/messages/:id/reject"}}),t.faxQueue=e(t.baseUrl+"fax/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/queues/describe"},clone:{method:"post",url:t.baseUrl+"fax/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"fax/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"fax/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"fax/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"fax/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"fax/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"fax/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"fax/queues/:id/users"}}),t.faxQueueReport=e(t.baseUrl+"fax/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"fax/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.smsAccount=e(t.baseUrl+"sms/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/accounts/describe"},clone:{method:"post",url:t.baseUrl+"sms/accounts/:id/clone",params:{includeAll:"@includeAll"}},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"sms/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/applications"},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/dispositions"},addDispositions:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/dispositions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/interactions"},send:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/send"},status:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/status"}}),t.smsApplication=e(t.baseUrl+"sms/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/applications/describe"},clone:{method:"post",url:t.baseUrl+"sms/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.smsDisposition=e(t.baseUrl+"sms/dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/dispositions/describe"},clone:{method:"post",url:t.baseUrl+"sms/dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),t.smsInteraction=e(t.baseUrl+"sms/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/interactions/describe"},clone:{method:"post",url:t.baseUrl+"sms/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"sms/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"sms/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"sms/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"sms/interactions/:id/tags"}}),t.smsMessage=e(t.baseUrl+"sms/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/messages/describe"},clone:{method:"post",url:t.baseUrl+"sms/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"sms/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"sms/messages/:id/reject"},status:{isArray:!1,method:"post",url:t.baseUrl+"sms/messages/:id/status"}}),t.smsQueue=e(t.baseUrl+"sms/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/queues/describe"},clone:{method:"post",url:t.baseUrl+"sms/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"sms/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"sms/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"sms/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"sms/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"sms/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"sms/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"sms/queues/:id/users"}}),t.openchannelAccount=e(t.baseUrl+"openchannel/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/accounts/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/accounts/:id/clone",params:{includeAll:"@includeAll"}},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/applications"},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/dispositions"},addDispositions:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/dispositions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/interactions"}}),t.openchannelApplication=e(t.baseUrl+"openchannel/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/applications/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.openchannelDisposition=e(t.baseUrl+"openchannel/dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/dispositions/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),t.openchannelInteraction=e(t.baseUrl+"openchannel/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/interactions/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/interactions/:id/tags"}}),t.openchannelMessage=e(t.baseUrl+"openchannel/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/messages/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"openchannel/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"openchannel/messages/:id/reject"}}),t.openchannelQueue=e(t.baseUrl+"openchannel/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/queues/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"openchannel/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"openchannel/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/queues/:id/users"}}),t.chatWebsite=e(t.baseUrl+"chat/websites/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/websites/describe"},clone:{method:"post",url:t.baseUrl+"chat/websites/:id/clone",params:{includeAll:"@includeAll"}},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"chat/websites/:id/canned_answers"},addLogo:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/logo"},addAvatar:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/avatar"},getLogo:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/logo"},getAvatar:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/avatar"},notify:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/notify"},offline:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/offline"},addInteraction:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/interactions"},getSnippet:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/snippet"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/applications"},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/dispositions"},addDispositions:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/dispositions"},addProactiveActions:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/proactive_actions"},getProactiveActions:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/proactive_actions"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/fields"},getOfflineMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/offline_messages"}}),t.openchannelQueueReport=e(t.baseUrl+"openchannel/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatApplication=e(t.baseUrl+"chat/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/applications/describe"},clone:{method:"post",url:t.baseUrl+"chat/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatDisposition=e(t.baseUrl+"chat/dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/dispositions/describe"},clone:{method:"post",url:t.baseUrl+"chat/dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatInteraction=e(t.baseUrl+"chat/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/interactions/describe"},clone:{method:"post",url:t.baseUrl+"chat/interactions/:id/clone",params:{includeAll:"@includeAll"}},abandon:{isArray:!1,method:"put",url:t.baseUrl+"chat/interactions/:id/abandon"},attachmentUpload:{isArray:!1,method:"post",url:t.baseUrl+"chat/interactions/:id/attachment_upload"},attachmentDownload:{isArray:!1,method:"get",url:t.baseUrl+"chat/interactions/:id/attachment_download"},close:{isArray:!1,method:"put",url:t.baseUrl+"chat/interactions/:id/close"},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"chat/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/interactions/:id/messages"},getMyMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/interactions/:id/my_messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"chat/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"chat/interactions/:id/tags"}}),t.chatMessage=e(t.baseUrl+"chat/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/messages/describe"},clone:{method:"post",url:t.baseUrl+"chat/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"chat/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"chat/messages/:id/reject"}}),t.chatOfflineMessage=e(t.baseUrl+"chat/offline_messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/offline_messages/describe"},clone:{method:"post",url:t.baseUrl+"chat/offline_messages/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatQueue=e(t.baseUrl+"chat/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/queues/describe"},clone:{method:"post",url:t.baseUrl+"chat/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"chat/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"chat/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"chat/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"chat/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"chat/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"chat/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"chat/queues/:id/users"}}),t.chatGroup=e(t.baseUrl+"chat/groups/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/groups/describe"},clone:{method:"post",url:t.baseUrl+"chat/groups/:id/clone",params:{includeAll:"@includeAll"}},getUnread:{isArray:!1,method:"get",url:t.baseUrl+"chat/groups/:id/unread"},addMembers:{isArray:!0,method:"post",url:t.baseUrl+"chat/groups/:id/members"},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"chat/groups/:id/members"},removeMembers:{isArray:!1,method:"delete",url:t.baseUrl+"chat/groups/:id/members"},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"chat/groups/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/groups/:id/messages"}}),t.chatProactiveAction=e(t.baseUrl+"chat/proactive_actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/proactive_actions/describe"},clone:{method:"post",url:t.baseUrl+"chat/proactive_actions/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmCompany=e(t.baseUrl+"cm/companies/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/companies/describe"},clone:{method:"post",url:t.baseUrl+"cm/companies/:id/clone",params:{includeAll:"@includeAll"}},addContacts:{isArray:!1,method:"post",url:t.baseUrl+"cm/companies/:id/contacts"},getContacts:{isArray:!1,method:"get",url:t.baseUrl+"cm/companies/:id/contacts"}}),t.cmContact=e(t.baseUrl+"cm/contacts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/contacts/describe"},clone:{method:"post",url:t.baseUrl+"cm/contacts/:id/clone",params:{includeAll:"@includeAll"}},merge:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/merge"},bulkCreate:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/create_many"},getHoppers:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/hopper_finals"},getJscriptySessions:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/jscripty_sessions"},uploadCsv:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/csv"},upload:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/upload"},import:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/upload/:id"}}),t.cmHopper=e(t.baseUrl+"cm/hopper/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper/:id/clone",params:{includeAll:"@includeAll"}},getPreview:{isArray:!1,method:"post",url:t.baseUrl+"cm/hopper/preview"},getOpenContacts:{isArray:!1,method:"get",url:t.baseUrl+"cm/hopper/opencontacts"}}),t.cmHopperBlack=e(t.baseUrl+"cm/hopper_black/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper_black/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper_black/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmHopperFinal=e(t.baseUrl+"cm/hopper_final/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper_final/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper_final/:id/clone",params:{includeAll:"@includeAll"}},countContactsQueueCampaignHopperFinal:{isArray:!0,method:"get",url:t.baseUrl+"cm/hopper_final/voice/queue/countAttributes/:id"},countContactsIvrCampaignHopperFinal:{isArray:!0,method:"get",url:t.baseUrl+"cm/hopper_final/campaign/countAttributes/:id"},moveContactsQueueCampaignHopperFinal:{isArray:!0,method:"post",url:t.baseUrl+"cm/hopper_final/voice/queue/moveContacts/:id"},moveContactsIvrCampaignHopperFinal:{isArray:!0,method:"post",url:t.baseUrl+"cm/hopper_final/voice/campaign/moveContacts/:id"},checkContactHopper:{isArray:!1,method:"post",url:t.baseUrl+"cm/hopper_final/checkContactHopper"}}),t.cmHopperHistory=e(t.baseUrl+"cm/hopper_history/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper_history/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper_history/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmCustomField=e(t.baseUrl+"cm/custom_fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/custom_fields/describe"},clone:{method:"post",url:t.baseUrl+"cm/custom_fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmList=e(t.baseUrl+"cm/lists/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/lists/describe"},clone:{method:"post",url:t.baseUrl+"cm/lists/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"cm/lists/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/dispositions"},addContacts:{isArray:!1,method:"post",url:t.baseUrl+"cm/lists/:id/contacts"},getContacts:{isArray:!0,method:"get",url:t.baseUrl+"cm/lists/:id/contacts"},getContactsCsv:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/contacts/csv"},addCustomField:{isArray:!1,method:"post",url:t.baseUrl+"cm/lists/:id/fields"},getCustomFields:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/fields"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"cm/lists/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"cm/lists/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/users"}}),t.action=e(t.baseUrl+"actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"actions/describe"},clone:{method:"post",url:t.baseUrl+"actions/:id/clone",params:{includeAll:"@includeAll"}}}),t.automation=e(t.baseUrl+"automations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"automations/describe"},clone:{method:"post",url:t.baseUrl+"automations/:id/clone",params:{includeAll:"@includeAll"}},addConditions:{isArray:!1,method:"post",url:t.baseUrl+"automations/:id/conditions"},getConditions:{isArray:!1,method:"get",url:t.baseUrl+"automations/:id/conditions"},addActions:{isArray:!1,method:"post",url:t.baseUrl+"automations/:id/actions"},getActions:{isArray:!1,method:"get",url:t.baseUrl+"automations/:id/actions"}}),t.cannedAnswer=e(t.baseUrl+"canned_answers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"canned_answers/describe"},clone:{method:"post",url:t.baseUrl+"canned_answers/:id/clone",params:{includeAll:"@includeAll"}}}),t.condition=e(t.baseUrl+"conditions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"conditions/describe"},clone:{method:"post",url:t.baseUrl+"conditions/:id/clone",params:{includeAll:"@includeAll"}}}),t.interval=e(t.baseUrl+"intervals/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"intervals/describe"},clone:{method:"post",url:t.baseUrl+"intervals/:id/clone",params:{includeAll:"@includeAll"}},addInterval:{isArray:!1,method:"post",url:t.baseUrl+"intervals/:id/sub_intervals"},getIntervals:{isArray:!1,method:"get",url:t.baseUrl+"intervals/:id/sub_intervals"},addIntervals:{isArray:!0,method:"post",url:t.baseUrl+"intervals/:id/sub_intervals/create_many"}}),t.pause=e(t.baseUrl+"pauses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"pauses/describe"},clone:{method:"post",url:t.baseUrl+"pauses/:id/clone",params:{includeAll:"@includeAll"}}}),t.cdr=e(t.baseUrl+"cdr/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cdr/describe"},clone:{method:"post",url:t.baseUrl+"cdr/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceQueuesLog=e(t.baseUrl+"voiceQueuesLog/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voiceQueuesLog/describe"},clone:{method:"post",url:t.baseUrl+"voiceQueuesLog/:id/clone",params:{includeAll:"@includeAll"}}}),t.schedule=e(t.baseUrl+"schedules/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"schedules/describe"},clone:{method:"post",url:t.baseUrl+"schedules/:id/clone",params:{includeAll:"@includeAll"}}}),t.sound=e(t.baseUrl+"sounds/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sounds/describe"},clone:{method:"post",url:t.baseUrl+"sounds/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"sounds/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}},delete:{isArray:!1,method:"delete",url:t.baseUrl+"sounds/:id"}}),t.tag=e(t.baseUrl+"tags/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"tags/describe"},clone:{method:"post",url:t.baseUrl+"tags/:id/clone",params:{includeAll:"@includeAll"}}}),t.template=e(t.baseUrl+"templates/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"templates/describe"},clone:{method:"post",url:t.baseUrl+"templates/:id/clone",params:{includeAll:"@includeAll"}}}),t.trigger=e(t.baseUrl+"triggers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"triggers/describe"},clone:{method:"post",url:t.baseUrl+"triggers/:id/clone",params:{includeAll:"@includeAll"}},addAllCondition:{isArray:!1,method:"post",url:t.baseUrl+"triggers/:id/all_conditions"},addAnyCondition:{isArray:!1,method:"post",url:t.baseUrl+"triggers/:id/any_conditions"},getAllConditions:{isArray:!1,method:"get",url:t.baseUrl+"triggers/:id/all_conditions"},getAnyConditions:{isArray:!1,method:"get",url:t.baseUrl+"triggers/:id/any_conditions"},addAction:{isArray:!1,method:"post",url:t.baseUrl+"triggers/:id/actions"},getActions:{isArray:!1,method:"get",url:t.baseUrl+"triggers/:id/actions"}}),t.variable=e(t.baseUrl+"variables/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"variables/describe"},clone:{method:"post",url:t.baseUrl+"variables/:id/clone",params:{includeAll:"@includeAll"}}}),t.integration=e(t.baseUrl+"integrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/:id/clone",params:{includeAll:"@includeAll"}}}),t.integrationReport=e(t.baseUrl+"integrations/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/reports/describe"},clone:{method:"post",url:t.baseUrl+"integrations/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.analyticCustomReport=e(t.baseUrl+"analytics/custom_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/custom_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/custom_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:t.baseUrl+"analytics/custom_reports/:id/preview"},run:{isArray:!1,method:"get",url:t.baseUrl+"analytics/custom_reports/:id/run"},query:{isArray:!1,method:"get",url:t.baseUrl+"analytics/custom_reports/:id/query"}}),t.analyticDefaultReport=e(t.baseUrl+"analytics/default_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/default_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/default_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:t.baseUrl+"analytics/default_reports/:id/preview"},run:{isArray:!1,method:"get",url:t.baseUrl+"analytics/default_reports/:id/run"},query:{isArray:!1,method:"get",url:t.baseUrl+"analytics/default_reports/:id/query"}}),t.analyticExtractedReport=e(t.baseUrl+"analytics/extracted_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/extracted_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/extracted_reports/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"analytics/extracted_reports/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.analyticMetric=e(t.baseUrl+"analytics/metrics/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/metrics/describe"},clone:{method:"post",url:t.baseUrl+"analytics/metrics/:id/clone",params:{includeAll:"@includeAll"}}}),t.analyticFieldReport=e(t.baseUrl+"analytics/field_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/field_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/field_reports/:id/clone",params:{includeAll:"@includeAll"}},bulkCreate:{method:"post",url:t.baseUrl+"analytics/field_reports/create_many",isArray:!0},bulkDestroy:{method:"delete",url:t.baseUrl+"analytics/field_reports/destroy_many",isArray:!0},addFields:{isArray:!0,method:"post",url:t.baseUrl+"analytics/field_reports/:id/create_many"}}),t.analyticTreeReport=e(t.baseUrl+"analytics/tree_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/tree_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/tree_reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.intSalesforceAccount=e(t.baseUrl+"integrations/salesforce/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/salesforce/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/salesforce/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/salesforce/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/accounts/:id/fields"}}),t.intSalesforceConfiguration=e(t.baseUrl+"integrations/salesforce/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/salesforce/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/salesforce/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/configurations/:id/descriptions"}}),t.intSalesforceField=e(t.baseUrl+"integrations/salesforce/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/salesforce/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/salesforce/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intSugarcrmAccount=e(t.baseUrl+"integrations/sugarcrm/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/sugarcrm/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/fields"}}),t.intSugarcrmConfiguration=e(t.baseUrl+"integrations/sugarcrm/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/descriptions"}}),t.intSugarcrmField=e(t.baseUrl+"integrations/sugarcrm/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/sugarcrm/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/sugarcrm/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intDeskAccount=e(t.baseUrl+"integrations/desk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/desk/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/desk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/desk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/accounts/:id/fields"}}),t.intDeskConfiguration=e(t.baseUrl+"integrations/desk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/desk/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/desk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:t.baseUrl+"integrations/desk/configurations/:id/tags"}}),t.intDeskField=e(t.baseUrl+"integrations/desk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/desk/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/desk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intZohoAccount=e(t.baseUrl+"integrations/zoho/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zoho/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zoho/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/zoho/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/accounts/:id/fields"}}),t.intZohoConfiguration=e(t.baseUrl+"integrations/zoho/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zoho/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zoho/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/configurations/:id/descriptions"}}),t.intZohoField=e(t.baseUrl+"integrations/zoho/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zoho/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zoho/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intZendeskAccount=e(t.baseUrl+"integrations/zendesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zendesk/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zendesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/zendesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/accounts/:id/fields"}}),t.intZendeskConfiguration=e(t.baseUrl+"integrations/zendesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zendesk/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zendesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:t.baseUrl+"integrations/zendesk/configurations/:id/tags"}}),t.intZendeskField=e(t.baseUrl+"integrations/zendesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zendesk/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zendesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intFreshdeskAccount=e(t.baseUrl+"integrations/freshdesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/freshdesk/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/freshdesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/accounts/:id/fields"}}),t.intFreshdeskConfiguration=e(t.baseUrl+"integrations/freshdesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/freshdesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:t.baseUrl+"integrations/freshdesk/configurations/:id/tags"}}),t.intFreshdeskField=e(t.baseUrl+"integrations/freshdesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/freshdesk/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/freshdesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.network=e(t.baseUrl+"networks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"networks/describe"},clone:{method:"post",url:t.baseUrl+"networks/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatQueueReport=e(t.baseUrl+"chat/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"chat/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatInternalMessage=e(t.baseUrl+"chat/internal/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/internal/messages/describe"},clone:{method:"post",url:t.baseUrl+"chat/internal/messages/:id/clone",params:{includeAll:"@includeAll"}},getUsers:{isArray:!1,method:"get",url:t.baseUrl+"chat/internal/messages/users"}}),t.jscriptyAnswerReport=e(t.baseUrl+"jscripty/answers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/answers/reports/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/answers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.jscriptyQuestionReport=e(t.baseUrl+"jscripty/questions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/questions/reports/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/questions/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.jscriptySessionReport=e(t.baseUrl+"jscripty/sessions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/sessions/reports/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/sessions/reports/:id/clone",params:{includeAll:"@includeAll"}},getQuestions:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/sessions/reports/:id/questions"}}),t.smsQueueReport=e(t.baseUrl+"sms/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"sms/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.squareReport=e(t.baseUrl+"square/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/reports/describe"},clone:{method:"post",url:t.baseUrl+"square/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.squareReportDetail=e(t.baseUrl+"square/details/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/details/reports/describe"},clone:{method:"post",url:t.baseUrl+"square/details/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.jscriptyProject=e(t.baseUrl+"jscripty/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/projects/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/projects/:id/clone",params:{includeAll:"@includeAll"}},getSessions:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/projects/:id/sessions"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/projects/:id/answers"},getSummary:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/projects/:id/summary"}}),t.setting=e(t.baseUrl+"settings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"settings/describe"},clone:{method:"post",url:t.baseUrl+"settings/:id/clone",params:{includeAll:"@includeAll"}},addLogo:{isArray:!1,method:"post",url:t.baseUrl+"settings/:id/logo"},addLogoLogin:{isArray:!1,method:"post",url:t.baseUrl+"settings/:id/logo_login"},getLogo:{isArray:!1,method:"get",url:t.baseUrl+"settings/:id/logo"},getLogoLogin:{isArray:!1,method:"get",url:t.baseUrl+"settings/:id/logo_login"},gdpr:{isArray:!1,method:"get",url:t.baseUrl+"settings/:id/gdpr"}}),t.squareOdbc=e(t.baseUrl+"square/odbc/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/odbc/describe"},clone:{method:"post",url:t.baseUrl+"square/odbc/:id/clone",params:{includeAll:"@includeAll"}},test:{isArray:!1,method:"get",url:t.baseUrl+"square/odbc/:id/test"}}),t.squareProject=e(t.baseUrl+"square/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/projects/describe"},clone:{method:"post",url:t.baseUrl+"square/projects/:id/clone",params:{includeAll:"@includeAll"}}}),t.squareRecording=e(t.baseUrl+"square/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/recordings/describe"},clone:{method:"post",url:t.baseUrl+"square/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"square/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.team=e(t.baseUrl+"teams/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"teams/describe"},clone:{method:"post",url:t.baseUrl+"teams/:id/clone",params:{includeAll:"@includeAll"}},getQueues:{isArray:!0,method:"get",url:t.baseUrl+"teams/:id/queues"},addQueues:{isArray:!0,method:"post",url:t.baseUrl+"teams/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:t.baseUrl+"teams/:id/queues"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"teams/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"teams/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"teams/:id/users"}}),t.license=e(t.baseUrl+"license/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"license/describe"},clone:{method:"post",url:t.baseUrl+"license/:id/clone",params:{includeAll:"@includeAll"}}}),t.campaign=e(t.baseUrl+"campaigns/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"campaigns/describe"},clone:{method:"post",url:t.baseUrl+"campaigns/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hopper_black"},getLists:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/lists"},addLists:{isArray:!0,method:"post",url:t.baseUrl+"campaigns/:id/lists"},removeLists:{isArray:!0,method:"delete",url:t.baseUrl+"campaigns/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:t.baseUrl+"campaigns/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:t.baseUrl+"campaigns/:id/blacklists"}}),t.migration=e(t.baseUrl+"migrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"migrations/describe"},clone:{method:"post",url:t.baseUrl+"migrations/:id/clone",params:{includeAll:"@includeAll"}}}),t.attachment=e(t.baseUrl+"attachments/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"attachments/describe"},clone:{method:"post",url:t.baseUrl+"attachments/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"attachments/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t}e.$inject=["$resource"],angular.module("motion").factory("api",e)}(),function(){"use strict";function e(e,t){t.setConfig({position:"top-right",sound:!1,html:!0,theme:"material"}),e.useLoader("$translatePartialLoader",{urlTemplate:"{part}/i18n/{lang}.json"}),e.preferredLanguage("en"),e.useSanitizeValueStrategy(null)}e.$inject=["$translateProvider","toastyConfigProvider"],angular.module("motion").config(e)}(),function(){"use strict";angular.module("motion")}(),function(){"use strict";function e(e,t,n){this.themes=e.themes;var a=n.get("motion.language");a&&t.use(a)}e.$inject=["motionTheming","$translate","$cookies"],angular.module("motion").controller("IndexController",e)}(),function(){"use strict";function e(a,i){return function(e){var t=new Date,n=new Date(e);return n.getDate()===t.getDate()&&n.getMonth()===t.getMonth()&&n.getFullYear()===t.getFullYear()?a("date")(n.getTime(),"shortTime"):n.getDate()===t.getDate()-1&&n.getMonth()===t.getMonth()&&n.getFullYear()===t.getFullYear()?i.instant("DASHBOARDS.YESTERDAY")+" "+a("date")(n.getTime(),"shortTime"):a("date")(n.getTime(),"MMM d, y h:mm a")}}function t(e){return{Today:e.instant("DASHBOARDS.TODAY"),Yesterday:e.instant("DASHBOARDS.YESTERDAY"),"This Week":e.instant("DASHBOARDS.THIS_WEEK"),"Last Week":e.instant("DASHBOARDS.LAST_WEEK"),"This Month":e.instant("DASHBOARDS.THIS_MONTH"),"Last Month":e.instant("DASHBOARDS.LAST_MONTH"),"This Year":e.instant("DASHBOARDS.THIS_YEAR"),"Last Year":e.instant("DASHBOARDS.LAST_YEAR"),January:e.instant("DASHBOARDS.JANUARY"),February:e.instant("DASHBOARDS.FEBRUARY"),March:e.instant("DASHBOARDS.MARCH"),April:e.instant("DASHBOARDS.APRIL"),May:e.instant("DASHBOARDS.MAY"),June:e.instant("DASHBOARDS.JUNE"),July:e.instant("DASHBOARDS.JULY"),August:e.instant("DASHBOARDS.AUGUST"),September:e.instant("DASHBOARDS.SEPTEMBER"),October:e.instant("DASHBOARDS.OCTOBER"),November:e.instant("DASHBOARDS.NOVEMBER"),December:e.instant("DASHBOARDS.DECEMBER"),Mon:e.instant("DASHBOARDS.MON"),Tue:e.instant("DASHBOARDS.TUE"),Wed:e.instant("DASHBOARDS.WED"),Thu:e.instant("DASHBOARDS.THU"),Fri:e.instant("DASHBOARDS.FRI"),Sat:e.instant("DASHBOARDS.SAT"),Sun:e.instant("DASHBOARDS.SUN")}}e.$inject=["$filter","$translate"],t.$inject=["$translate"],angular.module("motion").filter("limitObjectFromTo",function(){return function(e,t,n){var a,i={},o=0;for(a in e)if(n<=o&&(i[a]=e[a]),++o===n+t)break;return i}}).filter("formatdate",e).factory("IndexFactory",function(){var e=[{value:"jan"},{value:"feb"},{value:"mar"},{value:"apr"},{value:"may"},{value:"jun"},{value:"jul"},{value:"aug"},{value:"sep"},{value:"oct"},{value:"nov"},{value:"dec"}],t=[{value:"1"},{value:"2"},{value:"3"},{value:"4"},{value:"5"},{value:"6"},{value:"7"},{value:"8"},{value:"9"},{value:"10"},{value:"11"},{value:"12"}],n=[{value:"mon"},{value:"tue"},{value:"wed"},{value:"thu"},{value:"fri"},{value:"sat"},{value:"sun"}],a=[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{getMonthName:function(){return e},getMonthNumber:function(){return t},getDaysOfWeek:function(){return n},getDaysOfMonth:function(){return a}}}).factory("dateFilterLocalizationFactory",t).factory("Sequence",function(){return{enqueue:function(e){this.tail=this.tail?this.tail.finally(e):e()}}})}(),function(){"use strict";function e(e,t,n){var a;n.html5Mode(!0),t.otherwise("/dashboards/general"),angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.get("motion.layoutStyle")||"verticalNavigation",o={verticalNavigation:{main:"app/core/layouts/vertical-navigation.html",toolbar:"app/toolbar/layouts/vertical-navigation/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html",header:"app/header/layouts/vertical-navigation/header.html",footer:"app/footer/layouts/vertical-navigation/footer.html"},verticalNavigationFullwidthToolbar:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html"},verticalNavigationFullwidthToolbar2:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar-2/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html"},horizontalNavigation:{main:"app/core/layouts/horizontal-navigation.html",toolbar:"app/toolbar/layouts/horizontal-navigation/toolbar.html",navigation:"app/navigation/layouts/horizontal-navigation/navigation.html"},contentOnly:{main:"app/core/layouts/content-only.html",toolbar:"",navigation:""},contentWithToolbar:{main:"app/core/layouts/content-with-toolbar.html",toolbar:"app/toolbar/layouts/content-with-toolbar/toolbar.html",navigation:""}};e.state("app",{abstract:!0,views:{"main@":{templateUrl:o[i].main,controller:"MainController as vm"},"toolbar@app":{templateUrl:o[i].toolbar,controller:"ToolbarController as vm"},"navigation@app":{templateUrl:o[i].navigation,controller:"NavigationController as vm"},"quickPanel@app":{templateUrl:"app/quick-panel/quick-panel.html",controller:"QuickPanelController as vm"},"header@app":{templateUrl:o[i].header,controller:"HeaderController as vm"},"footer@app":{templateUrl:o[i].footer,controller:"FooterController as vm"}},resolve:{license:["apiResolver",function(e){return e.resolve("license@get")}],setting:["apiResolver",function(e){return e.resolve("setting@get",{id:1})}]}})}e.$inject=["$stateProvider","$urlRouterProvider","$locationProvider"],angular.module("motion").config(e)}(),function(){"use strict";function e(e,t,n){var a=e.$on("$stateChangeStart",function(){e.loadingProgress=!0}),i=e.$on("$stateChangeSuccess",function(){t(function(){e.loadingProgress=!1})});e.state=n,e.$on("$destroy",function(){a(),i()})}e.$inject=["$rootScope","$timeout","$state"],angular.module("motion").run(e)}(),function(){"use strict";function e(a,e){var i;function o(){i=io({query:"id="+e.getCurrentUser().id,transports:["websocket","polling"]})}return{connect:o,on:function(e,t){t=t||angular.noop,i||o(),i.on(e,function(){var e=arguments;a.$apply(function(){t.apply(i,e)})})},onWithoutApply:function(e,t){t=t||angular.noop,i||o(),i.on(e,function(){t.apply(i,arguments)})},emit:function(e,t,n){n=n||angular.noop,i||o(),i.emit(e,t,function(){var e=arguments;a.$apply(function(){n.apply(i,e)})})},removeAllListeners:function(e){i||o(),i.removeAllListeners(e)},removeListener:function(e,t){i||o(),i.removeListener(e,t)},disconnect:function(){i||o(),i.disconnect()}}}e.$inject=["$rootScope","Auth"],angular.module("motion").factory("socket",e)}(),function(){"use strict";function e(t,n,e,a,i,o){var s=this;s.progresslogin=!1,s.login=function(){return s.progresslogin=!0,o.login(s.form).then(function(){return t.go("app.dashboards.general")}).catch(function(e){s.message=e.message}).finally(function(){s.progresslogin=!1})},s.loginOauth=function(e){n.location.href="/api/auth/"+e},s.onInit=function(){{if(t.params.token&&t.params.userId)return o.removeCookies(),s.progresslogin=!0,e.put("motion.token",t.params.token),i.user.get({id:t.params.userId}).$promise.then(function(e){e&&(o.updateCurrentUser(e),t.go("app.dashboards.general"))}).finally(function(){s.progresslogin=!1});o.isLoggedIn()&&t.go("app.dashboards.general")}},s.onInit()}e.$inject=["$state","$window","$cookies","$timeout","api","Auth"],angular.module("app.login").controller("LoginController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="ANALYTICS.EDIT_EXTRACTEDREPORT",m.extractedReport=angular.copy(s),m.extractedReports=o,m.newExtractedReport=!1,m.extractedReport||(m.extractedReport={},m.title="ANALYTICS.NEW_EXTRACTEDREPORT",m.newExtractedReport=!0),m.addNewExtractedReport=function(){m.errors=[],r.analyticExtractedReport.save(m.extractedReport).$promise.then(function(e){m.extractedReports.unshift(e.toJSON()),i.success({title:"ExtractedReport properly created",msg:m.extractedReport.name?m.extractedReport.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveExtractedReport=function(){m.errors=[],r.analyticExtractedReport.update({id:m.extractedReport.id},m.extractedReport).$promise.then(function(e){var t=_.find(m.extractedReports,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ExtractedReport properly saved!",msg:m.extractedReport.name?m.extractedReport.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteExtractedReport=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The extractedReport will be deleted.").ariaLabel("Delete ExtractedReport").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.analyticExtractedReport.delete({id:m.extractedReport.id}).$promise.then(function(){_.remove(m.extractedReports,{id:m.extractedReport.id}),i.success({title:"ExtractedReport properly deleted!",msg:(m.extractedReport.name||"extractedReport")+" has been deleted!"}),u(m.extractedReport)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","extractedReports","extractedReport","api","Auth","license","setting"],angular.module("app.analytics").controller("CreateOrEditExtractedReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.extractedReports=r||{count:0,rows:[]},v.table="extractedReports",v.listOrder="",v.listOrderAsc=null,v.selectedExtractedReports=[],v.query={fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,createdAt,status,output",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{extractedReport:e,extractedReports:v.extractedReports.rows,license:v.license,setting:null}})},v.downloadfile2=function(o,e){return l.analyticExtractedReport.download({id:o.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=o.savename;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the extractedReport?").htmlContent("<b>"+(e.name||"extractedReport")+"</b> will be deleted.").ariaLabel("delete extractedReport").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getExtractedReports=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.analyticExtractedReport.get(v.query,f).$promise},v.createOrEditExtractedReport=function(e,t){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{extractedReport:t,extractedReports:v.extractedReports.rows,license:v.license,setting:v.setting}})},v.deleteExtractedReport=A,v.exportSelectedExtractedReports=function(){var e=angular.copy(v.selectedExtractedReports);return v.selectedExtractedReports=[],e},v.deleteSelectedExtractedReports=function(e){var t=i.confirm().title("Are you sure want to delete the selected extractedReports?").htmlContent("<b>"+v.selectedExtractedReports.length+" selected</b> will be deleted.").ariaLabel("delete ExtractedReports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedExtractedReports.forEach(function(e){A(e)}),v.selectedExtractedReports=[]})},v.deselectExtractedReports=function(){v.selectedExtractedReports=[]},v.selectAllExtractedReports=function(){v.selectedExtractedReports=v.extractedReports.rows};var h=!0,b=1;function f(e){v.extractedReports=e||{count:0,rows:[]}}function A(e){l.analyticExtractedReport.delete({id:e.id}).$promise.then(function(){_.remove(v.extractedReports.rows,{id:e.id}),v.extractedReports.count-=1,v.extractedReports.rows.length||v.getExtractedReports(),c.success({title:"ExtractedReport deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticExtractedReport"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticExtractedReport",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getExtractedReports())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","extractedReports","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.analytics").controller("ExtractedReportsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="ANALYTICS.EDIT_METRIC",m.metric=angular.copy(s),m.metrics=o,m.newMetric=!1,m.metric||(m.metric={table:"report_agent"},m.title="ANALYTICS.NEW_METRIC",m.newMetric=!0),m.addNewMetric=function(){m.errors=[],r.analyticMetric.save(m.metric).$promise.then(function(e){m.metrics.unshift(e.toJSON()),i.success({title:"Metric properly created",msg:m.metric.name?m.metric.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMetric=function(){m.errors=[],r.analyticMetric.update({id:m.metric.id},m.metric).$promise.then(function(e){var t=_.find(m.metrics,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Metric properly saved!",msg:m.metric.name?m.metric.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMetric=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The metric will be deleted.").ariaLabel("Delete Metric").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.analyticMetric.delete({id:m.metric.id}).$promise.then(function(){_.remove(m.metrics,{id:m.metric.id}),i.success({title:"Metric properly deleted!",msg:(m.metric.name||"metric")+" has been deleted!"}),u(m.metric)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","metrics","metric","api","Auth","license","setting"],angular.module("app.analytics").controller("CreateOrEditMetricDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.metrics=r||{count:0,rows:[]},v.table="metrics",v.listOrder="",v.listOrderAsc=null,v.selectedMetrics=[],v.query={fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,page:1},v.arraytable=_.keyBy([{option:"Agent Report",value:"'report_agent'"},{option:"Call Report",value:"'report_call'"},{option:"Contacts",value:"'cm_contacts'"},{option:"CSquare Report",value:"'report_square'"},{option:"CSquare Details Report",value:"'report_square_details'"},{option:"Dialer Hopper Processing",value:"'cm_hopper'"},{option:"Dialer Hopper Logs",value:"'cm_hopper_history'"},{option:"Dialer Hopper Final",value:"'cm_hopper_final'"},{option:"Integration Report",value:"'report_integration'"},{option:"Jscripty Sessions",value:"'report_jscripty_sessions'"},{option:"Jscripty Questions",value:"'report_jscripty_questions'"},{option:"Jscripty Answers",value:"'report_jscripty_answers'"},{option:"Member Report",value:"'report_member'"},{option:"Queue Report",value:"'report_queue'"},{option:"Users",value:"'users'"},{option:"Voice Recordings",value:"'voice_recordings'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editdialog=function(e,t){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{metric:e,metrics:v.metrics.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the metric?").htmlContent("<b>"+(e.name||"metric")+"</b> will be deleted.").ariaLabel("delete metric").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getMetrics=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.analyticMetric.get(v.query,f).$promise},v.createOrEditMetric=function(e,t){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{metric:t,metrics:v.metrics.rows,license:v.license,setting:v.setting}})},v.deleteMetric=A,v.exportSelectedMetrics=function(){var e=angular.copy(v.selectedMetrics);return v.selectedMetrics=[],e},v.deleteSelectedMetrics=function(e){var t=i.confirm().title("Are you sure want to delete the selected metrics?").htmlContent("<b>"+v.selectedMetrics.length+" selected</b> will be deleted.").ariaLabel("delete Metrics").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedMetrics.forEach(function(e){A(e)}),v.selectedMetrics=[]})},v.deselectMetrics=function(){v.selectedMetrics=[]},v.selectAllMetrics=function(){v.selectedMetrics=v.metrics.rows};var h=!0,b=1;function f(e){v.metrics=e||{count:0,rows:[]}}function A(e){l.analyticMetric.delete({id:e.id}).$promise.then(function(){_.remove(v.metrics.rows,{id:e.id}),v.metrics.count-=1,v.metrics.rows.length||v.getMetrics(),c.success({title:"Metric deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticMetric"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticMetric",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getMetrics())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","metrics","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.analytics").controller("MetricsController",e)}(),function(){"use strict";function e(e,t,a,n,i,o,s){var r=this;function l(){t.hide()}r.errors=[],r.report=angular.copy(n),r.report.name+="-copy",r.treeCustomData=s,r.treeCustomConfig={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},r.treeCustomEvents={select_node:function(e,t){r.currentNode=t.node}},r.copyReport=function(){var n;r.errors=[],i.analyticCustomReport.save({name:r.report.name,description:r.report.description,table:r.report.table,conditions:r.report.conditions,joins:r.report.joins,parent:r.currentNode.id}).$promise.then(function(e){n=e,a.success({title:"Report properly copied!",msg:r.report.name?r.report.name+" has been copied!":""});var t={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return t["analyticCustomReport"===o?"CustomReportId":"DefaultReportId"]=r.report.id,i.analyticFieldReport.get(t).$promise}).then(function(e){var e=_.map(e.rows,function(e){return _.extend({},e,{CustomReportId:n.id})});return i.analyticFieldReport.bulkCreate(e).$promise}).then(function(){a.success({title:"Fields copied!",msg:"Fields has been copied!"}),l()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:COPYREPORT",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","treeCustomData"],angular.module("app.analytics").controller("CopyReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l){var d=this;function c(){t.hide()}d.errors=[],d.joinTables=[],d.title="ANALYTICS.EDIT_REPORT",d.report=angular.copy(i),d.reports=a,d.newReport=!1,d.tables=l.getMap(),d.joinTypes=[{key:"join",value:"Join"},{key:"left_join",value:"Left Join"},{key:"right_join",value:"Right Join"},{key:"outer_join",value:"Outer Join"},{key:"cross_join",value:"Cross Join"}],d.report||(d.report={name:"",table:"report_agent",description:"",parent:r.id},d.title="ANALYTICS.NEW_REPORT",d.newReport=!0),d.addNewReport=function(){d.errors=[],d.report.joins=_.map(d.joinTables||[],function(e){return{parentKey:e.parentKey,foreignTable:e.name,foreignKey:e.foreignKey,type:e.type.toLowerCase()}}),d.report.joins=JSON.stringify(d.report.joins),o[s].save(d.report).$promise.then(function(e){d.reports.unshift(e),n.success({title:"Report properly created",msg:d.report.name?d.report.name+" has been created!":""}),c()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.save"}];for(var t=0;t<e.data.errors.length;t++)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveReport=function(){d.errors=[],o[s].update({id:d.report.id},d.report).$promise.then(function(e){var t=_.find(d.reports,{id:e.id});t&&_.merge(t,e),n.success({title:"Report properly saved!",msg:d.report.name?d.report.name+" has been saved!":""}),c()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.update"}];for(var t=0;t<e.data.errors.length;t++)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteReport=function(){d.errors=[];var e=t.confirm().title("Are you sure?").content("The report will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(event);t.show(e).then(function(){o[s].delete({id:d.report.id}).$promise.then(function(){_.remove(d.reports,{id:d.report.id}),n.success({title:"Report properly deleted!",msg:d.report.name?d.report.name+" has been deleted!":""}),c()}).catch(function(e){d.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.delete"}]})},function(){})},d.closeDialog=c,d.selectedTableChange=function(e){e&&(delete d.selectedItem,d.joinTables.push(e))},d.removeJoin=function(e){d.joinTables.splice(e,1)},d.getFields=function(t,n,e){var a=_.find(d.tables,{name:e});a&&a.api&&o[a.api].describe().$promise.then(function(e){t[n]=_.difference(_.keys(e),["$promise","$resolved"])}).catch(function(e){console.error(e)})}}e.$inject=["$location","$mdDialog","toasty","reports","report","api","apiName","currentNode","describeTable"],angular.module("app.analytics").controller("CreateOrEditReportDialogController",e)}(),function(){"use strict";function e(i,a,o,e){var s=this;s.report={},s.conditions=e.getConditions,s.init=function(e){s.report=e,s.report.condition=angular.fromJson(e.conditions)||{group:{operator:"AND",rules:[]}};for(var t=0;t<s.report.condition.group.rules.length;t++)if(s.report.condition.group.rules[t].field){var n=s.report.condition.group.rules[t].field.split(".");1===n.length&&(s.report.condition.group.rules[t].field=s.report.table+"."+s.report.condition.group.rules[t].field)}a.getColumns(s.report.table).then(function(e){s.columns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt"])}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.addCondition=function(e){e.unshift({condition:"=",field:"",value:""})},s.addGroup=function(e){e.push({group:{operator:"AND",rules:[]}})},s.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the item?").htmlContent("The item will be deleted.").ariaLabel("delete item").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){e.splice(t,1)},function(){console.log("CANCEL")})},s.isValueByCondition=function(e){return!_.includes(["IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"],e)}}e.$inject=["$mdDialog","describeTable","toasty","sqlUtil"],angular.module("app.analytics").controller("ReportConditionsController",e)}(),function(){"use strict";function e(t){var a={cm_contacts:"cmContact",cm_hopper:"cmHopper",cm_hopper_final:"cmHopperFinal",cm_hopper_history:"cmHopperHistory",chat_websites:"chatWebsite",chat_queues:"chatQueue",chat_interactions:"chatInteraction",chat_messages:"chatMessage",chat_offline_messages:"chatOfflineMessage",report_chat_queue:"chatQueueReport",mail_accounts:"mailAccount",mail_queues:"mailQueue",mail_interactions:"mailInteraction",mail_messages:"mailMessage",report_mail_queue:"mailQueueReport",openchannel_accounts:"openchannelAccount",openchannel_queues:"openchannelQueue",openchannel_interactions:"openchannelInteraction",openchannel_messages:"openchannelMessage",report_openchannel_queue:"openchannelQueueReport",sms_accounts:"smsAccount",sms_queues:"smsQueue",sms_interactions:"smsInteraction",sms_messages:"smsMessage",report_sms_queue:"smsQueueReport",fax_accounts:"faxAccount",fax_queues:"faxQueue",fax_interactions:"faxInteraction",fax_messages:"faxMessage",report_fax_queue:"faxQueueReport",report_call:"voiceCallReport",report_agent:"voiceAgentReport",report_square:"squareReport",report_member:"memberReport",report_queue:"voiceQueueReport",report_square_details:"squareReportDetail",report_jscripty_sessions:"jscriptySessionReport",report_jscripty_questions:"jscriptyQuestionReport",report_jscripty_answers:"jscriptyAnswerReport",users:"user",voice_recordings:"voiceRecording"};return{getMap:function(){var n=[];return _.forIn(a,function(e,t){n.push({name:t,api:e})}),n},getColumns:function(e){return t[a[e]].describe().$promise}}}e.$inject=["api"],angular.module("app.analytics").factory("describeTable",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;(m.errors=[],m.title="Edit Report Field",m.report=i,m.reportField=angular.copy(s),m.reportFields=o,m.metrics=r,m.columns=l,m.sqlUtil=d,m.newReportField=!1,m.reportField)?(m.reportField.type=m.reportField.custom?"custom":m.reportField.MetricId?"metric":"column",m.reportField.field&&!m.reportField.custom&&_.isNil(m.reportField.MetricId)&&1===m.reportField.field.split(".").length&&(m.reportField.field=m.report.table+"."+m.reportField.field)):(m.reportField={type:"column",function:null,format:null,groupBy:!1,orderBy:null},m.title="New Report Field",m.newReportField=!0);function u(){n.hide()}m.addNewReportField=function(){m.errors=[],m.reportField.custom="custom"===m.reportField.type,m.reportField.MetricId="metric"===m.reportField.type?m.reportField.MetricId:null,m.reportField.CustomReportId=m.report.id,c.analyticFieldReport.save(m.reportField).$promise.then(function(e){m.reportFields.push(e),a.success({title:"Report field properly created",msg:m.reportField.field?m.reportField.field+" has been created!":m.reportField.type+" has been created!"}),u()}).catch(function(e){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.save"}]})},m.saveReportField=function(){m.errors=[],m.reportField.custom="custom"===m.reportField.type,m.reportField.MetricId="metric"===m.reportField.type?m.reportField.MetricId:null,c.analyticFieldReport.update({id:m.reportField.id},m.reportField).$promise.then(function(e){var t=_.find(m.reportFields,{id:e.id});t&&_.merge(t,e),a.success({title:"Report Field properly saved!",msg:m.reportField.field?m.reportField.field+" has been saved!":""}),u()}).catch(function(e){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.update"}]})},m.deleteReportField=function(e){m.errors=[];var t=n.confirm().title("Are you sure?").content("The field will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){c.analyticFieldReport.delete({id:m.reportField.id}).$promise.then(function(){_.remove(m.reportFields,{id:m.reportField.id}),a.success({title:"Report Field properly deleted!",msg:m.reportField.field?m.reportField.field+" has been deleted!":""}),u()}).catch(function(e){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReportField.delete"}]})},function(){})},m.closeDialog=u}e.$inject=["$scope","$location","$mdDialog","toasty","report","reportFields","reportField","metrics","columns","sqlUtil","api"],angular.module("app.analytics").controller("CreateOrEditReportFieldDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.report={},c.reportFields={count:0,rows:[]},c.functions=_.keyBy(l.getFunctions,"value"),c.formats=_.keyBy(l.getFormats,"value"),c.groupBy=_.keyBy(l.getGroupBy,"value"),c.orderBy=_.keyBy(l.getOrderBy,"value"),c.selectedReportFields=[],c.query={fields:"createdAt,updatedAt,id,field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0},c.sortableTable={animation:100,onSort:function(e){s.analyticFieldReport.addFields({id:c.report.id},e.models).$promise.then(function(e){c.reportFields.rows=e}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDFIELDS"})})}},c.init=function(e){c.report=e,c.query.CustomReportId=c.report.id,r.getColumns(c.report.table).then(function(e){return c.columns=_.difference(_.keys(e),["$promise","$resolved"]),s.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise}).then(function(e){c.metrics=e.rows}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.getReportFields()},c.deleteConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>"+e.field+"</b> will be deleted.").ariaLabel("delete field").targetEvent(t).ok("OK").cancel("CANCEL");a.show(n).then(function(){p(e)},function(){console.log("CANCEL")})},c.success=u,c.getReportFields=function(){c.promise=s.analyticFieldReport.get(c.query,u).$promise},c.createOrEditReportField=function(e,t){a.show({controller:"CreateOrEditReportFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/edit/field/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:c.report,reportField:t,reportFields:c.reportFields.rows,metrics:c.metrics,columns:c.columns,setting:null}})},c.deleteReportField=p,c.deleteSelectedReportFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+c.selectedReportFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){c.selectedReportFields.forEach(function(e){p(e)}),c.selectedReportFields=[]})},c.getMetricName=function(e){var t=_.find(c.metrics,{id:e});return t?t.name:d.instant("ANALYTICS.NO_METRIC_FOUND")},c.getMetricValue=function(e){var t=_.find(c.metrics,{id:e});return t?t.metric:d.instant("ANALYTICS.NO_METRIC_FOUND")};var m=!0;function u(e){c.reportFields=e||{count:0,rows:[]}}function p(e){s.analyticFieldReport.delete({id:e.id}).$promise.then(function(){c.selectedReportFields=[],_.remove(c.reportFields.rows,{id:e.id}),c.reportFields.count-=1,c.reportFields.rows.length||c.getReportFields(),o.success({title:"Field deleted!",msg:e.field?e.field+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}t.$watch("vm_rf.query.filter",function(e,t){m?n(function(){m=!1}):c.getReportFields()})}e.$inject=["$cookies","$scope","$timeout","$mdDialog","$document","toasty","api","describeTable","sqlUtil","$translate"],angular.module("app.analytics").controller("ReportFieldsController",e)}(),function(){"use strict";angular.module("app.analytics").factory("sqlUtil",function(){return{getFunctions:[{value:"SUM",option:function(e){return"SUM ("+e+")"}},{value:"COUNT",option:function(e){return"COUNT ("+e+")"}},{value:"COUNT DISTINCT",option:function(e){return"COUNT (DISTINCT "+e+")"}},{value:"MAX",option:function(e){return"MAX ("+e+")"}},{value:"MIN",option:function(e){return"MIN ("+e+")"}},{value:"AVG",option:function(e){return"AVG ("+e+")"}},{value:"GROUP_CONCAT",option:function(e){return"GROUP_CONCAT ("+e+")"}},{value:"GROUP_CONCAT ASC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" ASC)"}},{value:"GROUP_CONCAT DESC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" DESC)"}}],getFormats:[{value:"SEC_TO_TIME",option:function(e){return"SEC_TO_TIME ("+e+")"}},{value:"DATE",option:function(e){return"DATE ("+e+")"}},{value:"HOUR",option:function(e){return"HOUR ("+e+")"}},{value:"ROUND",option:function(e){return"ROUND ("+e+")"}},{value:"UNIX_TIMESTAMP",option:function(e){return"UNIX_TIMESTAMP ("+e+")"}}],getGroupBy:[{value:!1,option:function(){return"No"}},{value:!0,option:function(e){return"GROUP BY "+e}}],getOrderBy:[{value:"ASC",option:function(e){return"ORDER BY "+e+" ASC"}},{value:"DESC",option:function(e){return"ORDER BY "+e+" DESC"}}],getConditions:["=","!=","<","<=",">",">=","LIKE","NOT LIKE","IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"]}})}(),function(){"use strict";function e(e,t,n,a){var i=this;function o(e){return _.isArray(e)}i.report=a||{},i.selectedTab=e.params.tab||0,i.gotoReports=function(){e.go("app.analytics.reports")},i.saveReport=function(){i.report.conditions=angular.toJson(i.report.condition),n.analyticCustomReport.update({id:i.report.id},_.omit(i.report,"joins")).$promise.then(function(){t.success({title:"Report updated!",msg:i.report.name?i.report.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETreport",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.previewReport=function(){i.columns=[],i.rows=[],i.error=!1,n.analyticFieldReport.get({fields:"field,alias",nolimit:!0,CustomReportId:i.report.id}).$promise.then(function(e){return i.columns=e?e.rows:[],n.analyticCustomReport.preview({id:i.report.id}).$promise}).then(function(e){i.rows=e}).catch(function(e){console.log(e),i.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},t.error(i.error)})},i.queryReport=function(){return i.queryResult="Loading...",n.analyticCustomReport.query({id:i.report.id}).$promise.then(function(e){i.queryResult=e.sql}).catch(function(e){i.queryResult="",console.log(e),i.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},t.error(i.error)})},i.mapArray=function(e,t){if(o(e))return _.map(e,t).join(",");return""},i.isArray=o,i.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t}}e.$inject=["$state","toasty","api","report"],angular.module("app.analytics").controller("ReportController",e)}(),function(){"use strict";function e(e,t,n,a,i,o){var s=this;s.errors=[],s.report=angular.copy(a),s.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t},s.closeDialog=function(){t.hide()},function(){s.columns=[],s.rows=[],s.error=!1;var e={fields:"field,alias",nolimit:!0};e["analyticCustomReport"===o?"CustomReportId":"DefaultReportId"]=s.report.id,s.promise=i.analyticFieldReport.get(e).$promise.then(function(e){return s.columns=e?e.rows:[],i[o].preview({id:s.report.id}).$promise}).then(function(e){s.rows=e}).catch(function(e){console.log(e),s.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},n.error(s.error)})}()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName"],angular.module("app.analytics").controller("PreviewReportDialogController",e)}(),function(){"use strict";function e(e,n,a,i,o,s,t,r,l,d,c){var m=this;m.currentUser=c.getCurrentUser(),m.reports={count:0,rows:[]},m.selectedReports=[],m.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},m.apiName=null,m.currentPath="",m.customTree=!0,m.editstate=function(e,t){o.go("app.analytics.reports.edit",{id:e.id})},m.copydialog=function(e,t){i.show({controller:"CopyReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/copy/dialog.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{report:e,apiName:m.apiName,treeCustomData:m.treeCustomInstance.jstree(!0).get_json("#")}}).finally(function(){})},m.previewdialog=function(e,t){i.show({controller:"PreviewReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/preview/dialog.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{report:e,apiName:m.apiName}})},m.rundialog=function(e,t){i.show({controller:"RunReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/dialog.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{report:e,apiName:m.apiName,currentPath:m.currentPath}})},m.downloadfile=function(a,e){var i;r.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise.then(function(e){i=_.keyBy(e.rows,"id");var t={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return t["analyticCustomReport"===m.apiName?"CustomReportId":"DefaultReportId"]=a.id,r.analyticFieldReport.get(t).$promise}).then(function(e){for(var t=0;t<e.rows.length;t+=1)e.rows[t].MetricId&&(e.rows[t].field=i[e.rows[t].MetricId].metric,e.rows[t].custom=!0),delete e.rows[t].MetricId;var n=s.document.createElement("a");n.href="data:text/json;charset=utf-8,"+s.encodeURIComponent(angular.toJson({name:a.name,description:a.description,table:a.table,conditions:a.conditions,joins:a.joins,fields:e.rows})),n.download=a.name+".json",n.target="_self",n.click(),d.success({title:"Report downloaded!",msg:a.name?a.name+" has been downloaded!":""})}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DOWNLOADJSON",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the report?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete report").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){h(e)},function(){console.log("CANCEL")})},m.success=g,m.getReports=v,m.createOrEditReport=function(e,t){i.show({controller:"CreateOrEditReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:t,reports:m.reports.rows,apiName:m.apiName,currentNode:m.currentNode,setting:null}})},m.importReport=function(e,t,n){if("application/json"===e.file.type){var a=new FileReader;a.onload=function(e){console.log(e.target.result);try{var n=atob(e.target.result.split(",")[1]);n=angular.fromJson(n),r.analyticCustomReport.save({name:n.name,description:n.description,table:n.table,conditions:n.conditions,joins:n.joins,parent:m.currentNode.id}).$promise.then(function(t){m.reports.rows.unshift(t),d.success({title:"Report saved!",msg:t.name?t.name+" has been saved!":""});var e=_.map(n.fields,function(e){return _.extend({},e,{CustomReportId:t.id})});return r.analyticFieldReport.bulkCreate(e).$promise}).then(function(e){d.success({title:"Fields saved!",msg:"Fields has been saved!"})}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETanalyticReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}catch(e){console.error(e),d.error({title:"Decode File Error",msg:e.toString()})}},a.readAsDataURL(e.file)}else d.error({title:"Format Error",msg:"Please use only json files"})},m.deleteReport=h,m.exportSelectedReports=function(){var e=angular.copy(m.selectedReports);return m.selectedReports=[],e},m.deleteSelectedReports=function(e){var t=i.confirm().title("Are you sure want to delete the selected reports?").htmlContent("<b>"+m.selectedReports.length+" selected</b> will be deleted.").ariaLabel("delete Reports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){m.selectedReports.forEach(function(e){h(e)}),m.selectedReports=[]})},m.deselectReports=function(){m.selectedReports=[]},m.selectAllReports=function(){m.selectedReports=m.reports.rows},m.treeDefaultData=l.rows[0]?angular.fromJson(l.rows[0].tree):[],m.treeCustomData=l.rows[1]?angular.fromJson(l.rows[1].tree):[],m.treeDefaultConfig=E(!1),m.treeCustomConfig=E(!0),m.treeDefaultEvents=y(!1),m.treeCustomEvents=y(!0);var u=!0,p=1;function g(e){m.reports=e||{count:0,rows:[]}}function v(){m.query.offset=(m.query.page-1)*m.query.limit,m.apiName&&(m.promise=r[m.apiName].get(m.query,g).$promise)}function h(e){m.apiName&&r[m.apiName].delete({id:e.id}).$promise.then(function(){_.remove(m.reports.rows,{id:e.id}),m.reports.count-=1,m.reports.rows.length||m.getReports(),d.success({title:"Report deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.analyticreport.delete"}];for(var t=0;t<e.data.errors.length;t++)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticreport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function b(e,t){m.treeDefaultInstance.jstree(!0).deselect_all(),m.treeDefaultInstance.jstree(!0).close_all(),m.currentNode=t.node,m.currentNode.custom=!0,m.currentPath=m.treeCustomInstance.jstree(!0).get_path(m.currentNode).join("/ "),m.apiName="analyticCustomReport",m.query.parent=t.node.id,v()}function f(e,t){m.treeCustomInstance.jstree(!0).deselect_all(),m.treeCustomInstance.jstree(!0).close_all(),m.currentNode=t.node,m.currentNode.custom=!1,m.currentPath=m.treeDefaultInstance.jstree(!0).get_path(m.currentNode).join("/ "),m.apiName="analyticDefaultReport",m.query.parent=t.node.id,v()}function A(e,t){var n=angular.toJson(m.treeCustomInstance.jstree(!0).get_json("#"));r.analyticTreeReport.update({id:2,tree:n}).$promise.then(function(){l.rows[1]&&(l.rows[1].tree=n),d.success({title:"Node Updated",msg:t.node.text?t.node.text+" has been updated!":"Node has been updated!"})}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEanalyticTreeReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}function E(e){return{core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:e?["contextmenu","dnd","search","state","wholerow"]:["search","state","wholerow"],contextmenu:{items:function(n){return{create:{label:t.instant("ANALYTICS.CREATE"),action:function(){n=m.treeCustomInstance.jstree(!0).create_node(n),m.treeCustomInstance.jstree(!0).edit(n)}},rename:{_disabled:"#"===n.parent,label:t.instant("ANALYTICS.RENAME"),action:function(){m.treeCustomInstance.jstree(!0).edit(n)}},remove:{_disabled:"#"===n.parent||"admin"!==m.currentUser.role&&0!==m.currentUser.crudPermissions,label:t.instant("ANALYTICS.REMOVE"),action:function(){var e=i.confirm().title("Are you sure want to delete the node?").htmlContent("<b>"+(n.text?n.text:"Node")+"</b> and its subnode will be deleted.").ariaLabel("delete node").ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,t=m.treeCustomInstance.jstree(!0).get_parent(n);t=m.treeCustomInstance.jstree(!0).get_node(t),m.treeCustomInstance.jstree(!0).delete_node(n),e=[n.id].concat(n.children_d||[]),r.analyticCustomReport.get({parent:e.join(","),fields:"id,name"}).$promise.then(function(e){e&&e.rows&&e.rows.forEach(function(e){h(e)})}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEreportsByParents",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.treeCustomInstance.jstree(!0).select_node(t)})}}}}}}}function y(e){return e?{create_node:A,rename_node:A,move_node:A,delete_node:A,select_node:b}:{select_node:f}}e.$watch("vm.query.filter",function(e,t){u?n(function(){u=!1}):(t||(p=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=p),m.getReports())}),e.$watch("vm.search",function(e,t){m.treeDefaultInstance&&m.treeDefaultInstance.jstree(!0).search(e),m.treeCustomInstance&&m.treeCustomInstance.jstree(!0).search(e)})}e.$inject=["$scope","$timeout","$document","$mdDialog","$state","$window","$translate","api","treeReports","toasty","Auth"],angular.module("app.analytics").controller("ReportsController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){l.export={id:l.report.id,name:l.report.name,startDate:new Date(moment().startOf("day")),endDate:new Date(moment().endOf("day")),output:"xlsx",fullPath:r?r+"/"+l.report.name:l.report.name}}function c(){n.hide()}l.errors=[],l.report=angular.copy(t),l.export={},l.runReport=function(t){l.errors=[],l.exportDate=_.assign({},l.export,{startDate:moment(l.export.startDate).format("YYYY-MM-DD HH:mm:ss"),endDate:moment(l.export.endDate).format("YYYY-MM-DD HH:mm:ss")}),i[o].run(l.exportDate).$promise.then(function(e){"web"===l.export.output?n.show({controller:"WebReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/web/dialog.html",parent:angular.element(s.body),targetEvent:t,skipHide:!0,locals:{apiName:o,exportDate:l.exportDate,results:e},resolve:{columns:["apiResolver",function(e){var t={fields:"field,alias",nolimit:!0};return t["analyticCustomReport"===o?"CustomReportId":"DefaultReportId"]=l.report.id,e.resolve("analyticFieldReport@get",t)}]}}):(a.success({title:"Report properly run!",msg:l.report.name?l.report.name+" has been run!":""}),c())}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.closeDialog=c,(l.refreshDate=d)()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","$document","currentPath"],angular.module("app.analytics").controller("RunReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s){var r=this;function l(e){r.results=e||{count:0,rows:[]}}r.errors=[],r.columns=a?a.rows:[],r.results=i||{rows:[],count:0},r.query={limit:10,page:1},r.closeDialog=function(){e.hide()},r.getResults=function(){s.offset=(r.query.page-1)*r.query.limit,s.limit=r.query.limit,r.promise=n[o].run(s,l).$promise},r.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t}}e.$inject=["$mdDialog","toasty","api","columns","results","apiName","exportDate"],angular.module("app.analytics").controller("WebReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CALLYSQUARE.EDIT_ODBC",m.odbc=angular.copy(s),m.odbcs=o,m.newOdbc=!1,m.odbc||(m.odbc={},m.title="CALLYSQUARE.NEW_ODBC",m.newOdbc=!0),m.addNewOdbc=function(){m.errors=[],r.squareOdbc.save(m.odbc).$promise.then(function(e){m.odbcs.unshift(e.toJSON()),i.success({title:"Odbc properly created",msg:m.odbc.name?m.odbc.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveOdbc=function(){m.errors=[],r.squareOdbc.update({id:m.odbc.id},m.odbc).$promise.then(function(e){var t=_.find(m.odbcs,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Odbc properly saved!",msg:m.odbc.name?m.odbc.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteOdbc=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The odbc will be deleted.").ariaLabel("Delete Odbc").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.squareOdbc.delete({id:m.odbc.id}).$promise.then(function(){_.remove(m.odbcs,{id:m.odbc.id}),i.success({title:"Odbc properly deleted!",msg:(m.odbc.name||"odbc")+" has been deleted!"}),u(m.odbc)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","odbcs","odbc","api","Auth","license","setting"],angular.module("app.callysquare").controller("CreateOrEditOdbcDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.odbcs=r||{count:0,rows:[]},v.table="odbcs",v.listOrder="",v.listOrderAsc=null,v.selectedODBC=[],v.query={fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{odbc:e,odbcs:v.odbcs.rows,license:v.license,setting:null}})},v.testtestOdbc=function(e,t){return l.squareOdbc.test({id:e.id}).$promise.then(function(){c.success({title:"Square ODBC properly tested",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"Square ODBC properly tested",msg:e.data?JSON.stringify(e.data):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the odbc?").htmlContent("<b>"+(e.name||"odbc")+"</b> will be deleted.").ariaLabel("delete odbc").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getODBC=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.squareOdbc.get(v.query,f).$promise},v.createOrEditOdbc=function(e,t){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{odbc:t,odbcs:v.odbcs.rows,license:v.license,setting:v.setting}})},v.deleteOdbc=A,v.exportSelectedODBC=function(){var e=angular.copy(v.selectedODBC);return v.selectedODBC=[],e},v.deleteSelectedODBC=function(e){var t=i.confirm().title("Are you sure want to delete the selected odbcs?").htmlContent("<b>"+v.selectedODBC.length+" selected</b> will be deleted.").ariaLabel("delete Odbcs").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedODBC.forEach(function(e){A(e)}),v.selectedODBC=[]})},v.deselectODBC=function(){v.selectedODBC=[]},v.selectAllODBC=function(){v.selectedODBC=v.odbcs.rows};var h=!0,b=1;function f(e){v.odbcs=e||{count:0,rows:[]}}function A(e){l.squareOdbc.delete({id:e.id}).$promise.then(function(){_.remove(v.odbcs.rows,{id:e.id}),v.odbcs.count-=1,v.odbcs.rows.length||v.getODBC(),c.success({title:"Odbc deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareOdbc"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareOdbc",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getODBC())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","odbcs","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.callysquare").controller("OdbcsController",e)}(),function(){"use strict";function e(t,n,e,a,i,o,s,r){var l=this;function d(e){t.hide(e)}l.errors=[],l.title="CALLYSQUARE.EDIT_PROJECT",l.project=angular.copy(a),l.newWindow=!0,l.projects=e,l.newProject=!1,l.openFromEditor=o,l.project||(l.project={name:"",description:""},l.title="CALLYSQUARE.NEW_PROJECT",l.newProject=!0),l.addNewProject=function(){l.errors=[],i.squareProject.save(l.project).$promise.then(function(e){l.projects.unshift(e),n.success({title:"Project properly created",msg:l.project.name?l.project.name+" has been created!":""}),d(e),l.openFromEditor&&(l.newWindow?s.open("/callysquare/projects/"+e.id,"_blank"):r.go("app.callysquare.projects.edit",{id:e.id}))}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}];for(var t=0;t<e.data.errors.length;t++)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.saveProject=function(){l.errors=[],i.squareProject.update({id:l.project.id},l.project).$promise.then(function(e){var t=_.find(l.projects,{id:e.id});t&&_.merge(t,e),n.success({title:"Project properly saved!",msg:l.project.name?l.project.name+" has been saved!":""}),d(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}];for(var t=0;t<e.data.errors.length;t++)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.deleteProject=function(){l.errors=[];var e=t.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(event);t.show(e).then(function(){i.squareProject.delete({id:l.project.id}).$promise.then(function(){_.remove(l.projects,{id:l.project.id}),n.success({title:"Project properly deleted!",msg:l.project.name?l.project.name+" has been deleted!":""}),d(l.project)}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.delete"}]})},function(){})},l.closeDialog=d}e.$inject=["$mdDialog","toasty","projects","project","api","openFromEditor","$window","$state"],angular.module("app.callysquare").controller("CreateOrEditSquareProjectDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,o,s,r,l,d,c,m,u,p,g,v,h,b,f,A,E,y,S,T,C){var x,O,w,I,R,N,D=this,L={playback:["file_id"],answer:["timeout"],menu:["file_id","digit","response","retry"],getdigits:["file_id","variable_id","mindigit","maxdigit","retry"],getsecretdigits:["file_id","variable_id","mindigit","maxdigit","hiddendigitsnum","retry"],vswitch:["variable_id"],database:["odbc_id","query"],ext_dial:["trunk_name","phone","timeout"],set:["variable_id"],math:["variable_id"],gotoc:["context","extension","priority"],system:["command"],agi:["command"],gotoif:["condition"],saydigits:["digits"],saynumber:["number"],sayphonetic:["text"],record:["file","timeout"],goal:["goalname"],dial:["sip_id","timeout"],queue:["queue_id","timeout"],callback:["list_id","name","phone","delay"],gotoiftime:["interval_id"],voicemail:["mailbox"],subproject:["project_id"],sendSMS:["sms_account_id","to","sms_text"],sendMail:["account_id","to"],sendFax:["account_id","to","attachment_path"],tts:["text"],ispeechtts:["text","key","speed"],ispeechasr:["key","timeout"],custom_app:["application"],googleasr:["key","timeout"],awspolly:["aws_access_key_id","aws_secret_access_key","tts"],lumenvoxtts:["text"],lumenvoxasr:["grammar"],tildeasr:["appid","appsecret","uri"],login:["findBy"],pause:["findBy","pause_id"],unpause:["findBy"],logout:["findBy"]},M={queue:["file_id"],database:["variable_id"],pause:["pause_id"]},k={sendMail:["to","cc","bcc"],voicemail:["mailbox"]};function U(e,t,n,a){return _.map(e,function(e){return{value:e[t],option:e[n],group:a?e[a]:void 0}})}D.cellName=A.tagName,D.attributes=_.map(A.attributes,function(e){return{name:e.name,value:e.value,defaultValue:M[D.cellName]&&_.includes(M[D.cellName],e.name),required:L[D.cellName]&&_.includes(L[D.cellName],e.name),help:k[D.cellName]&&_.includes(k[D.cellName],e.name)}}),D.values={sip_id:U(r,"id","fullname","role"),trunk_name:U(l,"name","name"),trunk_id:U(l,"id","name"),queue_id:U(d,"id","name"),file_id:U(c,"id","name"),variable_id:U(m,"id","name"),odbc_id:U(u,"id","name"),project_id:U(p,"id","name"),context:U(g,"id","name"),interval_id:(x=v,O="id",w="name",I="IntervalId",R=_.filter(x,function(e){return null===e[I]}),N=[],_.forEach(R,function(t){N.push({value:t[O],option:t[w]});var e=_.filter(x,function(e){return e[I]===t.id});_.forEach(e,function(e){N.push({value:e[O],option:" - "+e[w]})})}),N),account_id:U(h,"id","name"),template_id:U(b,"id","name"),list_id:U(f,"id","name"),sms_account_id:U(T,"id","name"),pause_id:U(C,"id","name"),answer:[{value:"yes",option:"Yes"},{value:"no",option:"No"}],hiddendigitspos:[{value:"first",option:"First"},{value:"last",option:"Last"}],recordingFormat:[{value:"wav",option:"Wav"},{value:"gsm",option:"Gsm"}],intkey:[{value:"#",option:"#"},{value:"*",option:"*"}],beep:[{value:"BEEP",option:"Yes"},{value:"NOBEEP",option:"No"}],model:n,ispeech_asr_language:a,ispeech_tts_language:o,google_tts_language:s,google_asr_language:i,aws_polly_region:S,aws_polly_voice:y,callback_priority:[{option:"Highest",value:4},{option:"High",value:3},{option:"Medium",value:2},{option:"Low",value:1},{option:"Lowest",value:0}],findBy:[{value:"internal",option:"Internal"},{value:"phone",option:"Phone"},{value:"mobile",option:"Mobile"}]},D.closeDialog=function(e){e&&E(D.attributes),t.hide()},D.getMap=U}e.$inject=["$mdDialog","toasty","ispeechAsrModel","ispeechAsrLanguage","googleAsrLanguage","ispeechTtsLanguage","googleTtsLanguage","users","trunks","queues","sounds","variables","databases","projects","contexts","intervals","mailAccounts","templates","lists","cell","saveCallback","awsPollyVoice","awsPollyRegion","smsAccounts","pauses"],angular.module("app.callysquare").controller("MxGraphDialogController",e)}(),function(){"use strict";angular.module("app.callysquare").directive("stringToNumber",function(){return{require:"ngModel",link:function(e,t,n,a){a.$parsers.push(function(e){return""+e}),a.$formatters.push(function(e){return parseFloat(e)})}}})}(),function(){"use strict";angular.module("app.callysquare").factory("ispeechAsrModel",function(){return[{value:"0",option:"Default"},{value:"date",option:"Date"},{value:"usmoney",option:"US Money"},{value:"numbersto9",option:"Numbers to 9"},{value:"numbersto99",option:"Numbers to 99"},{value:"numbersto999",option:"Numbers to 999"},{value:"time",option:"Time"},{value:"phonenumber",option:"Phone number"},{value:"streets",option:"Streets"},{value:"citystate",option:"US City/States"}]}).factory("ispeechAsrLanguage",function(){return[{value:"en-US",option:"English (US)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GB",option:"English (UK)"},{value:"en-AU",option:"English (Australia)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-MX",option:"Spanish (Mexico)"},{value:"it-IT",option:"Italian (Italy) / Finnish (Finland)"},{value:"fr-FR",option:"German (Germany)"},{value:"fr-CA",option:"French (Canada)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ca-ES",option:"Catalan (Catalan)"},{value:"zh-TW",option:"Chinese (Taiwan)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"ko-KR",option:"Korean (Korea)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"nb-NO",option:"Norwegian (Norway)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"zh-CN",option:"Chinese (China)"},{value:"zh-HK",option:"Chinese (Hong Kong)"}]}).factory("ispeechTtsLanguage",function(){return[{value:"usenglishfemale",option:"US English Female"},{value:"usenglishmale",option:"US English Male"},{value:"ukenglishfemale",option:"UK English Female"},{value:"ukenglishmale",option:"UK English Male"},{value:"auenglishfemale",option:"Australian English"},{value:"usspanishfemale",option:"US Spanish Female"},{value:"usspanishmale",option:"US Spanish Male"},{value:"chchinesefemale",option:"Chinese Female"},{value:"chchinesemale",option:"Chinese Male"},{value:"hkchinesefemale",option:"Hong Kong Cantonese Female"},{value:"twchinesefemale",option:"Taiwan Chinese Female"},{value:"jpjapanesefemale",option:"Japanese Female"},{value:"jpjapanesemale",option:"Japanese Male"},{value:"krkoreanfemale",option:"Korean Female"},{value:"krkoreanmale",option:"Korean Male"},{value:"caenglishfemale",option:"Canadian English Female"},{value:"huhungarianfemale",option:"Hungarian Female"},{value:"brportuguesefemale",option:"Brazilian Portuguese Female"},{value:"eurportuguesefemale",option:"European Portuguese Female"},{value:"eurportuguesemale",option:"European Portuguese Male"},{value:"eurspanishfemale",option:"European Spanish Female"},{value:"eurspanishmale",option:"European Spanish Male"},{value:"eurcatalanfemale",option:"European Catalan Female"},{value:"eurczechfemale",option:"European Czech Female"},{value:"eurdanishfemale",option:"European Danish Female"},{value:"eurfinnishfemale",option:"European Finnish Female"},{value:"eurfrenchfemale",option:"European French Female"},{value:"eurfrenchmale",option:"European French Male"},{value:"eurnorwegianfemale",option:"European Norwegian Female"},{value:"eurdutchfemale",option:"European Dutch Female"},{value:"eurpolishfemale",option:"European Polish Female"},{value:"euritalianfemale",option:"European Italian Female"},{value:"euritalianmale",option:"European Italian Male"},{value:"eurturkishfemale",option:"European Turkish Female"},{value:"eurturkishmale",option:"European Turkish Male"},{value:"eurgermanfemale",option:"European German Female"},{value:"eurgermanmale",option:"European German Male"},{value:"rurussianfemale",option:"Russian Female"},{value:"rurussianmale",option:"Russian Male"},{value:"swswedishfemale",option:"Swedish Female"},{value:"cafrenchfemale",option:"Canadian French Female"},{value:"cafrenchmale",option:"Canadian French Male"}]}).factory("googleTtsLanguage",function(){return[{value:"af",option:"Afrikaans"},{value:"sq",option:"Albanian"},{value:"am",option:"Amharic"},{value:"ar",option:"Arabic"},{value:"hy",option:"Armenian"},{value:"az",option:"Azerbaijani"},{value:"eu",option:"Basque"},{value:"be",option:"Belarusian"},{value:"bn",option:"Bengali"},{value:"bh",option:"Bihari"},{value:"bs",option:"Bosnian"},{value:"br",option:"Breton"},{value:"bg",option:"Bulgarian"},{value:"km",option:"Cambodian"},{value:"ca",option:"Catalan"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-TW",option:"Chinese (Traditional)"},{value:"co",option:"Corsican"},{value:"hr",option:"Croatian"},{value:"cs",option:"Czech"},{value:"da",option:"Danish"},{value:"nl",option:"Dutch"},{value:"en",option:"English"},{value:"eo",option:"Esperanto"},{value:"et",option:"Estonian"},{value:"fo",option:"Faroese"},{value:"tl",option:"Filipino"},{value:"fi",option:"Finnish"},{value:"fr",option:"French"},{value:"fy",option:"Frisian"},{value:"gl",option:"Galician"},{value:"ka",option:"Georgian"},{value:"de",option:"German"},{value:"el",option:"Greek"},{value:"gn",option:"Guarani"},{value:"gu",option:"Gujarati"},{value:"xx-hacker",option:"Hacker"},{value:"ha",option:"Hausa"},{value:"iw",option:"Hebrew"},{value:"hi",option:"Hindi"},{value:"hu",option:"Hungarian"},{value:"is",option:"Icelandic"},{value:"id",option:"Indonesian"},{value:"ia",option:"Interlingua"},{value:"ga",option:"Irish"},{value:"it",option:"Italian"},{value:"jw",option:"Javanese"},{value:"ja",option:"Japanese"},{value:"kn",option:"Kannada"},{value:"kk",option:"Kazakh"},{value:"rw",option:"Kinyarwanda"},{value:"rn",option:"Kirundi"},{value:"xx-klingon",option:"Klingon"},{value:"ku",option:"Kurdish"},{value:"ko",option:"Korean"},{value:"ky",option:"Kyrgyz"},{value:"lo",option:"Laothian"},{value:"la",option:"Latin"},{value:"lv",option:"Latvian"},{value:"ln",option:"Lingala"},{value:"lt",option:"Lithuanian"},{value:"mk",option:"Macedonian"},{value:"mg",option:"Malagasy"},{value:"ml",option:"Malayalam"},{value:"mt",option:"Maltese"},{value:"mi",option:"Maori"},{value:"mr",option:"Marathi"},{value:"mo",option:"Moldavian"},{value:"mn",option:"Mongolian"},{value:"sr-ME",option:"Montenegrin"},{value:"ne",option:"Nepali"},{value:"no",option:"Norwegian"},{value:"nn",option:"Norwegian (Nynorsk)"},{value:"oc",option:"Occitan"},{value:"or",option:"Oriya"},{value:"om",option:"Oromo"},{value:"ps",option:"Pashto"},{value:"fa",option:"Persian"},{value:"xx-pirate",option:"Pirate"},{value:"pl",option:"Polish"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"pa",option:"Punjabi"},{value:"qu",option:"Quechua"},{value:"ro",option:"Romanian"},{value:"rm",option:"Romansh"},{value:"ru",option:"Russian"},{value:"gd",option:"Scots Gaelic"},{value:"sr",option:"Serbian"},{value:"sh",option:"Serbo-Croatian"},{value:"st",option:"Sesotho"},{value:"sn",option:"Shona"},{value:"sd",option:"Sindhi"},{value:"si",option:"Sinhalese"},{value:"sk",option:"Slovak"},{value:"sl",option:"Slovenian"},{value:"so",option:"Somali"},{value:"es",option:"Spanish"},{value:"su",option:"Sundanese"},{value:"sw",option:"Swahili"},{value:"sv",option:"Swedish"},{value:"tg",option:"Tajik"},{value:"ta",option:"Tamil"},{value:"tt",option:"Tatar"},{value:"te",option:"Telugu"},{value:"th",option:"Thai"},{value:"ti",option:"Tigrinya"},{value:"to",option:"Tonga"},{value:"tr",option:"Turkish"},{value:"tk",option:"Turkmen"},{value:"tw",option:"Twi"},{value:"ug",option:"Uighur"},{value:"uk",option:"Ukrainian"},{value:"ur",option:"Urdu"},{value:"uz",option:"Uzbek"},{value:"vi",option:"Vietnamese"},{value:"cy",option:"Welsh"},{value:"xh",option:"Xhosa"},{value:"yi",option:"Yiddish"},{value:"yo",option:"Yoruba"},{value:"zu",option:"Zulu"}]}).factory("googleAsrLanguage",function(){return[{value:"af-ZA",option:"Afrikaans (South Africa)"},{value:"am-ET",option:"Amharic (Ethiopia)"},{value:"hy-AM",option:"Armenian (Armenia)"},{value:"az-AZ",option:"Azerbaijani (Azerbaijan)"},{value:"id-ID",option:"Indonesian (Indonesia)"},{value:"ms-MY",option:"Malay (Malaysia)"},{value:"bn-BD",option:"Bengali (Bangladesh)"},{value:"bn-IN",option:"Bengali (India)"},{value:"ca-ES",option:"Catalan (Spain)"},{value:"cs-CZ",option:"Czech (Czech Republic)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"de-DE",option:"German (Germany)"},{value:"en-AU",option:"English (Australia)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GH",option:"English (Ghana)"},{value:"en-GB",option:"English (United Kingdom)"},{value:"en-IN",option:"English (India)"},{value:"en-IE",option:"English (Ireland)"},{value:"en-KE",option:"English (Kenya)"},{value:"en-NZ",option:"English (New Zealand)"},{value:"en-NG",option:"English (Nigeria)"},{value:"en-PH",option:"English (Philippines)"},{value:"en-ZA",option:"English (South Africa)"},{value:"en-TZ",option:"English (Tanzania)"},{value:"en-US",option:"English (United States)"},{value:"es-AR",option:"Spanish (Argentina)"},{value:"es-BO",option:"Spanish (Bolivia)"},{value:"es-CL",option:"Spanish (Chile)"},{value:"es-CO",option:"Spanish (Colombia)"},{value:"es-CR",option:"Spanish (Costa Rica)"},{value:"es-EC",option:"Spanish (Ecuador)"},{value:"es-SV",option:"Spanish (El Salvador)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-US",option:"Spanish (United States)"},{value:"es-GT",option:"Spanish (Guatemala)"},{value:"es-HN",option:"Spanish (Honduras)"},{value:"es-MX",option:"Spanish (Mexico)"},{value:"es-NI",option:"Spanish (Nicaragua)"},{value:"es-PA",option:"Spanish (Panama)"},{value:"es-PY",option:"Spanish (Paraguay)"},{value:"es-PE",option:"Spanish (Peru)"},{value:"es-PR",option:"Spanish (Puerto Rico)"},{value:"es-DO",option:"Spanish (Dominican Republic)"},{value:"es-UY",option:"Spanish (Uruguay)"},{value:"es-VE",option:"Spanish (Venezuela)"},{value:"eu-ES",option:"Basque (Spain)"},{value:"fil-PH",option:"Filipino (Philippines)"},{value:"fr-CA",option:"French (Canada)"},{value:"fr-FR",option:"French (France)"},{value:"gl-ES",option:"Galician (Spain)"},{value:"ka-GE",option:"Georgian (Georgia)"},{value:"gu-IN",option:"Gujarati (India)"},{value:"hr-HR",option:"Croatian (Croatia)"},{value:"zu-ZA",option:"Zulu (South Africa)"},{value:"is-IS",option:"Icelandic (Iceland)"},{value:"it-IT",option:"Italian (Italy)"},{value:"jv-ID",option:"Javanese (Indonesia)"},{value:"kn-IN",option:"Kannada (India)"},{value:"km-KH",option:"Khmer (Cambodia)"},{value:"lo-LA",option:"Lao (Laos)"},{value:"lv-LV",option:"Latvian (Latvia)"},{value:"lt-LT",option:"Lithuanian (Lithuania)"},{value:"hu-HU",option:"Hungarian (Hungary)"},{value:"ml-IN",option:"Malayalam (India)"},{value:"mr-IN",option:"Marathi (India)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"ne-NP",option:"Nepali (Nepal)"},{value:"nb-NO",option:"Norwegian Bokmal (Norway)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ro-RO",option:"Romanian (Romania)"},{value:"si-LK",option:"Sinhala (Srilanka)"},{value:"sk-SK",option:"Slovak (Slovakia)"},{value:"sl-SI",option:"Slovenian (Slovenia)"},{value:"su-ID",option:"Sundanese (Indonesia)"},{value:"sw-TZ",option:"Swahili (Tanzania)"},{value:"sw-KE",option:"Swahili (Kenya)"},{value:"fi-FI",option:"Finnish (Finland)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"ta-IN",option:"Tamil (India)"},{value:"ta-SG",option:"Tamil (Singapore)"},{value:"ta-LK",option:"Tamil (Sri Lanka)"},{value:"ta-MY",option:"Tamil (Malaysia)"},{value:"te-IN",option:"Telugu (India)"},{value:"vi-VN",option:"Vietnamese (Vietnam)"},{value:"tr-TR",option:"Turkish (Turkey)"},{value:"ur-PK",option:"Urdu (Pakistan)"},{value:"ur-IN",option:"Urdu (India)"},{value:"el-GR",option:"Greek (Greece)"},{value:"bg-BG",option:"Bulgarian (Bulgaria)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sr-RS",option:"Serbian (Serbia)"},{value:"uk-UA",option:"Ukrainian (Ukraine)"},{value:"he-IL",option:"Hebrew (Israel)"},{value:"ar-IL",option:"Arabic (Israel)"},{value:"ar-JO",option:"Arabic (Jordan)"},{value:"ar-AE",option:"Arabic (United Arab Emirates)"},{value:"ar-BH",option:"Arabic (Bahrain)"},{value:"ar-DZ",option:"Arabic (Algeria)"},{value:"ar-SA",option:"Arabic (Saudi Arabia)"},{value:"ar-IQ",option:"Arabic (Iraq)"},{value:"ar-KW",option:"Arabic (Kuwait)"},{value:"ar-MA",option:"Arabic (Morocco)"},{value:"ar-TN",option:"Arabic (Tunisia)"},{value:"ar-OM",option:"Arabic (Oman)"},{value:"ar-PS",option:"Arabic (State of Palestine)"},{value:"ar-QA",option:"Arabic (Qatar)"},{value:"ar-LB",option:"Arabic (Lebanon)"},{value:"ar-EG",option:"Arabic (Egypt)"},{value:"fa-IR",option:"Persian (Iran)"},{value:"hi-IN",option:"Hindi (India)"},{value:"th-TH",option:"Thai (Thailand)"},{value:"ko-KR",option:"Korean (South Korea)"},{value:"cmn-Hant-TW",option:"Chinese, Mandarin (Traditional, Taiwan)"},{value:"yue-Hant-HK",option:"Chinese, Cantonese (Traditional, Hong Kong)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"cmn-Hans-HK",option:"Chinese, Mandarin (Simplified, Hong Kong)"},{value:"cmn-Hans-CN",option:"Chinese, Mandarin (Simplified, China)"}]}).factory("awsPollyVoice",function(){return[{value:"Amy",option:"Amy (English, British, Female)"},{value:"Astrid",option:"Astrid (Swedish, Female)"},{value:"Brian",option:"Brian (English, British, Male)"},{value:"Carla",option:"Carla (Italian, Female)"},{value:"Carmen",option:"Carmen (Romanian, Female)"},{value:"Celine",option:"Celine (French, Female)"},{value:"Chantal",option:"Chantal (French, Canadian, Female)"},{value:"Conchita",option:"Conchita (Spanish, Castilian, Female)"},{value:"Cristiano",option:"Cristiano (Portuguese, Male)"},{value:"Dora",option:"Dora (Icelandic, Female)"},{value:"Emma",option:"Emma (English, British, Female)"},{value:"Enrique",option:"Enrique (Spanish, Castilian, Male)"},{value:"Ewa",option:"Ewa (Polish, Female)"},{value:"Filiz",option:"Filiz (Turkish, Female)"},{value:"Geraint",option:"Geraint (English, Welsh, Male)"},{value:"Giorgio",option:"Giorgio (Italian, Male)"},{value:"Gwineth",option:"Gwineth (Welsh, Female)"},{value:"Hans",option:"Hans (German, Male)"},{value:"Ines",option:"Ines (Portuguese, Female)"},{value:"Ivy",option:"Ivy (English, US, Female)"},{value:"Jacek",option:"Jacek (Polish, Male)"},{value:"Jan",option:"Jan (Polish, Male)"},{value:"Joanna",option:"Joanna (English, US, Female)"},{value:"Joey",option:"Joey (English, US, Male)"},{value:"Justin",option:"Justin (English, US, Male)"},{value:"Karl",option:"Karl (Icelandic, Male)"},{value:"Kendra",option:"Kendra (English, US, Female)"},{value:"Kimberly",option:"Kimberly (English, US, Female)"},{value:"Liv",option:"Liv (Norwegian, Female)"},{value:"Lotte",option:"Lotte (Dutch, Female)"},{value:"Mads",option:"Mads (Danish, Male)"},{value:"Maja",option:"Maja (Polish, Female)"},{value:"Marlene",option:"Marlene (German, Female)"},{value:"Mathieu",option:"Mathieu (French, Male)"},{value:"Maxim",option:"Maxim (Russian, Male)"},{value:"Miguel",option:"Miguel (Spanish, US, Male)"},{value:"Mizuki",option:"Mizuki (Japanese, Female)"},{value:"Naja",option:"Naja (Danish, Female)"},{value:"Nicole",option:"Nicole (English, Austrialian, Female)"},{value:"Penelope",option:"Penelope (Spanish, US, Female)"},{value:"Raveena",option:"Raveena (English, Indian, Female)"},{value:"Ricardo",option:"Ricardo (Portuguese, Brazilian, Male)"},{value:"Ruben",option:"Ruben (Dutch, Male)"},{value:"Russell",option:"Russell (English, Austrialian, Male)"},{value:"Salli",option:"Salli (English, US, Female)"},{value:"Tatyana",option:"Tatyana (Russian, Female)"},{value:"Vitoria",option:"Vitoria (Portuguese, Brazilian, Female)"}]}).factory("awsPollyRegion",function(){return[{value:"us-east-1",option:"US East (N. Virginia)"},{value:"us-east-2",option:"US East (Ohio)"},{value:"us-west-1",option:"US West (N. California)"},{value:"us-west-2",option:"US West (Oregon)"},{value:"ca-central-1",option:"Canada (Central)"},{value:"eu-west-1",option:"EU (Ireland)"},{value:"eu-central-1",option:"EU (Frankfurt)"},{value:"eu-west-2",option:"EU (London)"},{value:"eu-west-3",option:"EU (Paris)"},{value:"ap-southeast-1",option:"Asia Pacific (Singapore)"},{value:"ap-southeast-2",option:"Asia Pacific (Sydney)"},{value:"ap-northeast-2",option:"Asia Pacific (Seoul)"},{value:"ap-northeast-1",option:"Asia Pacific (Tokyo)"},{value:"ap-south-1",option:"Asia Pacific (Mumbai)"},{value:"sa-east-1",option:"South America (São Paulo)"}]})}(),function(){"use strict";function e(t,e,n,a){var i=this;i.project={preproduction:n},i.closeDialog=function(e){e?(a(i.project.preproduction),t.hide(i.project.preproduction)):t.hide()}}e.$inject=["$mdDialog","toasty","currentXML","saveCallback"],angular.module("app.callysquare").controller("MxGraphEditXMLController",e)}(),function(){"use strict";function e(t,n){var a=this;function i(e){e?(n(e),t.hide(e)):t.hide()}a.errors=[],a.ngFlowOptions={chunkSize:5242880,maxChunkRetries:1,singleFile:!0,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},a.ngFlow={flow:{}},a.dropping=!1,a.closeDialog=i,a.fileAdded=function(e){a.errors=[],"text/xml"!==e.file.type&&a.errors.push({message:"The format "+e.file.type+" is not supported!"});5242880<e.file.size&&a.errors.push({message:"The file is too big. Max 5MB files are supported!"});if(!a.errors.length){var t=new FileReader;t.onload=function(e){i(e.target.result)},t.readAsText(e.file)}}}e.$inject=["$mdDialog","saveCallback"],angular.module("app.callysquare").controller("MxGraphImportXMLController",e)}(),function(){"use strict";function e(t,n,e,a){var i=this;i.project=_.clone(e),i.closeDialog=function(){t.hide()},i.save=function(){i.errors=[],a.squareProject.update({id:i.project.id},{notes:i.project.notes,description:i.project.description}).$promise.then(function(e){n.success({title:"Project updated!",msg:i.project.name?i.project.name+" has been updated!":""}),t.hide(e)}).catch(function(e){console.error(e),i.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}]})}}e.$inject=["$mdDialog","toasty","project","api"],angular.module("app.callysquare").controller("MxGraphUpdateInfoController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;o.projects=n,o.id="",o.newWindow=!0,o.closeDialog=function(e){o.errors=[],e?(t.hide(),o.newWindow?a.open("/callysquare/projects/"+o.id,"_blank"):i.go("app.callysquare.projects.edit",{id:o.id})):t.hide()}}e.$inject=["$mdDialog","toasty","projects","$window","$state"],angular.module("app.callysquare").controller("MxGraphOpenProjectController",e)}(),function(){"use strict";function e(t,n,e,a,i,o,s){var r=this;r.project=angular.copy(e),r.project.name+="_new",r.project.preproduction=a,r.newWindow=!0,r.closeDialog=function(){t.hide()},r.save=function(){delete r.project.id,i.squareProject.save(r.project).$promise.then(function(e){n.success({title:"Project properly created",msg:r.project.name?r.project.name+" has been created!":""}),t.hide(e),r.newWindow?o.open("/callysquare/projects/"+e.id,"_blank"):s.go("app.callysquare.projects.edit",{id:e.id})}).catch(function(e){console.error(e),r.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}]})}}e.$inject=["$mdDialog","toasty","project","currentXML","api","$window","$state"],angular.module("app.callysquare").controller("MxGraphSaveProjectAsController",e)}(),function(){"use strict";function e(e,n,a,i,o,t,s,r,l,d,c,m,u,p,g,v,h,b,f,A,E){var y=this;y.project=t||{},y.saveOrPublishProject=function(e,t){var n={preproduction:e};t&&(n.production=e);o.squareProject.update({id:y.project.id},n).$promise.then(function(e){i.success({title:"Project "+(t?"published":"saved")+"!",msg:y.project.name?y.project.name+" has been "+(t?"published":"saved")+"!":""}),y.project.preproduction=e.preproduction}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsquareProject",msg:e.data?JSON.stringify(e.data):e.toString()})})},y.$onInit=function(){new EditorUi(y,new Editor,document.getElementById("geEditor")).openString(y.project.preproduction,y.project.name,y.project)},y.openDialog=function(e,t){a.show({controller:"MxGraphDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{users:s.rows||[],trunks:r.rows||[],queues:l.rows||[],sounds:d.rows||[],variables:c.rows||[],databases:m.rows||[],contexts:u.rows||[],projects:p.rows||[],intervals:g.rows||[],mailAccounts:v.rows||[],smsAccounts:f.rows||[],pauses:A.rows||[],templates:h.rows||[],lists:b.rows||[],cell:e,saveCallback:t}})},y.newProject=function(e){a.show({controller:"CreateOrEditProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{project:e,projects:p.rows,openFromEditor:!0,setting:null}})},y.openProject=function(){a.show({controller:"MxGraphOpenProjectController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/open/open.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{projects:p.rows||[]}})},y.saveProjectAs=function(e){a.show({controller:"MxGraphSaveProjectAsController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{project:y.project,currentXML:e}}).then(function(e){e&&p.rows.push(e)})},y.newVariable=function(e){a.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{variable:e,variables:c.rows,license:null,setting:null}})},y.updateInfo=function(e){a.show({controller:"MxGraphUpdateInfoController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/info/info.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:y.project}}).then(function(e){e&&_.merge(y.project,e)})},y.editXML=function(e,t){a.show({controller:"MxGraphEditXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/edit/edit.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{currentXML:e,saveCallback:t}}).then(function(e){e&&(y.project.preproduction=e)})},y.importXML=function(e){a.show({controller:"MxGraphImportXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/import/import.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{saveCallback:e}}).then(function(e){e&&(y.project.preproduction=e)})},y.gotoProjects=function(){e.go("app.callysquare.projects")}}e.$inject=["$state","$document","$mdDialog","toasty","api","project","users","trunks","queues","sounds","variables","databases","contexts","projects","intervals","mailAccounts","templates","lists","smsAccounts","pauses","$window"],angular.module("app.callysquare").controller("ProjectController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d,c){var m=this;m.currentUser=c.getCurrentUser(),m.projects=a||{count:0,rows:[]},m.table="projects",m.listOrder="",m.listOrderAsc=null,m.selectedProjects=[],m.query={fields:"id,name,description,notes",sort:"-updatedAt",limit:10,page:1},m.editstate=function(e,t){n.go("app.callysquare.projects.edit",{id:e.id})},m.deleteconfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the project?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete project").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){v(e)},function(){console.log("CANCEL")})},m.success=g,m.getProjects=function(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=i.squareProject.get(m.query,g).$promise},m.createOrEditProject=function(e,t){s.show({controller:"CreateOrEditSquareProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:t,projects:m.projects.rows,openFromEditor:null,setting:null}})},m.deleteProject=v,m.exportSelectedProjects=function(){var e=angular.copy(m.selectedProjects);return m.selectedProjects=[],e},m.deleteSelectedProjects=function(e){var t=s.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+m.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){m.selectedProjects.forEach(function(e){v(e)}),m.selectedProjects=[]})},m.deselectProjects=function(){m.selectedProjects=[]},m.selectAllProjects=function(){m.selectedProjects=m.projects.rows};var u=!0,p=1;function g(e){m.projects=e||{count:0,rows:[]}}function v(e){i.squareProject.delete({id:e.id}).$promise.then(function(){_.remove(m.projects.rows,{id:e.id}),m.projects.count-=1,m.projects.rows.length||m.getProjects(),d.success({title:"Project deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.project.delete"}];for(var t=0;t<e.data.errors.length;t++)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.project.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){u?l(function(){u=!1}):(t||(p=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=p),m.getProjects())})}e.$inject=["$scope","$state","$mdSidenav","projects","api","msUtils","$mdDialog","$document","$timeout","toasty","Auth"],angular.module("app.callysquare").controller("ProjectsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CALLYSQUARE.EDIT_SQUARERECORDING",m.squareRecording=angular.copy(s),m.squareRecordings=o,m.newSquareRecording=!1,m.squareRecording||(m.squareRecording={},m.title="CALLYSQUARE.NEW_SQUARERECORDING",m.newSquareRecording=!0),m.addNewSquareRecording=function(){m.errors=[],r.squareRecording.save(m.squareRecording).$promise.then(function(e){m.squareRecordings.unshift(e.toJSON()),i.success({title:"SquareRecording properly created",msg:m.squareRecording.name?m.squareRecording.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSquareRecording=function(){m.errors=[],r.squareRecording.update({id:m.squareRecording.id},m.squareRecording).$promise.then(function(e){var t=_.find(m.squareRecordings,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SquareRecording properly saved!",msg:m.squareRecording.name?m.squareRecording.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSquareRecording=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The squareRecording will be deleted.").ariaLabel("Delete SquareRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.squareRecording.delete({id:m.squareRecording.id}).$promise.then(function(){_.remove(m.squareRecordings,{id:m.squareRecording.id}),i.success({title:"SquareRecording properly deleted!",msg:(m.squareRecording.name||"squareRecording")+" has been deleted!"}),u(m.squareRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","squareRecordings","squareRecording","api","Auth","license","setting"],angular.module("app.callysquare").controller("CreateOrEditSquareRecordingDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.squareRecordings=r||{count:0,rows:[]},v.table="squareRecordings",v.listOrder="",v.listOrderAsc=null,v.selectedSquareRecordings=[],v.query={fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,createdAt",sort:"-updatedAt",limit:10,page:1},v.downloadfile2=function(o,e){return l.squareRecording.download({id:o.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=o.uniqueid+".wav";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the squareRecording?").htmlContent("<b>"+(e.name||"squareRecording")+"</b> will be deleted.").ariaLabel("delete squareRecording").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getSquareRecordings=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.squareRecording.get(v.query,f).$promise},v.createOrEditSquareRecording=function(e,t){i.show({controller:"CreateOrEditSquareRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/squareRecordings/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{squareRecording:t,squareRecordings:v.squareRecordings.rows,license:v.license,setting:v.setting}})},v.deleteSquareRecording=A,v.exportSelectedSquareRecordings=function(){var e=angular.copy(v.selectedSquareRecordings);return v.selectedSquareRecordings=[],e},v.deleteSelectedSquareRecordings=function(e){var t=i.confirm().title("Are you sure want to delete the selected squareRecordings?").htmlContent("<b>"+v.selectedSquareRecordings.length+" selected</b> will be deleted.").ariaLabel("delete SquareRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedSquareRecordings.forEach(function(e){A(e)}),v.selectedSquareRecordings=[]})},v.deselectSquareRecordings=function(){v.selectedSquareRecordings=[]},v.selectAllSquareRecordings=function(){v.selectedSquareRecordings=v.squareRecordings.rows};var h=!0,b=1;function f(e){v.squareRecordings=e||{count:0,rows:[]}}function A(e){l.squareRecording.delete({id:e.id}).$promise.then(function(){_.remove(v.squareRecordings.rows,{id:e.id}),v.squareRecordings.count-=1,v.squareRecordings.rows.length||v.getSquareRecordings(),c.success({title:"SquareRecording deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareRecording"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getSquareRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","squareRecordings","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.callysquare").controller("SquareRecordingsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.chatQueues=r||{count:0,rows:[]},v.table="chatQueues",v.listOrder="",v.listOrderAsc=null,v.selectedChatQueues=[],v.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,page:1},v.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.chat.chatQueues.edit",{id:e.id,chatQueue:e})},v.teamadddialog=function(e,t){i.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:v.chatQueues?v.chatQueues.rows:[]}})},v.agentadddialog=function(e,t){i.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:v.chatQueues?v.chatQueues.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the chatQueue?").htmlContent("<b>"+(e.name||"chatQueue")+"</b> will be deleted.").ariaLabel("delete chatQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.chat.realtime.queues",{})},v.success=f,v.getChatQueues=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.chatQueue.get(v.query,f).$promise},v.createOrEditChatQueue=function(e,t){i.show({controller:"CreateOrEditChatQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:t,chatQueues:v.chatQueues.rows,license:v.license,setting:v.setting}})},v.deleteChatQueue=A,v.exportSelectedChatQueues=function(){var e=angular.copy(v.selectedChatQueues);return v.selectedChatQueues=[],e},v.deleteSelectedChatQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected chatQueues?").htmlContent("<b>"+v.selectedChatQueues.length+" selected</b> will be deleted.").ariaLabel("delete ChatQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedChatQueues.forEach(function(e){A(e)}),v.selectedChatQueues=[]})},v.deselectChatQueues=function(){v.selectedChatQueues=[]},v.selectAllChatQueues=function(){v.selectedChatQueues=v.chatQueues.rows};var h=!0,b=1;function f(e){v.chatQueues=e||{count:0,rows:[]}}function A(e){l.chatQueue.delete({id:e.id}).$promise.then(function(){_.remove(v.chatQueues.rows,{id:e.id}),v.chatQueues.count-=1,v.chatQueues.rows.length||v.getChatQueues(),c.success({title:"ChatQueue deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatQueue"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getChatQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","chatQueues","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.chat").controller("ChatQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CHAT.EDIT_CHATQUEUE",m.chatQueue=angular.copy(s),m.chatQueues=o,m.newChatQueue=!1,m.chatQueue||(m.chatQueue={strategy:"beepall",timeout:10},m.title="CHAT.NEW_CHATQUEUE",m.newChatQueue=!0),m.addNewChatQueue=function(){m.errors=[],r.chatQueue.save(m.chatQueue).$promise.then(function(e){m.chatQueues.unshift(e.toJSON()),i.success({title:"ChatQueue properly created",msg:m.chatQueue.name?m.chatQueue.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveChatQueue=function(){m.errors=[],r.chatQueue.update({id:m.chatQueue.id},m.chatQueue).$promise.then(function(e){var t=_.find(m.chatQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ChatQueue properly saved!",msg:m.chatQueue.name?m.chatQueue.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteChatQueue=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The chatQueue will be deleted.").ariaLabel("Delete ChatQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.chatQueue.delete({id:m.chatQueue.id}).$promise.then(function(){_.remove(m.chatQueues,{id:m.chatQueue.id}),i.success({title:"ChatQueue properly deleted!",msg:(m.chatQueue.name||"chatQueue")+" has been deleted!"}),u(m.chatQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","chatQueues","chatQueue","api","Auth","license","setting"],angular.module("app.chat").controller("CreateOrEditChatQueueDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.chatQueue[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.chatQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserChatQueue?"penalty "+e.UserChatQueue.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserChatQueue?"penalty "+e.UserChatQueue.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.chatQueue=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("CHAT.ALL_AGENTS"),labelSelected:s.instant("CHAT.SELECTED_AGENTS"),transferCallback:function(e,t){a.chatQueue[t?"removeAgents":"addAgents"]({id:l.chatQueue.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"ChatQueue properly "+(t?"removed":"added"),msg:"ChatQueue has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:chatQueue.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","chatQueue","chatQueues","realtime","$translate","Auth"],angular.module("app.chat").controller("ChatQueueagentaddController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.chatQueue=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("CHAT.ALL_TEAMS"),labelSelected:i.instant("CHAT.SELECTED_TEAMS"),transferCallback:function(e,t){a.chatQueue[t?"removeTeams":"addTeams"]({id:o.chatQueue.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:chatQueue.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.chatQueue.getTeams({id:o.chatQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","chatQueue","$translate"],angular.module("app.chat").controller("ChatQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.chatQueue=d||e.params.chatQueue||{},c.selectedTab=e.params.tab||0,c.teamadddialog=function(e,t){n.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:c.chatQueues?c.chatQueues.rows:[]}})},c.agentadddialog=function(e,t){n.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:c.chatQueues?c.chatQueues.rows:[],realtime:!1}})},c.alert=r.info,c.gotoChatQueues=function(){e.go("app.chat.chatQueues")},c.saveChatQueue=function(){s.chatQueue.update({id:c.chatQueue.id},c.chatQueue).$promise.then(function(){r.success({title:"ChatQueue updated!",msg:c.chatQueue.name?c.chatQueue.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","chatQueue"],angular.module("app.chat").controller("ChatQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.chatWebsites=r||{count:0,rows:[]},v.table="chatWebsites",v.listOrder="",v.listOrderAsc=null,v.selectedChatWebsites=[],v.query={fields:"createdAt,updatedAt,id,token,agentIdentifier,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,fontSize,header_shape,showAgentAvatar,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,header_offline,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardTranscript,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,page:1},v.arrayagentIdentifier=_.keyBy([{option:"WebsiteAlias",value:"'website_alias'"},{option:"AgentAlias",value:"'agent_alias'"},{option:"AgentFullname",value:"'agent_fullname'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayheader_shape=_.keyBy([{option:"Rounded",value:"'rounded'"},{option:"Squared",value:"'squared'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayratingType=_.keyBy([{option:"Star",value:"'star'"},{option:"Thumb",value:"'thumb'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayacceptMethod=_.keyBy([{option:"HTTP GET",value:"'GET'"},{option:"HTTP POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayrejectMethod=_.keyBy([{option:"HTTP GET",value:"'GET'"},{option:"HTTP POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraycloseMethod=_.keyBy([{option:"HTTP GET",value:"'GET'"},{option:"HTTP POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.chat.chatWebsites.edit",{id:e.id,chatWebsite:e})},v.interactionsgoto=function(e,t){n.go("app.chat.chatWebsites.edit",{id:e.id,tab:9})},v.offlinemessagesgoto=function(e,t){n.go("app.chat.chatWebsites.edit",{id:e.id,tab:10})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the chatWebsite?").htmlContent("<b>"+(e.name||"chatWebsite")+"</b> will be deleted.").ariaLabel("delete chatWebsite").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getChatWebsites=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.chatWebsite.get(v.query,f).$promise},v.createOrEditChatWebsite=function(e,t){i.show({controller:"CreateOrEditChatWebsiteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:t,chatWebsites:v.chatWebsites.rows,license:v.license,setting:v.setting}})},v.deleteChatWebsite=A,v.exportSelectedChatWebsites=function(){var e=angular.copy(v.selectedChatWebsites);return v.selectedChatWebsites=[],e},v.deleteSelectedChatWebsites=function(e){var t=i.confirm().title("Are you sure want to delete the selected chatWebsites?").htmlContent("<b>"+v.selectedChatWebsites.length+" selected</b> will be deleted.").ariaLabel("delete ChatWebsites").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedChatWebsites.forEach(function(e){A(e)}),v.selectedChatWebsites=[]})},v.deselectChatWebsites=function(){v.selectedChatWebsites=[]},v.selectAllChatWebsites=function(){v.selectedChatWebsites=v.chatWebsites.rows},l.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.lists=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){v.interval=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.chatWebsites=e||{count:0,rows:[]}}function A(e){l.chatWebsite.delete({id:e.id}).$promise.then(function(){_.remove(v.chatWebsites.rows,{id:e.id}),v.chatWebsites.count-=1,v.chatWebsites.rows.length||v.getChatWebsites(),c.success({title:"ChatWebsite deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getChatWebsites())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","chatWebsites","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.chat").controller("ChatWebsitesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CHAT.EDIT_CHATWEBSITE",m.chatWebsite=angular.copy(s),m.chatWebsites=o,m.newChatWebsite=!1,m.chatWebsite||(m.chatWebsite={remote:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():""),header_shape:"rounded",IntervalId:"null",timezone:"null",waitForTheAssignedAgent:10,notificationSound:!0},m.title="CHAT.NEW_CHATWEBSITE",m.newChatWebsite=!0),t.params.id&&(m.chatWebsite.ChatWebsiteId=t.params.id),m.addNewChatWebsite=function(){m.errors=[],r.chatWebsite.save(m.chatWebsite).$promise.then(function(e){m.chatWebsites.unshift(e.toJSON()),i.success({title:"ChatWebsite properly created",msg:m.chatWebsite.name?m.chatWebsite.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveChatWebsite=function(){m.errors=[],r.chatWebsite.update({id:m.chatWebsite.id},m.chatWebsite).$promise.then(function(e){var t=_.find(m.chatWebsites,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ChatWebsite properly saved!",msg:m.chatWebsite.name?m.chatWebsite.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteChatWebsite=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The chatWebsite will be deleted.").ariaLabel("Delete ChatWebsite").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.chatWebsite.delete({id:m.chatWebsite.id}).$promise.then(function(){_.remove(m.chatWebsites,{id:m.chatWebsite.id}),i.success({title:"ChatWebsite properly deleted!",msg:(m.chatWebsite.name||"chatWebsite")+" has been deleted!"}),u(m.chatWebsite)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){m.interval=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","chatWebsites","chatWebsite","api","Auth","license","setting"],angular.module("app.chat").controller("CreateOrEditChatWebsiteDialogController",e)}(),function(){"use strict";function e(s,i,a,o,e){var r=this;function t(e,t){if(r.chatWebsiteApps.rows.length){var n=r.chatWebsiteApps.rows[t]?r.chatWebsiteApps.rows[t]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsiteApp:n,chatWebsite:r.chatWebsite}}).then(function(e){e&&(e.id?r.chatWebsiteApps.rows[t]=e:r.chatWebsiteApps.rows.splice(t,0,e),l())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.chatWebsiteApps.rows.length;n++,0){var a=r.chatWebsiteApps.rows[n],i=[],o=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.chatWebsite.context,a.exten=r.chatWebsite.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(o.length?_.last(o).priority:a.priority)+1,t=_.concat(t,i,[a],o)}s.chatWebsite.addApplications({id:r.chatWebsite.id},_.sortBy(t,"priority")).$promise.then(function(e){r.chatWebsiteApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.chatWebsiteApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.chatWebsite={},r.chatWebsiteApps={count:0,rows:[]},r.selectedChatWebsiteApps=[],r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"ChatQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",route:"chatQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",route:"user",filters:{fields:"id,name",role:"agent",sort:"name",nolimit:!0}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",maxlength:255,required:!0,param:1}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e){r.chatWebsite=e,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getChatWebsiteApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.chatWebsiteApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getChatWebsiteApps=function(){r.promise=s.chatWebsite.getApplications(r.query,n).$promise},r.editChatWebsiteApp=t,r.editInterval=function(e,t){if(r.chatWebsiteApps.rows.length){var n=r.chatWebsiteApps.rows[t]?r.chatWebsiteApps.rows[t]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteChatWebsiteApp=function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id}),l(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedChatWebsiteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedChatWebsiteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedChatWebsiteApps.forEach(function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id})}),r.selectedChatWebsiteApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return s.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.chat").controller("ChatWebsiteActionsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size for image files is 8 Mb"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.chatWebsite=angular.copy(e),i.ngFlowOptions.target="/api/chat/websites/:id/avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsiteagentAvatarController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(e.appType||e.app).toUpperCase(),o.agent=angular.copy(e),o.agent.appdata)switch(o.agent.appType?o.agent.appType.toLowerCase():o.agent.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.agent.appdata.split(",");o.agent.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.agent.text=s.slice(1,s.length).join(",");break;case"message":o.agent.text=o.agent.appdata;break;case"set":o.agent.name=o.agent.appdata.split("=")[0],o.agent.value=o.agent.appdata.split("=")[1];break;case"agi":o.agent.project=o.agent.appdata;break;default:var r=o.agent.appdata.split(",");o.agent.agent=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.agent.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.agent.timeout=30;function l(e){t.hide(e)}o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outbounddial"===o.agent.appType.toLowerCase()&&(o.agent.prefix=o.agent.phone?o.agent.phone.split("$")[0]:void 0,o.agent.callerId=o.agent.callerID?"CALLERID(all)="+o.agent.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outboundDial"===o.agent.appType&&(o.agent.phone=a.cutdigits?(o.agent.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.agent.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.agent.options+="U(xcally-mixmonitor-context)"):o.agent.options=o.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.agents,{name:o.agent.agent});t&&(o.agent.UserId=t.id);if(o.agent.appType&&"custom"===o.agent.appType);else switch((o.agent.app||o.agent.appType).toLowerCase()){case"set":o.agent.appdata=o.agent.name+"="+o.agent.value;break;case"custom":break;default:e[0]=o.agent.agent,e[1]=o.agent.timeout,o.agent.appdata=e.join(",")}l(o.agent)},o.closeDialog=l,i.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){o.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(n.appType||n.app).toUpperCase(),o.autoreply=angular.copy(n),o.autoreply.appdata)switch(o.autoreply.appType?o.autoreply.appType.toLowerCase():o.autoreply.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.autoreply.appdata.split(",");o.autoreply.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.autoreply.text=s.slice(1,s.length).join(",");break;case"message":o.autoreply.text=o.autoreply.appdata;break;case"set":o.autoreply.name=o.autoreply.appdata.split("=")[0],o.autoreply.value=o.autoreply.appdata.split("=")[1];break;case"agi":o.autoreply.project=o.autoreply.appdata;break;default:var r=o.autoreply.appdata.split(",");o.autoreply.times=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.autoreply.text=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.autoreply.times=1;function l(e){t.hide(e)}o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outbounddial"===o.autoreply.appType.toLowerCase()&&(o.autoreply.prefix=o.autoreply.phone?o.autoreply.phone.split("$")[0]:void 0,o.autoreply.callerId=o.autoreply.callerID?"CALLERID(all)="+o.autoreply.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outboundDial"===o.autoreply.appType&&(o.autoreply.phone=a.cutdigits?(o.autoreply.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.autoreply.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.autoreply.options+="U(xcally-mixmonitor-context)"):o.autoreply.options=o.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(o.autoreply.appType&&"custom"===o.autoreply.appType);else switch((o.autoreply.app||o.autoreply.appType).toLowerCase()){case"set":o.autoreply.appdata=o.autoreply.name+"="+o.autoreply.value;break;case"custom":break;default:e[0]=o.autoreply.times,e[1]=o.autoreply.text,o.autoreply.appdata=e.join(",")}l(o.autoreply)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(n.appType||n.app).toUpperCase(),o.close=angular.copy(n),o.close.appdata)switch(o.close.appType?o.close.appType.toLowerCase():o.close.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.close.appdata.split(",");o.close.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.close.text=s.slice(1,s.length).join(",");break;case"message":o.close.text=o.close.appdata;break;case"set":o.close.name=o.close.appdata.split("=")[0],o.close.value=o.close.appdata.split("=")[1];break;case"agi":o.close.project=o.close.appdata;break;default:var r=o.close.appdata.split(",");o.close.disposition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outbounddial"===o.close.appType.toLowerCase()&&(o.close.prefix=o.close.phone?o.close.phone.split("$")[0]:void 0,o.close.callerId=o.close.callerID?"CALLERID(all)="+o.close.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outboundDial"===o.close.appType&&(o.close.phone=a.cutdigits?(o.close.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.close.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.close.options+="U(xcally-mixmonitor-context)"):o.close.options=o.close.options.replace("U(xcally-mixmonitor-context)",""));if(o.close.appType&&"custom"===o.close.appType);else switch((o.close.app||o.close.appType).toLowerCase()){case"set":o.close.appdata=o.close.name+"="+o.close.value;break;case"custom":break;default:e[0]=o.close.disposition,o.close.appdata=e.join(",")}l(o.close)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotoif=angular.copy(n),o.gotoif.appdata)switch(o.gotoif.appType?o.gotoif.appType.toLowerCase():o.gotoif.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotoif.appdata.split(",");o.gotoif.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotoif.text=s.slice(1,s.length).join(",");break;case"message":o.gotoif.text=o.gotoif.appdata;break;case"set":o.gotoif.name=o.gotoif.appdata.split("=")[0],o.gotoif.value=o.gotoif.appdata.split("=")[1];break;case"agi":o.gotoif.project=o.gotoif.appdata;break;default:var r=o.gotoif.appdata.split(",");o.gotoif.condition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.gotoif.truepriority=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.gotoif.falsepriority=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10)}function l(e){t.hide(e)}o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outbounddial"===o.gotoif.appType.toLowerCase()&&(o.gotoif.prefix=o.gotoif.phone?o.gotoif.phone.split("$")[0]:void 0,o.gotoif.callerId=o.gotoif.callerID?"CALLERID(all)="+o.gotoif.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outboundDial"===o.gotoif.appType&&(o.gotoif.phone=a.cutdigits?(o.gotoif.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotoif.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotoif.options+="U(xcally-mixmonitor-context)"):o.gotoif.options=o.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotoif.appType&&"custom"===o.gotoif.appType);else switch((o.gotoif.app||o.gotoif.appType).toLowerCase()){case"set":o.gotoif.appdata=o.gotoif.name+"="+o.gotoif.value;break;case"custom":break;default:e[0]=o.gotoif.condition,e[1]=o.gotoif.truepriority,e[2]=o.gotoif.falsepriority,o.gotoif.appdata=e.join(",")}l(o.gotoif)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotop=angular.copy(n),o.gotop.appdata)switch(o.gotop.appType?o.gotop.appType.toLowerCase():o.gotop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotop.appdata.split(",");o.gotop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotop.text=s.slice(1,s.length).join(",");break;case"message":o.gotop.text=o.gotop.appdata;break;case"set":o.gotop.name=o.gotop.appdata.split("=")[0],o.gotop.value=o.gotop.appdata.split("=")[1];break;case"agi":o.gotop.project=o.gotop.appdata;break;default:var r=o.gotop.appdata.split(",");o.gotop.priority=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outbounddial"===o.gotop.appType.toLowerCase()&&(o.gotop.prefix=o.gotop.phone?o.gotop.phone.split("$")[0]:void 0,o.gotop.callerId=o.gotop.callerID?"CALLERID(all)="+o.gotop.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outboundDial"===o.gotop.appType&&(o.gotop.phone=a.cutdigits?(o.gotop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotop.options+="U(xcally-mixmonitor-context)"):o.gotop.options=o.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotop.appType&&"custom"===o.gotop.appType);else switch((o.gotop.app||o.gotop.appType).toLowerCase()){case"set":o.gotop.appdata=o.gotop.name+"="+o.gotop.value;break;case"custom":break;default:e[0]=o.gotop.priority,o.gotop.appdata=e.join(",")}l(o.gotop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditChatWebsiteAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(n.appType||n.app).toUpperCase(),o.noop=angular.copy(n),o.noop.appdata)switch(o.noop.appType?o.noop.appType.toLowerCase():o.noop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.noop.appdata.split(",");o.noop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.noop.text=s.slice(1,s.length).join(",");break;case"message":o.noop.text=o.noop.appdata;break;case"set":o.noop.name=o.noop.appdata.split("=")[0],o.noop.value=o.noop.appdata.split("=")[1];break;case"agi":o.noop.project=o.noop.appdata;break;default:var r=o.noop.appdata.split(",");o.noop.value=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outbounddial"===o.noop.appType.toLowerCase()&&(o.noop.prefix=o.noop.phone?o.noop.phone.split("$")[0]:void 0,o.noop.callerId=o.noop.callerID?"CALLERID(all)="+o.noop.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outboundDial"===o.noop.appType&&(o.noop.phone=a.cutdigits?(o.noop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.noop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.noop.options+="U(xcally-mixmonitor-context)"):o.noop.options=o.noop.options.replace("U(xcally-mixmonitor-context)",""));if(o.noop.appType&&"custom"===o.noop.appType);else switch((o.noop.app||o.noop.appType).toLowerCase()){case"set":o.noop.appdata=o.noop.name+"="+o.noop.value;break;case"custom":break;default:e[0]=o.noop.value,o.noop.appdata=e.join(",")}l(o.noop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppnoopDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(e.appType||e.app).toUpperCase(),o.queue=angular.copy(e),o.queue.appdata)switch(o.queue.appType?o.queue.appType.toLowerCase():o.queue.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.queue.appdata.split(",");o.queue.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.queue.text=s.slice(1,s.length).join(",");break;case"message":o.queue.text=o.queue.appdata;break;case"set":o.queue.name=o.queue.appdata.split("=")[0],o.queue.value=o.queue.appdata.split("=")[1];break;case"agi":o.queue.project=o.queue.appdata;break;default:var r=o.queue.appdata.split(",");o.queue.queue=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.queue.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.queue.queue=300,o.queue.timeout=300;function l(e){t.hide(e)}o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outbounddial"===o.queue.appType.toLowerCase()&&(o.queue.prefix=o.queue.phone?o.queue.phone.split("$")[0]:void 0,o.queue.callerId=o.queue.callerID?"CALLERID(all)="+o.queue.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outboundDial"===o.queue.appType&&(o.queue.phone=a.cutdigits?(o.queue.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.queue.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.queue.options+="U(xcally-mixmonitor-context)"):o.queue.options=o.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.queues,{name:o.queue.queue});t&&(o.queue[_.capitalize("chat")+"QueueId"]=t.id);if(o.queue.appType&&"custom"===o.queue.appType);else switch((o.queue.app||o.queue.appType).toLowerCase()){case"set":o.queue.appdata=o.queue.name+"="+o.queue.value;break;case"custom":break;default:e[0]=o.queue.queue,e[1]=o.queue.timeout,o.queue.appdata=e.join(",")}l(o.queue)},o.closeDialog=l,i.chatQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){o.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppqueueDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="CHAT.EDIT_"+(e.appType||e.app).toUpperCase(),o.system=angular.copy(e),o.system.appdata)switch(o.system.appType?o.system.appType.toLowerCase():o.system.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.system.appdata.split(",");o.system.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.system.text=s.slice(1,s.length).join(",");break;case"message":o.system.text=o.system.appdata;break;case"set":o.system.name=o.system.appdata.split("=")[0],o.system.value=o.system.appdata.split("=")[1];break;case"agi":o.system.project=o.system.appdata;break;default:var r=o.system.appdata.split(",");o.system.command=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.system.variable=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.system.variable="";function l(e){t.hide(e)}o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outbounddial"===o.system.appType.toLowerCase()&&(o.system.prefix=o.system.phone?o.system.phone.split("$")[0]:void 0,o.system.callerId=o.system.callerID?"CALLERID(all)="+o.system.callerID:void 0),o.saveChatWebsiteApp=function(){o.errors=[];var e=[];o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outboundDial"===o.system.appType&&(o.system.phone=a.cutdigits?(o.system.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.system.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.system.options+="U(xcally-mixmonitor-context)"):o.system.options=o.system.options.replace("U(xcally-mixmonitor-context)",""));if(o.system.appType&&"custom"===o.system.appType);else switch((o.system.app||o.system.appType).toLowerCase()){case"set":o.system.appdata=o.system.name+"="+o.system.value;break;case"custom":break;default:e[0]=o.system.command,e[1]=o.system.variable,o.system.appdata=e.join(",")}l(o.system)},o.closeDialog=l,i.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){o.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","chatWebsiteApp","chatWebsite","api"],angular.module("app.chat").controller("EditChatWebsiteAppsystemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteChatCannedAnswers={count:0,rows:[]},c.selectedChatWebsiteChatCannedAnswers=[],c.query={fields:"createdAt,updatedAt,id,key,value,description,createdAt",limit:10,page:1},c.init=function(e){c.chatWebsite=e,c.query.id=c.chatWebsite.id,c.query.ChatWebsiteId=c.chatWebsite.id,c.getChatWebsiteChatCannedAnswers()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the chatCannedAnswer?").htmlContent("<b>"+(e.name||"chatCannedAnswer")+"</b> will be deleted.").ariaLabel("delete chatCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteChatCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getAnswers(c.query,p).$promise},c.createOrEditChatWebsiteChatCannedAnswer=function(e,t){o.show({controller:"CreateOrEditChatCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,chatCannedAnswer:t,chatCannedAnswers:c.chatWebsiteChatCannedAnswers.rows,license:null,setting:null}})},c.exportSelectedChatWebsiteChatCannedAnswers=function(){var e=angular.copy(c.selectedChatWebsiteChatCannedAnswers);return c.selectedChatWebsiteChatCannedAnswers=[],e},c.deleteChatWebsiteChatCannedAnswer=g,c.deleteSelectedChatWebsiteChatCannedAnswers=function(e){var t=o.confirm().title("Are you sure want to delete the selected chatCannedAnswers?").htmlContent("<b>"+c.selectedChatWebsiteChatCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete chatCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedChatWebsiteChatCannedAnswers.forEach(function(e){g(e)}),c.selectedChatWebsiteChatCannedAnswers=[]})};var m=!0,u=1;function p(e){c.chatWebsiteChatCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteChatCannedAnswers.rows,{id:e.id}),c.chatWebsiteChatCannedAnswers.count-=1,c.chatWebsiteChatCannedAnswers.rows.length||c.getChatWebsiteChatCannedAnswers(),r.success({title:"ChatCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteChatCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteChatCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CHAT.EDIT_CHATCANNEDANSWER",m.chatCannedAnswer=angular.copy(s),m.chatCannedAnswers=o,m.newChatCannedAnswer=!1,m.chatCannedAnswer||(m.chatCannedAnswer={},m.title="CHAT.NEW_CHATCANNEDANSWER",m.newChatCannedAnswer=!0),t.params.id&&(m.chatCannedAnswer.ChatWebsiteId=t.params.id),m.addNewChatCannedAnswer=function(){m.errors=[],r.cannedAnswer.save(m.chatCannedAnswer).$promise.then(function(e){m.chatCannedAnswers.unshift(e.toJSON()),i.success({title:"ChatCannedAnswer properly created",msg:m.chatCannedAnswer.name?m.chatCannedAnswer.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveChatCannedAnswer=function(){m.errors=[],r.cannedAnswer.update({id:m.chatCannedAnswer.id},m.chatCannedAnswer).$promise.then(function(e){var t=_.find(m.chatCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ChatCannedAnswer properly saved!",msg:m.chatCannedAnswer.name?m.chatCannedAnswer.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteChatCannedAnswer=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The chatCannedAnswer will be deleted.").ariaLabel("Delete ChatCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cannedAnswer.delete({id:m.chatCannedAnswer.id}).$promise.then(function(){_.remove(m.chatCannedAnswers,{id:m.chatCannedAnswer.id}),i.success({title:"ChatCannedAnswer properly deleted!",msg:(m.chatCannedAnswer.name||"chatCannedAnswer")+" has been deleted!"}),u(m.chatCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","chatCannedAnswers","chatCannedAnswer","api","Auth","license","setting"],angular.module("app.chat").controller("CreateOrEditChatCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteChatDispositions={count:0,rows:[]},c.selectedChatWebsiteChatDispositions=[],c.query={fields:"createdAt,updatedAt,id,name,createdAt",limit:10,page:1},c.init=function(e){c.chatWebsite=e,c.query.id=c.chatWebsite.id,c.query.ChatWebsiteId=c.chatWebsite.id,c.getChatWebsiteChatDispositions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the chatDisposition?").htmlContent("<b>"+(e.name||"chatDisposition")+"</b> will be deleted.").ariaLabel("delete chatDisposition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteChatDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getDispositions(c.query,p).$promise},c.createOrEditChatWebsiteChatDisposition=function(e,t){o.show({controller:"CreateOrEditChatDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/chatDispositions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,chatDisposition:t,chatDispositions:c.chatWebsiteChatDispositions.rows,license:null,setting:null}})},c.exportSelectedChatWebsiteChatDispositions=function(){var e=angular.copy(c.selectedChatWebsiteChatDispositions);return c.selectedChatWebsiteChatDispositions=[],e},c.deleteChatWebsiteChatDisposition=g,c.deleteSelectedChatWebsiteChatDispositions=function(e){var t=o.confirm().title("Are you sure want to delete the selected chatDispositions?").htmlContent("<b>"+c.selectedChatWebsiteChatDispositions.length+" selected</b> will be deleted.").ariaLabel("delete chatDispositions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedChatWebsiteChatDispositions.forEach(function(e){g(e)}),c.selectedChatWebsiteChatDispositions=[]})};var m=!0,u=1;function p(e){c.chatWebsiteChatDispositions=e||{count:0,rows:[]}}function g(e){l.chatDisposition.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteChatDispositions.rows,{id:e.id}),c.chatWebsiteChatDispositions.count-=1,c.chatWebsiteChatDispositions.rows.length||c.getChatWebsiteChatDispositions(),r.success({title:"ChatDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteChatDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteChatDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CHAT.EDIT_CHATDISPOSITION",m.chatDisposition=angular.copy(s),m.chatDispositions=o,m.newChatDisposition=!1,m.chatDisposition||(m.chatDisposition={},m.title="CHAT.NEW_CHATDISPOSITION",m.newChatDisposition=!0),t.params.id&&(m.chatDisposition.ChatWebsiteId=t.params.id),m.addNewChatDisposition=function(){m.errors=[],r.chatDisposition.save(m.chatDisposition).$promise.then(function(e){m.chatDispositions.unshift(e.toJSON()),i.success({title:"ChatDisposition properly created",msg:m.chatDisposition.name?m.chatDisposition.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatDisposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatDisposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveChatDisposition=function(){m.errors=[],r.chatDisposition.update({id:m.chatDisposition.id},m.chatDisposition).$promise.then(function(e){var t=_.find(m.chatDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ChatDisposition properly saved!",msg:m.chatDisposition.name?m.chatDisposition.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatDisposition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatDisposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteChatDisposition=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The chatDisposition will be deleted.").ariaLabel("Delete ChatDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.chatDisposition.delete({id:m.chatDisposition.id}).$promise.then(function(){_.remove(m.chatDispositions,{id:m.chatDisposition.id}),i.success({title:"ChatDisposition properly deleted!",msg:(m.chatDisposition.name||"chatDisposition")+" has been deleted!"}),u(m.chatDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatDisposition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatDisposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","chatDispositions","chatDisposition","api","Auth","license","setting"],angular.module("app.chat").controller("CreateOrEditChatDispositionDialogController",e)}(),function(){"use strict";function e(n,e,a){var i=this;i.chatWebsite={},i.offlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.offlineForm)&&(i.chatWebsite.offlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var t=0;t<e.rows.length;t++)i.customFields.push({key:"cf_"+e.rows[t].id,value:e.rows[t].alias});return a.cmContact.describe().$promise}).then(function(e){for(var t=_.keys(e),n=0;n<t.length;n++)_.includes(i.uselessFields,t[n])||_.startsWith(t[n],"cf_")||i.fields.unshift({key:t[n],value:t[n]});return a.variable.get().$promise}).then(function(e){i.variables=e.rows}).catch(function(e){console.error(e)})},i.up=function(e,t){if(0!==t){var n=i.chatWebsite.offlineForm.items[t-1];i.chatWebsite.offlineForm.items[t]=n,i.chatWebsite.offlineForm.items[t-1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===t?i.chatWebsite.offlineForm.fromKey--:i.chatWebsite.offlineForm.fromKey===t-1&&i.chatWebsite.offlineForm.fromKey++}},i.down=function(e,t){if(t!==i.chatWebsite.offlineForm.items.length-1){var n=i.chatWebsite.offlineForm.items[t+1];i.chatWebsite.offlineForm.items[t]=n,i.chatWebsite.offlineForm.items[t+1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===t?i.chatWebsite.offlineForm.fromKey++:i.chatWebsite.offlineForm.fromKey===t+1&&i.chatWebsite.offlineForm.fromKey--}},i.add=function(e){i.chatWebsite.offlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var t=n.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");n.show(t).then(function(){i.chatWebsite.offlineForm.items.splice(e,1)})}}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteofflineFormController",e)}(),function(){"use strict";function e(n,e,a){var i=this;i.chatWebsite={},i.onlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.onlineForm)&&(i.chatWebsite.onlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var t=0;t<e.rows.length;t++)i.customFields.push({key:"cf_"+e.rows[t].id,value:e.rows[t].alias});return a.cmContact.describe().$promise}).then(function(e){for(var t=_.keys(e),n=0;n<t.length;n++)_.includes(i.uselessFields,t[n])||_.startsWith(t[n],"cf_")||i.fields.unshift({key:t[n],value:t[n]});return a.variable.get().$promise}).then(function(e){i.variables=e.rows}).catch(function(e){console.error(e)})},i.up=function(e,t){if(0!==t){var n=i.chatWebsite.onlineForm.items[t-1];i.chatWebsite.onlineForm.items[t]=n,i.chatWebsite.onlineForm.items[t-1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===t?i.chatWebsite.onlineForm.fromKey--:i.chatWebsite.onlineForm.fromKey===t-1&&i.chatWebsite.onlineForm.fromKey++}},i.down=function(e,t){if(t!==i.chatWebsite.onlineForm.items.length-1){var n=i.chatWebsite.onlineForm.items[t+1];i.chatWebsite.onlineForm.items[t]=n,i.chatWebsite.onlineForm.items[t+1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===t?i.chatWebsite.onlineForm.fromKey++:i.chatWebsite.onlineForm.fromKey===t+1&&i.chatWebsite.onlineForm.fromKey--}},i.add=function(e){i.chatWebsite.onlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var t=n.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");n.show(t).then(function(){i.chatWebsite.onlineForm.fromKey===e&&(i.chatWebsite.onlineForm.fromKey=null),i.chatWebsite.onlineForm.items.splice(e,1),i.chatWebsite.onlineForm.items.length||(i.chatWebsite.onlineForm.fromKey=null)})}}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteonlineFormController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteInteractions={count:0,rows:[]},c.selectedChatWebsiteInteractions=[],c.query={fields:"createdAt,updatedAt,UserId,ContactId,ChatWebsiteId,id,createdAt,closedAt,Contact.firstName,Owner.name,disposition,ratingValue,ratingType,note,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e){c.chatWebsite=e,c.query.id=c.chatWebsite.id,c.getChatWebsiteInteractions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getInteractions(c.query,p).$promise},c.createOrEditChatWebsiteInteraction=function(e,t){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/interactions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,interaction:t,interactions:c.chatWebsiteInteractions.rows,license:null,setting:null}})},c.spychatInteraction=function(e,n){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"chat",interaction:n,spy:!0})}})},c.exportSelectedChatWebsiteInteractions=function(){var e=angular.copy(c.selectedChatWebsiteInteractions);return c.selectedChatWebsiteInteractions=[],e},c.deleteChatWebsiteInteraction=g,c.deleteSelectedChatWebsiteInteractions=function(e){var t=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedChatWebsiteInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedChatWebsiteInteractions.forEach(function(e){g(e)}),c.selectedChatWebsiteInteractions=[]})};var m=!0,u=1;function p(e){c.chatWebsiteInteractions=e||{count:0,rows:[]}}function g(e){l.chatInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteInteractions.rows,{id:e.id}),c.chatWebsiteInteractions.count-=1,c.chatWebsiteInteractions.rows.length||c.getChatWebsiteInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteInteractionsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size for image files is 8 Mb"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.chatWebsite=angular.copy(e),i.ngFlowOptions.target="/api/chat/websites/:id/logo".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitelogoController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteOfflineMessages={count:0,rows:[]},c.selectedChatWebsiteOfflineMessages=[],c.query={fields:"createdAt,updatedAt,id,ContactId,createdAt",sort:"-createdAt",limit:10,page:1},c.init=function(e){c.chatWebsite=e,c.query.id=c.chatWebsite.id,c.getChatWebsiteOfflineMessages()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the offlineMessage?").htmlContent("<b>"+(e.name||"offlineMessage")+"</b> will be deleted.").ariaLabel("delete offlineMessage").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteOfflineMessages=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getOfflineMessages(c.query,p).$promise},c.createOrEditChatWebsiteOfflineMessage=function(e,t){o.show({controller:"CreateOrEditOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,offlineMessage:t,offlineMessages:c.chatWebsiteOfflineMessages.rows,license:null,setting:null}})},c.showOfflineMessageChatWebsiteOfflineMessage=function(e,n){o.show({controller:"ShowOfflineMessageOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,resolve:{message:["apiResolver","$stateParams",function(e,t){return e.resolve("chatOfflineMessage@get",{fields:"id,body",id:n.id})}]}})},c.exportSelectedChatWebsiteOfflineMessages=function(){var e=angular.copy(c.selectedChatWebsiteOfflineMessages);return c.selectedChatWebsiteOfflineMessages=[],e},c.deleteChatWebsiteOfflineMessage=g,c.deleteSelectedChatWebsiteOfflineMessages=function(e){var t=o.confirm().title("Are you sure want to delete the selected offlineMessages?").htmlContent("<b>"+c.selectedChatWebsiteOfflineMessages.length+" selected</b> will be deleted.").ariaLabel("delete offlineMessages").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedChatWebsiteOfflineMessages.forEach(function(e){g(e)}),c.selectedChatWebsiteOfflineMessages=[]})},l.cmContact.get({fields:"id,firstName,lastName",nolimit:"true"}).$promise.then(function(e){c.contacts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontacts",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.chatWebsiteOfflineMessages=e||{count:0,rows:[]}}function g(e){l.chatOfflineMessage.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteOfflineMessages.rows,{id:e.id}),c.chatWebsiteOfflineMessages.count-=1,c.chatWebsiteOfflineMessages.rows.length||c.getChatWebsiteOfflineMessages(),r.success({title:"OfflineMessage deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteOfflineMessages())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteOfflineMessagesController",e)}(),function(){"use strict";function e(t,e){this.title="CHAT.OFFLINE_MESSAGE",this.message=e,this.closeDialog=function(e){t.hide(e)}}e.$inject=["$mdDialog","message"],angular.module("app.chat").controller("ShowOfflineMessageOfflineMessageDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteProactiveActions={count:0,rows:[]},c.selectedChatWebsiteProactiveActions=[],c.query={fields:"createdAt,updatedAt,id,name,type,selector,timeout,createdAt",limit:10,page:1},c.arraytype=_.keyBy([{option:"MouseOver",value:"'mouseOver'"},{option:"Timeout",value:"'timeout'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e){c.chatWebsite=e,c.query.id=c.chatWebsite.id,c.query.ChatWebsiteId=c.chatWebsite.id,c.getChatWebsiteProactiveActions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the chatProactiveAction?").htmlContent("<b>"+(e.name||"chatProactiveAction")+"</b> will be deleted.").ariaLabel("delete chatProactiveAction").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteProactiveActions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getProactiveActions(c.query,p).$promise},c.createOrEditChatWebsiteChatProactiveAction=function(e,t){o.show({controller:"CreateOrEditChatProactiveActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,chatProactiveAction:t,proactive:c.chatWebsiteProactiveActions.rows,license:null,setting:null}})},c.exportSelectedChatWebsiteProactiveActions=function(){var e=angular.copy(c.selectedChatWebsiteProactiveActions);return c.selectedChatWebsiteProactiveActions=[],e},c.deleteChatWebsiteChatProactiveAction=g,c.deleteSelectedChatWebsiteProactiveActions=function(e){var t=o.confirm().title("Are you sure want to delete the selected proactive?").htmlContent("<b>"+c.selectedChatWebsiteProactiveActions.length+" selected</b> will be deleted.").ariaLabel("delete proactive").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedChatWebsiteProactiveActions.forEach(function(e){g(e)}),c.selectedChatWebsiteProactiveActions=[]})};var m=!0,u=1;function p(e){c.chatWebsiteProactiveActions=e||{count:0,rows:[]}}function g(e){l.chatProactiveAction.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteProactiveActions.rows,{id:e.id}),c.chatWebsiteProactiveActions.count-=1,c.chatWebsiteProactiveActions.rows.length||c.getChatWebsiteProactiveActions(),r.success({title:"ChatProactiveAction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteProactiveActions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteProactiveActionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CHAT.EDIT_CHATPROACTIVEACTION",m.chatProactiveAction=angular.copy(s),m.proactive=o,m.newChatProactiveAction=!1,m.chatProactiveAction||(m.chatProactiveAction={type:"mouseOver"},m.title="CHAT.NEW_CHATPROACTIVEACTION",m.newChatProactiveAction=!0),t.params.id&&(m.chatProactiveAction.ChatWebsiteId=t.params.id),m.addNewChatProactiveAction=function(){m.errors=[],r.chatProactiveAction.save(m.chatProactiveAction).$promise.then(function(e){m.proactive.unshift(e.toJSON()),i.success({title:"ChatProactiveAction properly created",msg:m.chatProactiveAction.name?m.chatProactiveAction.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveChatProactiveAction=function(){m.errors=[],r.chatProactiveAction.update({id:m.chatProactiveAction.id},m.chatProactiveAction).$promise.then(function(e){var t=_.find(m.proactive,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ChatProactiveAction properly saved!",msg:m.chatProactiveAction.name?m.chatProactiveAction.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteChatProactiveAction=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The chatProactiveAction will be deleted.").ariaLabel("Delete ChatProactiveAction").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.chatProactiveAction.delete({id:m.chatProactiveAction.id}).$promise.then(function(){_.remove(m.proactive,{id:m.chatProactiveAction.id}),i.success({title:"ChatProactiveAction properly deleted!",msg:(m.chatProactiveAction.name||"chatProactiveAction")+" has been deleted!"}),u(m.chatProactiveAction)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","proactive","chatProactiveAction","api","Auth","license","setting"],angular.module("app.chat").controller("CreateOrEditChatProactiveActionDialogController",e)}(),function(){"use strict";function e(e){var t=this;t.chatWebsite={},t.init=function(e){t.chatWebsite=e,t.start="\n\x3c!-- START Motion Chat Script --\x3e",t.script='\n <script src="'+t.chatWebsite.remote+"/api/chat/websites/"+t.chatWebsite.id+"/snippet?token="+t.chatWebsite.token+'"><\/script>',t.end="\n\x3c!-- START Motion Chat Script --\x3e"},t.info={},e.$watch("vm_ac.chatWebsite.remote",function(e){t.script='\n <script src="'+t.chatWebsite.remote+"/api/chat/websites/"+t.chatWebsite.id+"/snippet?token="+t.chatWebsite.token+'"><\/script>'})}e.$inject=["$scope"],angular.module("app.chat").controller("ChatWebsiteScriptController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.chatWebsite=d||e.params.chatWebsite||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoChatWebsites=function(){e.go("app.chat.chatWebsites")},c.saveChatWebsite=function(){s.chatWebsite.update({id:c.chatWebsite.id},c.chatWebsite).$promise.then(function(){r.success({title:"ChatWebsite updated!",msg:c.chatWebsite.name?c.chatWebsite.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.lists=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.template.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.templates=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtemplates",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){c.interval=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","chatWebsite"],angular.module("app.chat").controller("ChatWebsiteController",e)}(),function(){"use strict";function e(e,s,t,n,a,i,o,r,l,d,c,m,u,p,g,v){var h=this,b=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum"],f=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var A in h.availableStates=["ringing","inuse","busy","onhold","not_inuse"],h.pauses=o||{count:0,rows:[]},h.license=g,h.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},h.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},h.paginatedAgents={},h.load=!1,h.order=[],h.agentInternal={},h.agents)h.agents.hasOwnProperty(A)&&(h.agents[A].init=!0);h.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},h.logout=function(e,t){return d.user.logout({id:e.id}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),h.agents[e.id]&&(h.agents[e.id].online=!1),h.rpcAgents[e.id]&&(h.rpcAgents[e.id].online=!1),y()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"chat",realtime:!0,direction:"inbound"}})},h.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},h.getAgentStatus=C,h.getAgentGlobalStatus=x,h.isPause=S,h.checkPause=function(e){return"pause"===e},h.isPartialPause=function(e){return"*pause"===e},h.onSave=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(_.omit(e,f),b)),_.merge(h.rpcAgents[e.id],_.pick(_.omit(e,f),b)),x(h.agents[e.id]))},h.onUpdate=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(e,b)),_.merge(h.rpcAgents[e.id],_.pick(e,b)),x(h.agents[e.id]))},h.onInit=y,h.onConnect=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(_.merge(h.agents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(h.rpcAgents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},h.onComplete=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(h.agents[h.agentInternal[e.destaccountcode]]=_.omit(h.agents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),h.rpcAgents[h.agentInternal[e.destaccountcode]]=_.omit(h.rpcAgents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",h.onSave),c.on("user:update",h.onUpdate),c.on("user:agentconnect",h.onConnect),c.on("user:agentcomplete",h.onComplete),y();var E=v(function(){h.load&&(h.load=!1,y())},999);function y(e){h.load=!1;var t,n,a=s.defer();h.promise=a.promise,h.filteredAgents=[],h.order=[],_.forIn(h.agents,function(e,t){h.rpcAgents[t]&&_.merge(e,_.pick(_.omit(h.rpcAgents[t],f),b)),x(e),e.online?(h.filteredAgents.push(e),h.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),h.query.globalStatusFilter&&_.remove(h.filteredAgents,function(e){return e.globalStatus!==h.query.globalStatusFilter}),h.query.pauseTypeFilter&&_.remove(h.filteredAgents,function(e){return e.pauseType!==h.query.pauseTypeFilter}),h.query.filter&&_.remove(h.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(h.query.filter.toLowerCase())<0}),h.filteredAgents=(t=h.filteredAgents,n=_.startsWith(h.query.order,"-")?"desc":"asc",_.orderBy(t,[h.query.order.replace("-","")],[n]));var i=(h.query.page-1)*h.query.limit;h.paginatedAgents=_.drop(h.filteredAgents,i).slice(0,h.query.limit);for(var o=0;o<h.paginatedAgents.length;o+=1)h.order.push(h.paginatedAgents[o].id);a.resolve(),h.load=!0}function S(e){return"pause"===e||"*pause"===e}function T(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function C(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function x(e){var t="unknown";t=_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"pause":_.some([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"*pause":_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],T)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=S(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),E&&(v.cancel(E),E=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","Auth","license","$interval"],angular.module("app.voice").controller("AgentsChatRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function g(){var n=[];return _.forIn(u.queues,function(e,t){e.paused=0,e.loggedInDb=0,u.queues[t].agents={},n.push(l.chatQueue.getMembers({id:t}).$promise),u.rpcQueues[t]&&_.merge(e,_.pick(u.rpcQueues[t],p))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&u.queues[e[t].rows[n].ChatQueueId].paused++,u.queues[e[t].rows[n].ChatQueueId].loggedInDb++,u.queues[e[t].rows[n].ChatQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].ChatQueueId}).catch(function(e){console.error(e)})}u.count=s.count?s.count:0,u.queues=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.hasRole("admin")?u.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:u.query={id:m.getCurrentUser().id,channel:"chat",type:"inbound",sort:"-updatedAt",limit:10,page:1},u.success=b,u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=l.chatQueue.get(u.query,b).$promise:u.promise=l.user.getQueues(u.query,b).$promise},u.createOrEditChatQueue=function(e,t){a.show({controller:"CreateOrEditChatQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:t,chatQueues:_.values(u.queues),license:null,setting:null}})},u.agentAdd=function(e,t){a.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:t,chatQueues:u.queues?u.queues.rows:[],realtime:!1}})},u.updateQueue=function(e){return l.chatQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},u.onSave=function(e){u.queues[e.id]&&_.merge(u.queues[e.id],_.pick(e,p))},u.onSaveMember=function(e){u.queues[e.ChatQueueId]&&u.queues[e.ChatQueueId].loggedInDb++},u.onRemoveMember=function(e){u.queues[e.ChatQueueId]&&u.queues[e.ChatQueueId].loggedInDb--},u.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(u.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(u.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},u.onLogin=function(e){console.log("onLogged",e),u.queues[e.ChatQueueId]&&(u.queues[e.ChatQueueId].loggedInDb+=1,u.queues[e.ChatQueueId].agents[e.UserId]=e.ChatQueueId)},u.onLogout=function(e){console.log("onLogout",e),u.queues[e.ChatQueueId]&&0<u.queues[e.ChatQueueId].loggedInDb&&(u.queues[e.ChatQueueId].loggedInDb-=1,delete u.queues[e.ChatQueueId].agents[e.UserId])},u.$onInit=g,u.order=[],_.forIn(u.queues,function(e,t){u.order.push(e.id)}),d.on("chat_queue:save",u.onSave),d.on("userChatQueue:save",u.onSaveMember),d.on("userChatQueue:remove",u.onRemoveMember),d.on("user:update",u.onPause),d.on("userVoiceQueue:remove",u.onLogout),d.on("userVoiceQueue:save",u.onLogin);var v=!0,h=1;function b(e){if(u.count=e.count,u.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){u.order=[];for(var t=0;t<e.rows.length;t++)u.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("chat_queue:save"),d.removeAllListeners("userChatQueue:remove"),d.removeAllListeners("userChatQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","Auth"],angular.module("app.chat").controller("QueuesChatRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.chat.realtime.agents":this.selectedTab=0;break;case"app.chat.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,n.go("app.chat.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.chat.realtime.agents");break;case 1:n.go("app.chat.realtime.queues");break;default:n.go("app.chat.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.chat").controller("ChatRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.companies=r||{count:0,rows:[]},v.table="companies",v.listOrder="",v.listOrderAsc=null,v.selectedCompanies=[],v.query={fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,page:1},v.editstate=function(e,t){n.go("app.contactmanager.companies.edit",{id:e.id,company:e})},v.gotocontactsgoto=function(e,t){n.go("app.contactmanager.contacts",{CompanyId:e.id})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the company?").htmlContent("<b>"+(e.name||"company")+"</b> will be deleted.").ariaLabel("delete company").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getCompanies=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.cmCompany.get(v.query,f).$promise},v.createOrEditCompany=function(e,t){i.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{company:t,companies:v.companies.rows,license:v.license,setting:v.setting}})},v.deleteCompany=A,v.exportSelectedCompanies=function(){var e=angular.copy(v.selectedCompanies);return v.selectedCompanies=[],e},v.deleteSelectedCompanies=function(e){var t=i.confirm().title("Are you sure want to delete the selected companies?").htmlContent("<b>"+v.selectedCompanies.length+" selected</b> will be deleted.").ariaLabel("delete Companys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedCompanies.forEach(function(e){A(e)}),v.selectedCompanies=[]})},v.deselectCompanies=function(){v.selectedCompanies=[]},v.selectAllCompanies=function(){v.selectedCompanies=v.companies.rows};var h=!0,b=1;function f(e){v.companies=e||{count:0,rows:[]}}function A(e){l.cmCompany.delete({id:e.id}).$promise.then(function(){_.remove(v.companies.rows,{id:e.id}),v.companies.count-=1,v.companies.rows.length||v.getCompanies(),c.success({title:"Company deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCompany"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCompany",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getCompanies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","companies","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.contactmanager").controller("CompaniesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CONTACTMANAGER.EDIT_COMPANY",m.company=angular.copy(s),m.companies=o,m.newCompany=!1,m.company||(m.company={},m.title="CONTACTMANAGER.NEW_COMPANY",m.newCompany=!0),m.addNewCompany=function(){m.errors=[],r.cmCompany.save(m.company).$promise.then(function(e){m.companies.unshift(e.toJSON()),i.success({title:"Company properly created",msg:m.company.name?m.company.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveCompany=function(){m.errors=[],r.cmCompany.update({id:m.company.id},m.company).$promise.then(function(e){var t=_.find(m.companies,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Company properly saved!",msg:m.company.name?m.company.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteCompany=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The company will be deleted.").ariaLabel("Delete Company").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cmCompany.delete({id:m.company.id}).$promise.then(function(){_.remove(m.companies,{id:m.company.id}),i.success({title:"Company properly deleted!",msg:(m.company.name||"company")+" has been deleted!"}),u(m.company)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","companies","company","api","Auth","license","setting"],angular.module("app.contactmanager").controller("CreateOrEditCompanyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.company=d||n.params.company||{},c.selectedTab=n.params.tab||0,c.gotogoto=function(e,t){n.go("app.contactmanager.contacts",{CompanyId:e.id})},c.alert=r.info,c.gotoCompanies=function(){n.go("app.contactmanager.companies")},c.saveCompany=function(){s.cmCompany.update({id:c.company.id},c.company).$promise.then(function(){r.success({title:"Company updated!",msg:c.company.name?c.company.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmCompany",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","company"],angular.module("app.contactmanager").controller("CompanyController",e)}(),function(){"use strict";function e(t,i,n,a,o,s,e,r,l,d,c,m,u,p,g,v){var h=this;h.currentUser=p.getCurrentUser();h.license=v,h.ngFlowOptions={target:"api/cm/contacts/upload",singleFile:!0,maxChunkRetries:1,chunkSize:62914560,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},h.contacts=e||{count:0,rows:[]},h.options={hidden:!1,hover:!1,isOpen:!1},h.table="cm_contacts",h.selectedContacts=[],h.lists=r||{rows:[],count:0},h.companies=d||{rows:[],count:0},h.tags=m||{rows:[],count:0},h.listsMap=l,h.companiesMap=c,h.selectedTags=[],h.selectedList=null,h.selectedCompany=null,h.query=_.merge({sort:"-updatedAt",limit:10,offset:0,page:1},g),h.editdialog=function(e,t){a.go("app.contactmanager.contacts.edit",{id:e.id})},h.deleteconfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the contact?").htmlContent("<b>"+(e.firstName||e.email||e.phone||"Contact")+"</b> will be deleted.").ariaLabel("delete contact").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){E(e)})},h.success=A,h.getContacts=function(){h.query.offset=(h.query.page-1)*h.query.limit,h.promise=s.cmContact.get(h.query,A).$promise},h.mergeContact=function(e,t){o.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"id,name"})}]},locals:{contacts:h.contacts.rows}})},h.duplicateContact=function(e,t){o.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"id,name"})}]},locals:{contacts:h.contacts.rows}})},h.createOrEditContact=function(e,t){t&&t.dateOfBirth&&(t.dateOfBirth=new Date(t.dateOfBirth));o.show({controller:"CreateOrEditContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ListId:h.query.ListId||a.params.ListId,CompanyId:h.query.CompanyId||a.params.CompanyId,contact:t,contacts:h.contacts.rows,setting:null},resolve:{lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"id,name"})}],companies:["apiResolver",function(e){return e.resolve("cmCompany@get",{fields:"id,name"})}]}})},h.deleteContact=E,h.exportSelectedContacts=function(){var e=angular.copy(h.selectedContacts);return h.selectedContacts=[],e},h.deleteSelectedContacts=function(e){var t=o.confirm().title("Are you sure want to delete the selected contacts?").htmlContent("<b>"+h.selectedContacts.length+" selected</b> will be deleted.").ariaLabel("delete Contacts").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){h.selectedContacts.forEach(function(e){E(e)}),h.selectedContacts=[]})},h.deselectContacts=function(){h.selectedContacts=[]},h.selectAllContacts=function(){h.selectedContacts=h.contacts.rows},h.createTag=function(e){var t=o.prompt().title("What would you name your tag?").placeholder("Tag name").ariaLabel("Tag name").targetEvent(e).ok("Ok").cancel("Cancel");return o.show(t).then(function(e){if(e)return s.tag.save({name:e});u.error({title:"Error creating tag!",msg:"Invalid tag name."})}).then(function(e){e&&(h.tags.rows.push(e),u.success({title:"Tag properly created!",msg:e.tag?e.name+" has been created!":""}))})},h.createList=function(e){var t=o.prompt().title("What would you name your list?").placeholder("List name").ariaLabel("List name").targetEvent(e).ok("Ok").cancel("Cancel");return o.show(t).then(function(e){if(e)return s.cmList.save({name:e});u.error({title:"Error creating list!",msg:"Invalid list name."})}).then(function(e){e&&(h.lists.rows.push(e),u.success({title:"List properly created!",msg:e.name?e.name+" has been created!":""}))})},h.createCompany=function(e){var t=o.prompt().title("What would you name your company?").placeholder("Company name").ariaLabel("Company name").targetEvent(e).ok("Ok").cancel("Cancel");return o.show(t).then(function(e){if(e)return s.cmCompany.save({name:e});u.error({title:"Error creating company!",msg:"Invalid company name."})}).then(function(e){e&&(h.companies.rows.push(e),u.success({title:"Company properly created!",msg:e.name?e.name+" has been created!":""}))})},h.uploadContacts=function(e){o.show({controller:"UploadContactsDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/upload/upload.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!1,locals:{lists:r,companies:d}}).then(function(){h.getContacts()}).catch(function(e){console.error()})},h.importContacts=function(e,t,n){var a=JSON.parse(t);o.show({controller:"ImportContactsDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/import/import.html",parent:angular.element(i.body),clickOutsideToClose:!1,locals:{lists:r,companies:d,file:a.file,fields:a.fields,license:h.license}}).then(function(){h.getContacts()}).catch(function(e){console.error()})},h.hasPermission=function(){return p.hasPermission(303)||p.hasRole("admin")},a.params.ListId&&(h.selectedList=a.params.ListId),a.params.CompanyId&&(h.selectedCompany=a.params.CompanyId),t.$watch("vm.options.isOpen",function(e){e?n(function(){t.tooltipVisible=h.options.isOpen},600):t.tooltipVisible=h.options.isOpen});var b=!0,f=1;function A(e){h.contacts=e||{count:0,rows:[]}}function E(e){s.cmContact.delete({id:e.id}).$promise.then(function(){_.remove(h.contacts.rows,{id:e.id}),h.contacts.count-=1,h.contacts.rows.length||h.getContacts(),u.success({title:"Contact deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){h.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}];for(var t=0;t<e.data.errors.length;t++)u.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else u.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm.query.filter",function(e,t){b?n(function(){b=!1}):(t||(f=h.query.page),e!==t&&(h.query.page=1),e||(h.query.page=f),h.getContacts())},!0),t.$watch("vm.selectedList",function(e,t){e!==t&&(h.query.ListId=h.selectedList||void 0,h.getContacts())}),t.$watch("vm.selectedCompany",function(e,t){e!==t&&(h.query.CompanyId=h.selectedCompany||void 0,h.getContacts())}),t.$watch("vm.selectedTags",function(e,t){(e.length||t.length)&&(h.query.tags=h.selectedTags.length?h.selectedTags.join():void 0,h.getContacts())})}e.$inject=["$scope","$document","$timeout","$state","$mdDialog","api","contacts","lists","listsMap","companies","companiesMap","tags","toasty","Auth","$stateParams","license"],angular.module("app.contactmanager").controller("ContactsController",e)}(),function(){"use strict";function e(n,a,e,t,i,o,s,r,l){var d=this;function c(){n.hide()}d.errors=[],d.title="CONTACTMANAGER.EDIT_CONTACT",d.contact=angular.copy(o),d.contacts=e||{rows:[],count:0},d.lists=t||{rows:[],count:0},d.companies=i||{rows:[],count:0},d.customFields={rows:[],count:0},d.newContact=!1,d.contact?(delete d.contact.List,d.ListId=d.contact.ListId||void 0):(d.contact={ListId:s?parseInt(s,10):void 0,CompanyId:r?parseInt(r,10):void 0},d.title="CONTACTMANAGER.NEW_CONTACT",d.newContact=!0),d.addNewContact=function(){d.errors=[],l.cmContact.save(d.contact).$promise.then(function(e){d.contacts.unshift(e),a.success({title:"Contact properly created",msg:d.contact.name?d.contact.name+" has been created!":""}),c()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t++)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contacts.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveContact=function(){d.errors=[],l.cmContact.update({id:d.contact.id},d.contact).$promise.then(function(e){var t=_.find(d.contacts,{id:e.id});t&&_.merge(t,e),a.success({title:"Contact properly saved!",msg:d.contact.name?d.contact.name+" has been saved!":""}),c()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.contact.update"}];for(var t=0;t<e.data.errors.length;t++)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteContact=function(e){d.errors=[];var t=n.confirm().title("Are you sure?").content("The contact will be deleted.").ariaLabel("Delete Contact").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){l.cmContact.delete({id:d.contact.id}).$promise.then(function(){_.remove(d.contacts,{id:d.contact.id}),a.success({title:"Contact properly deleted!",msg:d.contact.name?d.contact.name+" has been deleted!":""}),c()}).catch(function(e){console.error(e),d.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}]})},function(){})},d.closeDialog=c,d.getCustomFields=function(e){{if(e)return l.cmList.getCustomFields({id:e}).$promise.then(function(e){e&&(d.customFields=e)}).catch(function(e){console.error(e)});d.customFields={rows:[],count:0}}},d.getDateFromString=function(e){return new Date(e)}}e.$inject=["$mdDialog","toasty","contacts","lists","companies","contact","ListId","CompanyId","api"],angular.module("app.tools").controller("CreateOrEditContactDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o){var s=this;function r(){e.hide()}s.errors=[],s.title="CONTACTMANAGER.COPY_CONTACT",s.contact=angular.copy(n),s.lists=i||{rows:[],count:0},s.addNewContact=function(){s.errors=[],delete s.contact.id,s.contact.tags&&!s.contact.tags.length&&delete s.contact.tags;o.cmContact.save(s.contact).$promise.then(function(e){a.unshift(e),t.success({title:"Contact properly created",msg:s.contact.name?s.contact.name+" has been created!":""}),r()}).catch(function(e){console.error(e),s.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}]})},s.closeDialog=r}e.$inject=["$mdDialog","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("DuplicateContactDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;function d(e){a.hide(e)}l.errors=[],l.title="CONTACTMANAGER.EDIT_HOPPER",l.hopper=angular.copy(s),l.hoppers=o,l.newHopper=!1,l.hopper||(l.hopper={},l.title="CONTACTMANAGER.NEW_HOPPER",l.newHopper=!0),l.saveHopper=function(){l.errors=[],r.cmHopper.update({id:l.hopper.id},l.hopper).$promise.then(function(e){var t=_.find(l.hoppers,{id:e.id});t&&_.merge(t,e),i.success({title:"Hopper properly saved!",msg:l.hopper.name?l.hopper.name+" has been saved!":""}),d(e)}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}]})},l.getDateFromString=function(e){return new Date(e)},l.closeDialog=d}e.$inject=["$scope","$state","$location","$mdDialog","toasty","hoppers","hopper","api"],angular.module("app.contactmanager.contacts").controller("EditHopperDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d,c,m,u,p,g,v,h,b){var f=this;f.license=b,f.journey=[],f.contact=r||{},f.hoppers=l||{rows:[],count:0},f.finals=d||{rows:[],count:0},f.histories=c||{rows:[],count:0},f.companies=u||{rows:[],count:0},f.lists=p||{rows:[],count:0},f.customFields=g||{rows:[],count:0},f.tags=v||{rows:[],count:0},f.jscriptySessions=h||{rows:[],count:0},f.timelineOptions={scrollEl:"#interaction-content"},f.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.queryHopper={fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,page:1},f.queryFinal={fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-id",limit:10,page:1},f.queryHistory={fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-id",limit:10,page:1},f.queryJscriptySession={fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,page:1},f.selectedTab=t.params.tab||0,f.gotoContacts=function(){t.go("app.contactmanager.contacts",{},{reload:!0,notify:!0})},f.duplicateContact=function(e){i.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,resolve:{lists:["apiResolver",function(e){return e.resolve("cmList@get",{fields:"id,name"})}]},locals:{contacts:m.rows,contact:r}})},f.saveContact=function(){s.cmContact.update({id:f.contact.id},f.contact).$promise.then(function(){o.success({title:"Contact updated!",msg:f.contact.name?f.contact.name+" has been updated!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEcontact",msg:e.data?JSON.stringify(e.data):e.toString()})})},f.editCompany=function(e,t){i.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{companies:[],license:null,setting:null},resolve:{company:["apiResolver",function(e){return e.resolve("cmCompany@get",{id:t})}]}})},f.onSelectList=function(e){if(f.contact.ListId){var t=i.confirm().title("You are selecting the list number: "+f.contact.ListId).textContent("Warning! You won't select a different list for the contact "+f.contact.firstName||f.contact.lastName||f.contact.id).targetEvent(e).ok("Ok").cancel("Cancel");return i.show(t).then(f.onSelectListSuccess).catch(function(){f.contact.ListId=null})}},f.onSelectListSuccess=function(){return s.cmList.getCustomFields({id:f.contact.ListId}).$promise.then(function(e){f.customFields=e||{rows:[],count:0}}).catch(function(e){console.error(e)})},f.getDateFromString=function(e){return new Date(e)},f.getHoppers=function(){f.queryHopper.offset=(f.queryHopper.page-1)*f.queryHopper.limit,f.queryHopper.id=f.contact.id,f.promise=s.cmContact.getHoppers(f.queryHopper,y("hoppers")).$promise},f.getFinals=function(){f.queryFinal.offset=(f.queryFinal.page-1)*f.queryFinal.limit,f.queryFinal.id=f.contact.id,f.promise=s.cmContact.getHopperFinals(f.queryFinal,y("finals")).$promise},f.getHistories=function(){f.queryHistory.offset=(f.queryHistory.page-1)*f.queryHistory.limit,f.queryHistory.id=f.contact.id,f.promise=s.cmContact.getHopperHistories(f.queryHistory,y("histories")).$promise},f.getJscriptySessions=function(){f.queryJscriptySession.offset=(f.queryJscriptySession.page-1)*f.queryJscriptySession.limit,f.queryJscriptySession.id=f.contact.id,f.promise=s.cmContact.getJscriptySessions(f.queryJscriptySession,y("jscriptySessions")).$promise},f.deleteconfirm=function(t,e){var n=i.confirm().title("Are you sure want to delete the agent?").htmlContent("<b>"+(t.phone||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){var e;e=t,s.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(f.hoppers.rows,{id:e.id}),f.hoppers.count--,f.hoppers.rows.length||f.getHoppers(),o.success({title:"Hopper deleted!",msg:e.phone?e.phone+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEhopper",msg:e.data?JSON.stringify(e.data):e.toString()})})},function(){console.log("CANCEL")})},f.editHopper=function(e,t){i.show({controller:"CreateOrEditHopperVoiceQueueIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:t,hoppers:f.hoppers.rows,license:null,setting:null}})},f.createOrEditIvrCampaignHopper=function(e,t){i.show({controller:"CreateOrEditHopperCampaignIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:t,hoppers:f.hoppers.rows,license:null,setting:null}})};var A=!0,E=1;function y(t){return function(e){f[t]=e||{count:0,rows:[]}}}function S(e){console.log(e),e&&e.count&&e.rows.length&&(f.journey=_.concat(f.journey,e.rows))}e.$watch("vm.queryHopper.filter",function(e,t){A?n(function(){A=!1}):(t||(E=f.queryHopper.page),e!==t&&(f.queryHopper.page=1),e||(f.queryHopper.page=E),f.getHoppers())}),e.$watch("vm.queryFinal.filter",function(e,t){A?n(function(){A=!1}):(t||(E=f.queryFinal.page),e!==t&&(f.queryFinal.page=1),e||(f.queryFinal.page=E),f.getFinals())}),e.$watch("vm.queryHistory.filter",function(e,t){A?n(function(){A=!1}):(t||(E=f.queryHistory.page),e!==t&&(f.queryHistory.page=1),e||(f.queryHistory.page=E),f.getHistories())}),s.user.get({fields:"id,fullname",nolimit:!0}).$promise.then(function(e){f.users=e||{count:0,rows:[]},f.usersMap=_.mapValues(_.keyBy(f.users.rows,"id"),"fullname")}).then(function(e){var t=["mail","chat","sms","openchannel","fax"];if(e&&e.id){for(var n=0;n<t.length;n++)s[t[n]+"Interaction"].get({ContactId:e.id,includeAll:!0}).$promise.then(S);s.voiceCallReport.get({ContactId:e.id,includeAll:!0}).$promise.then(S).catch(function(e){console.error(e)})}}(r))}e.$inject=["$scope","$timeout","$state","$document","$mdDialog","toasty","api","contact","hoppers","finals","histories","contacts","companies","lists","customFields","tags","jscriptySessions","license"],angular.module("app.contactmanager.contacts").controller("ContactController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p){var g=this;g.processing=!1,g.stopping=!0,g.license=p,g.pid=0,g.result={finish:!1,rows:0,affectedRows:0,failedRows:0,duplicatedRows:0,errors:[]},g.contactFields=[{key:"firstName",required:!0},{key:"lastName",required:!1},{key:"phone",required:!0},{key:"mobile",required:!1},{key:"email",required:!1},{key:"dateOfBirth",required:!1},{key:"country",required:!1},{key:"city",required:!1},{key:"street",required:!1},{key:"postalCode",required:!1},{key:"fax",required:!1}],g.motionBullFields=[{key:"UserId",required:!1},{key:"scheduledat",required:!1},{key:"priority",required:!1}],g.binding={},g.duplicate=[],g.lists=o||{rows:[],count:0},g.companies=s||{rows:[],count:0},g.customFields={rows:[],count:0},g.fields=u||[],g.closeDialog=function(){d.removeAllListeners("contact:import:"+v),t.hide()},g.onChangeList=function(){return l.cmList.getCustomFields({id:g.ListId}).$promise.then(function(e){g.customFields=e}).catch(function(e){console.error(e)})},g.uploadCsv=function(){g.processing=moment(),l.cmContact.import({id:m.filename,binding:g.binding,ListId:g.ListId,CompanyId:g.CompanyId,duplicates:g.duplicates,socket_timestamp:v}).$promise.then(function(e){g.stopping=!1,e&&e.pid&&(g.pid=e.pid)}).catch(function(e){g.processing=!1,r.error({title:"Import process failed!",msg:"Please retry with a new file"})})},g.getHeaderErrors=function(){var e=u;return e.push("contact_import_error"),e},g.getArrayErrors=function(){for(var e=[],t=0;t<g.result.errors.length;t+=1){var n=g.result.errors[t].row;n.contact_import_error=g.result.errors[t].message,e.push(n)}return e},g.stopUpload=function(){if(g.stopping=!0,g.pid)return l.system.killProcess({pid:g.pid}).$promise.then(function(e){r.success({title:"CSV import process stopped!",msg:"Import has been stopped!"})}).catch(function(e){r.error({title:"CSV stop import process failed!",msg:"pid is unknown"})})};var v=moment().unix();d.on("contact:import:"+v,function(n){i(function(){if(g.result.rows=n.rows,n.errors)for(var e=0;e<n.errors.length;e++)g.result.errors.push(n.errors[e]);if(n.finish){g.result.finish=!0,g.result.affectedRows=n.affectedRows,g.result.failedRows=g.result.errors.length;var t=g.result.rows-g.result.affectedRows-g.result.errors.length;t&&0<t&&(g.duplicates.length?g.result.duplicatedRows=t:g.result.failedRows+=t),g.result.elapsed=moment().diff(g.processing,"seconds")}})}),c.$on("$destroy",function(){d.removeAllListeners("contact:import:"+v)})}e.$inject=["$cookies","$mdDialog","$interval","$q","$timeout","lists","companies","toasty","api","socket","$scope","file","fields","license"],angular.module("app.tools").controller("ImportContactsDialogController",e)}(),function(){"use strict";function e(i,e,o,t,s,n,r){var a=this;a.errors=[],a.title="CONTACTMANAGER.MERGE_CONTACT",a.contact=angular.copy(t),a.lists=n||[],a.change=function(){a.searchTerm?r.cmContact.get({fields:"id,firstName,lastName,phone,email",filter:a.searchTerm,ListId:t.ListId}).$promise.then(function(e){a.contacts=e.rows}).catch(function(e){console.error(e)}):a.contacts=[]},a.showConfirm=function(e,t,n){var a=i.confirm().title("Would you like to merge your contacs?").textContent("All unfilled values of the contact #"+n.id+" will be overwritten by the fields of the contact #"+t.id+".").targetEvent(e).ok("Ok").cancel("Cancel");i.show(a).then(function(){return r.cmContact.merge({to:n.id,from:t.id}).$promise}).then(function(e){_.remove(s,{id:n.id}),_.remove(s,{id:t.id}),s.unshift(e)}).then(function(){o.success({title:"Contact properly merged!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:MERGE_CONTACT",msg:e.data?JSON.stringify(e.data):e.toString()})})},a.closeDialog=function(){i.hide()}}e.$inject=["$mdDialog","$scope","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("MergeContactDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this,u=moment().unix();d.on("contact:csv_"+u,function(t){i(function(){m.uploading=!0,m.success+=t.success,m.errors+=t.errors,m.duplicate+=t.duplicates;for(var e=0;e<t.rows.length;e+=1)m.rows.push(t.rows[e]);t.finished&&(m.uploading=!1,m.finished=!0,m.disableStopButton=!0)})}),m.uploading=!1,m.showStopButton=!1,m.success=0,m.errors=0,m.duplicate=0,m.rows=[],m.contactFields=[{key:"firstName",required:!0},{key:"lastName",required:!1},{key:"phone",required:!0},{key:"mobile",required:!1},{key:"email",required:!1},{key:"dateOfBirth",required:!1},{key:"country",required:!1},{key:"city",required:!1},{key:"street",required:!1},{key:"postalCode",required:!1},{key:"fax",required:!1}],m.binding={},m.lists=o||{rows:[],count:0},m.companies=s||{rows:[],count:0},m.customFields={rows:[],count:0},m.ngFlowOptions={maxChunkRetries:1,chunkSize:15728640,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,target:"api/cm/contacts/csv",allowDuplicateUploads:!0},m.ngFlow={flow:{}},m.closeDialog=function(){d.removeAllListeners("contact:csv_"+u),t.hide()},m.onChangeList=function(){return l.cmList.getCustomFields({id:m.ListId}).$promise.then(function(e){m.customFields=e}).catch(function(e){console.error(e)})},m.uploadCsv=function(){m.uploading=!0,m.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},m.ngFlow.flow.opts.query={},m.ngFlow.flow.opts.query.binding_keys=_.keys(m.binding),m.ngFlow.flow.opts.query.binding_values=_.values(m.binding),m.ngFlow.flow.opts.query.ListId=m.ListId,m.ngFlow.flow.opts.query.socket_timestamp=u,m.CompanyId&&(m.ngFlow.flow.opts.query.CompanyId=m.CompanyId);m.duplicates&&(m.ngFlow.flow.opts.query.duplicates=m.duplicates);console.log("Flow options are:",m.ngFlow.flow.opts),m.ngFlow.flow.upload()},m.exportErrors=function(){for(var e=angular.copy(m.rows),t=0;t<e.length;t+=1)e[t].contact&&(e[t].contact=JSON.stringify(e[t].contact));return angular.copy(e)},m.fileAdded=function(e,t,n){Papa.parse(t.file,{skipEmptyLines:!0,header:!0,complete:function(e){console.log("csv file resultss",e),m.fields=e.meta.fields,m.fileSelected=!0,c.$apply()}})},m.fileSuccess=function(e,t,n){console.log("filessuccess",e,t,n);try{var a=JSON.parse(t);if(!a.pid)throw new Error("No pid parameter from api response!");m.pid=a.pid,m.showStopButton=!0}catch(e){console.error("Unable to parse upload result",e)}},m.stopUpload=function(){if(m.disableStopButton=!1,m.pid)return l.system.killProcess({pid:m.pid}).$promise.then(function(e){console.log("CSV upload process stopped!")}).catch(function(e){console.error(e)});console.error("pid is not defined")},c.$on("$destroy",function(){d.removeAllListeners("contact:csv_"+u)})}e.$inject=["$cookies","$mdDialog","$interval","$q","$timeout","lists","companies","toasty","api","socket","$scope"],angular.module("app.tools").controller("UploadContactsDialogController",e)}(),function(){"use strict";function e(a,e,t,n,i,o,s,r,l,d,c){var m=this;function u(e){n.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD",m.sortable={animation:800,sort:!0,onSort:function(e){a.globalCustomFieldForm.$pristine=!1}},m.globalCustomField=s,m.globalCustomFields=o,m.newGlobalCustomField=!1,m.globalCustomField||(m.globalCustomField={type:"text"},m.title="CONTACTMANAGER.NEW_GLOBALCUSTOMFIELD",m.newGlobalCustomField=!0),a.$watch("vm.globalCustomField.type",function(e,t){if(e!==t)switch(e){case"text":m.globalCustomField.values="";break;case"select":m.globalCustomField.values=[]}}),m.addNewGlobalCustomField=function(){m.errors=[],r.cmCustomField.save(m.globalCustomField).$promise.then(function(e){m.globalCustomFields.unshift(e.toJSON()),i.success({title:"GlobalCustomField properly created",msg:m.globalCustomField.name?m.globalCustomField.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveGlobalCustomField=function(){m.errors=[],r.cmCustomField.update({id:m.globalCustomField.id},m.globalCustomField).$promise.then(function(e){var t=_.find(m.globalCustomFields,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"GlobalCustomField properly saved!",msg:m.globalCustomField.name?m.globalCustomField.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteGlobalCustomField=function(e){m.errors=[];var t=n.confirm().title("Are you sure?").content("The globalCustomField will be deleted.").ariaLabel("Delete GlobalCustomField").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){r.cmCustomField.delete({id:m.globalCustomField.id}).$promise.then(function(){_.remove(m.globalCustomFields,{id:m.globalCustomField.id}),i.success({title:"GlobalCustomField properly deleted!",msg:(m.globalCustomField.name||"globalCustomField")+" has been deleted!"}),u(m.globalCustomField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,m.addItem=function(e){e.push({value:"New Item"}),a.globalCustomFieldForm.$pristine=!1},m.removeItem=function(e,t){e.splice(t,1),a.globalCustomFieldForm.$pristine=!1},m.removeItems=function(e){for(var t=e.length,n=0;n<t;n++)e.splice(0,1);a.globalCustomFieldForm.$pristine=!1}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","globalCustomFields","globalCustomField","api","Auth","license","setting"],angular.module("app.contactmanager").controller("CreateOrEditGlobalCustomFieldDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.globalCustomFields=r||{count:0,rows:[]},v.table="globalCustomFields",v.listOrder="",v.listOrderAsc=null,v.selectedGlobalCustomFields=[],v.query={fields:"createdAt,updatedAt,id,alias,type,values,required",sort:"-updatedAt",ListId:"null",limit:10,page:1},v.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editdialog=function(e,t){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{globalCustomField:e,globalCustomFields:v.globalCustomFields.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the globalCustomField?").htmlContent("<b>"+(e.name||"globalCustomField")+"</b> will be deleted.").ariaLabel("delete globalCustomField").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getGlobalCustomFields=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.cmCustomField.get(v.query,f).$promise},v.createOrEditGlobalCustomField=function(e,t){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{globalCustomField:t,globalCustomFields:v.globalCustomFields.rows,license:v.license,setting:v.setting}})},v.deleteGlobalCustomField=A,v.exportSelectedGlobalCustomFields=function(){var e=angular.copy(v.selectedGlobalCustomFields);return v.selectedGlobalCustomFields=[],e},v.deleteSelectedGlobalCustomFields=function(e){var t=i.confirm().title("Are you sure want to delete the selected globalCustomFields?").htmlContent("<b>"+v.selectedGlobalCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete GlobalCustomFields").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedGlobalCustomFields.forEach(function(e){A(e)}),v.selectedGlobalCustomFields=[]})},v.deselectGlobalCustomFields=function(){v.selectedGlobalCustomFields=[]},v.selectAllGlobalCustomFields=function(){v.selectedGlobalCustomFields=v.globalCustomFields.rows};var h=!0,b=1;function f(e){v.globalCustomFields=e||{count:0,rows:[]}}function A(e){l.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(v.globalCustomFields.rows,{id:e.id}),v.globalCustomFields.count-=1,v.globalCustomFields.rows.length||v.getGlobalCustomFields(),c.success({title:"GlobalCustomField deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCustomField"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCustomField",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getGlobalCustomFields())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","globalCustomFields","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.contactmanager").controller("GlobalCustomFieldsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CONTACTMANAGER.EDIT_LIST",m.list=angular.copy(s),m.lists=o,m.newList=!1,m.list||(m.list={},m.title="CONTACTMANAGER.NEW_LIST",m.newList=!0),m.addNewList=function(){m.errors=[],r.cmList.save(m.list).$promise.then(function(e){m.lists.unshift(e.toJSON()),i.success({title:"List properly created",msg:m.list.name?m.list.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveList=function(){m.errors=[],r.cmList.update({id:m.list.id},m.list).$promise.then(function(e){var t=_.find(m.lists,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"List properly saved!",msg:m.list.name?m.list.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteList=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The list will be deleted.").ariaLabel("Delete List").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cmList.delete({id:m.list.id}).$promise.then(function(){_.remove(m.lists,{id:m.list.id}),i.success({title:"List properly deleted!",msg:(m.list.name||"list")+" has been deleted!"}),u(m.list)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","lists","list","api","Auth","license","setting"],angular.module("app.contactmanager").controller("CreateOrEditListDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.cmList[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.list.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserList?"penalty "+e.UserList.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserList?"penalty "+e.UserList.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.list=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("CONTACTMANAGER.ALL_AGENTS"),labelSelected:s.instant("CONTACTMANAGER.SELECTED_AGENTS"),transferCallback:function(e,t){a.cmList[t?"removeAgents":"addAgents"]({id:l.list.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"List properly "+(t?"removed":"added"),msg:"List has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:cmList.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","list","lists","realtime","$translate","Auth"],angular.module("app.contactmanager").controller("ListagentaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.list={},c.listCustomFields={count:0,rows:[]},c.selectedListCustomFields=[],c.query={fields:"createdAt,updatedAt,id,alias,type,values,required",limit:10,page:1},c.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e){c.list=e,c.query.id=c.list.id,c.query.ListId=c.list.id,c.getListCustomFields()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the customField?").htmlContent("<b>"+(e.name||"customField")+"</b> will be deleted.").ariaLabel("delete customField").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getListCustomFields=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.cmList.getCustomFields(c.query,p).$promise},c.createOrEditListCustomField=function(e,t){o.show({controller:"CreateOrEditCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:c.list,customField:t,customFields:c.listCustomFields.rows,license:null,setting:null}})},c.exportSelectedListCustomFields=function(){var e=angular.copy(c.selectedListCustomFields);return c.selectedListCustomFields=[],e},c.deleteListCustomField=g,c.deleteSelectedListCustomFields=function(e){var t=o.confirm().title("Are you sure want to delete the selected customFields?").htmlContent("<b>"+c.selectedListCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete customFields").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedListCustomFields.forEach(function(e){g(e)}),c.selectedListCustomFields=[]})};var m=!0,u=1;function p(e){c.listCustomFields=e||{count:0,rows:[]}}function g(e){l.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(c.listCustomFields.rows,{id:e.id}),c.listCustomFields.count-=1,c.listCustomFields.rows.length||c.getListCustomFields(),r.success({title:"CustomField deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcmList"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getListCustomFields())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.contactmanager").controller("ListCustomFieldsController",e)}(),function(){"use strict";function e(a,e,t,n,i,o,s,r,l,d,c){var m=this;function u(e){n.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CONTACTMANAGER.EDIT_CUSTOMFIELD",m.sortable={animation:800,sort:!0,onSort:function(e){a.customFieldForm.$pristine=!1}},m.customField=s,m.customFields=o,m.newCustomField=!1,m.customField||(m.customField={type:"text"},m.title="CONTACTMANAGER.NEW_CUSTOMFIELD",m.newCustomField=!0),e.params.id&&(m.customField.ListId=e.params.id),a.$watch("vm.customField.type",function(e,t){if(e!==t)switch(e){case"text":m.customField.values="";break;case"select":m.customField.values=[]}}),m.addNewCustomField=function(){m.errors=[],r.cmList.addCustomField({id:e.params.id},m.customField).$promise.then(function(e){m.customFields.unshift(e.toJSON()),i.success({title:"CustomField properly created",msg:m.customField.name?m.customField.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveCustomField=function(){m.errors=[],r.cmCustomField.update({id:m.customField.id},m.customField).$promise.then(function(e){var t=_.find(m.customFields,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"CustomField properly saved!",msg:m.customField.name?m.customField.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteCustomField=function(e){m.errors=[];var t=n.confirm().title("Are you sure?").content("The customField will be deleted.").ariaLabel("Delete CustomField").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){r.cmCustomField.delete({id:m.customField.id}).$promise.then(function(){_.remove(m.customFields,{id:m.customField.id}),i.success({title:"CustomField properly deleted!",msg:(m.customField.name||"customField")+" has been deleted!"}),u(m.customField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,m.addItem=function(e){e.push({value:"New Item"}),a.customFieldForm.$pristine=!1},m.removeItem=function(e,t){e.splice(t,1),a.customFieldForm.$pristine=!1},m.removeItems=function(e){for(var t=e.length,n=0;n<t;n++)e.splice(0,1);a.customFieldForm.$pristine=!1}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","customFields","customField","api","Auth","license","setting"],angular.module("app.contactmanager").controller("CreateOrEditCustomFieldDialogController",e)}(),function(){"use strict";function e(n,e,a,i,t,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=t,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.list=d||n.params.list||{},c.selectedTab=n.params.tab||0,c.gotogoto=function(e,t){n.go("app.contactmanager.contacts",{ListId:e.id})},c.agentadddialog=function(e,t){a.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{list:e,lists:c.lists?c.lists.rows:[],realtime:!1}})},c.alert=r.info,c.gotoLists=function(){n.go("app.contactmanager.lists")},c.saveList=function(){s.cmList.update({id:c.list.id},c.list).$promise.then(function(){r.success({title:"List updated!",msg:c.list.name?c.list.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","list"],angular.module("app.contactmanager").controller("ListController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.list={},c.listVoiceDispositions={count:0,rows:[]},c.selectedListVoiceDispositions=[],c.query={fields:"createdAt,updatedAt,id,name,createdAt",limit:10,page:1},c.init=function(e){c.list=e,c.query.id=c.list.id,c.query.ListId=c.list.id,c.getListVoiceDispositions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the voiceDisposition?").htmlContent("<b>"+(e.name||"voiceDisposition")+"</b> will be deleted.").ariaLabel("delete voiceDisposition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getListVoiceDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.cmList.getDispositions(c.query,p).$promise},c.createOrEditListVoiceDisposition=function(e,t){o.show({controller:"CreateOrEditVoiceDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/voiceDispositions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:c.list,voiceDisposition:t,voiceDispositions:c.listVoiceDispositions.rows,license:null,setting:null}})},c.exportSelectedListVoiceDispositions=function(){var e=angular.copy(c.selectedListVoiceDispositions);return c.selectedListVoiceDispositions=[],e},c.deleteListVoiceDisposition=g,c.deleteSelectedListVoiceDispositions=function(e){var t=o.confirm().title("Are you sure want to delete the selected voiceDispositions?").htmlContent("<b>"+c.selectedListVoiceDispositions.length+" selected</b> will be deleted.").ariaLabel("delete voiceDispositions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedListVoiceDispositions.forEach(function(e){g(e)}),c.selectedListVoiceDispositions=[]})};var m=!0,u=1;function p(e){c.listVoiceDispositions=e||{count:0,rows:[]}}function g(e){l.voiceDisposition.delete({id:e.id}).$promise.then(function(){_.remove(c.listVoiceDispositions.rows,{id:e.id}),c.listVoiceDispositions.count-=1,c.listVoiceDispositions.rows.length||c.getListVoiceDispositions(),r.success({title:"VoiceDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcmList"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getListVoiceDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.contactmanager").controller("ListVoiceDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="CONTACTMANAGER.EDIT_VOICEDISPOSITION",m.voiceDisposition=angular.copy(s),m.voiceDispositions=o,m.newVoiceDisposition=!1,m.voiceDisposition||(m.voiceDisposition={},m.title="CONTACTMANAGER.NEW_VOICEDISPOSITION",m.newVoiceDisposition=!0),t.params.id&&(m.voiceDisposition.ListId=t.params.id),m.addNewVoiceDisposition=function(){m.errors=[],r.voiceDisposition.save(m.voiceDisposition).$promise.then(function(e){m.voiceDispositions.unshift(e.toJSON()),i.success({title:"VoiceDisposition properly created",msg:m.voiceDisposition.name?m.voiceDisposition.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceDisposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceDisposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveVoiceDisposition=function(){m.errors=[],r.voiceDisposition.update({id:m.voiceDisposition.id},m.voiceDisposition).$promise.then(function(e){var t=_.find(m.voiceDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"VoiceDisposition properly saved!",msg:m.voiceDisposition.name?m.voiceDisposition.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceDisposition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceDisposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteVoiceDisposition=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The voiceDisposition will be deleted.").ariaLabel("Delete VoiceDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceDisposition.delete({id:m.voiceDisposition.id}).$promise.then(function(){_.remove(m.voiceDispositions,{id:m.voiceDisposition.id}),i.success({title:"VoiceDisposition properly deleted!",msg:(m.voiceDisposition.name||"voiceDisposition")+" has been deleted!"}),u(m.voiceDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceDisposition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceDisposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","voiceDispositions","voiceDisposition","api","Auth","license","setting"],angular.module("app.contactmanager").controller("CreateOrEditVoiceDispositionDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.lists=r||{count:0,rows:[]},v.table="lists",v.listOrder="",v.listOrderAsc=null,v.selectedLists=[],v.query={fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,page:1},v.editstate=function(e,t){n.go("app.contactmanager.lists.edit",{id:e.id,list:e})},v.gotocontactsgoto=function(e,t){n.go("app.contactmanager.contacts",{ListId:e.id})},v.exportcsvcontactsexport=function(e,t){var n=a.document.createElement("a");n.href="/api/cm/lists/"+e.id+"/contacts/csv",n.target="_self",n.click()},v.agentadddialog=function(e,t){i.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{list:e,lists:v.lists?v.lists.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the list?").htmlContent("<b>"+(e.name||"list")+"</b> will be deleted.").ariaLabel("delete list").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getLists=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.cmList.get(v.query,f).$promise},v.createOrEditList=function(e,t){i.show({controller:"CreateOrEditListDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:t,lists:v.lists.rows,license:v.license,setting:v.setting}})},v.deleteList=A,v.exportSelectedLists=function(){var e=angular.copy(v.selectedLists);return v.selectedLists=[],e},v.deleteSelectedLists=function(e){var t=i.confirm().title("Are you sure want to delete the selected lists?").htmlContent("<b>"+v.selectedLists.length+" selected</b> will be deleted.").ariaLabel("delete Lists").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedLists.forEach(function(e){A(e)}),v.selectedLists=[]})},v.deselectLists=function(){v.selectedLists=[]},v.selectAllLists=function(){v.selectedLists=v.lists.rows};var h=!0,b=1;function f(e){v.lists=e||{count:0,rows:[]}}function A(e){l.cmList.delete({id:e.id}).$promise.then(function(){_.remove(v.lists.rows,{id:e.id}),v.lists.count-=1,v.lists.rows.length||v.getLists(),c.success({title:"List deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmList"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getLists())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","lists","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.contactmanager").controller("ListsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s){var r=this;r.currentUser=o.getCurrentUser(),r.customDashboard={},r.voiceQueues=s&&s.count?s:{count:0,rows:[]},r.voiceQueuesSelected=s&&s.count?_.map(s.rows,"id"):[],r.interval=t(function(){},1e3),r.onChangeVoiceQueues=function(){for(var e=0;e<r.customDashboard.widgets.length;e+=1)r.customDashboard.widgets[e].voiceQueuesSelected=r.voiceQueuesSelected},r.goToEdit=function(){e.go("app.tools.customDashboards.edit",{id:r.customDashboard.id,tab:1})},i.onWithoutApply("voice_queue:save",function(e){var t=_.find(r.voiceQueues.rows,{id:e.id});t&&_.merge(t,_.pick(e,_.keys(t)))}),a.dashboard.get({id:e.params.id}).$promise.then(function(e){if(e)return r.customDashboard=e,r.customDashboard.widgets=[],r.customDashboard.preview=!0,r.customDashboard.draggable={enabled:!1},r.customDashboard.resizable={enabled:!1},a.dashboard.getItems({id:r.customDashboard.id}).$promise}).then(function(e){if(e&&e.count&&e.rows)for(var t=0;t<e.rows.length;t+=1)e.rows[t].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[t].type+"/ms-widget-engine."+e.rows[t].type+".html",e.rows[t].voiceQueues=r.voiceQueues,e.rows[t].voiceQueuesSelected=r.voiceQueuesSelected,r.customDashboard.widgets.push(e.rows[t])}).catch(function(e){r.customDashboard=void 0}),n.$on("$destroy",function(){i.removeAllListeners("voice_queue:save"),r.interval&&t.cancel(r.interval)})}e.$inject=["$state","$interval","$scope","api","socket","Auth","voiceQueues"],angular.module("app.dashboards.custom").controller("DashboardCustomController",e)}(),function(){"use strict";function e(e,t,n,a,s,i,o,r,l,d,c,m,u,p,g,v,h,b,f,A,E,y,S,T){var C=this;C.license=E;function x(e){var t={};for(var n in C.tabs)C.tabs.hasOwnProperty(n)&&(t[n]=C.tabs[n],C.tabs[n].interaction&&(t[n].interaction=_.pick(C.tabs[n].interaction,["id","OpenchannelAccountId","MailAccountId","ChatWebsiteId","FaxAccountId","SmsAccountId","closed"])));a.localStorage.setItem("motion2.user:"+C.user.id,JSON.stringify({tabs:t,currentTab:C.currentTab})),O(e)}function O(e){if(_.isNil(e)||e&&"interaction"===e.type){var t={id:C.user.id,online:!0,capacity:{mail:0,fax:0,sms:0,openchannel:0,chat:0},interaction:{mail:[],fax:[],sms:[],openchannel:[],chat:[]}};for(var n in C.tabs)C.tabs.hasOwnProperty(n)&&t.capacity.hasOwnProperty(C.tabs[n].channel)&&C.tabs[n].interaction&&!C.tabs[n].interaction.closed&&(t.capacity[C.tabs[n].channel]+=1,t.interaction[C.tabs[n].channel].push(C.tabs[n].interaction.id));return p.rpc.setAgentCapacity(t)}console.log("No capacity updated")}function w(t){if(C.tabs[t.id]&&(function(e){if(e.channel&&e.interaction)p.user["remove"+_.upperFirst(e.channel)+"Interactions"]({id:C.user.id,ids:[e.interaction.id]}).$promise.catch(function(e){console.error(e)})}(C.tabs[t.id]),delete C.tabs[t.id],C.currentTab=0,x(t),"interaction"===t.type))return p[t.channel+"Interaction"].get({id:t.interaction.id}).$promise.then(function(e){return p.user["remove"+_.upperFirst(t.channel)+"Interactions"]({id:C.user.id,ids:[e.id]}).$promise}).catch(function(e){console.error(e)})}function I(e){e.id=_.random(1e10),e.openedAt=new Date,e.saved=!1,e.badges=0,C.tabs[e.id]=e,C.currentTab=e.id,x(e)}function R(t,n){var e={type:"interaction",title:t?t.toUpperCase():"openchannel",icon:function(e){switch(e){case"chat":return"icon-hangouts";case"mail":return"icon-email";case"sms":return"icon-message-text";case"openchannel":return"icon-google-earth";case"fax":return"icon-deskphone";default:return"icon-hangouts"}}(t),color:function(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";default:return"grey"}}(t),channel:t,interaction:n},a=_.find(C.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id===n.id&&e.channel===t});a?C.currentTab=a.id:I(e)}function N(e){e&&e.uniqueid&&C.notifications[e.uniqueid]&&(v.clear(C.notifications[e.uniqueid]),delete C.notifications[e.uniqueid])}function D(){return function(e){if(404===e.status)v.warning({title:s.instant("DASHBOARDS.ATTENTION"),msg:s.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){C.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var t=0;t<e.data.errors.length;t+=1)v.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else v.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}C.detectBrowser=T.detectBrowser(),C.user=u.getCurrentUser(),C.currentTab=0,C.notifications={},C.tabs={},C.globalUserLists=h||{count:0,rows:[]},C.globalLists=b||{count:0,rows:[]},C.globalCompanies=f||{count:0,rows:[]},C.globalTags=A||{count:0,rows:[]},C.onContactManager=function(t){var e={ListId:t.ListId,limit:1,offset:0,sort:"-updatedAt"},n=!1,a=t.calleridname&&"<unknown>"!==t.calleridname?t.calleridname:t.calleridnum||t.uniqueid,i=t.calleridnum;_.isNil(t["xmd-contactid"])?_.isNil(t.routeId)?e.phone=t.calleridnum:(e.phone=t.destcalleridnum,a=t.destcalleridname&&"<unknown>"!==t.destcalleridname?t.destcalleridname:t.destcalleridnum||t.uniqueid,i=t.destcalleridnum):(e.id=t["xmd-contactid"],n=!0,_.isNil(t["xmd-listid"])||parseInt(t["xmd-listid"],10)===t.ListId||t["xmd-contactid2"]&&(e.id=t["xmd-contactid2"]));return p.cmContact.get(e).$promise.then(function(e){n?e&&C.addContactTab(e,t):e.count&&e.rows[0]?C.addContactTab(e.rows[0],t):C.addContactTab({firstName:a,ListId:t.ListId,phone:i},t)}).catch(D())},C.onJscripty=function(n){return p.jscriptyProject.get({id:n.ProjectId}).$promise.then(function(t){if(t){if(!_.isUndefined(n["xmd-contactid"]))return p.cmContact.get({id:n["xmd-contactid"]}).$promise.then(function(e){I({type:"jscripty",title:t.name,icon:"icon-script",color:"grey",project:t,call:n,contact:e})}).catch(D());I({type:"jscripty",title:t.name,icon:"icon-script",color:"grey",project:t,call:n})}}).catch(D())},C.onBrowserUrl=function(e){if(e&&e.uri)if(e.uriLocation)switch(e.uriLocation){case"0":a.open(e.uri);break;case"1":a.open(e.uri,"_blank","width="+(e.windowWidth||"800")+",height="+e.windowHeight||"600");break;default:a.open(e.uri)}else a.open(e.uri)},C.onBrowserPopup=function(e){e&&e.html&&I({type:"popup",title:e.calleridnum||"popup",icon:"icon-tablet",color:"grey",html:e.html})},C.onNotificationSave=function(e){if(e&&e.uniqueid){n=e,y.isSupported()?y.requestPermission().then(function(){var e,t;t={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"../../../../../../../assets/images/avatars/customer.png",body:(e=n).queue?"Queue: "+e.queue:"",focusOnclick:!0,closeOnClick:!0},y.show(e.title,t)},function(e){console.error("Please enable browser notifications!",e)}):console.error("Browser notifications are not supported by the browser. Normal notifications will be used.");var t=C.alreadyExistsTab(e);if(t){if(p[e.channel+"Message"])return C.currentTab!==t.id&&(t.badges+=1),p[e.channel+"Message"].accept({id:e.id,UserId:C.user.id}).$promise.catch(D())}else v.wait({title:e.title,msg:e.msg||"",showClose:!1,clickToClose:!1,timeout:!1,sound:e.sound,html:!0,shake:e.shake||!1,onAdd:function(){C.notifications[e.uniqueid]=this.id},onAccept:function(){if(N(e),p[e.channel+"Message"])return p[e.channel+"Message"].accept({id:e.id,UserId:C.user.id,manual:!0}).$promise.then(function(e){R(e.channel,e.interaction),v.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(D())},onReject:function(){if(N(e),p[e.channel+"Message"])return p[e.channel+"Message"].reject({id:e.id,UserId:C.user.id}).$promise.then(function(e){v.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(D())}})}var n},C.onNotificationRemove=N,C.onClickTab=function(e){C.currentTab=e,x(C.tabs[e])},C.isActiveTab=function(e){return e===C.currentTab},C.alreadyExistsTab=function(t){return _.find(C.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id==t.interactionId&&e.channel==t.channel})},C.addContactTab=function(t,n){var a={type:"contact",title:t?function(e){var t="";e&&(e.firstName||e.lastName?(e.firstName&&(t+=e.firstName+" "),e.lastName&&(t+=e.lastName)):e.phone&&(t=e.phone));return t}(t):s.instant("DASHBOARDS.NEW_CONTACT"),icon:"icon-account-circle",color:"red",contact:t,userLists:h,lists:b,companies:f,tags:A,calls:n?[n]:[],autoCreate:n?n.autoCreate:0};if(n){if(n["xmd-cdrtype"]&&"dialer"===n["xmd-cdrtype"])n.answeredAt=n.agentcalledAt?moment(n.agentcalledAt,"YYYY-MM-DD HH:mm:ss").toDate():new Date;else if(n.uniqueid){var e=n.uniqueid.split(".")[0];n.answeredAt=e?new Date(1e3*parseInt(e)):new Date}(n.agentcompleteAt||n.endtime)&&(n.disposedAt=new Date)}if(t){var i=_.find(C.tabs,function(e){return"contact"===e.type&&e.contact&&e.contact.id==t.id});if(i){if(n)if(i.calls){var o=_.find(i.calls,function(e){return e.uniqueid===n.uniqueid});o||i.calls.push(n)}else i.calls=[n];C.currentTab=i.id}else{if(t.ListId)return p.cmList.getDispositions({id:t.ListId}).$promise.then(function(e){return a.dispositions=e,p.cmList.getCustomFields({id:t.ListId}).$promise}).then(function(e){a.customFields=e}).catch(D()).finally(function(){I(a)});I(a)}}else I(a)},C.addInteractionTab=R,C.addTab=I,C.removeTab=w,C.updateLocalStorage=x,C.closeTab=function(e){var t=n.confirm().title("interaction"===e.type?"Do you want to close the interaction?":"Are you sure want to close the "+e.type+"?").textContent("interaction"===e.type?"":"The "+e.type+" has been modified. Closing will lose all changes!").ariaLabel("Close Contact").ok("interaction"===e.type?"YES":"OK").cancel("interaction"===e.type?"NO":"CANCEL");{if(!e.saved)return n.show(t).then(function(){"interaction"===e.type&&n.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!0,locals:{channel:e.channel,interaction:e.interaction}}),w(e)}).catch(function(){"interaction"===e.type&&w(e)});w(e)}},g.on("trigger:contactmanager",C.onContactManager),g.on("trigger:jscripty",C.onJscripty),g.on("trigger:browser:url",C.onBrowserUrl),g.on("trigger:browser:popup",C.onBrowserPopup),g.on("notification:save",C.onNotificationSave),g.on("notification:remove",C.onNotificationRemove),function(){var e=a.localStorage.getItem("motion2.user:"+C.user.id);if(e)try{e=JSON.parse(e),C.tabs=e.tabs?e.tabs:{},C.currentTab=e.currentTab?e.currentTab:0,O(C.tabs[C.currentTab])}catch(e){console.error(e)}}(),e.$on("$destroy",function(){for(var e in C.notifications)C.notifications.hasOwnProperty(e)&&N({uniqueid:e});g.removeAllListeners("trigger:contactmanager"),g.removeAllListeners("trigger:jscripty"),g.removeAllListeners("trigger:browser:url"),g.removeAllListeners("trigger:browser:popup"),g.removeAllListeners("notification:save"),g.removeAllListeners("notification:remove")})}e.$inject=["$scope","$state","$mdDialog","$window","$translate","$mdToast","$document","$templateCache","$rootScope","$controller","$compile","$templateRequest","Auth","api","socket","toasty","globalUserLists","globalLists","globalCompanies","globalTags","license","desktopNotification","$http","msUtils"],angular.module("app.dashboards").controller("AgentDashboardGeneralController",e)}(),function(){"use strict";angular.module("app.dashboards").provider("desktopNotification",function(){var b={autoClose:!0,duration:5,showOnPageHidden:!1};return{config:function(e){for(var t in e)b.hasOwnProperty(t)&&null!=e[t]&&(b[t]=e[t])},$get:["$q","$timeout","$window","PERMISSIONS",function(e,u,t,p){var g=t.Notification||t.mozNotification||t.webkitNotification;return{isSupported:v,currentPermission:h,requestPermission:function(){if(!v())return e.reject("Notification API not supported");var n=e.defer();Promise.resolve(g.requestPermission)==g.requestPermission?g.requestPermission().then(function(e){p.GRANTED===e?n.resolve(e):n.reject(e)}):g.requestPermission(function(e,t){p.GRANTED===e?n.resolve(e):n.reject(e)});return n.promise},show:function(e,t){if(t=t||{},!v()||(n=e,a=t,i=angular.isString(n),o=!a.onClick||angular.isFunction(a.onClick),!i||!o)||function(e){if(e||b.showOnPageHidden)return!(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)}(t.showOnPageHidden)||h()!==p.GRANTED)return;var n,a,i,o;var s=new g(e,t),r=t.duration||b.duration,l=void 0===t.autoClose?b.autoClose:t.autoClose;s.onclick=function(){t.onClick&&t.onClick(),t.focusOnclick&&window.focus(),t.closeOnClick&&s.close()},l&&(d=s,c=r,m=1e3*c,u(d.close.bind(d),m,!1));var d,c,m;return s},permissions:{default:p.DEFAULT,granted:p.GRANTED,denied:p.DENIED}};function v(){return!(void 0===g)}function h(){return(g||{}).permission}}]}}).provider("msNavigationAgentService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function t(e,t){if(angular.isString(e)){for(var n=e.split("."),a=n[n.length-1],i=function(e){var t=l;if(1===e.length)return t;e.pop();for(var n=0;n<e.length;n++){for(var a=e[n],i=!0,o=0;o<t.length;o++)if(t[o]._id===a){t=t[o].children,i=!1;break}if(i){var s={_id:a,_path:e.join("."),title:a,weight:1,children:[]};t.push(s),t=s.children}}return t}(n),o=!1,s=0;s<i.length;s++)if(i[s]._id===a){o=i[s];break}o?(angular.extend(o,t),o.uisref=d(o)):(t.children=[],!angular.isUndefined(t.weight)&&angular.isNumber(t.weight)||(t.weight=1),t._id=a,t._path=e,t.uisref=d(t),i.push(t))}else r.error("path must be a string (eg. `dashboard.project`)")}function d(e){var t="";return angular.isDefined(e.state)&&(t=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(t=t+"("+angular.toJson(e.stateParams)+")")),t}this.saveItem=t,this.$get=function(){var e={saveItem:t,getNavigation:function(e){if(e){for(var t=0;t<l.length;t++)if(l[t]._id===e)return[l[t]];return null}return l}};return e}}).constant("PERMISSIONS",{DEFAULT:"default",GRANTED:"granted",DENIED:"denied"})}(),function(){"use strict";function e(s,r,i,l,d,c,t,e,n,a){var m=this;function o(e){e&&e.count&&e.rows.length&&(m.journey=_.concat(m.journey,e.rows))}m.user=t.getCurrentUser(),m.detectBrowser=a.detectBrowser(),m.journey=[],m.queryHopper={fields:"id,phone,scheduledat",sort:"-updatedAt",limit:10,page:1},m.queryFinal={fields:"uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-updatedAt",limit:10,page:1},m.queryHistory={fields:"uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,page:1},m.hoppers={rows:[],count:0},m.finals={rows:[],count:0},m.histories={rows:[],count:0},m.addNewContact=function(){m.errors=[],d.cmContact.save(m.contact).$promise.then(function(e){return m.contact.id=e.id,m.newContact=!1,m.tab.title=e.firstName||e.phone,m.tab.contact=m.contact,d.user.addContacts({id:t.getCurrentUser().id,ids:[e.id]})}).then(function(){m.detailForm.$pristine=!0,m.customFieldsForm.$pristine=!0,c.success({title:"Contact properly created",msg:m.contact.firstName?m.contact.firstName+" has been created!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveContact=function(){m.errors=[],d.cmContact.update({id:m.contact.id},m.contact).$promise.then(function(e){return m.tab.title=e.firstName||e.phone,m.tab.contact=m.contact,l.$parent.vm.updateLocalStorage(),d.user.addContacts({id:t.getCurrentUser().id,ids:[e.id]})}).then(function(){m.detailForm.$pristine=!0,m.customFieldsForm.$pristine=!0,c.success({title:"Contact properly updated!",msg:m.contact.name?m.contact.name+" has been updated!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getCustomFields=function(e){return d.cmList.getCustomFields({id:e}).$promise.then(function(e){m.tab.customFields=e}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"LIST:GETCustomFields",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.call=l.$parent.vm.call,m.disposeCall=function(e,t){if(m.newContact)return void c.error({title:"ATTENTION",msg:"Before to dispose, please save the contact!"});s.show({controller:"DisposeCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",parent:angular.element(r.body),targetEvent:t,clickOutsideToClose:!1,locals:{dispositions:m.tab.dispositions,contact:m.contact,call:t}}).then(function(e){e&&("BLACKLIST"===e?c.success({title:n.instant("DASHBOARDS.INFO"),msg:n.instant("DASHBOARDS.CALL_DISPOSED")+" "+e}):"RECALLME"===e||"RESCHEDULE"===e||c.success({title:n.instant("DASHBOARDS.INFO"),msg:n.instant("DASHBOARDS.CALL_SAVED")})),_.remove(m.tab.calls,function(e){return e.uniqueid==t.uniqueid})})},m.duplicateContact=function(e){s.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:m.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:t.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}})},m.mergeContact=function(e){s.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:m.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:t.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}})},m.getDateFromString=function(e){if(e)return new Date(e);return null},m.addJscriptyTab=function(e,t){try{l.$parent.$parent.$parent.vm.addTab({type:"jscripty",title:e.name,icon:"icon-script",color:"grey",project:e,contact:m.contact})}catch(e){c.error({title:"ERROR OPENING JSCRIPTY PROJECT",msg:"The project cannot be started"+JSON.stringify(e)})}},m.getHoppers=function(){m.contact&&m.contact.id&&(m.queryHopper.ContactId=m.contact.id,m.queryHopper.offset=(m.queryHopper.page-1)*m.queryHopper.limit,m.promise=d.cmHopper.get(m.queryHopper,g("hoppers")).$promise)},m.getFinals=function(){m.contact&&m.contact.id&&(m.queryFinal.ContactId=m.contact.id,m.queryFinal.offset=(m.queryFinal.page-1)*m.queryFinal.limit,m.promise=d.cmHopperFinal.get(m.queryFinal,g("finals")).$promise)},m.getHistories=function(){m.contact&&m.contact.id&&(m.queryHistory.ContactId=m.contact.id,m.queryHistory.offset=(m.queryHistory.page-1)*m.queryHistory.limit,m.promise=d.cmHopperHistory.get(m.queryHistory,g("histories")).$promise)},m.getJscriptyProjects=function(){d.jscriptyProject.get({fields:"createdAt,updatedAt,id,name,description,createdAt,formData,enableUncompleteSave",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){m.jscriptyProjects=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.jscripty.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscripty.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getMailAccounts=function(){d.mailAccount.get({nolimit:!0}).$promise.then(function(e){m.mailAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mail.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mail.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getFaxAccounts=function(){d.faxAccount.get({nolimit:!0}).$promise.then(function(e){m.faxAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.fax.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.fax.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getSmsAccounts=function(){d.smsAccount.get({nolimit:!0}).$promise.then(function(e){m.smsAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.sms.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sms.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.composeInteraction=function(e,i,t,n){var o=i.toLowerCase();s.show({controller:"Compose"+i+"InteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose"+i+"/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{account:t,message:{to:"mail"==o?n:n.split(",")},type:"new",interaction:{Contact:m.contact}},fullscreen:!0}).then(function(a){return d[o+"Account"].send({id:t.id},a).$promise.then(function(e){if("Mail"===i){var t=e;if(t&&t.Messages&&t.Messages.length){if(a.attachments&&a.attachments.length)for(var n=0;n<a.attachments.length;n+=1)d.attachment.update({id:a.attachments[n].id},{MailMessageId:_.head(t.Messages).id});c.success({title:"Message properly sent!",msg:"Message has been sent!"}),t.closed?(t.disposition=null,s.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!0,locals:{channel:"mail",interaction:t}})):l.$parent.vm.addInteractionTab("mail",t)}}else c.success({title:"Message properly sent!",msg:"Message has been sent!"}),l.$parent.vm.addInteractionTab(o,e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else"fax"===o?c.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()}):c.error({title:e.status?"API:"+e.status+" - "+e.statusText:i.toUpperCase()+"ACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.init=function(e,t){m.tab=e,l.$watchGroup(["vm.detailForm.$pristine","vm.customFieldsForm.$pristine"],function(e,t){m.tab.saved=e[0]&&e[1]}),m.license=t,m.contact=m.tab.contact,m.newContact=!1,m.currentTab=0,m.contact&&m.contact.id?(d.user.addContacts({id:m.user.id,ids:[m.contact.id]}),m.contact.ListId&&(m.tab.userLists.rows=_.unionBy(m.tab.userLists.rows,_.filter(m.tab.lists.rows,{id:m.contact.ListId}),"id"),m.list=_.find(m.tab.userLists.rows,{id:m.contact.ListId})),m.getHoppers(),m.getFinals(),m.getHistories(),m.getMailAccounts(),m.getFaxAccounts(),m.getSmsAccounts()):(m.newContact=!0,e.autoCreate&&(console.log("autoCreate"),m.addNewContact()));d.user.get({fields:"id,fullname",nolimit:!0}).$promise.then(function(e){m.users=e||{count:0,rows:[]},m.usersMap=_.mapValues(_.keyBy(m.users.rows,"id"),"fullname")}).then(function(e){var t=["mail","chat","sms","openchannel","fax"];if(e&&e.id){for(var n=0;n<t.length;n++)d[t[n]+"Interaction"].get({ContactId:e.id,includeAll:!0}).$promise.then(o);d.voiceCallReport.get({ContactId:e.id,includeAll:!0}).$promise.then(o).catch(function(e){console.error(e)})}}(m.contact))},m.hasPermission=function(e){return t.hasPermission(e)},m.openInteraction=function(e,t){try{if(t.MailAccountId)return l.$parent.$parent.$parent.vm.addInteractionTab("mail",t);if(t.ChatWebsiteId)return l.$parent.$parent.$parent.vm.addInteractionTab("chat",t);if(t.SmsAccountId)return l.$parent.$parent.$parent.vm.addInteractionTab("sms",t);if(t.OpenchannelAccountId)return l.$parent.$parent.$parent.vm.addInteractionTab("openchannel",t);if(t.FaxAccountId)return l.$parent.$parent.$parent.vm.addInteractionTab("fax",t)}catch(e){c.error({title:"ERROR OPEN INTERACTION",msg:"Customer Journey can't open the interaction"})}},e.on("voice_queue_channel:remove",v),e.on("voice_outbound_channel:remove",v),m.getJscriptyProjects(),l.$watch("currentTab",function(e,t){1===m.currentTab&&(m.getHoppers(),m.getFinals(),m.getHistories())});var u=!0,p=1;function g(t){return function(e){m[t]=e||{count:0,rows:[]}}}function v(t){var n,e,a=_.findLastIndex(m.tab.calls,function(e){return e.uniqueid===t.uniqueid});0<=a&&(m.tab.calls[a].disposedAt=new Date),m.contact&&m.contact.id&&i((n=t.uniqueid,e=m.contact.id,function(){if(_.find(m.tab.calls,function(e){return e.uniqueid===n}))return d.voiceCallReport.update({id:n,ContactId:e}).$promise.catch(function(e){console.error(e)})}),1e3)}l.$watch("queryHopper.filter",function(e,t){u?i(function(){u=!1}):(t||(p=m.queryHopper.page),e!==t&&(m.queryHopper.page=1),e||(m.queryHopper.page=p),m.getHoppers())}),l.$watch("queryFinal.filter",function(e,t){u?i(function(){u=!1}):(t||(p=m.queryFinal.page),e!==t&&(m.queryFinal.page=1),e||(m.queryFinal.page=p),m.getFinals())}),l.$watch("queryHistory.filter",function(e,t){u?i(function(){u=!1}):(t||(p=m.queryHistory.page),e!==t&&(m.queryHistory.page=1),e||(m.queryHistory.page=p),m.getHistories())}),l.$on("$destroy",function(){e.removeAllListeners("voice_queue_channel:remove"),e.removeAllListeners("voice_outbound_channel:remove")})}e.$inject=["$mdDialog","$document","$timeout","$scope","api","toasty","Auth","socket","$translate","msUtils"],angular.module("app.dashboards").controller("AgentGeneralContactController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p){var g=this;function v(){var e=g.choice?g.choice.toLowerCase():void 0;return{id:g.call.uniqueid,disposition:g.choice,dispositionat:moment(),amd:"amd"===e,fax:"fax"===e,blacklist:"blacklist"===e,recallme:"recallme"===e,UserId:"recallme"===e?u.getCurrentUser().id:null}}g.choice=null,g.isReschedule=!1,g.recallme=!1,g.dispositions=d,g.contact=m,g.call=c,g.note=g.call.note||void 0,g.dialerCall=!1,g.hopper={minDate:new Date,dateTime:new Date},g.call&&g.call.variables&&g.call.variables["xmd-voicequeueid"]&&(g.dialerCall=!0),g.saveDisposition=function(e){if(g.choice=_.isNil(e)?g.choice:e,g.call.note=g.note,l.voiceCallReport.update({id:g.call.uniqueid,userDisposition:g.choice,note:g.note,UserId:u.getCurrentUser().id,ContactId:g.contact.id}).$promise.catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICECALLREPORT",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceRecording.get({uniqueid:g.call.uniqueid}).$promise.then(function(e){if(e)for(var t=0;t<e.rows.length;t+=1)l.voiceRecording.update({id:e.rows[t].id,userDisposition:g.choice}).$promise.catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.dialerCall)if(l.cmHopperFinal.update(v()).$promise.catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERFINAL",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.cmHopperHistory.update(v()).$promise.catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERHISTORY",msg:e.data?JSON.stringify(e.data):e.toString()})}),_.isNil(g.choice))a.hide(g.choice?g.choice.toUpperCase():"");else switch(g.choice.toLowerCase()){case"blacklist":g.call&&g.call.variables&&g.call.variables["xmd-voicequeueid"]&&function(e){if(e)l.voiceQueue.getBlackLists({id:e,type:"outbound",fields:"id"}).$promise.then(function(e){var t=[];if(e&&0<e.count){for(var n=0;n<e.rows.length;n+=1){var a=angular.copy(g.contact);delete a.id,a.ListId=e.rows[n].id,t.push(l.cmContact.save(a).$promise)}return o.all(t)}return r.success({title:p.instant("DASHBOARDS.INFO"),msg:p.instant("DASHBOARDS.NOTAVAILABLE")+" "+g.choice}),void(g.choice=void 0)}).then(function(e){e&&a.hide(g.choice?g.choice.toUpperCase():"")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEBLACKLIST",msg:e.data?JSON.stringify(e.data):e.toString()}),a.hide(g.choice?g.choice.toUpperCase():"")})}(g.call.variables["xmd-voicequeueid"]);break;case"reschedule":g.isReschedule=!0,g.recallme=!1;break;case"recallme":g.isReschedule=!0,g.recallme=!0;break;default:a.hide(g.choice?g.choice.toUpperCase():"")}else a.hide(g.choice?g.choice.toUpperCase():"")},g.closeDialog=function(){a.cancel()},g.saveReschedule=function(){return g.disable=!0,l.cmHopper.save({phone:g.contact.phone,UserId:g.recallme?u.getCurrentUser().id:null,ContactId:g.contact.id,ListId:g.contact.ListId,VoiceQueueId:Number(g.call["xmd-voicequeueid"]),scheduledat:moment(g.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),priority:3,recallme:g.recallme}).$promise.then(function(){l.cmHopperFinal.update({id:g.call.uniqueid,rescheduled:!0,rescheduledat:moment(g.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),recallme:g.recallme}).$promise.catch(function(e){console.log(e)})}).then(function(){r.success({title:p.instant("DASHBOARDS.INFO"),msg:p.instant("DASHBOARDS.CALL_DISPOSED")+" "+(g.recallme?p.instant("DASHBOARDS.RECALLME"):p.instant("DASHBOARDS.RESCHEDULE"))})}).catch(function(e){a.cancel(e)}).finally(function(){g.disable=!1,a.hide(g.choice?g.choice.toUpperCase():"")})}}e.$inject=["$scope","$state","$location","$mdDialog","$timeout","$q","$document","toasty","api","dispositions","call","contact","Auth","$translate"],angular.module("app.staff").controller("DisposeCallDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m){var u=this;u.call=l,u.contact=r,u.hopper={minDate:new Date,dateTime:new Date},u.closeDialog=function(){a.cancel()},u.saveDialog=function(){return u.disable=!0,s.cmHopper.save({phone:u.contact.phone,UserId:c?d.getCurrentUser().id:null,ContactId:u.contact.id,ListId:u.contact.ListId,VoiceQueueId:Number(u.call["xmd-voicequeueid"]),scheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),priority:3,recallme:c}).$promise.then(function(){s.cmHopperFinal.update({id:u.call.uniqueid,rescheduled:!0,rescheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),recallme:c}).$promise}).then(function(){o.success({title:m.instant("DASHBOARDS.INFO"),msg:m.instant("DASHBOARDS.CALL_DISPOSED")+" "+(c?m.instant("DASHBOARDS.RECALLME"):m.instant("DASHBOARDS.RESCHEDULE"))}),a.hide()}).catch(function(e){a.cancel(e)}).finally(function(){u.disable=!1})}}e.$inject=["$scope","$state","$location","$mdDialog","$timeout","toasty","api","contact","call","Auth","recallme","$translate"],angular.module("app.staff").controller("RescheduleCallDialogController",e)}(),function(){"use strict";function e(e,t){var n=t(function(){},999);e.$on("$destroy",function(){n&&(t.cancel(n),n=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeAbandonedController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d,c){var m=this,u=!0;function p(){var e=i.localStorage.getItem("motion2.home.abandoned.bull.contacts:"+m.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(m.query=_.merge(e.query,_.omit(m.query,["sort","limit","page"])),m.query=_.omit(m.query,"filter")),s.voiceDisposition.get().$promise.then(function(e){m.disposition=e?e.rows:[]}).catch(function(e){console.log(e)}),s.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){m.queues=e||{count:0,rows:[]},m.queuesMap=_.mapValues(_.keyBy(m.queues.rows,"name"),"name"),m.defaultQueues=m.queues.rows?_.map(m.queues.rows,"name").join(","):void 0}).catch(function(e){console.error(e)}).finally(function(){m.getContacts()})}function g(e){m.contacts=e||{count:0,rows:[]},u=!1,m.refresh=!0}m.showTooltip=!1,m.refresh=!0,m.disable=[],m.disposition,m.currentUser=r.getCurrentUser(),m.localizationMap=c,m.pickerModel={dateStart:null,dateEnd:null},m.queues={},m.contacts={count:0,rows:[]},m.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},m.clearAll=function(){m.query.dateStart=void 0,m.query.dateEnd=void 0,m.pickerModel={dateStart:null,dateEnd:null},m.getContacts()},m.getContacts=function(){m.query.dateStart=void 0,m.query.dateEnd=void 0,m.pickerModel.dateStart&&!u&&(m.query.dateStart=m.pickerModel.dateStart,m.query.dateEnd=m.pickerModel.dateEnd);m.query.queue=m.query.queue||m.defaultQueues,m.query.offset=(m.query.page-1)*m.query.limit,i.localStorage.setItem("motion2.home.abandoned.bull.contacts:"+m.currentUser.id,JSON.stringify({query:_.omit(m.query,"queue")})),m.promise=s.voiceQueueReport.getVoiceQueuesReport(m.query,g).$promise},m.refreshContacts=function(){m.showTooltip=!1,m.getContacts()},m.onInit=p,m.reserved=function(e,t){e&&(m.disable[e.id]=!0,s.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?m.currentUser.name:null,assigned:e.assigned,disposition:t||null}).$promise.catch(function(e){console.log(e)}).finally(function(){m.disable[e.id]=!1}))},m.onSavevoiceQueueReport=function(e){m.queuesMap&&"outbound"===e.type&&m.queuesMap[e.queue]&&(m.showTooltip=!0)},m.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(m.contacts.rows,["id",e.id]);0<=t&&_.merge(m.contacts.rows[t],e)}},m.call=e.$parent.$parent.$parent.$parent.vm.call,m.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,m.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,m.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",m.onSavevoiceQueueReport),l.onWithoutApply("voiceQueueReport:update",m.onUpdatevoiceQueueReport),p();var v=!0,h=1;e.$watch("vm_bull.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=h),m.getContacts())}),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeAbandonedBullController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d,c){var m=this,u=!0;function p(){var e=i.localStorage.getItem("motion2.home.abandoned.voice.contacts:"+m.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(m.query=_.merge(e.query,_.omit(m.query,["sort","limit","page"])),m.query=_.omit(m.query,"filter")),s.voiceDisposition.get().$promise.then(function(e){m.disposition=e?e.rows:[]}).catch(function(e){console.log(e)}),s.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise.then(function(e){m.queues=e||{count:0,rows:[]},m.queuesMap=_.mapValues(_.keyBy(m.queues.rows,"name"),"name"),m.defaultQueues=m.queues.rows?_.map(m.queues.rows,"name").join(","):void 0}).catch(function(e){console.error(e)}).finally(function(){m.getContacts()})}function g(e){m.contacts=e||{count:0,rows:[]},u=!1,m.refresh=!0}m.showTooltip=!1,m.refresh=!0,m.disable=[],m.disposition,m.currentUser=r.getCurrentUser(),m.localizationMap=c,m.pickerModel={dateStart:null,dateEnd:null},m.queues={},m.contacts={count:0,rows:[]},m.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},m.clearAll=function(){m.query.dateStart=void 0,m.query.dateEnd=void 0,m.pickerModel={dateStart:null,dateEnd:null},m.getContacts()},m.getContacts=function(){m.query.dateStart=void 0,m.query.dateEnd=void 0,m.pickerModel.dateStart&&!u&&(m.query.dateStart=m.pickerModel.dateStart,m.query.dateEnd=m.pickerModel.dateEnd);m.query.queue=m.query.queue||m.defaultQueues,m.query.offset=(m.query.page-1)*m.query.limit,i.localStorage.setItem("motion2.home.abandoned.voice.contacts:"+m.currentUser.id,JSON.stringify({query:_.omit(m.query,"queue")})),m.promise=s.voiceQueueReport.getVoiceQueuesReport(m.query,g).$promise},m.refreshContacts=function(){m.showTooltip=!1,m.getContacts()},m.onInit=p,m.reserved=function(e,t){e&&(m.disable[e.id]=!0,s.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?m.currentUser.name:null,assigned:e.assigned,disposition:t||null}).$promise.catch(function(e){console.log(e)}).finally(function(){m.disable[e.id]=!1}))},m.onSavevoiceQueueReport=function(e){m.queuesMap&&"inbound"===e.type&&m.queuesMap[e.queue]&&(m.showTooltip=!0)},m.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(m.contacts.rows,["id",e.id]);0<=t&&_.merge(m.contacts.rows[t],e)}},m.call=e.$parent.$parent.$parent.$parent.vm.call,m.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,m.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,m.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",m.onSavevoiceQueueReport),l.onWithoutApply("voiceQueueReport:update",m.onUpdatevoiceQueueReport),p();var v=!0,h=1;e.$watch("vm_voice.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=h),m.getContacts())}),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeAbandonedVoiceController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s){var r=this;r.user=i.getCurrentUser(),r.license={},r.sidebar="dashboard",r.navigation=s.getNavigation(),r.addContactTab=e.$parent.vm.addContactTab,r.addInteractionTab=e.$parent.vm.addInteractionTab,r.init=function(e){r.license=e;var t=n.localStorage.getItem("motion2.home:"+r.user.id);if(t)try{t=JSON.parse(t),r.sidebar=t.currentSidebarTab?t.currentSidebarTab:"dashboard"}catch(e){console.error(e),r.sidebar="dashboard"}},r.changeSidebarTab=function(e){r.sidebar=e,n.localStorage.setItem("motion2.home:"+r.user.id,JSON.stringify({currentSidebarTab:e}))},r.hasPermission=function(e){return i.hasPermission(e)}}e.$inject=["$scope","$timeout","$window","api","Auth","socket","msNavigationAgentService"],angular.module("app.dashboards").controller("AgentGeneralHomeController",e)}(),function(){"use strict";function e(n,a,e,t,i,o,s,r,l,d){var c=this;function m(e){c.chatInteractions=e||{count:0,rows:[]};for(var t=0;t<c.chatInteractions.rows.length;t+=1)p(c.chatInteractions.rows[t])}function u(){c.query.dateStart=void 0,c.query.dateEnd=void 0,c.pickerModel.dateStart&&(c.query.dateStart=c.pickerModel.dateStart,c.query.dateEnd=c.pickerModel.dateEnd),c.query.offset=(c.query.page-1)*c.query.limit,i.localStorage.setItem("motion2.home.chat:"+c.user.id,JSON.stringify({query:c.query})),c.promise=s.chatInteraction.get(c.query,m).$promise}function p(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}c.user=r.getCurrentUser(),c.tags={count:0,rows:[]},c.chatInteractions={count:0,rows:[]},c.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,substatus:null,ChatWebsiteId:null},c.success=m,c.getChatInteractions=u,c.showChatInteraction=function(e,t){n.$parent.vm.addInteractionTab("chat",t)},c.getContactLabel=function(e){if(e.Contact){var t="";t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||"");var n=e.Account?e.Account.mapKey:void 0;return t+=n&&e.Contact[n]?" <"+e.Contact[n]+">":""}return o.instant("DASHBOARDS.UNKNOWN")},c.getUserLabel=function(e){if(e.UserId)return e.UserId===r.getCurrentUser().id?o.instant("DASHBOARDS.ME"):c.usersByKey[e.UserId].fullname+" <"+c.usersByKey[e.UserId].internal+">";return o.instant("DASHBOARDS.NOT_ASSIGNED")},c.getChatWebsiteLabel=function(e){if(e.Account)return e.Account.key;return o.instant("DASHBOARDS.UNKNOWN")},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.clearAll=function(){c.calendarModel={dateStart:null},c.pickerModel={dateStart:null},c.serviceModel={dateStart:null},c.getChatInteractions()},c.onInit=function(){return s.chatWebsite.get({nolimit:!0}).$promise.then(function(e){return c.chatAccounts=e||{count:0,rows:[]},s.tag.get().$promise}).then(function(e){c.tags=e||{count:0,rows:[]}}).then(function(){return s.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){c.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=i.localStorage.getItem("motion2.home.chat:"+c.user.id);if(e)try{(e=JSON.parse(e)).query&&(c.query=_.merge(c.query,e.query),c.query=_.omit(c.query,"filter"),c.query.sort&&0<=c.query.sort.indexOf("lastMessage")&&(c.query=_.omit(c.query,"sort")),c.query.includeAll=!0)}catch(e){console.error(e)}l.on("chatInteraction:save",c.onChatInteractionSave),l.on("chatInteraction:update",c.onChatInteractionSave),l.on("chatInteractionTags:save",c.onChatInteractionTagsSave),l.on("chatMessage:save",c.onChatMessageSave),l.on("chatMessage:update",c.onChatMessageSave),l.on("user_has_chat_interactions:save",c.onChatInteractionOpen),l.on("user_has_chat_interactions:remove",c.onChatInteractionClose),c.getChatInteractions()})},c.onChatInteractionSave=function(e){if(e){var t=_.find(c.chatInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):u(),p(e)}},c.onChatInteractionTagsSave=function(e){if(e){var t=_.find(c.chatInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},c.onChatMessageSave=function(e){if(e&&!e.secret){var t=_.find(c.chatInteractions.rows,{id:e.ChatInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),p(t)}}},c.onChatInteractionOpen=function(e){var t=_.find(c.chatInteractions.rows,{id:e.ChatInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},c.onChatInteractionClose=function(e){var t=_.find(c.chatInteractions.rows,{id:e.ChatInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},c.localizationMap={Today:o.instant("DASHBOARDS.TODAY"),Yesterday:o.instant("DASHBOARDS.YESTERDAY"),"This Week":o.instant("DASHBOARDS.THIS_WEEK"),"Last Week":o.instant("DASHBOARDS.LAST_WEEK"),"This Month":o.instant("DASHBOARDS.THIS_MONTH"),"Last Month":o.instant("DASHBOARDS.LAST_MONTH"),"This Year":o.instant("DASHBOARDS.THIS_YEAR"),"Last Year":o.instant("DASHBOARDS.LAST_YEAR"),January:o.instant("DASHBOARDS.JANUARY"),February:o.instant("DASHBOARDS.FEBRUARY"),March:o.instant("DASHBOARDS.MARCH"),April:o.instant("DASHBOARDS.APRIL"),May:o.instant("DASHBOARDS.MAY"),June:o.instant("DASHBOARDS.JUNE"),July:o.instant("DASHBOARDS.JULY"),August:o.instant("DASHBOARDS.AUGUST"),September:o.instant("DASHBOARDS.SEPTEMBER"),October:o.instant("DASHBOARDS.OCTOBER"),November:o.instant("DASHBOARDS.NOVEMBER"),December:o.instant("DASHBOARDS.DECEMBER"),Mon:o.instant("DASHBOARDS.MON"),Tue:o.instant("DASHBOARDS.TUE"),Wed:o.instant("DASHBOARDS.WED"),Thu:o.instant("DASHBOARDS.THU"),Fri:o.instant("DASHBOARDS.FRI"),Sat:o.instant("DASHBOARDS.SAT"),Sun:o.instant("DASHBOARDS.SUN")},c.pickerModel={dateStart:null},c.onInit();var g=!0,v=1;n.$watch("vm.query.filter",function(e,t){g?a(function(){g=!1}):(t||(v=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=v),c.getChatInteractions())}),n.$on("$destroy",function(){l.removeAllListeners("chatMessage:save"),l.removeAllListeners("chatMessage:update"),l.removeAllListeners("chatInteraction:save"),l.removeAllListeners("chatInteractionTags:save"),l.removeAllListeners("chatInteraction:update"),l.removeAllListeners("user_has_chat_interactions:save"),l.removeAllListeners("user_has_chat_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeChatController",e)}(),function(){"use strict";function e(n,a,i,o,e,t,s,r){var l=this;l.currentUser=t.getCurrentUser(),l.lists={},l.contacts={count:0,rows:[]},l.query={sort:"-updatedAt",limit:10,page:1},l.getContacts=function(){l.query.ListId=l.query.ListId||l.defaultLists,l.query.offset=(l.query.page-1)*l.query.limit,r.localStorage.setItem("motion2.home.contacts:"+l.currentUser.id,JSON.stringify({query:_.omit(l.query,"ListId")})),l.promise=s.cmContact.get(l.query,m).$promise},l.refreshContacts=function(){l.getContacts()},l.mergeContact=function(e,t){o.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.duplicateContact=function(e,t){o.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.openContact=function(e,t){a.$parent.vm.addContactTab(t)},l.call=a.$parent.vm.call,(l.onInit=u)();var d=!0,c=1;function m(e){l.contacts=e||{count:0,rows:[]}}function u(){var e=r.localStorage.getItem("motion2.home.contacts:"+l.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(l.query=_.merge(l.query,e.query),l.query=_.omit(l.query,"filter")),s.user.getLists({id:l.currentUser.id,fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){l.lists=e||{count:0,rows:[]},l.listsMap=_.keyBy(l.lists.rows,"id"),l.defaultLists=l.lists.rows?_.map(l.lists.rows,"id").join(","):void 0}).catch(function(e){console.error(e)}).finally(function(){l.getContacts()})}a.$watch("vm.query.filter",function(e,t){d?i(function(){d=!1}):(t||(c=l.query.page),e!==t&&(l.query.page=1),e||(l.query.page=c),l.getContacts())})}e.$inject=["$document","$scope","$timeout","$mdDialog","$stateParams","Auth","api","$window"],angular.module("app.dashboards").controller("AgentHomeContactsController",e)}(),function(){"use strict";function e(e,t){var n=t(function(){},999);e.$on("$destroy",function(){n&&(t.cancel(n),n=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeDashboardController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this,m=["type","waiting","dialMethod","dialActive"];function u(e){c.voiceQueuesTotal=e.count?e.count:0,c.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.voiceQueues,function(e,t){c.rpcVoiceQueues[t]&&(c.voiceQueues[t].waiting=c.rpcVoiceQueues[t].waiting||0)})}c.voiceQueues={},c.voiceQueuesTotal=0,c.rpcVoiceQueues={},c.getVoiceQueues={},c.rpcVoiceQueuesChannels={},c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.load=!0,c.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"outbound",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=u,c.getVoiceQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=s.user.getQueues(c.query,u).$promise},c.getSize=function(e){return _.size(e)},c.onSaveQueue=function(e){c.voiceQueues[e.id]&&c.rpcVoiceQueues[e.id]&&(c.rpcVoiceQueues[e.id]=e,_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onSaveChannel=function(e){"outbound"===e.type&&(e.queuecallerleaveAt?(delete c.rpcVoiceQueuesChannels[e.uniqueid],c.load&&c.deleteVoiceQueuesChannels.push(e.uniqueid)):(c.rpcVoiceQueuesChannels[e.uniqueid]=e,c.load&&(c.addVoiceQueuesChannels[e.uniqueid]=e)))},c.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getVoiceQueues()},c.onSaveVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]=_.pick(e,m))},c.onUpdateVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]&&_.merge(c.rpcVoiceQueues[e.id],_.pick(e,m)),c.voiceQueues[e.id]&&_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete c.rpcVoiceQueues[e.id],delete c.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",c.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",c.onSaveChannel),l.onWithoutApply("userVoiceQueue:save",c.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",c.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",c.onUpdateVoiceQueue),s.rpc.getVoiceQueues().$promise.then(function(e){return c.rpcVoiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},s.rpc.getVoiceQueuesChannels().$promise}).then(function(e){c.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,{type:"outbound",queuecallerleaveAt:null}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(c.rpcVoiceQueuesChannels,c.addVoiceQueuesChannels);for(var e=0;e<c.deleteVoiceQueuesChannels.length;e+=1)delete c.rpcVoiceQueuesChannels[c.deleteVoiceQueuesChannels[e]];c.load=!1,c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.getVoiceQueues()});var p=!0,g=1;e.$watch("vm_dc.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardBullController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcChatQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.chatQueuesTotal=e.count?e.count:0,c.chatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.chatQueues,function(e,t){c.rpcChatQueues[t]&&(c.chatQueues[t].waiting=c.rpcChatQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=s.user.getQueues(c.query,g).$promise}c.chatQueues={},c.chatQueuesTotal=0,c.rpcChatQueues={},c.paginatedInteractions=[],c.deleteChatQueuesWaitingInteractions=[],c.rpcChatQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"chat",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getChatQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.chatQueues[e.id]&&c.rpcChatQueues[e.id]&&(_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onSaveChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]=_.pick(e,m))},c.onUpdateChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]&&_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),c.chatQueues[e.id]&&_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onRemoveChatQueue=function(e){_.isNil(e)||(delete c.rpcChatQueues[e.id],delete c.chatQueues[e.id])},c.onSaveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onRemoveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onSaveChatQueueChannel=function(e){c.rpcChatQueuesWaitingInteractions[e.id]=e,p()},c.onRemoveChatQueueChannel=function(e){delete c.rpcChatQueuesWaitingInteractions[e.id],u&&c.deleteChatQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("chat_queue:save",c.onSaveQueue),l.onWithoutApply("chatQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("chatQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("chatQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userChatQueue:save",c.onSaveUserChatQueue),l.onWithoutApply("userChatQueue:remove",c.onRemoveUserChatQueue),l.onWithoutApply("chat_queue_waiting_interaction:save",c.onSaveChatQueueChannel),l.onWithoutApply("chat_queue_waiting_interaction:remove",c.onRemoveChatQueueChannel),s.rpc.getChatQueues().$promise.then(function(e){return c.rpcChatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},s.rpc.getChatQueuesWaitingInteractions().$promise}).then(function(e){_.merge(c.rpcChatQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteChatQueuesWaitingInteractions.length;e+=1)delete c.rpcChatQueuesWaitingInteractions[c.deleteChatQueuesWaitingInteractions[e]];u=!1,c.deleteChatQueuesWaitingInteractions=[],v(),p()});var h=!0,b=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(b=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=b),c.getChatQueues())}),e.$on("$destroy",function(){l.removeAllListeners("chat_queue:save"),l.removeAllListeners("chatQueue:save"),l.removeAllListeners("chatQueue:update"),l.removeAllListeners("chatQueue:remove"),l.removeAllListeners("userChatQueue:save"),l.removeAllListeners("userChatQueue:remove"),l.removeAllListeners("chat_queue_waiting_interaction:save"),l.removeAllListeners("chat_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelChatController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcFaxQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.faxQueuesTotal=e.count?e.count:0,c.faxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.faxQueues,function(e,t){c.rpcFaxQueues[t]&&(c.faxQueues[t].waiting=c.rpcFaxQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=s.user.getQueues(c.query,g).$promise}c.faxQueues={},c.faxQueuesTotal=0,c.rpcFaxQueues={},c.paginatedInteractions=[],c.deleteFaxQueuesWaitingInteractions=[],c.rpcFaxQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"fax",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getFaxQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.faxQueues[e.id]&&c.rpcFaxQueues[e.id]&&(_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onSaveFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]=_.pick(e,m))},c.onUpdateFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]&&_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),c.faxQueues[e.id]&&_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onRemoveFaxQueue=function(e){_.isNil(e)||(delete c.rpcFaxQueues[e.id],delete c.faxQueues[e.id])},c.onSaveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onRemoveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onSaveFaxQueueChannel=function(e){c.rpcFaxQueuesWaitingInteractions[e.id]=e,p()},c.onRemoveFaxQueueChannel=function(e){delete c.rpcFaxQueuesWaitingInteractions[e.id],u&&c.deleteFaxQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("fax_queue:save",c.onSaveQueue),l.onWithoutApply("faxQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("faxQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("faxQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userFaxQueue:save",c.onSaveUserFaxQueue),l.onWithoutApply("userFaxQueue:remove",c.onRemoveUserFaxQueue),l.onWithoutApply("fax_queue_waiting_interaction:save",c.onSaveFaxQueueChannel),l.onWithoutApply("fax_queue_waiting_interaction:remove",c.onRemoveFaxQueueChannel),s.rpc.getFaxQueues().$promise.then(function(e){return c.rpcFaxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},s.rpc.getFaxQueuesWaitingInteractions().$promise}).then(function(e){_.merge(c.rpcFaxQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteFaxQueuesWaitingInteractions.length;e+=1)delete c.rpcFaxQueuesWaitingInteractions[c.deleteFaxQueuesWaitingInteractions[e]];u=!1,c.deleteFaxQueuesWaitingInteractions=[],v(),p()});var h=!0,b=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(b=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=b),c.getFaxQueues())}),e.$on("$destroy",function(){l.removeAllListeners("fax_queue:save"),l.removeAllListeners("faxQueue:save"),l.removeAllListeners("faxQueue:update"),l.removeAllListeners("faxQueue:remove"),l.removeAllListeners("userFaxQueue:save"),l.removeAllListeners("userFaxQueue:remove"),l.removeAllListeners("fax_queue_waiting_interaction:save"),l.removeAllListeners("fax_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelFaxController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcMailQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.mailQueuesTotal=e.count?e.count:0,c.mailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.mailQueues,function(e,t){c.rpcMailQueues[t]&&(c.mailQueues[t].waiting=c.rpcMailQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=s.user.getQueues(c.query,g).$promise}c.mailQueues={},c.mailQueuesTotal=0,c.rpcMailQueues={},c.paginatedInteractions=[],c.deleteMailQueuesWaitingInteractions=[],c.rpcMailQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"mail",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getMailQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.mailQueues[e.id]&&c.rpcMailQueues[e.id]&&(_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onSaveMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]=_.pick(e,m))},c.onUpdateMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]&&_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),c.mailQueues[e.id]&&_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onRemoveMailQueue=function(e){_.isNil(e)||(delete c.rpcMailQueues[e.id],delete c.mailQueues[e.id])},c.onSaveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onRemoveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onSaveMailQueueChannel=function(e){c.rpcMailQueuesWaitingInteractions[e.id]=e,p()},c.onRemoveMailQueueChannel=function(e){delete c.rpcMailQueuesWaitingInteractions[e.id],u&&c.deleteMailQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("mail_queue:save",c.onSaveQueue),l.onWithoutApply("mailQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("mailQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("mailQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userMailQueue:save",c.onSaveUserMailQueue),l.onWithoutApply("userMailQueue:remove",c.onRemoveUserMailQueue),l.onWithoutApply("mail_queue_waiting_interaction:save",c.onSaveMailQueueChannel),l.onWithoutApply("mail_queue_waiting_interaction:remove",c.onRemoveMailQueueChannel),s.rpc.getMailQueues().$promise.then(function(e){return c.rpcMailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},s.rpc.getMailQueuesWaitingInteractions().$promise}).then(function(e){_.merge(c.rpcMailQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteMailQueuesWaitingInteractions.length;e+=1)delete c.rpcMailQueuesWaitingInteractions[c.deleteMailQueuesWaitingInteractions[e]];u=!1,c.deleteMailQueuesWaitingInteractions=[],v(),p()});var h=!0,b=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(b=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=b),c.getMailQueues())}),e.$on("$destroy",function(){l.removeAllListeners("mail_queue:save"),l.removeAllListeners("mailQueue:save"),l.removeAllListeners("mailQueue:update"),l.removeAllListeners("mailQueue:remove"),l.removeAllListeners("userMailQueue:save"),l.removeAllListeners("userMailQueue:remove"),l.removeAllListeners("mail_queue_waiting_interaction:save"),l.removeAllListeners("mail_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelMailController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcOpenchannelQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.openchannelQueuesTotal=e.count?e.count:0,c.openchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.openchannelQueues,function(e,t){c.rpcOpenchannelQueues[t]&&(c.openchannelQueues[t].waiting=c.rpcOpenchannelQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=s.user.getQueues(c.query,g).$promise}c.openchannelQueues={},c.openchannelQueuesTotal=0,c.rpcOpenchannelQueues={},c.paginatedInteractions=[],c.deleteOpenchannelQueuesWaitingInteractions=[],c.rpcOpenchannelQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"openchannel",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getOpenchannelQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.openchannelQueues[e.id]&&c.rpcOpenchannelQueues[e.id]&&(_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onSaveOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]=_.pick(e,m))},c.onUpdateOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]&&_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),c.openchannelQueues[e.id]&&_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onRemoveOpenchannelQueue=function(e){_.isNil(e)||(delete c.rpcOpenchannelQueues[e.id],delete c.openchannelQueues[e.id])},c.onSaveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onRemoveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onSaveOpenchannelQueueChannel=function(e){c.rpcOpenchannelQueuesWaitingInteractions[e.id]=e,p()},c.onRemoveOpenchannelQueueChannel=function(e){delete c.rpcOpenchannelQueuesWaitingInteractions[e.id],u&&c.deleteOpenchannelQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("openchannel_queue:save",c.onSaveQueue),l.onWithoutApply("openchannelQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("openchannelQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("openchannelQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userOpenchannelQueue:save",c.onSaveUserOpenchannelQueue),l.onWithoutApply("userOpenchannelQueue:remove",c.onRemoveUserOpenchannelQueue),l.onWithoutApply("openchannel_queue_waiting_interaction:save",c.onSaveOpenchannelQueueChannel),l.onWithoutApply("openchannel_queue_waiting_interaction:remove",c.onRemoveOpenchannelQueueChannel),s.rpc.getOpenchannelQueues().$promise.then(function(e){return c.rpcOpenchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},s.rpc.getOpenchannelQueuesWaitingInteractions().$promise}).then(function(e){_.merge(c.rpcOpenchannelQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteOpenchannelQueuesWaitingInteractions.length;e+=1)delete c.rpcOpenchannelQueuesWaitingInteractions[c.deleteOpenchannelQueuesWaitingInteractions[e]];u=!1,c.deleteOpenchannelQueuesWaitingInteractions=[],v(),p()});var h=!0,b=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(b=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=b),c.getOpenchannelQueues())}),e.$on("$destroy",function(){l.removeAllListeners("openchannel_queue:save"),l.removeAllListeners("openchannelQueue:save"),l.removeAllListeners("openchannelQueue:update"),l.removeAllListeners("openchannelQueue:remove"),l.removeAllListeners("userOpenchannelQueue:save"),l.removeAllListeners("userOpenchannelQueue:remove"),l.removeAllListeners("openchannel_queue_waiting_interaction:save"),l.removeAllListeners("openchannel_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelOpenchannelController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcSmsQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.smsQueuesTotal=e.count?e.count:0,c.smsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.smsQueues,function(e,t){c.rpcSmsQueues[t]&&(c.smsQueues[t].waiting=c.rpcSmsQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=s.user.getQueues(c.query,g).$promise}c.smsQueues={},c.smsQueuesTotal=0,c.rpcSmsQueues={},c.paginatedInteractions=[],c.deleteSmsQueuesWaitingInteractions=[],c.rpcSmsQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"sms",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getSmsQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.smsQueues[e.id]&&c.rpcSmsQueues[e.id]&&(_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onSaveSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]=_.pick(e,m))},c.onUpdateSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]&&_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),c.smsQueues[e.id]&&_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onRemoveSmsQueue=function(e){_.isNil(e)||(delete c.rpcSmsQueues[e.id],delete c.smsQueues[e.id])},c.onSaveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onRemoveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onSaveSmsQueueChannel=function(e){c.rpcSmsQueuesWaitingInteractions[e.id]=e,p()},c.onRemoveSmsQueueChannel=function(e){delete c.rpcSmsQueuesWaitingInteractions[e.id],u&&c.deleteSmsQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("sms_queue:save",c.onSaveQueue),l.onWithoutApply("smsQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("smsQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("smsQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userSmsQueue:save",c.onSaveUserSmsQueue),l.onWithoutApply("userSmsQueue:remove",c.onRemoveUserSmsQueue),l.onWithoutApply("sms_queue_waiting_interaction:save",c.onSaveSmsQueueChannel),l.onWithoutApply("sms_queue_waiting_interaction:remove",c.onRemoveSmsQueueChannel),s.rpc.getSmsQueues().$promise.then(function(e){return c.rpcSmsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},s.rpc.getSmsQueuesWaitingInteractions().$promise}).then(function(e){_.merge(c.rpcSmsQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteSmsQueuesWaitingInteractions.length;e+=1)delete c.rpcSmsQueuesWaitingInteractions[c.deleteSmsQueuesWaitingInteractions[e]];u=!1,c.deleteSmsQueuesWaitingInteractions=[],v(),p()});var h=!0,b=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(b=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=b),c.getSmsQueues())}),e.$on("$destroy",function(){l.removeAllListeners("sms_queue:save"),l.removeAllListeners("smsQueue:save"),l.removeAllListeners("smsQueue:update"),l.removeAllListeners("smsQueue:remove"),l.removeAllListeners("userSmsQueue:save"),l.removeAllListeners("userSmsQueue:remove"),l.removeAllListeners("sms_queue_waiting_interaction:save"),l.removeAllListeners("sms_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelSmsController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this,m=["type","waiting","dialMethod","dialActive"];function u(e){c.voiceQueuesTotal=e.count?e.count:0,c.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.voiceQueues,function(e,t){c.rpcVoiceQueues[t]&&(c.voiceQueues[t].waiting=c.rpcVoiceQueues[t].waiting||0)})}c.voiceQueues={},c.voiceQueuesTotal=0,c.rpcVoiceQueues={},c.getVoiceQueues={},c.rpcVoiceQueuesChannels={},c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.load=!0,c.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"inbound",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=u,c.getVoiceQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=s.user.getQueues(c.query,u).$promise},c.getSize=function(e){return _.size(e)},c.onSaveQueue=function(e){c.voiceQueues[e.id]&&c.rpcVoiceQueues[e.id]&&(c.rpcVoiceQueues[e.id]=e,_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onSaveChannel=function(e){"inbound"===e.type&&(e.queuecallerleaveAt?(delete c.rpcVoiceQueuesChannels[e.uniqueid],c.load&&c.deleteVoiceQueuesChannels.push(e.uniqueid)):(c.rpcVoiceQueuesChannels[e.uniqueid]=e,c.load&&(c.addVoiceQueuesChannels[e.uniqueid]=e)))},c.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getVoiceQueues()},c.onSaveVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]=_.pick(e,m))},c.onUpdateVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]&&_.merge(c.rpcVoiceQueues[e.id],_.pick(e,m)),c.voiceQueues[e.id]&&_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete c.rpcVoiceQueues[e.id],delete c.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",c.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",c.onSaveChannel),l.onWithoutApply("userVoiceQueue:save",c.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",c.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",c.onUpdateVoiceQueue),s.rpc.getVoiceQueues().$promise.then(function(e){return c.rpcVoiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},s.rpc.getVoiceQueuesChannels().$promise}).then(function(e){c.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,{type:"inbound",queuecallerleaveAt:null}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(c.rpcVoiceQueuesChannels,c.addVoiceQueuesChannels);for(var e=0;e<c.deleteVoiceQueuesChannels.length;e+=1)delete c.rpcVoiceQueuesChannels[c.deleteVoiceQueuesChannels[e]];c.load=!1,c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.getVoiceQueues()});var p=!0,g=1;e.$watch("vm_dc.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardVoiceController",e)}(),function(){"use strict";function e(n,a,i,o,t,s,r,l,d,c){var m=this;function e(e){m.faxInteractions=e||{count:0,rows:[]};for(var t=0;t<m.faxInteractions.rows.length;t+=1)p(m.faxInteractions.rows[t])}function u(){m.query.dateStart=void 0,m.query.dateEnd=void 0,m.pickerModel.dateStart&&(m.query.dateStart=m.pickerModel.dateStart,m.query.dateEnd=m.pickerModel.dateEnd),m.query.offset=(m.query.page-1)*m.query.limit,t.localStorage.setItem("motion2.home.fax:"+m.user.id,JSON.stringify({query:m.query})),m.promise=r.faxInteraction.get(m.query,e).$promise}function p(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=l.getCurrentUser(),m.tags={count:0,rows:[]},m.faxInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,substatus:null,FaxAccountId:null},m.success=e,m.getFaxInteractions=u,m.showFaxInteraction=function(e,t){n.$parent.vm.addInteractionTab("fax",t)},m.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),t+=" <"+(e.Contact.fax||"unknown")+">"}return s.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===l.getCurrentUser().id?s.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return s.instant("DASHBOARDS.NOT_ASSIGNED")},m.getFaxAccountLabel=function(e){if(e.Account)return e.Account.key;return s.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getFaxInteractions()},m.composeFaxInteraction=function(e,t){i.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeFax/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){return r.faxAccount.send({id:t.id},e).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),n.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})})},m.onInit=function(){return r.faxAccount.get({nolimit:!0}).$promise.then(function(e){return m.faxAccounts=e||{count:0,rows:[]},r.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return r.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.fax:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}d.on("faxInteraction:save",m.onFaxInteractionSave),d.on("faxInteraction:update",m.onFaxInteractionSave),d.on("faxInteractionTags:save",m.onFaxInteractionTagsSave),d.on("faxMessage:save",m.onFaxMessageSave),d.on("faxMessage:update",m.onFaxMessageSave),d.on("user_has_fax_interactions:save",m.onFaxInteractionOpen),d.on("user_has_fax_interactions:remove",m.onFaxInteractionClose),m.getFaxInteractions()})},m.onFaxInteractionSave=function(e){if(e){var t=_.find(m.faxInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):u(),p(e)}},m.onFaxInteractionTagsSave=function(e){if(e){var t=_.find(m.faxInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onFaxMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),p(t)}}},m.onFaxInteractionOpen=function(e){var t=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onFaxInteractionClose=function(e){var t=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap={Today:s.instant("DASHBOARDS.TODAY"),Yesterday:s.instant("DASHBOARDS.YESTERDAY"),"This Week":s.instant("DASHBOARDS.THIS_WEEK"),"Last Week":s.instant("DASHBOARDS.LAST_WEEK"),"This Month":s.instant("DASHBOARDS.THIS_MONTH"),"Last Month":s.instant("DASHBOARDS.LAST_MONTH"),"This Year":s.instant("DASHBOARDS.THIS_YEAR"),"Last Year":s.instant("DASHBOARDS.LAST_YEAR"),January:s.instant("DASHBOARDS.JANUARY"),February:s.instant("DASHBOARDS.FEBRUARY"),March:s.instant("DASHBOARDS.MARCH"),April:s.instant("DASHBOARDS.APRIL"),May:s.instant("DASHBOARDS.MAY"),June:s.instant("DASHBOARDS.JUNE"),July:s.instant("DASHBOARDS.JULY"),August:s.instant("DASHBOARDS.AUGUST"),September:s.instant("DASHBOARDS.SEPTEMBER"),October:s.instant("DASHBOARDS.OCTOBER"),November:s.instant("DASHBOARDS.NOVEMBER"),December:s.instant("DASHBOARDS.DECEMBER"),Mon:s.instant("DASHBOARDS.MON"),Tue:s.instant("DASHBOARDS.TUE"),Wed:s.instant("DASHBOARDS.WED"),Thu:s.instant("DASHBOARDS.THU"),Fri:s.instant("DASHBOARDS.FRI"),Sat:s.instant("DASHBOARDS.SAT"),Sun:s.instant("DASHBOARDS.SUN")},m.pickerModel={dateStart:null},m.onInit();var g=!0,v=1;n.$watch("vm.query.filter",function(e,t){g?a(function(){g=!1}):(t||(v=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=v),m.getFaxInteractions())}),n.$on("$destroy",function(){d.removeAllListeners("faxMessage:save"),d.removeAllListeners("faxMessage:update"),d.removeAllListeners("faxInteraction:save"),d.removeAllListeners("faxInteractionTags:save"),d.removeAllListeners("faxInteraction:update"),d.removeAllListeners("user_has_fax_interactions:save"),d.removeAllListeners("user_has_fax_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeFaxController",e)}(),function(){"use strict";function e(a,n,i,o,t,s,r,l,d,c){var m=this;function e(e){m.mailInteractions=e||{count:0,rows:[]};for(var t=0;t<m.mailInteractions.rows.length;t+=1)p(m.mailInteractions.rows[t])}function u(){m.query.dateStart=void 0,m.query.dateEnd=void 0,m.pickerModel.dateStart&&(m.query.dateStart=m.pickerModel.dateStart,m.query.dateEnd=m.pickerModel.dateEnd),0!=m.query.closed&&(m.query.substatus=null),m.query.offset=(m.query.page-1)*m.query.limit,t.localStorage.setItem("motion2.home.mail:"+m.user.id,JSON.stringify({query:m.query})),m.promise=r.mailInteraction.get(m.query,e).$promise}function p(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=l.getCurrentUser(),m.tags={count:0,rows:[]},m.mailInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,substatus:null,MailAccountId:null},m.success=e,m.getMailInteractions=u,m.showMailInteraction=function(e,t){a.$parent.vm.addInteractionTab("mail",t)},m.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),e.to&&e.Account&&e.to.indexOf(e.Account.email)<0?t=e.to:t+=" <"+(e.Contact.email||"unknown")+">",t}return s.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===l.getCurrentUser().id?s.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return s.instant("DASHBOARDS.NOT_ASSIGNED")},m.getMailAccountLabel=function(e){if(e.Account)return e.Account.key;return s.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getMailInteractions()},m.composeMailInteraction=function(e,t){i.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeMail/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(n){return r.mailAccount.send({id:t.id},n).$promise.then(function(e){if(e&&e.Messages&&e.Messages.length){if(n.attachments&&n.attachments.length)for(var t=0;t<n.attachments.length;t+=1)r.attachment.update({id:n.attachments[t].id},{MailMessageId:_.head(e.Messages).id});c.success({title:"Message properly sent!",msg:"Message has been sent!"}),e.closed?(e.disposition=null,i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!0,locals:{channel:"mail",interaction:e}})):a.$parent.vm.addInteractionTab("mail",e)}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"MAILACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.onInit=function(){return r.mailAccount.get({nolimit:!0}).$promise.then(function(e){return m.mailAccounts=e||{count:0,rows:[]},r.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return r.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).then(function(){return r.mailSubstatus.get({nolimit:!0}).$promise}).then(function(e){m.subStatuses=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.mail:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}d.on("mailInteraction:save",m.onMailInteractionSave),d.on("mailInteraction:update",m.onMailInteractionSave),d.on("mailInteractionTags:save",m.onMailInteractionTagsSave),d.on("mailMessage:save",m.onMailMessageSave),d.on("mailMessage:update",m.onMailMessageSave),d.on("user_has_mail_interactions:save",m.onMailInteractionOpen),d.on("user_has_mail_interactions:remove",m.onMailInteractionClose),m.getMailInteractions()})},m.onMailInteractionSave=function(e){if(e){var t=_.find(m.mailInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):u(),p(e)}},m.onMailInteractionTagsSave=function(e){if(e){var t=_.find(m.mailInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onMailMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.mailInteractions.rows,{id:e.MailInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),p(t)}}},m.onMailInteractionOpen=function(e){var t=_.find(m.mailInteractions.rows,{id:e.MailInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onMailInteractionClose=function(e){var t=_.find(m.mailInteractions.rows,{id:e.MailInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap={Today:s.instant("DASHBOARDS.TODAY"),Yesterday:s.instant("DASHBOARDS.YESTERDAY"),"This Week":s.instant("DASHBOARDS.THIS_WEEK"),"Last Week":s.instant("DASHBOARDS.LAST_WEEK"),"This Month":s.instant("DASHBOARDS.THIS_MONTH"),"Last Month":s.instant("DASHBOARDS.LAST_MONTH"),"This Year":s.instant("DASHBOARDS.THIS_YEAR"),"Last Year":s.instant("DASHBOARDS.LAST_YEAR"),January:s.instant("DASHBOARDS.JANUARY"),February:s.instant("DASHBOARDS.FEBRUARY"),March:s.instant("DASHBOARDS.MARCH"),April:s.instant("DASHBOARDS.APRIL"),May:s.instant("DASHBOARDS.MAY"),June:s.instant("DASHBOARDS.JUNE"),July:s.instant("DASHBOARDS.JULY"),August:s.instant("DASHBOARDS.AUGUST"),September:s.instant("DASHBOARDS.SEPTEMBER"),October:s.instant("DASHBOARDS.OCTOBER"),November:s.instant("DASHBOARDS.NOVEMBER"),December:s.instant("DASHBOARDS.DECEMBER"),Mon:s.instant("DASHBOARDS.MON"),Tue:s.instant("DASHBOARDS.TUE"),Wed:s.instant("DASHBOARDS.WED"),Thu:s.instant("DASHBOARDS.THU"),Fri:s.instant("DASHBOARDS.FRI"),Sat:s.instant("DASHBOARDS.SAT"),Sun:s.instant("DASHBOARDS.SUN")},m.pickerModel={dateStart:null},m.onInit();var g=!0,v=1;a.$watch("vm.query.filter",function(e,t){g?n(function(){g=!1}):(t||(v=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=v),m.getMailInteractions())}),a.$on("$destroy",function(){d.removeAllListeners("mailMessage:save"),d.removeAllListeners("mailMessage:update"),d.removeAllListeners("mailInteraction:save"),d.removeAllListeners("mailInteractionTags:save"),d.removeAllListeners("mailInteraction:update"),d.removeAllListeners("user_has_mail_interactions:save"),d.removeAllListeners("user_has_mail_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeMailController",e)}(),function(){"use strict";function e(n,a,i,o,e,t,s){var r=this;r.currentUser=e.getCurrentUser(),r.lists={},r.contacts={count:0,rows:[]},r.query={id:r.currentUser.id,sort:"-updatedAt",limit:10,page:1},r.getContacts=function(){r.query.ListId=r.query.ListId||r.defaultLists,r.query.offset=(r.query.page-1)*r.query.limit,s.localStorage.setItem("motion2.home.mycontacts:"+r.currentUser.id,JSON.stringify({query:r.query})),r.promise=t.user.getContacts(r.query,c).$promise},r.refreshContacts=function(){r.getContacts()},r.mergeContact=function(e,t){o.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:r.currentUser.id,fields:"id,name"})}]},locals:{contacts:r.contacts.rows}})},r.duplicateContact=function(e,t){o.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:r.currentUser.id,fields:"id,name"})}]},locals:{contacts:r.contacts.rows}})},r.openContact=function(e,t){a.$parent.vm.addContactTab(t)},r.call=a.$parent.vm.call,r.onInit=function(){var e=s.localStorage.getItem("motion2.home.mycontacts:"+r.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(r.query=_.omit(e.query,"filter"))}catch(e){console.error(e)}r.getContacts()},t.cmList.get({fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){r.lists=e||{count:0,rows:[]},r.listsMap=_.keyBy(r.lists.rows,"id"),r.defaultLists=r.lists.rows?_.map(r.lists.rows,"id").join(","):void 0}).catch(function(e){console.error(e)}).finally(function(){r.getContacts()});var l=!0,d=1;function c(e){r.contacts=e||{count:0,rows:[]}}a.$watch("vm.query.filter",function(e,t){l?i(function(){l=!1}):(t||(d=r.query.page),e!==t&&(r.query.page=1),e||(r.query.page=d),r.getContacts())})}e.$inject=["$document","$scope","$timeout","$mdDialog","Auth","api","$window"],angular.module("app.dashboards").controller("AgentHomeMyContactsController",e)}(),function(){"use strict";function e(n,a,e,t,i,o,s,r,l,d){var c=this;function m(e){c.openchannelInteractions=e||{count:0,rows:[]};for(var t=0;t<c.openchannelInteractions.rows.length;t+=1)p(c.openchannelInteractions.rows[t])}function u(){c.query.dateStart=void 0,c.query.dateEnd=void 0,c.pickerModel.dateStart&&(c.query.dateStart=c.pickerModel.dateStart,c.query.dateEnd=c.pickerModel.dateEnd),c.query.offset=(c.query.page-1)*c.query.limit,i.localStorage.setItem("motion2.home.openchannel:"+c.user.id,JSON.stringify({query:c.query})),c.promise=s.openchannelInteraction.get(c.query,m).$promise}function p(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}c.user=r.getCurrentUser(),c.tags={count:0,rows:[]},c.openchannelInteractions={count:0,rows:[]},c.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,substatus:null,OpenchannelAccountId:null},c.success=m,c.getOpenchannelInteractions=u,c.showOpenchannelInteraction=function(e,t){n.$parent.vm.addInteractionTab("openchannel",t)},c.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),e.from&&(t=e.from),t}return o.instant("DASHBOARDS.UNKNOWN")},c.getUserLabel=function(e){if(e.UserId)return e.UserId===r.getCurrentUser().id?o.instant("DASHBOARDS.ME"):c.usersByKey[e.UserId].fullname+" <"+c.usersByKey[e.UserId].internal+">";return o.instant("DASHBOARDS.NOT_ASSIGNED")},c.getOpenchannelAccountLabel=function(e){if(e.Account)return e.Account.key;return o.instant("DASHBOARDS.UNKNOWN")},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.clearAll=function(){c.calendarModel={dateStart:null},c.pickerModel={dateStart:null},c.serviceModel={dateStart:null},c.getOpenchannelInteractions()},c.onInit=function(){return s.openchannelAccount.get({nolimit:!0}).$promise.then(function(e){return c.openchannelAccounts=e||{count:0,rows:[]},s.tag.get().$promise}).then(function(e){c.tags=e||{count:0,rows:[]}}).then(function(){return s.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){c.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=i.localStorage.getItem("motion2.home.openchannel:"+c.user.id);if(e)try{(e=JSON.parse(e)).query&&(c.query=_.merge(c.query,e.query),c.query=_.omit(c.query,"filter"),c.query.sort&&0<=c.query.sort.indexOf("lastMessage")&&(c.query=_.omit(c.query,"sort")),c.query.includeAll=!0)}catch(e){console.error(e)}l.on("openchannelInteraction:save",c.onOpenchannelInteractionSave),l.on("openchannelInteraction:update",c.onOpenchannelInteractionSave),l.on("openchannelInteractionTags:save",c.onOpenchannelInteractionTagsSave),l.on("openchannelMessage:save",c.onOpenchannelMessageSave),l.on("openchannelMessage:update",c.onOpenchannelMessageSave),l.on("user_has_openchannel_interactions:save",c.onOpenchannelInteractionOpen),l.on("user_has_openchannel_interactions:remove",c.onOpenchannelInteractionClose),c.getOpenchannelInteractions()})},c.onOpenchannelInteractionSave=function(e){if(e){var t=_.find(c.openchannelInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):u(),p(e)}},c.onOpenchannelInteractionTagsSave=function(e){if(e){var t=_.find(c.openchannelInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},c.onOpenchannelMessageSave=function(e){if(e&&!e.secret){var t=_.find(c.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),p(t)}}},c.onOpenchannelInteractionOpen=function(e){var t=_.find(c.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},c.onOpenchannelInteractionClose=function(e){var t=_.find(c.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},c.localizationMap={Today:o.instant("DASHBOARDS.TODAY"),Yesterday:o.instant("DASHBOARDS.YESTERDAY"),"This Week":o.instant("DASHBOARDS.THIS_WEEK"),"Last Week":o.instant("DASHBOARDS.LAST_WEEK"),"This Month":o.instant("DASHBOARDS.THIS_MONTH"),"Last Month":o.instant("DASHBOARDS.LAST_MONTH"),"This Year":o.instant("DASHBOARDS.THIS_YEAR"),"Last Year":o.instant("DASHBOARDS.LAST_YEAR"),January:o.instant("DASHBOARDS.JANUARY"),February:o.instant("DASHBOARDS.FEBRUARY"),March:o.instant("DASHBOARDS.MARCH"),April:o.instant("DASHBOARDS.APRIL"),May:o.instant("DASHBOARDS.MAY"),June:o.instant("DASHBOARDS.JUNE"),July:o.instant("DASHBOARDS.JULY"),August:o.instant("DASHBOARDS.AUGUST"),September:o.instant("DASHBOARDS.SEPTEMBER"),October:o.instant("DASHBOARDS.OCTOBER"),November:o.instant("DASHBOARDS.NOVEMBER"),December:o.instant("DASHBOARDS.DECEMBER"),Mon:o.instant("DASHBOARDS.MON"),Tue:o.instant("DASHBOARDS.TUE"),Wed:o.instant("DASHBOARDS.WED"),Thu:o.instant("DASHBOARDS.THU"),Fri:o.instant("DASHBOARDS.FRI"),Sat:o.instant("DASHBOARDS.SAT"),Sun:o.instant("DASHBOARDS.SUN")},c.pickerModel={dateStart:null},c.onInit();var g=!0,v=1;n.$watch("vm.query.filter",function(e,t){g?a(function(){g=!1}):(t||(v=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=v),c.getOpenchannelInteractions())}),n.$on("$destroy",function(){l.removeAllListeners("openchannelMessage:save"),l.removeAllListeners("openchannelMessage:update"),l.removeAllListeners("openchannelInteraction:save"),l.removeAllListeners("openchannelInteractionTags:save"),l.removeAllListeners("openchannelInteraction:update"),l.removeAllListeners("user_has_openchannel_interactions:save"),l.removeAllListeners("user_has_openchannel_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeOpenchannelController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u){var p=this;function g(e){p.voiceRecordings=e||{count:0,rows:[]}}p.currentUser=c.getCurrentUser(),p.voiceRecordings={},p.localizationMap=u,p.pickerModel={dateStart:null},p.table="voiceRecordings",p.query={UserId:p.currentUser.id,fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,rating,audio,UserId",sort:"-updatedAt",limit:10,page:1,type:null},p.downloadfile=function(i,e){return r.voiceRecording.download({id:i.id,exists:!0}).$promise.then(function(e){var t=[e.buffer],n=new Blob(t,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(n)),a.setAttribute("download",i.uniqueid+i.format),a.click()}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})},p.success=g,p.getVoiceRecordings=function(){p.query.dateStart=void 0,p.query.dateEnd=void 0,p.pickerModel.dateStart&&(p.query.dateStart=p.pickerModel.dateStart,p.query.dateEnd=p.pickerModel.dateEnd);p.query.offset=(p.query.page-1)*p.query.limit,t.localStorage.setItem("motion2.home.recordings:"+p.currentUser.id,JSON.stringify({query:p.query})),p.promise=r.voiceRecording.get(p.query,g).$promise},p.onInit=function(){var e=t.localStorage.getItem("motion2.home.recordings:"+p.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(p.query=_.omit(e.query,["filter","id"]),p.query.fields="createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,rating,audio,UserId",p.query.UserId=p.currentUser.id)}catch(e){console.error(e)}p.getVoiceRecordings()},p.clearAll=function(){p.pickerModel={dateStart:null},p.getVoiceRecordings()};var v=!0,h=1;e.$watch("vm.query.filter",function(e,t){v?s(function(){v=!1}):(t||(h=p.query.page),e!==t&&(p.query.page=1),e||(p.query.page=h),p.getVoiceRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","api","msUtils","toasty","Auth","$translate","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeRecordingsController",e)}(),function(){"use strict";function e(n,a,i,o,t,s,r,l,d,c){var m=this;function e(e){m.smsInteractions=e||{count:0,rows:[]};for(var t=0;t<m.smsInteractions.rows.length;t+=1)p(m.smsInteractions.rows[t])}function u(){m.query.dateStart=void 0,m.query.dateEnd=void 0,m.pickerModel.dateStart&&(m.query.dateStart=m.pickerModel.dateStart,m.query.dateEnd=m.pickerModel.dateEnd),m.query.offset=(m.query.page-1)*m.query.limit,t.localStorage.setItem("motion2.home.sms:"+m.user.id,JSON.stringify({query:m.query})),m.promise=r.smsInteraction.get(m.query,e).$promise}function p(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=l.getCurrentUser(),m.tags={count:0,rows:[]},m.smsInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,substatus:null,SmsAccountId:null},m.success=e,m.getSmsInteractions=u,m.showSmsInteraction=function(e,t){n.$parent.vm.addInteractionTab("sms",t)},m.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),t+=" <"+(e.Contact.mobile||"unknown")+">"}return s.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===l.getCurrentUser().id?s.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return s.instant("DASHBOARDS.NOT_ASSIGNED")},m.getSmsAccountLabel=function(e){if(e.Account)return e.Account.key;return s.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getSmsInteractions()},m.composeSmsInteraction=function(e,t){i.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeSms/dialog.html",parent:angular.element(o.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){return r.smsAccount.send({id:t.id},e).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),n.$parent.vm.addInteractionTab("sms",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SMSACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.onInit=function(){return r.smsAccount.get({nolimit:!0}).$promise.then(function(e){return m.smsAccounts=e||{count:0,rows:[]},r.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return r.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.sms:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}d.on("smsInteraction:save",m.onSmsInteractionSave),d.on("smsInteraction:update",m.onSmsInteractionSave),d.on("smsInteractionTags:save",m.onSmsInteractionTagsSave),d.on("smsMessage:save",m.onSmsMessageSave),d.on("smsMessage:update",m.onSmsMessageSave),d.on("user_has_sms_interactions:save",m.onSmsInteractionOpen),d.on("user_has_sms_interactions:remove",m.onSmsInteractionClose),m.getSmsInteractions()})},m.onSmsInteractionSave=function(e){if(e){var t=_.find(m.smsInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):u(),p(e)}},m.onSmsInteractionTagsSave=function(e){if(e){var t=_.find(m.smsInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onSmsMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),p(t)}}},m.onSmsInteractionOpen=function(e){var t=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onSmsInteractionClose=function(e){var t=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap={Today:s.instant("DASHBOARDS.TODAY"),Yesterday:s.instant("DASHBOARDS.YESTERDAY"),"This Week":s.instant("DASHBOARDS.THIS_WEEK"),"Last Week":s.instant("DASHBOARDS.LAST_WEEK"),"This Month":s.instant("DASHBOARDS.THIS_MONTH"),"Last Month":s.instant("DASHBOARDS.LAST_MONTH"),"This Year":s.instant("DASHBOARDS.THIS_YEAR"),"Last Year":s.instant("DASHBOARDS.LAST_YEAR"),January:s.instant("DASHBOARDS.JANUARY"),February:s.instant("DASHBOARDS.FEBRUARY"),March:s.instant("DASHBOARDS.MARCH"),April:s.instant("DASHBOARDS.APRIL"),May:s.instant("DASHBOARDS.MAY"),June:s.instant("DASHBOARDS.JUNE"),July:s.instant("DASHBOARDS.JULY"),August:s.instant("DASHBOARDS.AUGUST"),September:s.instant("DASHBOARDS.SEPTEMBER"),October:s.instant("DASHBOARDS.OCTOBER"),November:s.instant("DASHBOARDS.NOVEMBER"),December:s.instant("DASHBOARDS.DECEMBER"),Mon:s.instant("DASHBOARDS.MON"),Tue:s.instant("DASHBOARDS.TUE"),Wed:s.instant("DASHBOARDS.WED"),Thu:s.instant("DASHBOARDS.THU"),Fri:s.instant("DASHBOARDS.FRI"),Sat:s.instant("DASHBOARDS.SAT"),Sun:s.instant("DASHBOARDS.SUN")},m.pickerModel={dateStart:null},m.onInit();var g=!0,v=1;n.$watch("vm.query.filter",function(e,t){g?a(function(){g=!1}):(t||(v=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=v),m.getSmsInteractions())}),n.$on("$destroy",function(){d.removeAllListeners("smsMessage:save"),d.removeAllListeners("smsMessage:update"),d.removeAllListeners("smsInteraction:save"),d.removeAllListeners("smsInteractionTags:save"),d.removeAllListeners("smsInteraction:update"),d.removeAllListeners("user_has_sms_interactions:save"),d.removeAllListeners("user_has_sms_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeSmsController",e)}(),function(){"use strict";function e(t,n,e,a,i,o,s,r,l,d){var c=this;function m(e){c.voiceCalls=e||{count:0,rows:[]}}c.currentUser=i.getCurrentUser(),c.voiceCalls={},c.localizationMap=d,c.pickerModel={dateStart:null},c.table="voiceCalls",c.query={UserId:c.currentUser.id,fields:"id,type,uniqueid,tag,starttime,endtime,source,destination,userDisposition,note,duration,billableseconds,answertime",sort:"-updatedAt",limit:10,page:1,type:null},c.success=m,c.getVoiceCalls=function(){c.query.dateStart=void 0,c.query.dateEnd=void 0,c.pickerModel.dateStart&&(c.query.dateStart=c.pickerModel.dateStart,c.query.dateEnd=c.pickerModel.dateEnd);c.query.offset=(c.query.page-1)*c.query.limit,s.localStorage.setItem("motion2.home.voice:"+c.currentUser.id,JSON.stringify({query:c.query})),c.promise=e.voiceCallReport.get(c.query,m).$promise},c.onInit=function(){return e.tag.get().$promise.then(function(e){c.tags=e||{count:0,rows:[]}}).catch(function(e){a.error({title:"Init error",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}),c.tags={count:0,rows:[]}}).finally(function(){var e=s.localStorage.getItem("motion2.home.voice:"+c.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(c.query=_.omit(e.query,"filter"))}catch(e){console.error(e)}c.getVoiceCalls()})},c.showDetails=function(e){t.show({controller:"AgentHomeVoiceDetailsController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{call:e}})},c.clearAll=function(){c.pickerModel={dateStart:null},c.getVoiceCalls()};var u=!0,p=1;r.$watch("vm.query.filter",function(e,t){u?l(function(){u=!1}):(t||(p=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=p),c.getVoiceCalls())})}e.$inject=["$mdDialog","$document","api","toasty","Auth","$translate","$window","$scope","$timeout","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeVoiceController",e)}(),function(){"use strict";function e(e,t){this.call=t,this.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","call"],angular.module("app.dashboards").controller("AgentHomeVoiceDetailsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p){var g=this;function v(){i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{channel:g.tab.channel,interaction:g.tab.interaction}}).then(function(e){g.tab.saved=!!e,e&&a.$parent.$parent.$parent.vm.closeTab(g.tab)})}function h(e,t){i.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeMail/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!1,locals:{account:g.account,message:t,type:e,interaction:g.interaction},fullscreen:!0,skipHide:!!g.tab.spy}).then(function(t){t&&f(t),t.Interaction&&g.interaction&&g.interaction.id&&(t.Interaction.id=g.interaction.id,d.mailInteraction.update(t.Interaction).$promise.then(function(e){e&&e.closed?(g.tab.saved=!0,g.interaction.closed=!0,g.interaction.closedAt=e.closedAt,v()):null!==t.Interaction.substatus&&(g.tab.saved=!0,g.tab.interaction.substatus=t.Interaction.substatus,a.$parent.$parent.$parent.vm.closeTab(g.tab))}).catch(function(e){console.error(e)}))})}function b(){"mail"!==g.tab.channel&&t(function(){var e=angular.element(n.find("md-content[name*='interaction-content-"+g.tab.id+"']"));e&&e[0]&&(e[0].scrollTop=e[0].scrollHeight)},0)}function f(n){if(n)return n["chat"===g.tab.channel?"ChatWebsiteId":_.capitalize(g.tab.channel)+"AccountId"]=g.interaction["chat"===g.tab.channel?"ChatWebsiteId":_.capitalize(g.tab.channel)+"AccountId"],n[_.capitalize(g.tab.channel)+"InteractionId"]=g.interaction.id,n.UserId=g.user.id,n.ContactId=g.interaction.ContactId,n.direction="out",n.secret=!(!g.tab.spy&&!n.secret),d[g.tab.channel+"Message"].save(n).$promise.then(function(e){if(e&&e.id&&n.attachments&&n.attachments.length)for(var t=0;t<n.attachments.length;t+=1)d.attachment.update({id:n.attachments[t].id},{MailMessageId:e.id})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SENDMESSAGE",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){g.setText(),b()})}function A(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";default:return"blue-A700"}}function E(e){e&&e.count&&e.rows.length&&(g.journey=_.concat(g.journey,e.rows))}g.showFooter=!1,g.showInteraction=!1,g.user=m.getCurrentUser(),g.detectBrowser=p.detectBrowser(),g.journey=[],g.acceptedMessages=[],g.omniChannels=["mail","chat","sms","openchannel","fax"],g.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,singleFile:!0,target:"api/attachments",allowDuplicateUploads:!0},g.ngFlow={flow:{}},g.selectedMailShowDetails={},g.selectedMailShowSystemMessage={},g.init=function(e){g.tab=e,g.tab.saved=!0,g.tab.badges=0,g.tab&&g.tab.channel&&g.tab.interaction&&(g.interaction=g.tab.interaction,d[g.tab.channel+"Interaction"].get({id:g.tab.interaction.id,includeAll:!0}).$promise.then(function(e){return e&&(g.interaction=e,g.tab.interaction=e),g.tab.saved=g.interaction.closed,g.queryMessage={id:g.interaction.id,includeAll:!0},"mail"===g.tab.channel?(g.queryMessage.sort="-id",g.queryMessage.offset=0,g.queryMessage.limit=3):(g.queryMessage.sort="id",g.queryMessage.nolimit=!0),d[g.tab.channel+"Interaction"].getMessages(g.queryMessage).$promise}).then(function(e){return g.messages=e||{count:0,rows:[]},d["chat"===g.tab.channel?"chatWebsite":g.tab.channel+"Account"].get({id:g.interaction["chat"===g.tab.channel?"ChatWebsiteId":_.capitalize(g.tab.channel)+"AccountId"]}).$promise}).then(function(e){return g.account=e,g.tab.title=g.account.key||g.account.name,d.cmContact.get({id:g.interaction.ContactId}).$promise}).then(function(e){return g.contact=e,g.showInteraction=!0,g.contact&&(!function(e){if(e&&e.id){for(var t=0;t<g.omniChannels.length;t++)d[g.omniChannels[t]+"Interaction"].get({ContactId:e.id,includeAll:!0}).$promise.then(E);d.voiceCallReport.get({ContactId:e.id,includeAll:!0}).$promise.then(E)}}(g.contact),g.tab.title+=" - "+g.contact.firstName),d.user.get({fields:"id,fullname",nolimit:!0}).$promise}).then(function(e){g.users=e||{count:0,rows:[]},g.usersMap=_.mapValues(_.keyBy(g.users.rows,"id"),"fullname")}).then(function(){if(g.tab.channel&&g.interaction)return d.user["add"+_.upperFirst(g.tab.channel)+"Interactions"]({id:g.user.id,ids:[g.interaction.id]})}).then(function(){return d.mailSubstatus.get({nolimit:!0}).$promise}).then(function(e){g.subStatuses=e||{count:0,rows:[]}}).catch(function(e){console.error(e),g.showInteraction=!0}).finally(function(){!function(){if(!g.tab.spy)for(var e=0;e<g.messages.rows.length;e+=1)"in"!==g.messages.rows[e].direction||g.messages.rows[e].read||(d[g.tab.channel+"Message"].accept({id:g.messages.rows[e].id,UserId:g.user.id}),g.acceptedMessages.push(g.messages.rows[e].id))}(),b(),u.on(g.tab.channel+"Message:save",g.onMessageSave),u.on(g.tab.channel+"Message:update",g.onMessageSave),u.on(g.tab.channel+"Interaction:save",g.onInteractionSave),u.on(g.tab.channel+"Interaction:update",g.onInteractionSave),u.on("user_has_"+g.tab.channel+"_interactions:save",g.onInteractionOpen),u.on("user_has_"+g.tab.channel+"_interactions:remove",g.onInteractionClose),g.showFooter=!0}))},g.getLabelByMessage=function(e){var t="loading...";if(e)return"in"===e.direction?e.Contact?e.Contact.firstName||"Anonymous":t:e.UserId?g.usersMap?g.usersMap[e.UserId]:t:"System"},g.openContact=function(e,t){try{a.$parent.$parent.$parent.vm.addContactTab(t||g.contact)}catch(e){c.error({title:"ERROR OPEN CONTACT",msg:"Jscripty can't open the contact"})}},g.openInteraction=function(e,t){try{if(t.MailAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("mail",t);if(t.ChatWebsiteId)return a.$parent.$parent.$parent.vm.addInteractionTab("chat",t);if(t.SmsAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("sms",t);if(t.OpenchannelAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("openchannel",t);if(t.FaxAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("fax",t)}catch(e){c.error({title:"ERROR OPEN INTERACTION",msg:"Customer Journey can't open the interaction"})}},g.disposeInteraction=v,g.tagInteraction=function(){i.show({controller:"TagInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,skipHide:!!g.tab.spy,resolve:{tags:["apiResolver",function(e){return e.resolve("tag@get",{nolimit:!0,fields:"id,name,color"})}]},locals:{channel:g.tab.channel,interaction:g.tab.interaction}})},g.composeMailInteraction=function(t,e){if(e.inReplyTo){var n=_.find(g.messages.rows,{messageId:e.inReplyTo});if(!n)return d.mailMessage.get({messageId:e.inReplyTo}).$promise.then(function(e){h(t,e&&e.count?e.rows[0]:void 0)}).catch(function(e){console.error(e),h(t,void 0)});h(t,n)}else h(t,e)},g.composeFaxInteraction=function(e){var t={to:[]};t.to.push(g.contact.fax),i.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeFax/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!1,locals:{account:g.account,message:t,type:e},fullscreen:!0}).then(function(e){return d.faxAccount.send({id:g.account.id},e).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})})},g.composeSmsInteraction=function(e,t){i.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeSms/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!1,locals:{account:g.account,message:t,type:e},fullscreen:!0,skipHide:!!g.tab.spy}).then(function(e){e&&f(e)})},g.reply=function(e,t){if(e&&13===e.keyCode&&e.shiftKey)return;if(e&&13!==e.keyCode)return;if(""===t)return;f(function(e){var t={},n="chat"===g.tab.channel?"ChatWebsiteId":_.capitalize(g.tab.channel)+"AccountId";t[n]=g.interaction[n].toString(),t[_.capitalize(g.tab.channel)+"InteractionId"]=g.interaction.id,"sms"===g.tab.channel&&(t.phone=g.interaction.phone);e&&(t.UserId=g.user.id,t.ContactId=g.interaction.ContactId,t.body=e,t.createdAt=Date.now());return t}(t))},g.upload=function(){g.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},g.ngFlow.flow.upload()},g.setTextWrapper=function(e){g.setText=e},g.getTextWrapper=function(e){g.getText=e},g.fileAdded=function(e){{if("fax"===g.tab.channel){var t=["pdf","tif"];return!!_.includes(t,e.getExtension())||(c.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1)}return!0}},g.fileSuccess=function(e,t){var n=JSON.parse(t),a=n.name;"chat"===g.tab.channel&&(a='<a href="'+(g.account.remote?g.account.remote:l.protocol()+"://"+l.host())+"/api/chat/interactions/"+g.interaction.id+"/attachment_download?attachId="+n.id+"&token="+g.account.token+'" target="_self">'+n.name+"</a>");f({body:a,AttachmentId:n.id})},g.onMessageSave=function(e){if(e&&g.interaction.id!=e[_.capitalize(g.tab.channel)+"InteractionId"])return;var t=!1;g.messages?t=_.find(g.messages.rows,{id:e.id}):g.messages={rows:[],count:0};t?_.merge(t,e):("mail"===g.tab.channel?g.messages.rows.unshift(e):g.messages.rows.push(e),b())},g.onInteractionSave=function(e){if(e&&g.interaction.id!==e.id)return;_.merge(g.interaction,e)},g.searchTextChange=function(t){var n=o.defer(),a=[],e={},i="chat"===g.tab.channel?"ChatWebsiteId":_.capitalize(g.tab.channel)+"AccountId";return e.filter=t,e[i]=g.account.id,d.cannedAnswer.get(e).$promise.then(function(e){return a=_.concat(a,e.rows),d.cannedAnswer.get({filter:t}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),n.resolve(a)}).catch(function(e){n.reject(e)}),n.promise},g.selectedItemChange=function(t){if(t){var n=g.getText();try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(t.value),a={user:g.user,account:g.account,interaction:g.interaction,contact:g.interaction&&g.interaction.Contact?g.interaction.Contact:{}};g.setText(n+" "+e(a))}catch(e){g.setText(n+" "+t.value)}g.selectedItem=null,g.changeDisplayCannedAnswerInputValue()}},g.getIconByChannel=function(e){switch(e){case"chat":return"icon-hangouts";case"mail":return"icon-email";case"sms":return"icon-message-text";case"openchannel":return"icon-google-earth";case"fax":return"icon-deskphone";default:return"icon-hangouts"}},g.getColorByChannel=A,g.getColorByItem=function(e){var t="";e.FaxAccountId?t="fax":e.OpenchannelAccountId?t="openchannel":e.SmsAccountId?t="sms":e.MailAccountId?t="mail":e.ChatWebsiteId?t="chat":e.amaflags&&(t="voice");return A(t)},g.displayCannedAnswerInput=!1,g.changeDisplayCannedAnswerInputValue=function(){g.displayCannedAnswerInput=!g.displayCannedAnswerInput},g.setAs=function(e){g.tab.channel&&g.interaction&&g.interaction.id&&d[g.tab.channel+"Interaction"].update({id:g.interaction.id,substatus:e,substatusAt:Date.now()}).$promise.catch(function(e){console.error(e)})},g.markAsUnread=function(){if(g.tab.channel&&g.interaction&&g.interaction.id)if(g.acceptedMessages.length)for(var e=0;e<g.acceptedMessages.length;e+=1)d[g.tab.channel+"Message"].update({id:g.acceptedMessages[e],read:!1,UserId:null});else for(var t=0;t<g.messages.rows.length;t+=1)if("in"===g.messages.rows[t].direction){g.messages.rows[t].UserId===g.user.id?d[g.tab.channel+"Message"].update({id:g.messages.rows[t].id,read:!1,UserId:null}):c.error({title:"You can't mark as unread",msg:"You are not the owner of the last message!"});break}g.tab.saved=!0,a.$parent.$parent.$parent.vm.closeTab(g.tab)},g.getAttachments=function(t){return d.attachment.get({MailMessageId:t.id}).$promise.then(function(e){e&&e.rows&&(t.attachments=e.rows)}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},g.getAttachment=function(i){return d.attachment.download({id:i.id}).$promise.then(function(e){if(e){var t=new Blob([e.buffer],{type:e.type}),n=document.createElement("a"),a=window.URL.createObjectURL(t);n.href=a,n.target="_self",n.download=i.name,document.body.appendChild(n),n.click(),setTimeout(function(){document.body.removeChild(n),window.URL.revokeObjectURL(a)},100)}}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},g.htmlToPlaintext=function(e){return e?String(e).replace(/<[^>]+>/gm,""):""},g.onInteractionOpen=function(e){var t;g.interaction.id==e[_.upperFirst(g.tab.channel)+"InteractionId"]&&(g.interaction.Users&&(t=_.find(g.interaction.Users,{id:e.UserId})),t||g.interaction.Users.push({id:e.UserId}))},g.onInteractionClose=function(e){g.interaction.id==e[_.upperFirst(g.tab.channel)+"InteractionId"]&&g.interaction.Users&&_.remove(g.interaction.Users,{id:e.UserId})},g.loadNextPage=function(){var n=o.defer();return g.queryMessage?(g.queryMessage.offset=g.messages.rows.length,d[g.tab.channel+"Interaction"].getMessages(g.queryMessage).$promise.then(function(e){for(var t=0;t<e.rows.length;t+=1)g.messages.rows.push(e.rows[t]),"in"!==e.rows[t].direction||e.rows[t].read||(d[g.tab.channel+"Message"].accept({id:e.rows[t].id,UserId:g.user.id}),g.acceptedMessages.push(e.rows[t].id));return n.resolve(e)}).catch(function(e){return n.reject(e)})):n.reject()},g.timelineOptions={scrollEl:"#interaction-content"},a.$on("$destroy",function(){u.removeAllListeners(g.tab.channel+"Message:save"),u.removeAllListeners(g.tab.channel+"Message:update"),u.removeAllListeners(g.tab.channel+"Interaction:save"),u.removeAllListeners(g.tab.channel+"Interaction:update"),u.removeAllListeners("user_has_"+g.tab.channel+"_interactions:save"),u.removeAllListeners("user_has_"+g.tab.channel+"_interactions:remove")})}function t(a){return{scope:{ngBindHtmlUnsafe:"="},template:"<div ng-bind-html='trustedHtml'></div>",link:function(n){n.updateView=function(){var e,t=_.replace(n.ngBindHtmlUnsafe,'<div id="xm-mail-content"','<a style="cursor:pointer" class="toggle-details md-accent-color" onclick="document.getElementById(\''+(e="xm-mail-content-"+Math.floor(9999*Math.random()+1))+"').style.display='block'; this.parentNode.removeChild(this)\">See More</a><div id=\""+e+'" style="display:none"');n.trustedHtml=a.trustAsHtml(t)},n.$watch("ngBindHtmlUnsafe",function(e,t){n.updateView(e)})}}}e.$inject=["$cookies","$timeout","$document","$scope","$mdDialog","$q","$sce","$window","$location","api","toasty","Auth","socket","msUtils"],t.$inject=["$sce"],angular.module("app.dashboards").directive("ngBindHtmlUnsafe",t).controller("AgentGeneralInteractionController",e)}(),function(){"use strict";angular.module("app.dashboards").factory("Emojis",function(){return{watchEmbedData:!1,sanitizeHtml:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank",pdf:{embed:!0},image:{embed:!0},audio:{embed:!0},basicVideo:!1,gdevAuth:"xxxxxxxx",video:{embed:!1,width:null,height:null,ytTheme:"dark",details:!1,thumbnailQuality:"medium",autoPlay:!0},twitchtvEmbed:!0,dailymotionEmbed:!0,tedEmbed:!0,dotsubEmbed:!0,liveleakEmbed:!0,ustreamEmbed:!0,soundCloudEmbed:!0,soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},spotifyEmbed:!0,tweetEmbed:!0,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},code:{highlight:!0,lineNumbers:!1},codepenEmbed:!0,codepenHeight:300,jsfiddleEmbed:!0,jsfiddleHeight:300,jsbinEmbed:!0,jsbinHeight:300,plunkerEmbed:!0,githubgistEmbed:!0,ideoneEmbed:!0,ideoneHeight:300}})}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.separatorKeys=[a.KEY_CODE.ENTER,a.KEY_CODE.COMMA,a.KEY_CODE.TAB],c.fileAdded=function(e){var t=["pdf","tif"];if(!_.includes(t,e.getExtension()))return l.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;return!0},c.message={from:i.localstationid,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,attachments:[]},c.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,singleFile:!0,target:"api/attachments",allowDuplicateUploads:!0},c.ngFlow={flow:{}},c.send=function(e){1===c.message.attachments.length?c.message.to.length?(o.draft=void 0,n.hide({from:c.message.from,to:c.message.to,attach:c.message.attachments.length,attachments:c.message.attachments})):l.error("To is mandatory"):l.error("Attachment is mandatory")},c.upload=function(){c.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},c.ngFlow.flow.upload()},c.fileSuccess=function(e,t){try{(t=JSON.parse(t)).size=e.size,c.message.attachments.push(t)}catch(e){console.error(e)}},c.getContact=function(e){var t="";e.firstName&&e.firstName!==e.fax&&(t+=e.firstName+" ");e.lastName&&e.lastName!==e.fax&&(t+=e.lastName+" ");return t+="<"+e.fax+">"},c.contactSearch=function(e){return i&&i.ListId?r.cmContact.get({ListId:i.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,fax"}).$promise.then(function(e){return e.rows}):[]},c.transformContact=function(e){var t=e;if(_.isObject(e))return e.fax;if(n=t,!/[&\/\\#,()$~%.'":;*?<>{}\s\\|a-zA-Z\pS!òàùè…_§°çéì-]/.test(n))return t;var n;return l.error("Fax "+t+" is not valid"),null},c.closeDialog=function(){o.draft=c.message,n.cancel()}}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q"],angular.module("app.dashboards").controller("ComposeFaxInteractionDialogController",e)}(),function(){"use strict";function e(t,e,i,n,o,s,a,r,l,d,c,m){var u=this;switch(u.currentUser=c.getCurrentUser(),u.secret="note"===a,u.hiddenCC=!0,u.hiddenBCC=!0,u.verifySmtp=!0,u.errors=[],u.separatorKeys=[n.KEY_CODE.ENTER,n.KEY_CODE.COMMA,n.KEY_CODE.TAB],u.searchTextChange=function(t){var n=d.defer(),a=[];return r.cannedAnswer.get({filter:t,MailAccountId:o.id}).$promise.then(function(e){return a=_.concat(a,e.rows),r.cannedAnswer.get({filter:t}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),n.resolve(a)}).catch(function(e){n.reject(e)}),n.promise},u.selectedItemChange=function(t){if(t&&t.value&&u.ckEditorInstance)try{var e=_.template(t.value),n={user:u.currentUser,account:o,interaction:m,contact:m&&m.Contact?m.Contact:{}};u.ckEditorInstance.insertText(e(n))}catch(e){console.error(e),u.ckEditorInstance.insertText(t.value)}document.getElementById("html-area").focus(),u.selectedItem=null},u.onReadyEditor=function(e){try{u.ckEditorInstance=CKEDITOR.instances["html-area"]}catch(e){console.error("Unable to get Html Editor instance",e)}},_.templateSettings.interpolate=/{{([\s\S]+?)}}/g,u.replyTemplate=_.template("On {{ date }}, at {{ time }}, {{ from }} wrote:"),u.forwardTemplate=_.template("Begin forwarded message:<br><br><strong>From:</strong> {{ from }}<br><strong>Subject:</strong> {{ subject }}<br><strong>Date:</strong> {{ date }}, at {{ time }}<br><strong>To:</strong> {{ to }}"),u.message={from:o.email,to:[],cc:[],bcc:[],body:g(),type:a,attachments:[],showLastMessage:!0},u.ckeditor={skin:"office2013",startupFocus:!0,language:"en",allowedContent:!0,extraPlugins:"font,colorbutton,autogrow,autoembed,autocorrect,googlethisterm,pastebase64",toolbarGroups:[{name:"styles",groups:["styles"]},{name:"clipboard",groups:["undo"]},{name:"colors",groups:["colors"]},{name:"basicstyles",groups:["basicstyles"]},{name:"paragraph",groups:["list","indent","align"]}],autoGrow_onStartup:!0,autoGrow_minHeight:u.secret?160:300,autoGrow_maxHeight:e.innerHeight-400,autocorrect_enabled:!0,disableNativeSpellChecker:!1,font_defaultLabel:o.fontFamily?o.fontFamily.split(",")[0]:"Arial",fontSize_defaultLabel:o.fontSize||"12",removePlugins:"magicline"},u.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,singleFile:!0,target:"api/attachments",allowDuplicateUploads:!0},u.ngFlow={flow:{}},u.reply=function(e){angular.isDefined(s)&&(u.message.type="reply",u.message.to="in"===s.direction?s.from.split(","):s.to.split(","),u.message.subject=_.startsWith(s.subject,"Re:")?s.subject:"Re: "+s.subject,u.message.inReplyTo=s.messageId,u.message.body=s.draft&&s.draft.inReplyTo?s.draft.body:g(),u.message.attachments=s.draft?s.draft.attachments:[],e&&s.cc&&(u.hiddenCC=!1,u.message.cc=s.cc.split(",")),u.message.showLastMessage=!!s.draft&&s.draft.showLastMessage)},u.newMail=function(){angular.isDefined(s)&&(u.message.type="new",u.message.to=s.to?s.to.split(","):[])},u.forward=function(){if(angular.isDefined(s)){if(u.message.type="forward",u.message.subject=_.startsWith(s.subject,"Fwd:")?s.subject:"Fwd: "+s.subject,u.message.body=s.draft&&!s.draft.inReplyTo?s.draft.body:g(),s.Attachments&&s.Attachments.length)for(var e=0;e<s.Attachments.length;e++)u.message.attachments.push(s.Attachments[e]);u.message.showLastMessage=!!s.draft&&s.draft.showLastMessage}},u.send=function(e,t,n){if(u.message.to&&u.message.body)if(u.message.to.length)if(s.draft=void 0,_.isEmpty(u.message.subject)){var a=i.confirm({skipHide:!0}).title("Warning").textContent("This message has no subject. Are you sure you want to send it?").ariaLabel("Warning").targetEvent(e).ok("Send Anyway").cancel("Cancel");i.show(a).then(function(){p(t,n)})}else p(t,n);else l.error("To is mandatory")},u.note=function(){u.type="note",u.secret=!0,u.message.body='<div style="font-family:'+o.fontFamily+";font-size:"+o.fontSize+'px"><p></p></div>'},u.addNote=function(){u.message.body&&(u.message.draft=void 0,i.hide({secret:!0,body:u.message.body,attach:u.message.attachments.length,attachments:u.message.attachments}))},u.upload=function(e){u.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+t.get("motion.token")},u.ngFlow.flow.upload()},u.fileSuccess=function(e,t){try{(t=JSON.parse(t)).size=e.size,u.message.attachments.push(t)}catch(e){console.error(e)}},u.deleteAttachment=function(e){u.message.attachments=_.reject(u.message.attachments,{id:e.id}),r.attachment.delete({id:e.id}).$promise.then(function(){l.success({title:"Attachment deleted!",msg:e.name?e.name+" has been deleted!":""})})},u.getContact=function(e){var t="";e.firstName&&e.firstName!==e.email&&(t+=e.firstName+" ");e.lastName&&e.lastName!==e.email&&(t+=e.lastName+" ");return t+="<"+e.email+">"},u.contactSearch=function(e){return o&&o.ListId?r.cmContact.get({ListId:o.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,email"}).$promise.then(function(e){return e.rows}):[]},u.transformContact=function(e){var t=e;if(_.isObject(e))return e.email;if(n=t,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n))return t;var n;return l.error("Email "+t+" is not valid"),null},u.closeDialog=function(){angular.isDefined(s)&&(s.draft=u.message);i.cancel()},u.loadLastMessage=function(){u.message.body+=v(u.message.type)},a){case"reply":u.reply(!1);break;case"replyAll":u.reply(!0);break;case"forward":u.forward();break;case"new":u.newMail();break;case"note":u.note()}function p(e,t){var n={from:u.message.from,to:u.message.to.join(","),cc:u.message.cc.join(","),bcc:u.message.bcc.join(","),subject:u.message.subject,body:u.message.showLastMessage?u.message.body:u.message.body+v(u.message.type),inReplyTo:u.message.inReplyTo,attach:u.message.attachments.length,attachments:u.message.attachments,Interaction:{lastMsgAt:moment().format("YYYY-MM-DD HH:mm:ss"),lastMsgDirection:"out",lastMsgBody:u.message.body,substatus:t,substatusAt:moment().format("YYYY-MM-DD HH:mm:ss")}};n.html='<div id="xm-mail-content">'+_.replace(n.body,'<div id="xm-mail-content"',"<div")+"</div>",e&&(n.Interaction.closed=!0,n.Interaction.closedAt=moment().format("YYYY-MM-DD HH:mm:ss")),i.hide(n)}function g(){return'<div style="font-family:'+o.fontFamily+";font-size:"+o.fontSize+'px">'+function(){if(_.isNil(o.template))return"";try{return _.template(o.template)({user:u.currentUser,account:o,interaction:m,contact:m&&m.Contact?m.Contact:{}})}catch(e){return console.error(e),""}}()+"</div>"}function v(e){var t,n,a='<div id="xm-mail-content"><blockquote type="cite">';switch(e){case"reply":case"replyAll":a+=u.replyTemplate({date:moment(s.createdAt).format("D MMM YYYY")||"",time:moment(s.createdAt).format("HH:mm")||"",from:_.escape(s.from)||""});break;case"forward":a+=u.forwardTemplate({date:moment(s.createdAt).format("D MMM YYYY")||"",time:moment(s.createdAt).format("HH:mm")||"",from:_.escape(s.from)||"",to:_.escape(s.to)||"",subject:_.escape(s.subject)||""})}return a+="<br><br>",a+=(t=s.body?_.replace(s.body,'<div id="xm-mail-content"',"<div"):"",(n=t.match(/\<body[^>]*\>([^]*)\<\/body/m))?n[1]:t),a+="</blockquote></div>",e?a:""}r.mailSubstatus.get({nolimit:!0}).$promise.then(function(e){u.subStatuses=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}),u.secret||r.mailAccount.verifySmtp({id:o.id}).$promise.catch(function(e){u.verifySmtp=!1,u.errors.push({message:e.data,type:e.status}),u.errors.push({message:"You can't reply or send an email. Please contact the administrator!",type:"500"})})}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","Auth","interaction"],angular.module("app.dashboards").controller("ComposeMailInteractionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(t){var n=c.defer(),a=[];return l.cannedAnswer.get({filter:t,SmsAccountId:o.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:t}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),n.resolve(a)}).catch(function(e){n.reject(e)}),n.promise},p.selectedItemChange=function(t){if(t){var n=p.getText();try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(t.value),a={user:p.currentUser,account:o};p.setText(n+" "+e(a))}catch(e){p.setText(n+" "+t.value)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){var e=p.getText();e&&a.hide({secret:!0,body:e})},p.message={from:o.phone,to:_.isNil(s.to)||_.isEmpty(s.to)?[]:s.to,body:""},p.send=function(e){var t=p.getText();p.message.to&&t&&(p.message.to.length?(n=t,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var t="";e.firstName&&e.firstName!==e.mobile&&(t+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(t+=e.lastName+" ");return t+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){return o&&o.ListId?l.cmContact.get({ListId:o.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows}):[]},p.setTextWrapper=function(e){p.setText=e},p.getTextWrapper=function(e){p.getText=e},p.transformContact=function(e){var t=e;if(_.isObject(t))return e.mobile;if(n=t,/^(\+|\d)[0-9]{7,16}$/.test(n))return t;var n;return d.error("Mobile "+t+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeSmsInteractionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;function d(e){a.hide(e)}l.errors=[],l.interaction=angular.copy(s),l.interaction.disposition||(l.interaction.disposition=null),l.channel=r,l.saveDisposition=function(e){l.errors=[],l.interaction.closed||(l.interaction.closedAt=Date.now());l.interaction.closed=!0,o[l.interactionMethod]?o[l.interactionMethod].update(_.pick(l.interaction,["MailAccountId","closed","closedAt","disposition","id","note"])).$promise.then(function(e){l.interaction=e,i.success({title:"Interaction properly closed!",msg:"Interaction has been closed!"}),d(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})}):d(!1)},l.closeDialog=d,l.dispositionMethod="chat"===l.channel?"chatWebsite":l.channel+"Account",l.interactionMethod=l.channel+"Interaction",o[l.dispositionMethod]&&o[l.dispositionMethod].getDispositions({fields:"id,name",sort:"name",nolimit:!0,id:l.interaction["chat"===l.channel?"ChatWebsiteId":_.capitalize(l.channel)+"AccountId"]}).$promise.then(function(e){l.dispositions=e||{count:0,rows:[]}}).catch(function(e){console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","interaction","channel"],angular.module("app.dashboards").controller("DisposeInteractionDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i,o){var s=this;function r(e){t.hide(e)}s.errors=[],s.tags=o,s.interaction=angular.copy(a),s.interaction.Tags=_.map(s.interaction.Tags,function(e){return{id:e.id,name:e.name,color:e.color}}),s.channel=i,s.autocompleteRequireMatch=!0,s.saveTag=function(){{if(s.errors=[],e[s.interactionMethod])return e[s.interactionMethod].addTags({id:s.interaction.id,ids:_.map(s.interaction.Tags,"id")}).$promise.then(function(){n.success({title:"Interaction properly tagged!",msg:"Interaction has been tagged!"}),a.Tags=s.interaction.Tags,r(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})});r(!1)}},s.closeDialog=r,s.interactionMethod=s.channel+"Interaction"}e.$inject=["$mdDialog","toasty","api","interaction","channel","tags"],angular.module("app.dashboards").controller("TagInteractionDialogController",e)}(),function(){"use strict";function e(i,o,s,e,l,d,t,n,a,r,c){var m=this;function u(){try{i.$parent.$parent.$parent.vm.updateLocalStorage()}catch(e){d.error({title:"ERROR UPDATE LOCAL TABS",msg:"Error updating locally stored tabs"})}}function p(n,e){var r=t.getCurrentUser();l.jscriptySessionReport.save({starttime:m.starttime,membername:m.call&&m.call.membername?m.call.membername:r.name,calleridname:m.call&&m.call.calleridname?m.call.calleridname:void 0,calleridnum:m.call&&m.call.calleridnum?m.call.calleridnum:void 0,queue:m.call&&m.call.queue?m.call.queue:void 0,uniqueid:m.call&&m.call.uniqueid?m.call.uniqueid:void 0,VoiceQueueId:m.call&&m.call["xmd-voicequeueid"]?m.call["xmd-voicequeueid"]:void 0,ProjectId:m.project&&m.project.id?m.project.id:void 0,projectname:m.project&&m.project.name?m.project.name:void 0,ContactId:m.contact&&m.contact.id?m.contact.id:void 0,completed:e}).$promise.then(function(e){if(e)for(var t=m.getResponseSheetHeaders(),n=m.getResponseSheetRow(),a=m.getQuestionWithResponseList(),i=0;i<t.length;i+=1)if(!_.isEmpty(n[i])){l.jscriptyQuestionReport.save({question:t[i],answer:n[i],questionId:a[i].id,membername:m.call&&m.call.membername?m.call.membername:r.name,calleridname:m.call&&m.call.calleridname?m.call.calleridname:void 0,calleridnum:m.call&&m.call.calleridnum?m.call.calleridnum:void 0,queue:m.call&&m.call.queue?m.call.queue:void 0,uniqueid:m.call&&m.call.uniqueid?m.call.uniqueid:void 0,SessionId:e.id,ProjectId:m.project.id,projectname:m.project.name});for(var o=n[i].toString().split(";"),s=0;s<o.length;s+=1)l.jscriptyAnswerReport.save({question:t[i],questionId:a[i].id,answer:o[s].trim(),membername:m.call&&m.call.membername?m.call.membername:r.name,calleridname:m.call&&m.call.calleridname?m.call.calleridname:void 0,calleridnum:m.call&&m.call.calleridnum?m.call.calleridnum:void 0,queue:m.call&&m.call.queue?m.call.queue:void 0,uniqueid:m.call&&m.call.uniqueid?m.call.uniqueid:void 0,SessionId:e.id,ProjectId:m.project.id,projectname:m.project.name})}return e}).then(function(e){e?n.resolve(!0):n.reject()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var t=0;t<e.data.errors.length;t+=1)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()});n.reject()})}m.formViewer={},m.showResetButton=!0,m.showIncompleteSubmitButton=!1,m.detectBrowser=c.detectBrowser(),m.onSubmit=function(e,t){var n=o.defer();if(t){var a=s.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("YES").cancel("NO");s.show(a).then(function(){p(n,!1)},function(){n.resolve()})}else p(n,!0);return n.promise.then(function(e){e&&(d.success({title:"Session saved",msg:"Your survey session has been properly saved!"}),function(e){try{i.$parent.$parent.$parent.vm.removeTab(e)}catch(e){d.error({title:"ERROR REMOVE TAB",msg:"Error while removing tab"})}}(m.tab.id))}).catch(function(e){d.error({title:"Session save error",msg:"There has been an error while trying to save your survey session!"})})},m.openContact=function(e,t){try{i.$parent.$parent.$parent.vm.addContactTab(t)}catch(e){d.error({title:"ERROR OPEN CONTACT",msg:"Jscripty can't open the contact"})}},m.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0},m.getResponseSheet=function(){return e.getResponseSheet(m.project.formData,m.project.responseData,!1)},m.getResponseSheetRow=function(){return e.getResponseSheetRow(m.project.formData,m.project.responseData)},m.getResponseSheetHeaders=function(){return e.getResponseSheetHeaders(m.project.formData,!1)},m.getQuestionWithResponseList=function(){return e.getQuestionWithResponseList(m.project.formData,m.project.responseData)},m.init=function(e){m.tab=e,m.tab&&(m.call=m.tab.call,m.starttime=m.tab.openedAt,m.contact=m.tab.contact,m.project=m.tab.project,m.project&&(_.isObjectLike(m.project.formData)?m.project.formData=m.project.formData:m.isJsonString(m.project.formData)?m.project.formData=JSON.parse(m.project.formData):m.project.formData=void 0,m.project.responseData=m.project.responseData||{},void 0!==m.project.currentPage&&r(function(){a.$broadcast("mwForm.pageEvents.changePage",{page:m.project.currentPage})}),i.$on("mwForm.pageEvents.pageCurrentChanged",function(e,t){if(t.currentPage&&(m.project.currentPage=t.currentPage.number-1,u(),m.project.enableUncompleteSave&&(1<=t.currentPage.number&&t.currentPage.number<m.project.formData.pages.length?m.showIncompleteSubmitButton=!0:m.showIncompleteSubmitButton=!1),m.project.formData&&m.project.formData.pages))for(var n=0,a=m.project.formData.pages.length;n<a;n++)if(t.currentPage.number<n+1&&m.project.formData.pages[n].elements)for(var i=0,o=m.project.formData.pages[n].elements.length;i<o;i++)"question"===m.project.formData.pages[n].elements[i].type&&m.project.formData.pages[n].elements[i].question&&delete m.project.responseData[m.project.formData.pages[n].elements[i].question.id]})))},m.resetViewer=function(e){if(m.formViewer.reset){var t=s.confirm().title(n.instant("JSCRIPTY.DO_YOU_WANT_TO_RESET_SESSION")).content(n.instant("JSCRIPTY.ALL_SURVEY_DATA_WILL_BE_LOST")).textContent("").ariaLabel("survey").targetEvent(e).ok(n.instant("JSCRIPTY.YES")).cancel(n.instant("JSCRIPTY.NO"));s.show(t).then(function(){m.showIncompleteSubmitButton=!1,m.project.currentPage=void 0,u(),m.formViewer.reset()})}}}e.$inject=["$scope","$q","$mdDialog","mwFormResponseUtils","api","toasty","Auth","$translate","$rootScope","$timeout","msUtils"],angular.module("app.dashboards").controller("AgentGeneralJscriptyController",e)}(),function(){"use strict";function e(n,a,e,t,i){var o=this;function s(){return function(e){if(404===e.status)a.info({title:n.instant("DASHBOARDS.ATTENTION"),msg:n.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){o.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}o.notification=e,o.user=i.getCurrentUser(),o.accept=function(e){{if(t[o.notification.channel+"Message"])return t[o.notification.channel+"Message"].accept({id:o.notification.id,UserId:o.user.id,manual:!0}).$promise.then(function(e){a.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(s());a.error({title:"API:ERROR",msg:"API accept message not found: "+o.notification.channel+"Message"})}},o.reject=function(e){{if(t[o.notification.channel+"Message"])return t[o.notification.channel+"Message"].reject({id:o.notification.id,UserId:o.user.id}).$promise.then(function(e){a.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(s());a.error({title:"API:ERROR",msg:"API reject message not found: "+o.notification.channel+"Message"})}}}e.$inject=["$translate","toasty","notification","api","Auth"],angular.module("app.dashboards").controller("NotificationController",e)}(),function(){"use strict";angular.module("app.dashboards").controller("AgentGeneralPopupController",function(){var t=this;t.init=function(e){t.tab=e,t.tab&&(t.tab.saved=!0,t.html=t.tab.html)}})}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(){l({queues:m.outboundQueues,rpcQueues:m.rpcQueues}).then(function(e){m.inbound=e})}function p(){d({rpcCampaigns:m.rpcCampaigns}).then(function(e){m.ivr=e})}m.outboundQueues=s?_.keyBy(s.rows?s.rows:[],"id"):{},m.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.rpcCampaigns=c?_.keyBy(c.rows?c.rows:[],"id"):{},m.inbound={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0},m.ivr={originated:0,limitCalls:0},m.onSaveQueue=function(e){m.outboundQueues[e.id]&&m.rpcQueues[e.id]&&(m.rpcQueues[e.id]=e)},m.onSaveCampaign=function(e){m.rpcCampaigns[e.id]&&(m.rpcCampaigns[e.id]=e)},i.onWithoutApply("voice_queue:save",m.onSaveQueue),m.interval=t(function(){u(),p()},999),i.onWithoutApply("campaign:save",m.onSaveCampaign),u(),p(),e.$on("$destroy",function(){i.removeAllListeners("voice_queue:save"),i.removeAllListeners("campaign:save"),m.interval&&t.cancel(m.interval)})}e.$inject=["$scope","$interval","$mdSidenav","Auth","socket","api","outboundQueues","rpcQueues","initializeRealtimeQueue","initializeRealtimeCampaign","rpcCampaigns"],angular.module("app.dashboards").controller("UserVoiceDashboardDialerController",e)}(),function(){"use strict";function e(n){var o=[],s=function(){var a=o[0],i={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,originated:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0};_.forIn(a.queues,function(e,t){if(a.rpcQueues[t]){i.waiting+=a.rpcQueues[t].waiting||0,i.talking+=(a.rpcQueues[t].talking||0)+(a.rpcQueues[t].pTalking||0),i.answered+=a.rpcQueues[t].answered||0,i.unmanaged+=a.rpcQueues[t].unmanaged||0,i.sumHoldTime+=a.rpcQueues[t].sumHoldTime||0,i.sumBillable+=a.rpcQueues[t].sumBillable||0,i.total+=a.rpcQueues[t].total||0,i.originated+=a.rpcQueues[t].originated||0,i.outboundDropCallsDayCallersExit+=a.rpcQueues[t].outboundDropCallsDayCallersExit||0,i.outboundDropCallsDayTimeout+=a.rpcQueues[t].outboundDropCallsDayTimeout||0;var n=a.rpcQueues[t].total-a.rpcQueues[t].answered-a.rpcQueues[t].unmanaged;i.abandoned+=0<n?n:0}}),i.avgHoldTime=Math.round(0<i.total?i.sumHoldTime/i.total:0),i.avgHoldTime=new Date(1e3*i.avgHoldTime).toISOString().substr(11,8),i.avgTalkTime=Math.round(0<i.answered?i.sumBillable/i.answered:0),i.avgTalkTime=new Date(1e3*i.avgTalkTime).toISOString().substr(11,8),i.answerRate=Math.round((0<i.total?i.answered/i.total*100:0)*Math.pow(10,1))/Math.pow(10,1),i.abandonRate=Math.round((0<i.total?i.abandoned/i.total*100:0)*Math.pow(10,1))/Math.pow(10,1),i.outboundDropRate=Math.round((0<i.total?i.outboundDropCallsDayTimeout/i.total*100:0)*Math.pow(10,1))/Math.pow(10,1),i.outboundAbandonRate=Math.round((0<i.total?i.outboundDropCallsDayCallersExit/i.total*100:0)*Math.pow(10,1))/Math.pow(10,1),i.outboundanswerRate=0<100-i.outboundDropRate-i.outboundAbandonRate&&i.total?100-i.outboundDropRate-i.outboundAbandonRate:0,o.shift(),a.defer.resolve(i),0<o.length&&s()};return function(e){var t=n.defer();return o.push({queues:e.queues,rpcQueues:e.rpcQueues,defer:t}),1===o.length&&s(),t.promise}}function t(n){var i=[],o=function(){var n=i[0],a={originated:0,limitCalls:0};_.forIn(n.rpcCampaigns,function(e,t){n.rpcCampaigns[t]&&(a.originated+=n.rpcCampaigns[t].originated||0,a.limitCalls+=n.rpcCampaigns[t].limitCalls||0)}),i.shift(),n.defer.resolve(a),0<i.length&&o()};return function(e){var t=n.defer();return i.push({rpcCampaigns:e.rpcCampaigns,defer:t}),1===i.length&&o(),t.promise}}function n(e,o,t,n){var s=this;s.hasPermission=function(){return t.hasPermission(101)||t.hasRole("admin")},s.license=n,e.$on("$stateChangeSuccess",function(e,t,n,a,i){if(t.data)switch(s.currentTab=t.data.selectedTab,s.currentTab){case 1:o.go("app.dashboards.general.dialer");break;default:o.go("app.dashboards.general.voice")}})}e.$inject=["$q"],t.$inject=["$q"],n.$inject=["$scope","$state","Auth","license"],angular.module("app.dashboards").filter("secToTime",function(){return function(e){return new Date(1e3*e).toISOString().substr(11,8)}}).factory("initializeRealtimeQueue",e).factory("initializeRealtimeCampaign",t).controller("UserDashboardGeneralController",n)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;function m(){d({queues:c.inboundQueues,rpcQueues:c.rpcQueues}).then(function(e){c.inbound=e})}c.inboundQueues=s?_.keyBy(s.rows?s.rows:[],"id"):{},c.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},c.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},c.outbound=l||{answered:0,sumBillable:0,sumDuration:0,sumHoldTime:0,total:0},c.onSaveQueue=function(e){c.inboundQueues[e.id]&&c.rpcQueues[e.id]&&(c.rpcQueues[e.id]=e,m())},c.onSaveOutbound=function(e){c.outbound=e},i.on("voice_queue:save",c.onSaveQueue),i.on("voice_outbound:save",c.onSaveOutbound),m(),e.$on("$destroy",function(){i.removeAllListeners("voice_queue:save"),i.removeAllListeners("voice_outbound:save")})}e.$inject=["$scope","$interval","$mdSidenav","Auth","socket","api","inboundQueues","rpcQueues","outbound","initializeRealtimeQueue"],angular.module("app.dashboards").controller("UserVoiceDashboardGeneralController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="FAX.EDIT_FAXACCOUNT",m.faxAccount=angular.copy(s),m.faxAccounts=o,m.newFaxAccount=!1,m.faxAccount||(m.faxAccount={waitForTheAssignedAgent:10,notificationSound:!0},m.title="FAX.NEW_FAXACCOUNT",m.newFaxAccount=!0),t.params.id&&(m.faxAccount.FaxAccountId=t.params.id),m.addNewFaxAccount=function(){m.errors=[],r.faxAccount.addAccountApplications(m.faxAccount).$promise.then(function(e){m.faxAccounts.unshift(e.toJSON()),i.success({title:"FaxAccount properly created",msg:m.faxAccount.name?m.faxAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveFaxAccount=function(){m.errors=[],r.faxAccount.updateAccountApplications(m.faxAccount).$promise.then(function(e){var t=_.find(m.faxAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"FaxAccount properly saved!",msg:m.faxAccount.name?m.faxAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteFaxAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The faxAccount will be deleted.").ariaLabel("Delete FaxAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.faxAccount.delete({id:m.faxAccount.id}).$promise.then(function(){_.remove(m.faxAccounts,{id:m.faxAccount.id}),i.success({title:"FaxAccount properly deleted!",msg:(m.faxAccount.name||"faxAccount")+" has been deleted!"}),u(m.faxAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.trunks=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","faxAccounts","faxAccount","api","Auth","license","setting"],angular.module("app.fax").controller("CreateOrEditFaxAccountDialogController",e)}(),function(){"use strict";function e(s,i,a,o,e){var r=this;function t(e,t){if(r.faxAccountApps.rows.length){var n=r.faxAccountApps.rows[t]?r.faxAccountApps.rows[t]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccountApp:n,faxAccount:r.faxAccount}}).then(function(e){e&&(e.id?r.faxAccountApps.rows[t]=e:r.faxAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.faxAccountApps.rows.length;n++,0){var a=r.faxAccountApps.rows[n],i=[],o=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.faxAccount.context,a.exten=r.faxAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(o.length?_.last(o).priority:a.priority)+1,t=_.concat(t,i,[a],o)}s.faxAccount.addApplications({id:r.faxAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.faxAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.faxAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.faxAccount={},r.faxAccountApps={count:0,rows:[]},r.selectedFaxAccountApps=[],r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"FaxQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",route:"faxQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e){r.faxAccount=e,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getFaxAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.faxAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getFaxAccountApps=function(){r.promise=s.faxAccount.getApplications(r.query,n).$promise},r.editFaxAccountApp=t,r.editInterval=function(e,t){if(r.faxAccountApps.rows.length){var n=r.faxAccountApps.rows[t]?r.faxAccountApps.rows[t]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteFaxAccountApp=function(e){_.remove(r.faxAccountApps.rows,{id:e.id}),l(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedFaxAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedFaxAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedFaxAccountApps.forEach(function(e){_.remove(r.faxAccountApps.rows,{id:e.id})}),r.selectedFaxAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return s.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.fax").controller("FaxAccountActionsController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="FAX.EDIT_"+(e.appType||e.app).toUpperCase(),o.agent=angular.copy(e),o.agent.appdata)switch(o.agent.appType?o.agent.appType.toLowerCase():o.agent.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.agent.appdata.split(",");o.agent.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.agent.text=s.slice(1,s.length).join(",");break;case"message":o.agent.text=o.agent.appdata;break;case"set":o.agent.name=o.agent.appdata.split("=")[0],o.agent.value=o.agent.appdata.split("=")[1];break;case"agi":o.agent.project=o.agent.appdata;break;default:var r=o.agent.appdata.split(",");o.agent.agent=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.agent.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.agent.timeout=30;function l(e){t.hide(e)}o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outbounddial"===o.agent.appType.toLowerCase()&&(o.agent.prefix=o.agent.phone?o.agent.phone.split("$")[0]:void 0,o.agent.callerId=o.agent.callerID?"CALLERID(all)="+o.agent.callerID:void 0),o.saveFaxAccountApp=function(){o.errors=[];var e=[];o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outboundDial"===o.agent.appType&&(o.agent.phone=a.cutdigits?(o.agent.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.agent.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.agent.options+="U(xcally-mixmonitor-context)"):o.agent.options=o.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.agents,{name:o.agent.agent});t&&(o.agent.UserId=t.id);if(o.agent.appType&&"custom"===o.agent.appType);else switch((o.agent.app||o.agent.appType).toLowerCase()){case"set":o.agent.appdata=o.agent.name+"="+o.agent.value;break;case"custom":break;default:e[0]=o.agent.agent,e[1]=o.agent.timeout,o.agent.appdata=e.join(",")}l(o.agent)},o.closeDialog=l,i.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){o.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","faxAccountApp","faxAccount","api"],angular.module("app.fax").controller("EditFaxAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="FAX.EDIT_"+(n.appType||n.app).toUpperCase(),o.close=angular.copy(n),o.close.appdata)switch(o.close.appType?o.close.appType.toLowerCase():o.close.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.close.appdata.split(",");o.close.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.close.text=s.slice(1,s.length).join(",");break;case"message":o.close.text=o.close.appdata;break;case"set":o.close.name=o.close.appdata.split("=")[0],o.close.value=o.close.appdata.split("=")[1];break;case"agi":o.close.project=o.close.appdata;break;default:var r=o.close.appdata.split(",");o.close.disposition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outbounddial"===o.close.appType.toLowerCase()&&(o.close.prefix=o.close.phone?o.close.phone.split("$")[0]:void 0,o.close.callerId=o.close.callerID?"CALLERID(all)="+o.close.callerID:void 0),o.saveFaxAccountApp=function(){o.errors=[];var e=[];o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outboundDial"===o.close.appType&&(o.close.phone=a.cutdigits?(o.close.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.close.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.close.options+="U(xcally-mixmonitor-context)"):o.close.options=o.close.options.replace("U(xcally-mixmonitor-context)",""));if(o.close.appType&&"custom"===o.close.appType);else switch((o.close.app||o.close.appType).toLowerCase()){case"set":o.close.appdata=o.close.name+"="+o.close.value;break;case"custom":break;default:e[0]=o.close.disposition,o.close.appdata=e.join(",")}l(o.close)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","faxAccountApp","faxAccount","api"],angular.module("app.fax").controller("EditFaxAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="FAX.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotoif=angular.copy(n),o.gotoif.appdata)switch(o.gotoif.appType?o.gotoif.appType.toLowerCase():o.gotoif.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotoif.appdata.split(",");o.gotoif.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotoif.text=s.slice(1,s.length).join(",");break;case"message":o.gotoif.text=o.gotoif.appdata;break;case"set":o.gotoif.name=o.gotoif.appdata.split("=")[0],o.gotoif.value=o.gotoif.appdata.split("=")[1];break;case"agi":o.gotoif.project=o.gotoif.appdata;break;default:var r=o.gotoif.appdata.split(",");o.gotoif.condition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.gotoif.truepriority=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.gotoif.falsepriority=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10)}function l(e){t.hide(e)}o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outbounddial"===o.gotoif.appType.toLowerCase()&&(o.gotoif.prefix=o.gotoif.phone?o.gotoif.phone.split("$")[0]:void 0,o.gotoif.callerId=o.gotoif.callerID?"CALLERID(all)="+o.gotoif.callerID:void 0),o.saveFaxAccountApp=function(){o.errors=[];var e=[];o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outboundDial"===o.gotoif.appType&&(o.gotoif.phone=a.cutdigits?(o.gotoif.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotoif.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotoif.options+="U(xcally-mixmonitor-context)"):o.gotoif.options=o.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotoif.appType&&"custom"===o.gotoif.appType);else switch((o.gotoif.app||o.gotoif.appType).toLowerCase()){case"set":o.gotoif.appdata=o.gotoif.name+"="+o.gotoif.value;break;case"custom":break;default:e[0]=o.gotoif.condition,e[1]=o.gotoif.truepriority,e[2]=o.gotoif.falsepriority,o.gotoif.appdata=e.join(",")}l(o.gotoif)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","faxAccountApp","faxAccount","api"],angular.module("app.fax").controller("EditFaxAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="FAX.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotop=angular.copy(n),o.gotop.appdata)switch(o.gotop.appType?o.gotop.appType.toLowerCase():o.gotop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotop.appdata.split(",");o.gotop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotop.text=s.slice(1,s.length).join(",");break;case"message":o.gotop.text=o.gotop.appdata;break;case"set":o.gotop.name=o.gotop.appdata.split("=")[0],o.gotop.value=o.gotop.appdata.split("=")[1];break;case"agi":o.gotop.project=o.gotop.appdata;break;default:var r=o.gotop.appdata.split(",");o.gotop.priority=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outbounddial"===o.gotop.appType.toLowerCase()&&(o.gotop.prefix=o.gotop.phone?o.gotop.phone.split("$")[0]:void 0,o.gotop.callerId=o.gotop.callerID?"CALLERID(all)="+o.gotop.callerID:void 0),o.saveFaxAccountApp=function(){o.errors=[];var e=[];o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outboundDial"===o.gotop.appType&&(o.gotop.phone=a.cutdigits?(o.gotop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotop.options+="U(xcally-mixmonitor-context)"):o.gotop.options=o.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotop.appType&&"custom"===o.gotop.appType);else switch((o.gotop.app||o.gotop.appType).toLowerCase()){case"set":o.gotop.appdata=o.gotop.name+"="+o.gotop.value;break;case"custom":break;default:e[0]=o.gotop.priority,o.gotop.appdata=e.join(",")}l(o.gotop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","faxAccountApp","faxAccount","api"],angular.module("app.fax").controller("EditFaxAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditFaxAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="FAX.EDIT_"+(n.appType||n.app).toUpperCase(),o.noop=angular.copy(n),o.noop.appdata)switch(o.noop.appType?o.noop.appType.toLowerCase():o.noop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.noop.appdata.split(",");o.noop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.noop.text=s.slice(1,s.length).join(",");break;case"message":o.noop.text=o.noop.appdata;break;case"set":o.noop.name=o.noop.appdata.split("=")[0],o.noop.value=o.noop.appdata.split("=")[1];break;case"agi":o.noop.project=o.noop.appdata;break;default:var r=o.noop.appdata.split(",");o.noop.value=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outbounddial"===o.noop.appType.toLowerCase()&&(o.noop.prefix=o.noop.phone?o.noop.phone.split("$")[0]:void 0,o.noop.callerId=o.noop.callerID?"CALLERID(all)="+o.noop.callerID:void 0),o.saveFaxAccountApp=function(){o.errors=[];var e=[];o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outboundDial"===o.noop.appType&&(o.noop.phone=a.cutdigits?(o.noop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.noop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.noop.options+="U(xcally-mixmonitor-context)"):o.noop.options=o.noop.options.replace("U(xcally-mixmonitor-context)",""));if(o.noop.appType&&"custom"===o.noop.appType);else switch((o.noop.app||o.noop.appType).toLowerCase()){case"set":o.noop.appdata=o.noop.name+"="+o.noop.value;break;case"custom":break;default:e[0]=o.noop.value,o.noop.appdata=e.join(",")}l(o.noop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","faxAccountApp","faxAccount","api"],angular.module("app.fax").controller("EditFaxAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="FAX.EDIT_"+(e.appType||e.app).toUpperCase(),o.queue=angular.copy(e),o.queue.appdata)switch(o.queue.appType?o.queue.appType.toLowerCase():o.queue.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.queue.appdata.split(",");o.queue.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.queue.text=s.slice(1,s.length).join(",");break;case"message":o.queue.text=o.queue.appdata;break;case"set":o.queue.name=o.queue.appdata.split("=")[0],o.queue.value=o.queue.appdata.split("=")[1];break;case"agi":o.queue.project=o.queue.appdata;break;default:var r=o.queue.appdata.split(",");o.queue.queue=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.queue.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.queue.queue=300,o.queue.timeout=300;function l(e){t.hide(e)}o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outbounddial"===o.queue.appType.toLowerCase()&&(o.queue.prefix=o.queue.phone?o.queue.phone.split("$")[0]:void 0,o.queue.callerId=o.queue.callerID?"CALLERID(all)="+o.queue.callerID:void 0),o.saveFaxAccountApp=function(){o.errors=[];var e=[];o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outboundDial"===o.queue.appType&&(o.queue.phone=a.cutdigits?(o.queue.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.queue.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.queue.options+="U(xcally-mixmonitor-context)"):o.queue.options=o.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.queues,{name:o.queue.queue});t&&(o.queue[_.capitalize("fax")+"QueueId"]=t.id);if(o.queue.appType&&"custom"===o.queue.appType);else switch((o.queue.app||o.queue.appType).toLowerCase()){case"set":o.queue.appdata=o.queue.name+"="+o.queue.value;break;case"custom":break;default:e[0]=o.queue.queue,e[1]=o.queue.timeout,o.queue.appdata=e.join(",")}l(o.queue)},o.closeDialog=l,i.faxQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){o.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","faxAccountApp","faxAccount","api"],angular.module("app.fax").controller("EditFaxAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="FAX.EDIT_"+(e.appType||e.app).toUpperCase(),o.system=angular.copy(e),o.system.appdata)switch(o.system.appType?o.system.appType.toLowerCase():o.system.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.system.appdata.split(",");o.system.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.system.text=s.slice(1,s.length).join(",");break;case"message":o.system.text=o.system.appdata;break;case"set":o.system.name=o.system.appdata.split("=")[0],o.system.value=o.system.appdata.split("=")[1];break;case"agi":o.system.project=o.system.appdata;break;default:var r=o.system.appdata.split(",");o.system.command=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.system.variable=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.system.variable="";function l(e){t.hide(e)}o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outbounddial"===o.system.appType.toLowerCase()&&(o.system.prefix=o.system.phone?o.system.phone.split("$")[0]:void 0,o.system.callerId=o.system.callerID?"CALLERID(all)="+o.system.callerID:void 0),o.saveFaxAccountApp=function(){o.errors=[];var e=[];o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outboundDial"===o.system.appType&&(o.system.phone=a.cutdigits?(o.system.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.system.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.system.options+="U(xcally-mixmonitor-context)"):o.system.options=o.system.options.replace("U(xcally-mixmonitor-context)",""));if(o.system.appType&&"custom"===o.system.appType);else switch((o.system.app||o.system.appType).toLowerCase()){case"set":o.system.appdata=o.system.name+"="+o.system.value;break;case"custom":break;default:e[0]=o.system.command,e[1]=o.system.variable,o.system.appdata=e.join(",")}l(o.system)},o.closeDialog=l,i.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){o.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","faxAccountApp","faxAccount","api"],angular.module("app.fax").controller("EditFaxAccountAppsystemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.faxAccount={},c.faxAccountFaxDispositions={count:0,rows:[]},c.selectedFaxAccountFaxDispositions=[],c.query={fields:"createdAt,updatedAt,id,name,createdAt",limit:10,page:1},c.init=function(e){c.faxAccount=e,c.query.id=c.faxAccount.id,c.query.FaxAccountId=c.faxAccount.id,c.getFaxAccountFaxDispositions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the faxDisposition?").htmlContent("<b>"+(e.name||"faxDisposition")+"</b> will be deleted.").ariaLabel("delete faxDisposition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getFaxAccountFaxDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.faxAccount.getDispositions(c.query,p).$promise},c.createOrEditFaxAccountFaxDisposition=function(e,t){o.show({controller:"CreateOrEditFaxDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/faxDispositions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:c.faxAccount,faxDisposition:t,faxDispositions:c.faxAccountFaxDispositions.rows,license:null,setting:null}})},c.exportSelectedFaxAccountFaxDispositions=function(){var e=angular.copy(c.selectedFaxAccountFaxDispositions);return c.selectedFaxAccountFaxDispositions=[],e},c.deleteFaxAccountFaxDisposition=g,c.deleteSelectedFaxAccountFaxDispositions=function(e){var t=o.confirm().title("Are you sure want to delete the selected faxDispositions?").htmlContent("<b>"+c.selectedFaxAccountFaxDispositions.length+" selected</b> will be deleted.").ariaLabel("delete faxDispositions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedFaxAccountFaxDispositions.forEach(function(e){g(e)}),c.selectedFaxAccountFaxDispositions=[]})};var m=!0,u=1;function p(e){c.faxAccountFaxDispositions=e||{count:0,rows:[]}}function g(e){l.faxDisposition.delete({id:e.id}).$promise.then(function(){_.remove(c.faxAccountFaxDispositions.rows,{id:e.id}),c.faxAccountFaxDispositions.count-=1,c.faxAccountFaxDispositions.rows.length||c.getFaxAccountFaxDispositions(),r.success({title:"FaxDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETfaxAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getFaxAccountFaxDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.fax").controller("FaxAccountFaxDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="FAX.EDIT_FAXDISPOSITION",m.faxDisposition=angular.copy(s),m.faxDispositions=o,m.newFaxDisposition=!1,m.faxDisposition||(m.faxDisposition={},m.title="FAX.NEW_FAXDISPOSITION",m.newFaxDisposition=!0),t.params.id&&(m.faxDisposition.FaxAccountId=t.params.id),m.addNewFaxDisposition=function(){m.errors=[],r.faxDisposition.save(m.faxDisposition).$promise.then(function(e){m.faxDispositions.unshift(e.toJSON()),i.success({title:"FaxDisposition properly created",msg:m.faxDisposition.name?m.faxDisposition.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxDisposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxDisposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveFaxDisposition=function(){m.errors=[],r.faxDisposition.update({id:m.faxDisposition.id},m.faxDisposition).$promise.then(function(e){var t=_.find(m.faxDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"FaxDisposition properly saved!",msg:m.faxDisposition.name?m.faxDisposition.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxDisposition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxDisposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteFaxDisposition=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The faxDisposition will be deleted.").ariaLabel("Delete FaxDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.faxDisposition.delete({id:m.faxDisposition.id}).$promise.then(function(){_.remove(m.faxDispositions,{id:m.faxDisposition.id}),i.success({title:"FaxDisposition properly deleted!",msg:(m.faxDisposition.name||"faxDisposition")+" has been deleted!"}),u(m.faxDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxDisposition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxDisposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","faxDispositions","faxDisposition","api","Auth","license","setting"],angular.module("app.fax").controller("CreateOrEditFaxDispositionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.faxAccount={},c.faxAccountInteractions={count:0,rows:[]},c.selectedFaxAccountInteractions=[],c.query={fields:"createdAt,updatedAt,id,createdAt,Contact.firstName,Owner.name,closedAt,disposition,note,UserId,ContactId,FaxAccountId,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e){c.faxAccount=e,c.query.id=c.faxAccount.id,c.getFaxAccountInteractions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getFaxAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.faxAccount.getInteractions(c.query,p).$promise},c.createOrEditFaxAccountInteraction=function(e,t){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/interactions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:c.faxAccount,interaction:t,interactions:c.faxAccountInteractions.rows,license:null,setting:null}})},c.spyfaxInteraction=function(e,n){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"fax",interaction:n,spy:!0})}})},c.exportSelectedFaxAccountInteractions=function(){var e=angular.copy(c.selectedFaxAccountInteractions);return c.selectedFaxAccountInteractions=[],e},c.deleteFaxAccountInteraction=g,c.deleteSelectedFaxAccountInteractions=function(e){var t=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedFaxAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedFaxAccountInteractions.forEach(function(e){g(e)}),c.selectedFaxAccountInteractions=[]})};var m=!0,u=1;function p(e){c.faxAccountInteractions=e||{count:0,rows:[]}}function g(e){l.faxInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.faxAccountInteractions.rows,{id:e.id}),c.faxAccountInteractions.count-=1,c.faxAccountInteractions.rows.length||c.getFaxAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETfaxAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getFaxAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.fax").controller("FaxAccountInteractionsController",e)}(),function(){"use strict";function e(n,e,t,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.faxAccount=d||n.params.faxAccount||{},c.selectedTab=n.params.tab||0,c.gotogoto=function(e,t){n.go("app.fax.realtime.accounts",{})},c.alert=r.info,c.gotoFaxAccounts=function(){n.go("app.fax.faxAccounts")},c.saveFaxAccount=function(){s.faxAccount.updateAccountApplications(c.faxAccount).$promise.then(function(){r.success({title:"FaxAccount updated!",msg:c.faxAccount.name?c.faxAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.trunks=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.lists=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","faxAccount"],angular.module("app.fax").controller("FaxAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.faxAccounts=r||{count:0,rows:[]},v.table="faxAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedFaxAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,page:1},v.arrayecm=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayminrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraymaxrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytech=_.keyBy([{option:"SIP",value:"'SIP'"},{option:"IAX",value:"'IAX'"},{option:"DADHI",value:"'DADHI'"},{option:"KHOMP",value:"'KHOMP'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayacceptMethod=_.keyBy([{option:"HTTP GET",value:"'GET'"},{option:"HTTP POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayrejectMethod=_.keyBy([{option:"HTTP GET",value:"'GET'"},{option:"HTTP POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraycloseMethod=_.keyBy([{option:"HTTP GET",value:"'GET'"},{option:"HTTP POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.fax.faxAccounts.edit",{id:e.id,faxAccount:e})},v.interactionsgoto=function(e,t){n.go("app.fax.faxAccounts.edit",{id:e.id,tab:5})},v.gotorealtimegoto=function(e,t){n.go("app.fax.realtime.accounts",{})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the faxAccount?").htmlContent("<b>"+(e.name||"faxAccount")+"</b> will be deleted.").ariaLabel("delete faxAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getFaxAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.faxAccount.get(v.query,f).$promise},v.createOrEditFaxAccount=function(e,t){i.show({controller:"CreateOrEditFaxAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:t,faxAccounts:v.faxAccounts.rows,license:v.license,setting:v.setting}})},v.deleteFaxAccount=A,v.exportSelectedFaxAccounts=function(){var e=angular.copy(v.selectedFaxAccounts);return v.selectedFaxAccounts=[],e},v.deleteSelectedFaxAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected faxAccounts?").htmlContent("<b>"+v.selectedFaxAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FaxAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedFaxAccounts.forEach(function(e){A(e)}),v.selectedFaxAccounts=[]})},v.deselectFaxAccounts=function(){v.selectedFaxAccounts=[]},v.selectAllFaxAccounts=function(){v.selectedFaxAccounts=v.faxAccounts.rows},l.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.trunks=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.lists=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.faxAccounts=e||{count:0,rows:[]}}function A(e){l.faxAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.faxAccounts.rows,{id:e.id}),v.faxAccounts.count-=1,v.faxAccounts.rows.length||v.getFaxAccounts(),c.success({title:"FaxAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getFaxAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","faxAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.fax").controller("FaxAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="FAX.EDIT_FAXQUEUE",m.faxQueue=angular.copy(s),m.faxQueues=o,m.newFaxQueue=!1,m.faxQueue||(m.faxQueue={strategy:"beepall",timeout:10},m.title="FAX.NEW_FAXQUEUE",m.newFaxQueue=!0),m.addNewFaxQueue=function(){m.errors=[],r.faxQueue.save(m.faxQueue).$promise.then(function(e){m.faxQueues.unshift(e.toJSON()),i.success({title:"FaxQueue properly created",msg:m.faxQueue.name?m.faxQueue.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveFaxQueue=function(){m.errors=[],r.faxQueue.update({id:m.faxQueue.id},m.faxQueue).$promise.then(function(e){var t=_.find(m.faxQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"FaxQueue properly saved!",msg:m.faxQueue.name?m.faxQueue.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteFaxQueue=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The faxQueue will be deleted.").ariaLabel("Delete FaxQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.faxQueue.delete({id:m.faxQueue.id}).$promise.then(function(){_.remove(m.faxQueues,{id:m.faxQueue.id}),i.success({title:"FaxQueue properly deleted!",msg:(m.faxQueue.name||"faxQueue")+" has been deleted!"}),u(m.faxQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","faxQueues","faxQueue","api","Auth","license","setting"],angular.module("app.fax").controller("CreateOrEditFaxQueueDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.faxQueue[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.faxQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserFaxQueue?"penalty "+e.UserFaxQueue.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserFaxQueue?"penalty "+e.UserFaxQueue.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.faxQueue=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("FAX.ALL_AGENTS"),labelSelected:s.instant("FAX.SELECTED_AGENTS"),transferCallback:function(e,t){a.faxQueue[t?"removeAgents":"addAgents"]({id:l.faxQueue.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"FaxQueue properly "+(t?"removed":"added"),msg:"FaxQueue has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:faxQueue.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","faxQueue","faxQueues","realtime","$translate","Auth"],angular.module("app.fax").controller("FaxQueueagentaddController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.faxQueue=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("FAX.ALL_TEAMS"),labelSelected:i.instant("FAX.SELECTED_TEAMS"),transferCallback:function(e,t){a.faxQueue[t?"removeTeams":"addTeams"]({id:o.faxQueue.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:faxQueue.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.faxQueue.getTeams({id:o.faxQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","faxQueue","$translate"],angular.module("app.fax").controller("FaxQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.faxQueue=d||e.params.faxQueue||{},c.selectedTab=e.params.tab||0,c.teamadddialog=function(e,t){n.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:c.faxQueues?c.faxQueues.rows:[]}})},c.agentadddialog=function(e,t){n.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:c.faxQueues?c.faxQueues.rows:[],realtime:!1}})},c.alert=r.info,c.gotoFaxQueues=function(){e.go("app.fax.faxQueues")},c.saveFaxQueue=function(){s.faxQueue.update({id:c.faxQueue.id},c.faxQueue).$promise.then(function(){r.success({title:"FaxQueue updated!",msg:c.faxQueue.name?c.faxQueue.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","faxQueue"],angular.module("app.fax").controller("FaxQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.faxQueues=r||{count:0,rows:[]},v.table="faxQueues",v.listOrder="",v.listOrderAsc=null,v.selectedFaxQueues=[],v.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,page:1},v.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.fax.faxQueues.edit",{id:e.id,faxQueue:e})},v.teamadddialog=function(e,t){i.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:v.faxQueues?v.faxQueues.rows:[]}})},v.agentadddialog=function(e,t){i.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:v.faxQueues?v.faxQueues.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the faxQueue?").htmlContent("<b>"+(e.name||"faxQueue")+"</b> will be deleted.").ariaLabel("delete faxQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.fax.realtime.queues",{})},v.success=f,v.getFaxQueues=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.faxQueue.get(v.query,f).$promise},v.createOrEditFaxQueue=function(e,t){i.show({controller:"CreateOrEditFaxQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:t,faxQueues:v.faxQueues.rows,license:v.license,setting:v.setting}})},v.deleteFaxQueue=A,v.exportSelectedFaxQueues=function(){var e=angular.copy(v.selectedFaxQueues);return v.selectedFaxQueues=[],e},v.deleteSelectedFaxQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected faxQueues?").htmlContent("<b>"+v.selectedFaxQueues.length+" selected</b> will be deleted.").ariaLabel("delete FaxQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedFaxQueues.forEach(function(e){A(e)}),v.selectedFaxQueues=[]})},v.deselectFaxQueues=function(){v.selectedFaxQueues=[]},v.selectAllFaxQueues=function(){v.selectedFaxQueues=v.faxQueues.rows};var h=!0,b=1;function f(e){v.faxQueues=e||{count:0,rows:[]}}function A(e){l.faxQueue.delete({id:e.id}).$promise.then(function(){_.remove(v.faxQueues.rows,{id:e.id}),v.faxQueues.count-=1,v.faxQueues.rows.length||v.getFaxQueues(),c.success({title:"FaxQueue deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxQueue"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getFaxQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","faxQueues","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.fax").controller("FaxQueuesController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this;function m(){_.forIn(c.faxAccounts,function(e,t){c.rpcFaxAccounts[t]&&_.merge(e,c.rpcFaxAccounts[t])}),_.forIn(c.faxAccounts,function(t,e){var n={id:e,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss")};o.faxAccount.getMessages(n).$promise.then(function(e){return e&&(t.in=e.count||0,t.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),n.direction="out",o.faxAccount.getMessages(n).$promise}).then(function(e){e&&(t.out=e.count||0,t.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){console.log(e)})})}c.count=l&&l.count?l.count:0,c.faxAccounts=l?_.keyBy(l.rows?l.rows:[],"id"):{},c.rpcFaxAccounts=d?_.keyBy(d.rows?d.rows:[],"id"):{},c.query={sort:"-name",limit:10,page:1},c.success=g,c.$onInit=m,c.getFaxAccounts=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.faxAccount.get(c.query,g).$promise},c.onSave=function(e){c.faxAccounts[e.id]&&_.merge(c.faxAccounts[e.id],e)},c.onFaxMessageSave=function(e){c.faxAccounts[e.FaxAccountId]&&("in"==e.direction?(c.faxAccounts[e.FaxAccountId].in+=1,c.faxAccounts[e.FaxAccountId].lastIn=e.createdAt):(c.faxAccounts[e.FaxAccountId].out+=1,c.faxAccounts[e.FaxAccountId].lastOut=e.createdAt))},c.goToFaxAccount=function(e,t){i.go("app.fax.faxAccounts.edit",{id:t.id,faxAccount:t})},c.order=[],_.forIn(c.faxAccounts,function(e,t){c.order.push(e.id)}),s.on("faxAccount:save",c.onSave),s.on("faxAccount:update",c.onSave),s.on("faxMessage:save",c.onFaxMessageSave);var u=!0,p=1;function g(e){if(c.faxAccounts=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){c.order=[];for(var t=0;t<e.rows.length;t++)c.order.push(e.rows[t].id)}m()}e.$watch("vm.query.filter",function(e,t){u?n(function(){u=!1}):(t||(p=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=p),c.getFaxAccounts())}),e.$on("$destroy",function(){s.removeAllListeners("faxAccount:save"),s.removeAllListeners("faxAccount:update"),s.removeAllListeners("faxMessage:save")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$state","api","socket","toasty","faxAccounts","rpcFaxAccounts"],angular.module("app.fax").controller("FaxAccountsRealtimeController",e)}(),function(){"use strict";function e(e,s,t,n,a,i,o,r,l,d,c,m,u,p,g,v){var h=this,b=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum"],f=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var A in h.availableStates=["ringing","inuse","busy","onhold","not_inuse"],h.pauses=o||{count:0,rows:[]},h.license=g,h.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},h.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},h.paginatedAgents={},h.load=!1,h.order=[],h.agentInternal={},h.agents)h.agents.hasOwnProperty(A)&&(h.agents[A].init=!0);h.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},h.logout=function(e,t){return d.user.logout({id:e.id}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),h.agents[e.id]&&(h.agents[e.id].online=!1),h.rpcAgents[e.id]&&(h.rpcAgents[e.id].online=!1),y()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"fax",realtime:!0,direction:"inbound"}})},h.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},h.getAgentStatus=C,h.getAgentGlobalStatus=x,h.isPause=S,h.checkPause=function(e){return"pause"===e},h.isPartialPause=function(e){return"*pause"===e},h.onSave=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(_.omit(e,f),b)),_.merge(h.rpcAgents[e.id],_.pick(_.omit(e,f),b)),x(h.agents[e.id]))},h.onUpdate=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(e,b)),_.merge(h.rpcAgents[e.id],_.pick(e,b)),x(h.agents[e.id]))},h.onInit=y,h.onConnect=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(_.merge(h.agents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(h.rpcAgents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},h.onComplete=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(h.agents[h.agentInternal[e.destaccountcode]]=_.omit(h.agents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),h.rpcAgents[h.agentInternal[e.destaccountcode]]=_.omit(h.rpcAgents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",h.onSave),c.on("user:update",h.onUpdate),c.on("user:agentconnect",h.onConnect),c.on("user:agentcomplete",h.onComplete),y();var E=v(function(){h.load&&(h.load=!1,y())},999);function y(e){h.load=!1;var t,n,a=s.defer();h.promise=a.promise,h.filteredAgents=[],h.order=[],_.forIn(h.agents,function(e,t){h.rpcAgents[t]&&_.merge(e,_.pick(_.omit(h.rpcAgents[t],f),b)),x(e),e.online?(h.filteredAgents.push(e),h.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),h.query.globalStatusFilter&&_.remove(h.filteredAgents,function(e){return e.globalStatus!==h.query.globalStatusFilter}),h.query.pauseTypeFilter&&_.remove(h.filteredAgents,function(e){return e.pauseType!==h.query.pauseTypeFilter}),h.query.filter&&_.remove(h.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(h.query.filter.toLowerCase())<0}),h.filteredAgents=(t=h.filteredAgents,n=_.startsWith(h.query.order,"-")?"desc":"asc",_.orderBy(t,[h.query.order.replace("-","")],[n]));var i=(h.query.page-1)*h.query.limit;h.paginatedAgents=_.drop(h.filteredAgents,i).slice(0,h.query.limit);for(var o=0;o<h.paginatedAgents.length;o+=1)h.order.push(h.paginatedAgents[o].id);a.resolve(),h.load=!0}function S(e){return"pause"===e||"*pause"===e}function T(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function C(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function x(e){var t="unknown";t=_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"pause":_.some([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"*pause":_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],T)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=S(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),E&&(v.cancel(E),E=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","Auth","license","$interval"],angular.module("app.voice").controller("AgentsFaxRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function g(){var n=[];return _.forIn(u.queues,function(e,t){e.paused=0,e.loggedInDb=0,u.queues[t].agents={},n.push(l.faxQueue.getMembers({id:t}).$promise),u.rpcQueues[t]&&_.merge(e,_.pick(u.rpcQueues[t],p))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&u.queues[e[t].rows[n].FaxQueueId].paused++,u.queues[e[t].rows[n].FaxQueueId].loggedInDb++,u.queues[e[t].rows[n].FaxQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].FaxQueueId}).catch(function(e){console.error(e)})}u.count=s.count?s.count:0,u.queues=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.hasRole("admin")?u.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:u.query={id:m.getCurrentUser().id,channel:"fax",type:"inbound",sort:"-updatedAt",limit:10,page:1},u.success=b,u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=l.faxQueue.get(u.query,b).$promise:u.promise=l.user.getQueues(u.query,b).$promise},u.createOrEditFaxQueue=function(e,t){a.show({controller:"CreateOrEditFaxQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:t,faxQueues:_.values(u.queues),license:null,setting:null}})},u.agentAdd=function(e,t){a.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:t,faxQueues:u.queues?u.queues.rows:[],realtime:!1}})},u.updateQueue=function(e){return l.faxQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},u.onSave=function(e){u.queues[e.id]&&_.merge(u.queues[e.id],_.pick(e,p))},u.onSaveMember=function(e){u.queues[e.FaxQueueId]&&u.queues[e.FaxQueueId].loggedInDb++},u.onRemoveMember=function(e){u.queues[e.FaxQueueId]&&u.queues[e.FaxQueueId].loggedInDb--},u.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(u.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(u.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},u.onLogin=function(e){console.log("onLogged",e),u.queues[e.FaxQueueId]&&(u.queues[e.FaxQueueId].loggedInDb+=1,u.queues[e.FaxQueueId].agents[e.UserId]=e.FaxQueueId)},u.onLogout=function(e){console.log("onLogout",e),u.queues[e.FaxQueueId]&&0<u.queues[e.FaxQueueId].loggedInDb&&(u.queues[e.FaxQueueId].loggedInDb-=1,delete u.queues[e.FaxQueueId].agents[e.UserId])},u.$onInit=g,u.order=[],_.forIn(u.queues,function(e,t){u.order.push(e.id)}),d.on("fax_queue:save",u.onSave),d.on("userFaxQueue:save",u.onSaveMember),d.on("userFaxQueue:remove",u.onRemoveMember),d.on("user:update",u.onPause),d.on("userVoiceQueue:remove",u.onLogout),d.on("userVoiceQueue:save",u.onLogin);var v=!0,h=1;function b(e){if(u.count=e.count,u.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){u.order=[];for(var t=0;t<e.rows.length;t++)u.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("fax_queue:save"),d.removeAllListeners("userFaxQueue:remove"),d.removeAllListeners("userFaxQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","Auth"],angular.module("app.fax").controller("QueuesFaxRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.fax.realtime.agents":this.selectedTab=0;break;case"app.fax.realtime.trunks":this.selectedTab=1;break;case"app.fax.realtime.queues":this.selectedTab=2;break;case"app.fax.realtime.accounts":this.selectedTab=3;break;default:this.selectedTab=0,n.go("app.fax.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.fax.realtime.agents");break;case 1:n.go("app.fax.realtime.trunks");break;case 2:n.go("app.fax.realtime.queues");break;case 3:n.go("app.fax.realtime.accounts");break;default:n.go("app.fax.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.fax").controller("FaxRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l){var d=this,c=["status","stateRegistry","registry","host","port","internal","state","status"];function m(){for(var e,t=0;t<d.trunks.length;t+=1)0<=(e=_.findIndex(d.rpcTrunks,["id",d.trunks[t].id]))&&_.merge(d.trunks[t],_.pick(d.rpcTrunks[e],c))}function u(e,t,n){0<=t&&_.merge(e[t],_.pick(n,c))}d.count=a.count,d.trunks=a?a.rows:[],d.rpcTrunks=i&&i.rows?i.rows:[],d.query={fields:"id,name",active:!0,sort:"-updatedAt",limit:10,page:1},d.statusClass=r.status,d.stateClass=r.state,d.success=v,d.$onInit=m,d.showInfo=function(e){t.show(t.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},d.getTrunks=function(){d.query.offset=(d.query.page-1)*d.query.limit,d.promise=o.trunk.get(d.query,v).$promise},d.goToTrunk=function(e,t){l.go("app.tools.trunks.edit",{id:t.id})},d.onSave=function(e){var t=_.findIndex(d.trunks,["id",e.id]),n=_.findIndex(d.rpcTrunks,["id",e.id]);u(d.trunks,t,e),u(d.rpcTrunks,n,e)},s.on("trunk:save",d.onSave);var p=!0,g=1;function v(e){d.count=e.count,d.trunks=e&&e.rows?e.rows:[],m()}e.$watch("vm.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=d.query.page),e!==t&&(d.query.page=1),e||(d.query.page=g),d.getTrunks())}),e.$on("$destroy",function(){s.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","helperClasses","$state"],angular.module("app.fax").controller("TrunksFaxRealtimeController",e)}(),function(){"use strict";function e(e,t){this.info=e,this.license=t}e.$inject=["info","license"],angular.module("app.help.about").controller("AboutController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_DESKACCOUNT",m.deskAccount=angular.copy(s),m.deskAccounts=o,m.newDeskAccount=!1,m.deskAccount||(m.deskAccount={type:"integrationTab",authType:"basic",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},m.title="INTEGRATIONS.NEW_DESKACCOUNT",m.newDeskAccount=!0),m.addNewDeskAccount=function(){m.errors=[],r.intDeskAccount.save(m.deskAccount).$promise.then(function(e){m.deskAccounts.unshift(e.toJSON()),i.success({title:"DeskAccount properly created",msg:m.deskAccount.name?m.deskAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveDeskAccount=function(){m.errors=[],r.intDeskAccount.update({id:m.deskAccount.id},m.deskAccount).$promise.then(function(e){var t=_.find(m.deskAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"DeskAccount properly saved!",msg:m.deskAccount.name?m.deskAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteDeskAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The deskAccount will be deleted.").ariaLabel("Delete DeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intDeskAccount.delete({id:m.deskAccount.id}).$promise.then(function(){_.remove(m.deskAccounts,{id:m.deskAccount.id}),i.success({title:"DeskAccount properly deleted!",msg:(m.deskAccount.name||"deskAccount")+" has been deleted!"}),u(m.deskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","deskAccounts","deskAccount","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditDeskAccountDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.deskAccounts=r||{count:0,rows:[]},v.table="deskAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedDeskAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",limit:10,page:1},v.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayauthType=_.keyBy([{option:"Basic",value:"'basic'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.integrations.deskAccounts.edit",{id:e.id,deskAccount:e})},v.testtestintegrationaccount=function(e,t){return l.intDeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){c.success({title:"DeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"DeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the deskAccount?").htmlContent("<b>"+(e.name||"deskAccount")+"</b> will be deleted.").ariaLabel("delete deskAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getDeskAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.intDeskAccount.get(v.query,f).$promise},v.createOrEditDeskAccount=function(e,t){i.show({controller:"CreateOrEditDeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskAccount:t,deskAccounts:v.deskAccounts.rows,license:v.license,setting:v.setting}})},v.deleteDeskAccount=A,v.exportSelectedDeskAccounts=function(){var e=angular.copy(v.selectedDeskAccounts);return v.selectedDeskAccounts=[],e},v.deleteSelectedDeskAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected deskAccounts?").htmlContent("<b>"+v.selectedDeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete DeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedDeskAccounts.forEach(function(e){A(e)}),v.selectedDeskAccounts=[]})},v.deselectDeskAccounts=function(){v.selectedDeskAccounts=[]},v.selectAllDeskAccounts=function(){v.selectedDeskAccounts=v.deskAccounts.rows};var h=!0,b=1;function f(e){v.deskAccounts=e||{count:0,rows:[]}}function A(e){l.intDeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.deskAccounts.rows,{id:e.id}),v.deskAccounts.count-=1,v.deskAccounts.rows.length||v.getDeskAccounts(),c.success({title:"DeskAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintDeskAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintDeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getDeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","deskAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("DeskAccountsController",e)}(),function(){"use strict";function e(a,n,i,o,e){var s=this;function r(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.subjects,{id:e.id}),o.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.descriptions,{id:e.id}),o.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.fields,{id:e.id}),o.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}s.currentUser=e.getCurrentUser(),s.deskAccount={},s.deskConfiguration={},s.configurations=[],s.selectedDeskConfiguration=-1,s.init=function(e){s.deskAccount=e,i.intDeskAccount.getConfigurations({id:s.deskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return s.configurations=e.rows?e.rows:[],s.configurations.length&&s.getDeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){s.variables=e.rows?e.rows:[],s.variablesById=_.keyBy(s.variables,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.getDeskConfiguration=function(e){s.deskConfiguration=s.configurations[e],s.selectedDeskConfiguration=e,i.intDeskConfiguration.getSubjects({id:s.deskConfiguration.id}).$promise.then(function(e){return s.subjects=e.rows?e.rows:[],i.intDeskConfiguration.getDescriptions({id:s.deskConfiguration.id}).$promise}).then(function(e){return s.descriptions=e.rows?e.rows:[],i.intDeskConfiguration.getFields({id:s.deskConfiguration.id}).$promise}).then(function(e){s.fields=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intDeskConfiguration.getTags({id:s.deskConfiguration.id}).$promise.then(function(e){s.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.createOrEditDeskConfiguration=function(e,t){a.show({controller:"CreateOrEditDeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskConfiguration:t,configurations:s.configurations,license:null,setting:null}}).finally(function(){s.getDeskConfiguration(0)})},s.deleteDeskConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the deskConfiguration?").htmlContent("<b>"+(t.name||"deskConfiguration")+"</b> will be deleted.").ariaLabel("delete deskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intDeskConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(s.configurations,{id:t.id}),o.success({title:"DeskConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){s.getDeskConfiguration(0)})},function(){console.log("CANCEL")})},s.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:s.deskConfiguration.id},s.deskConfiguration).$promise.then(function(){o.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.selectedTags=[],s.selectTagsChanged=function(e){i.intDeskConfiguration.setTags({id:s.deskConfiguration.id,ids:s.selectedTags}).$promise.then(function(){o.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){s.tags=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.selectedSubjects=[],s.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:s.subjects,configuration:s.deskConfiguration,account:s.deskAccount,license:null,setting:null}})},s.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},s.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+s.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedSubjects.forEach(function(e){r(e)}),s.selectedSubjects=[]})},s.selectedDescriptions=[],s.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:s.descriptions,configuration:s.deskConfiguration,account:s.deskAccount,license:null,setting:null}})},s.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},s.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+s.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedDescriptions.forEach(function(e){l(e)}),s.selectedDescriptions=[]})},s.selectedFields=[],s.createOrEditField=function(e,t){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:s.fields,configuration:s.deskConfiguration,account:s.deskAccount,license:null,setting:null}})},s.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},s.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+s.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedFields.forEach(function(e){d(e)}),s.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("DeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_DESKCONFIGURATION",m.deskConfiguration=angular.copy(s),m.configurations=o,m.newDeskConfiguration=!1,m.deskConfiguration||(m.deskConfiguration={channel:"voice",type:"inbound"},m.title="INTEGRATIONS.NEW_DESKCONFIGURATION",m.newDeskConfiguration=!0),m.addNewDeskConfiguration=function(){m.errors=[],r.intDeskAccount.addConfiguration({id:t.params.id},m.deskConfiguration).$promise.then(function(e){m.configurations.unshift(e.toJSON()),i.success({title:"DeskConfiguration properly created",msg:m.deskConfiguration.name?m.deskConfiguration.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveDeskConfiguration=function(){m.errors=[],r.intDeskConfiguration.update({id:m.deskConfiguration.id},m.deskConfiguration).$promise.then(function(e){var t=_.find(m.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"DeskConfiguration properly saved!",msg:m.deskConfiguration.name?m.deskConfiguration.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteDeskConfiguration=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The deskConfiguration will be deleted.").ariaLabel("Delete DeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intDeskConfiguration.delete({id:m.deskConfiguration.id}).$promise.then(function(){_.remove(m.configurations,{id:m.deskConfiguration.id}),i.success({title:"DeskConfiguration properly deleted!",msg:(m.deskConfiguration.name||"deskConfiguration")+" has been deleted!"}),u(m.deskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configurations","deskConfiguration","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditDeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(){a.hide()}m.errors=[],m.title="INTEGRATIONS.EDIT_"+_.toUpper(d),m.item=angular.copy(r),m.items=s,m.type=d,m.newItem=!1,m.item||(m.item={type:"string"},m.item[_.capitalize(d)+"Id"]=o.id,m.title="INTEGRATIONS.NEW_"+_.toUpper(d),m.newItem=!0),m.addNewItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intDeskField.save(m.item).$promise.then(function(e){m.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},m.saveItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intDeskField.update({id:m.item.id},m.item).$promise.then(function(e){var t=_.find(m.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},m.deleteItem=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intDeskField.delete({id:m.item.id}).$promise.then(function(){_.remove(m.items,{id:m.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},m.getSelectedVariable=function(){return void 0!==m.item.variableName?m.item.variableName:"Please select a variable"},m.closeDialog=u,c.variable.get({nolimit:!0}).$promise.then(function(e){return m.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return m.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){m.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDeskAccount.getFields({id:l.id}).$promise.then(function(e){m.accountConnected=!0,m.fields=e.rows?e.rows:[],m.item.idField&&(m.customField=_.find(m.fields,{id:m.item.idField}))}).catch(function(e){m.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api"],angular.module("app.integrations").controller("CreateOrEditDeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.deskAccount=d||e.params.deskAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoDeskAccounts=function(){e.go("app.integrations.deskAccounts")},c.saveDeskAccount=function(){s.intDeskAccount.update({id:c.deskAccount.id},c.deskAccount).$promise.then(function(){r.success({title:"DeskAccount updated!",msg:c.deskAccount.name?c.deskAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintDeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","deskAccount"],angular.module("app.integrations").controller("DeskAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_FRESHDESKACCOUNT",m.freshdeskAccount=angular.copy(s),m.freshdeskAccounts=o,m.newFreshdeskAccount=!1,m.freshdeskAccount||(m.freshdeskAccount={serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},m.title="INTEGRATIONS.NEW_FRESHDESKACCOUNT",m.newFreshdeskAccount=!0),m.addNewFreshdeskAccount=function(){m.errors=[],r.intFreshdeskAccount.save(m.freshdeskAccount).$promise.then(function(e){m.freshdeskAccounts.unshift(e.toJSON()),i.success({title:"FreshdeskAccount properly created",msg:m.freshdeskAccount.name?m.freshdeskAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveFreshdeskAccount=function(){m.errors=[],r.intFreshdeskAccount.update({id:m.freshdeskAccount.id},m.freshdeskAccount).$promise.then(function(e){var t=_.find(m.freshdeskAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"FreshdeskAccount properly saved!",msg:m.freshdeskAccount.name?m.freshdeskAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteFreshdeskAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The freshdeskAccount will be deleted.").ariaLabel("Delete FreshdeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intFreshdeskAccount.delete({id:m.freshdeskAccount.id}).$promise.then(function(){_.remove(m.freshdeskAccounts,{id:m.freshdeskAccount.id}),i.success({title:"FreshdeskAccount properly deleted!",msg:(m.freshdeskAccount.name||"freshdeskAccount")+" has been deleted!"}),u(m.freshdeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","freshdeskAccounts","freshdeskAccount","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,o,e){var s=this;function r(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.subjects,{id:e.id}),o.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.descriptions,{id:e.id}),o.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.fields,{id:e.id}),o.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}s.currentUser=e.getCurrentUser(),s.freshdeskAccount={},s.freshdeskConfiguration={},s.configurations=[],s.selectedFreshdeskConfiguration=-1,s.init=function(e){s.freshdeskAccount=e,i.intFreshdeskAccount.getConfigurations({id:s.freshdeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return s.configurations=e.rows?e.rows:[],s.configurations.length&&s.getFreshdeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){s.variables=e.rows?e.rows:[],s.variablesById=_.keyBy(s.variables,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.getFreshdeskConfiguration=function(e){s.freshdeskConfiguration=s.configurations[e],s.selectedFreshdeskConfiguration=e,i.intFreshdeskConfiguration.getSubjects({id:s.freshdeskConfiguration.id}).$promise.then(function(e){return s.subjects=e.rows?e.rows:[],i.intFreshdeskConfiguration.getDescriptions({id:s.freshdeskConfiguration.id}).$promise}).then(function(e){return s.descriptions=e.rows?e.rows:[],i.intFreshdeskConfiguration.getFields({id:s.freshdeskConfiguration.id}).$promise}).then(function(e){s.fields=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intFreshdeskConfiguration.getTags({id:s.freshdeskConfiguration.id}).$promise.then(function(e){s.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.createOrEditFreshdeskConfiguration=function(e,t){a.show({controller:"CreateOrEditFreshdeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskConfiguration:t,configurations:s.configurations,license:null,setting:null}}).finally(function(){s.getFreshdeskConfiguration(0)})},s.deleteFreshdeskConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the freshdeskConfiguration?").htmlContent("<b>"+(t.name||"freshdeskConfiguration")+"</b> will be deleted.").ariaLabel("delete freshdeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intFreshdeskConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(s.configurations,{id:t.id}),o.success({title:"FreshdeskConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){s.getFreshdeskConfiguration(0)})},function(){console.log("CANCEL")})},s.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:s.freshdeskConfiguration.id},s.freshdeskConfiguration).$promise.then(function(){o.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.selectedTags=[],s.selectTagsChanged=function(e){i.intFreshdeskConfiguration.setTags({id:s.freshdeskConfiguration.id,ids:s.selectedTags}).$promise.then(function(){o.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){s.tags=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.selectedSubjects=[],s.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:s.subjects,configuration:s.freshdeskConfiguration,account:s.freshdeskAccount,license:null,setting:null}})},s.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},s.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+s.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedSubjects.forEach(function(e){r(e)}),s.selectedSubjects=[]})},s.selectedDescriptions=[],s.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:s.descriptions,configuration:s.freshdeskConfiguration,account:s.freshdeskAccount,license:null,setting:null}})},s.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},s.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+s.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedDescriptions.forEach(function(e){l(e)}),s.selectedDescriptions=[]})},s.selectedFields=[],s.createOrEditField=function(e,t){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:s.fields,configuration:s.freshdeskConfiguration,account:s.freshdeskAccount,license:null,setting:null}})},s.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},s.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+s.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedFields.forEach(function(e){d(e)}),s.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("FreshdeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_FRESHDESKCONFIGURATION",m.freshdeskConfiguration=angular.copy(s),m.configurations=o,m.newFreshdeskConfiguration=!1,m.freshdeskConfiguration||(m.freshdeskConfiguration={channel:"voice",type:"inbound"},m.title="INTEGRATIONS.NEW_FRESHDESKCONFIGURATION",m.newFreshdeskConfiguration=!0),m.addNewFreshdeskConfiguration=function(){m.errors=[],r.intFreshdeskAccount.addConfiguration({id:t.params.id},m.freshdeskConfiguration).$promise.then(function(e){m.configurations.unshift(e.toJSON()),i.success({title:"FreshdeskConfiguration properly created",msg:m.freshdeskConfiguration.name?m.freshdeskConfiguration.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveFreshdeskConfiguration=function(){m.errors=[],r.intFreshdeskConfiguration.update({id:m.freshdeskConfiguration.id},m.freshdeskConfiguration).$promise.then(function(e){var t=_.find(m.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"FreshdeskConfiguration properly saved!",msg:m.freshdeskConfiguration.name?m.freshdeskConfiguration.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteFreshdeskConfiguration=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The freshdeskConfiguration will be deleted.").ariaLabel("Delete FreshdeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intFreshdeskConfiguration.delete({id:m.freshdeskConfiguration.id}).$promise.then(function(){_.remove(m.configurations,{id:m.freshdeskConfiguration.id}),i.success({title:"FreshdeskConfiguration properly deleted!",msg:(m.freshdeskConfiguration.name||"freshdeskConfiguration")+" has been deleted!"}),u(m.freshdeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configurations","freshdeskConfiguration","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditFreshdeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(){a.hide()}m.errors=[],m.title="INTEGRATIONS.EDIT_"+_.toUpper(d),m.item=angular.copy(r),m.items=s,m.type=d,m.newItem=!1,m.item||(m.item={type:"string"},m.item[_.capitalize(d)+"Id"]=o.id,m.title="INTEGRATIONS.NEW_"+_.toUpper(d),m.newItem=!0),m.addNewItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intFreshdeskField.save(m.item).$promise.then(function(e){m.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},m.saveItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intFreshdeskField.update({id:m.item.id},m.item).$promise.then(function(e){var t=_.find(m.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},m.deleteItem=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intFreshdeskField.delete({id:m.item.id}).$promise.then(function(){_.remove(m.items,{id:m.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},m.getSelectedVariable=function(){return void 0!==m.item.variableName?m.item.variableName:"Please select a variable"},m.closeDialog=u,c.variable.get({nolimit:!0}).$promise.then(function(e){return m.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return m.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){m.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshdeskAccount.getFields({id:l.id}).$promise.then(function(e){m.accountConnected=!0,m.fields=e.rows?e.rows:[],m.item.idField&&(m.customField=_.find(m.fields,{id:m.item.idField}))}).catch(function(e){m.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.freshdeskAccount=d||e.params.freshdeskAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoFreshdeskAccounts=function(){e.go("app.integrations.freshdeskAccounts")},c.saveFreshdeskAccount=function(){s.intFreshdeskAccount.update({id:c.freshdeskAccount.id},c.freshdeskAccount).$promise.then(function(){r.success({title:"FreshdeskAccount updated!",msg:c.freshdeskAccount.name?c.freshdeskAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintFreshdeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","freshdeskAccount"],angular.module("app.integrations").controller("FreshdeskAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.freshdeskAccounts=r||{count:0,rows:[]},v.table="freshdeskAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedFreshdeskAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",limit:10,page:1},v.editstate=function(e,t){n.go("app.integrations.freshdeskAccounts.edit",{id:e.id,freshdeskAccount:e})},v.testtestintegrationaccount=function(e,t){return l.intFreshdeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){c.success({title:"FreshdeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"FreshdeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the freshdeskAccount?").htmlContent("<b>"+(e.name||"freshdeskAccount")+"</b> will be deleted.").ariaLabel("delete freshdeskAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getFreshdeskAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.intFreshdeskAccount.get(v.query,f).$promise},v.createOrEditFreshdeskAccount=function(e,t){i.show({controller:"CreateOrEditFreshdeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskAccount:t,freshdeskAccounts:v.freshdeskAccounts.rows,license:v.license,setting:v.setting}})},v.deleteFreshdeskAccount=A,v.exportSelectedFreshdeskAccounts=function(){var e=angular.copy(v.selectedFreshdeskAccounts);return v.selectedFreshdeskAccounts=[],e},v.deleteSelectedFreshdeskAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected freshdeskAccounts?").htmlContent("<b>"+v.selectedFreshdeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FreshdeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedFreshdeskAccounts.forEach(function(e){A(e)}),v.selectedFreshdeskAccounts=[]})},v.deselectFreshdeskAccounts=function(){v.selectedFreshdeskAccounts=[]},v.selectAllFreshdeskAccounts=function(){v.selectedFreshdeskAccounts=v.freshdeskAccounts.rows};var h=!0,b=1;function f(e){v.freshdeskAccounts=e||{count:0,rows:[]}}function A(e){l.intFreshdeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.freshdeskAccounts.rows,{id:e.id}),v.freshdeskAccounts.count-=1,v.freshdeskAccounts.rows.length||v.getFreshdeskAccounts(),c.success({title:"FreshdeskAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintFreshdeskAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintFreshdeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getFreshdeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","freshdeskAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("FreshdeskAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_SALESFORCEACCOUNT",m.salesforceAccount=angular.copy(s),m.salesforceAccounts=o,m.newSalesforceAccount=!1,m.salesforceAccount||(m.salesforceAccount={type:"integrationTab",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},m.title="INTEGRATIONS.NEW_SALESFORCEACCOUNT",m.newSalesforceAccount=!0),m.addNewSalesforceAccount=function(){m.errors=[],r.intSalesforceAccount.save(m.salesforceAccount).$promise.then(function(e){m.salesforceAccounts.unshift(e.toJSON()),i.success({title:"SalesforceAccount properly created",msg:m.salesforceAccount.name?m.salesforceAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSalesforceAccount=function(){m.errors=[],r.intSalesforceAccount.update({id:m.salesforceAccount.id},m.salesforceAccount).$promise.then(function(e){var t=_.find(m.salesforceAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SalesforceAccount properly saved!",msg:m.salesforceAccount.name?m.salesforceAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSalesforceAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The salesforceAccount will be deleted.").ariaLabel("Delete SalesforceAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intSalesforceAccount.delete({id:m.salesforceAccount.id}).$promise.then(function(){_.remove(m.salesforceAccounts,{id:m.salesforceAccount.id}),i.success({title:"SalesforceAccount properly deleted!",msg:(m.salesforceAccount.name||"salesforceAccount")+" has been deleted!"}),u(m.salesforceAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","salesforceAccounts","salesforceAccount","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,o,e){var s=this;function r(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(s.subjects,{id:e.id}),o.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(s.descriptions,{id:e.id}),o.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(s.fields,{id:e.id}),o.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}s.currentUser=e.getCurrentUser(),s.salesforceAccount={},s.salesforceConfiguration={},s.configurations=[],s.selectedSalesforceConfiguration=-1,s.init=function(e){s.salesforceAccount=e,i.intSalesforceAccount.getConfigurations({id:s.salesforceAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return s.configurations=e.rows?e.rows:[],s.configurations.length&&s.getSalesforceConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){s.variables=e.rows?e.rows:[],s.variablesById=_.keyBy(s.variables,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.getSalesforceConfiguration=function(e){s.salesforceConfiguration=s.configurations[e],s.selectedSalesforceConfiguration=e,i.intSalesforceConfiguration.getSubjects({id:s.salesforceConfiguration.id}).$promise.then(function(e){return s.subjects=e.rows?e.rows:[],i.intSalesforceConfiguration.getDescriptions({id:s.salesforceConfiguration.id}).$promise}).then(function(e){return s.descriptions=e.rows?e.rows:[],i.intSalesforceConfiguration.getFields({id:s.salesforceConfiguration.id}).$promise}).then(function(e){s.fields=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.createOrEditSalesforceConfiguration=function(e,t){a.show({controller:"CreateOrEditSalesforceConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceConfiguration:t,configurations:s.configurations,license:null,setting:null}}).finally(function(){s.getSalesforceConfiguration(0)})},s.deleteSalesforceConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the salesforceConfiguration?").htmlContent("<b>"+(t.name||"salesforceConfiguration")+"</b> will be deleted.").ariaLabel("delete salesforceConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intSalesforceConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(s.configurations,{id:t.id}),o.success({title:"SalesforceConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){s.getSalesforceConfiguration(0)})},function(){console.log("CANCEL")})},s.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:s.salesforceConfiguration.id},s.salesforceConfiguration).$promise.then(function(){o.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.selectedSubjects=[],s.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:s.subjects,configuration:s.salesforceConfiguration,account:s.salesforceAccount,license:null,setting:null}})},s.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},s.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+s.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedSubjects.forEach(function(e){r(e)}),s.selectedSubjects=[]})},s.selectedDescriptions=[],s.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:s.descriptions,configuration:s.salesforceConfiguration,account:s.salesforceAccount,license:null,setting:null}})},s.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},s.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+s.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedDescriptions.forEach(function(e){l(e)}),s.selectedDescriptions=[]})},s.selectedFields=[],s.createOrEditField=function(e,t){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:s.fields,configuration:s.salesforceConfiguration,account:s.salesforceAccount,license:null,setting:null}})},s.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},s.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+s.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedFields.forEach(function(e){d(e)}),s.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SalesforceAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_SALESFORCECONFIGURATION",m.salesforceConfiguration=angular.copy(s),m.configurations=o,m.newSalesforceConfiguration=!1,m.salesforceConfiguration||(m.salesforceConfiguration={channel:"voice",type:"inbound"},m.title="INTEGRATIONS.NEW_SALESFORCECONFIGURATION",m.newSalesforceConfiguration=!0),m.addNewSalesforceConfiguration=function(){m.errors=[],r.intSalesforceAccount.addConfiguration({id:t.params.id},m.salesforceConfiguration).$promise.then(function(e){m.configurations.unshift(e.toJSON()),i.success({title:"SalesforceConfiguration properly created",msg:m.salesforceConfiguration.name?m.salesforceConfiguration.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSalesforceConfiguration=function(){m.errors=[],r.intSalesforceConfiguration.update({id:m.salesforceConfiguration.id},m.salesforceConfiguration).$promise.then(function(e){var t=_.find(m.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SalesforceConfiguration properly saved!",msg:m.salesforceConfiguration.name?m.salesforceConfiguration.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSalesforceConfiguration=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The salesforceConfiguration will be deleted.").ariaLabel("Delete SalesforceConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intSalesforceConfiguration.delete({id:m.salesforceConfiguration.id}).$promise.then(function(){_.remove(m.configurations,{id:m.salesforceConfiguration.id}),i.success({title:"SalesforceConfiguration properly deleted!",msg:(m.salesforceConfiguration.name||"salesforceConfiguration")+" has been deleted!"}),u(m.salesforceConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configurations","salesforceConfiguration","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditSalesforceConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(){a.hide()}m.errors=[],m.title="INTEGRATIONS.EDIT_"+_.toUpper(d),m.item=angular.copy(r),m.items=s,m.type=d,m.newItem=!1,m.item||(m.item={type:"string"},m.item[_.capitalize(d)+"Id"]=o.id,m.title="INTEGRATIONS.NEW_"+_.toUpper(d),m.newItem=!0),m.addNewItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intSalesforceField.save(m.item).$promise.then(function(e){m.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},m.saveItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intSalesforceField.update({id:m.item.id},m.item).$promise.then(function(e){var t=_.find(m.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},m.deleteItem=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intSalesforceField.delete({id:m.item.id}).$promise.then(function(){_.remove(m.items,{id:m.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},m.getSelectedVariable=function(){return void 0!==m.item.variableName?m.item.variableName:"Please select a variable"},m.closeDialog=u,c.variable.get({nolimit:!0}).$promise.then(function(e){return m.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return m.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){m.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSalesforceAccount.getFields({id:l.id}).$promise.then(function(e){m.accountConnected=!0,m.fields=e.rows?e.rows:[],m.item.idField&&(m.customField=_.find(m.fields,{id:m.item.idField}))}).catch(function(e){m.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.salesforceAccount=d||e.params.salesforceAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoSalesforceAccounts=function(){e.go("app.integrations.salesforceAccounts")},c.saveSalesforceAccount=function(){s.intSalesforceAccount.update({id:c.salesforceAccount.id},c.salesforceAccount).$promise.then(function(){r.success({title:"SalesforceAccount updated!",msg:c.salesforceAccount.name?c.salesforceAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSalesforceAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","salesforceAccount"],angular.module("app.integrations").controller("SalesforceAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.salesforceAccounts=r||{count:0,rows:[]},v.table="salesforceAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedSalesforceAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",limit:10,page:1},v.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.integrations.salesforceAccounts.edit",{id:e.id,salesforceAccount:e})},v.testtestintegrationaccount=function(e,t){return l.intSalesforceAccount.getFields({id:e.id,test:!0}).$promise.then(function(){c.success({title:"SalesforceAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"SalesforceAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the salesforceAccount?").htmlContent("<b>"+(e.name||"salesforceAccount")+"</b> will be deleted.").ariaLabel("delete salesforceAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getSalesforceAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.intSalesforceAccount.get(v.query,f).$promise},v.createOrEditSalesforceAccount=function(e,t){i.show({controller:"CreateOrEditSalesforceAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceAccount:t,salesforceAccounts:v.salesforceAccounts.rows,license:v.license,setting:v.setting}})},v.deleteSalesforceAccount=A,v.exportSelectedSalesforceAccounts=function(){var e=angular.copy(v.selectedSalesforceAccounts);return v.selectedSalesforceAccounts=[],e},v.deleteSelectedSalesforceAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected salesforceAccounts?").htmlContent("<b>"+v.selectedSalesforceAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SalesforceAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedSalesforceAccounts.forEach(function(e){A(e)}),v.selectedSalesforceAccounts=[]})},v.deselectSalesforceAccounts=function(){v.selectedSalesforceAccounts=[]},v.selectAllSalesforceAccounts=function(){v.selectedSalesforceAccounts=v.salesforceAccounts.rows};var h=!0,b=1;function f(e){v.salesforceAccounts=e||{count:0,rows:[]}}function A(e){l.intSalesforceAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.salesforceAccounts.rows,{id:e.id}),v.salesforceAccounts.count-=1,v.salesforceAccounts.rows.length||v.getSalesforceAccounts(),c.success({title:"SalesforceAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSalesforceAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSalesforceAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getSalesforceAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","salesforceAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("SalesforceAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_SUGARCRMACCOUNT",m.sugarcrmAccount=angular.copy(s),m.sugarcrmAccounts=o,m.newSugarcrmAccount=!1,m.sugarcrmAccount||(m.sugarcrmAccount={serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},m.title="INTEGRATIONS.NEW_SUGARCRMACCOUNT",m.newSugarcrmAccount=!0),m.addNewSugarcrmAccount=function(){m.errors=[],r.intSugarcrmAccount.save(m.sugarcrmAccount).$promise.then(function(e){m.sugarcrmAccounts.unshift(e.toJSON()),i.success({title:"SugarcrmAccount properly created",msg:m.sugarcrmAccount.name?m.sugarcrmAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSugarcrmAccount=function(){m.errors=[],r.intSugarcrmAccount.update({id:m.sugarcrmAccount.id},m.sugarcrmAccount).$promise.then(function(e){var t=_.find(m.sugarcrmAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SugarcrmAccount properly saved!",msg:m.sugarcrmAccount.name?m.sugarcrmAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSugarcrmAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The sugarcrmAccount will be deleted.").ariaLabel("Delete SugarcrmAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intSugarcrmAccount.delete({id:m.sugarcrmAccount.id}).$promise.then(function(){_.remove(m.sugarcrmAccounts,{id:m.sugarcrmAccount.id}),i.success({title:"SugarcrmAccount properly deleted!",msg:(m.sugarcrmAccount.name||"sugarcrmAccount")+" has been deleted!"}),u(m.sugarcrmAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","sugarcrmAccounts","sugarcrmAccount","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,o,e){var s=this;function r(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(s.subjects,{id:e.id}),o.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(s.descriptions,{id:e.id}),o.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(s.fields,{id:e.id}),o.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}s.currentUser=e.getCurrentUser(),s.sugarcrmAccount={},s.sugarcrmConfiguration={},s.configurations=[],s.selectedSugarcrmConfiguration=-1,s.init=function(e){s.sugarcrmAccount=e,i.intSugarcrmAccount.getConfigurations({id:s.sugarcrmAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return s.configurations=e.rows?e.rows:[],s.configurations.length&&s.getSugarcrmConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){s.variables=e.rows?e.rows:[],s.variablesById=_.keyBy(s.variables,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.getSugarcrmConfiguration=function(e){s.sugarcrmConfiguration=s.configurations[e],s.selectedSugarcrmConfiguration=e,i.intSugarcrmConfiguration.getSubjects({id:s.sugarcrmConfiguration.id}).$promise.then(function(e){return s.subjects=e.rows?e.rows:[],i.intSugarcrmConfiguration.getDescriptions({id:s.sugarcrmConfiguration.id}).$promise}).then(function(e){return s.descriptions=e.rows?e.rows:[],i.intSugarcrmConfiguration.getFields({id:s.sugarcrmConfiguration.id}).$promise}).then(function(e){s.fields=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.createOrEditSugarcrmConfiguration=function(e,t){a.show({controller:"CreateOrEditSugarcrmConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmConfiguration:t,configurations:s.configurations,license:null,setting:null}}).finally(function(){s.getSugarcrmConfiguration(0)})},s.deleteSugarcrmConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the sugarcrmConfiguration?").htmlContent("<b>"+(t.name||"sugarcrmConfiguration")+"</b> will be deleted.").ariaLabel("delete sugarcrmConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intSugarcrmConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(s.configurations,{id:t.id}),o.success({title:"SugarcrmConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){s.getSugarcrmConfiguration(0)})},function(){console.log("CANCEL")})},s.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:s.sugarcrmConfiguration.id},s.sugarcrmConfiguration).$promise.then(function(){o.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.selectedSubjects=[],s.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:s.subjects,configuration:s.sugarcrmConfiguration,account:s.sugarcrmAccount,license:null,setting:null}})},s.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},s.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+s.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedSubjects.forEach(function(e){r(e)}),s.selectedSubjects=[]})},s.selectedDescriptions=[],s.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:s.descriptions,configuration:s.sugarcrmConfiguration,account:s.sugarcrmAccount,license:null,setting:null}})},s.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},s.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+s.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedDescriptions.forEach(function(e){l(e)}),s.selectedDescriptions=[]})},s.selectedFields=[],s.createOrEditField=function(e,t){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:s.fields,configuration:s.sugarcrmConfiguration,account:s.sugarcrmAccount,license:null,setting:null}})},s.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},s.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+s.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedFields.forEach(function(e){d(e)}),s.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SugarcrmAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_SUGARCRMCONFIGURATION",m.sugarcrmConfiguration=angular.copy(s),m.configurations=o,m.newSugarcrmConfiguration=!1,m.sugarcrmConfiguration||(m.sugarcrmConfiguration={channel:"voice",type:"inbound"},m.title="INTEGRATIONS.NEW_SUGARCRMCONFIGURATION",m.newSugarcrmConfiguration=!0),m.addNewSugarcrmConfiguration=function(){m.errors=[],r.intSugarcrmAccount.addConfiguration({id:t.params.id},m.sugarcrmConfiguration).$promise.then(function(e){m.configurations.unshift(e.toJSON()),i.success({title:"SugarcrmConfiguration properly created",msg:m.sugarcrmConfiguration.name?m.sugarcrmConfiguration.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSugarcrmConfiguration=function(){m.errors=[],r.intSugarcrmConfiguration.update({id:m.sugarcrmConfiguration.id},m.sugarcrmConfiguration).$promise.then(function(e){var t=_.find(m.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SugarcrmConfiguration properly saved!",msg:m.sugarcrmConfiguration.name?m.sugarcrmConfiguration.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSugarcrmConfiguration=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The sugarcrmConfiguration will be deleted.").ariaLabel("Delete SugarcrmConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intSugarcrmConfiguration.delete({id:m.sugarcrmConfiguration.id}).$promise.then(function(){_.remove(m.configurations,{id:m.sugarcrmConfiguration.id}),i.success({title:"SugarcrmConfiguration properly deleted!",msg:(m.sugarcrmConfiguration.name||"sugarcrmConfiguration")+" has been deleted!"}),u(m.sugarcrmConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configurations","sugarcrmConfiguration","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditSugarcrmConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(){a.hide()}m.errors=[],m.title="INTEGRATIONS.EDIT_"+_.toUpper(d),m.item=angular.copy(r),m.items=s,m.type=d,m.newItem=!1,m.item||(m.item={type:"string"},m.item[_.capitalize(d)+"Id"]=o.id,m.title="INTEGRATIONS.NEW_"+_.toUpper(d),m.newItem=!0),m.addNewItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intSugarcrmField.save(m.item).$promise.then(function(e){m.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},m.saveItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intSugarcrmField.update({id:m.item.id},m.item).$promise.then(function(e){var t=_.find(m.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},m.deleteItem=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intSugarcrmField.delete({id:m.item.id}).$promise.then(function(){_.remove(m.items,{id:m.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},m.getSelectedVariable=function(){return void 0!==m.item.variableName?m.item.variableName:"Please select a variable"},m.closeDialog=u,c.variable.get({nolimit:!0}).$promise.then(function(e){return m.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return m.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){m.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSugarcrmAccount.getFields({id:l.id}).$promise.then(function(e){m.accountConnected=!0,m.fields=e.rows?e.rows:[],m.item.idField&&(m.customField=_.find(m.fields,{id:m.item.idField}))}).catch(function(e){m.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.sugarcrmAccount=d||e.params.sugarcrmAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoSugarcrmAccounts=function(){e.go("app.integrations.sugarcrmAccounts")},c.saveSugarcrmAccount=function(){s.intSugarcrmAccount.update({id:c.sugarcrmAccount.id},c.sugarcrmAccount).$promise.then(function(){r.success({title:"SugarcrmAccount updated!",msg:c.sugarcrmAccount.name?c.sugarcrmAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSugarcrmAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","sugarcrmAccount"],angular.module("app.integrations").controller("SugarcrmAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.sugarcrmAccounts=r||{count:0,rows:[]},v.table="sugarcrmAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedSugarcrmAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",limit:10,page:1},v.editstate=function(e,t){n.go("app.integrations.sugarcrmAccounts.edit",{id:e.id,sugarcrmAccount:e})},v.testtestintegrationaccount=function(e,t){return l.intSugarcrmAccount.getFields({id:e.id,test:!0}).$promise.then(function(){c.success({title:"SugarcrmAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"SugarcrmAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the sugarcrmAccount?").htmlContent("<b>"+(e.name||"sugarcrmAccount")+"</b> will be deleted.").ariaLabel("delete sugarcrmAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getSugarcrmAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.intSugarcrmAccount.get(v.query,f).$promise},v.createOrEditSugarcrmAccount=function(e,t){i.show({controller:"CreateOrEditSugarcrmAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmAccount:t,sugarcrmAccounts:v.sugarcrmAccounts.rows,license:v.license,setting:v.setting}})},v.deleteSugarcrmAccount=A,v.exportSelectedSugarcrmAccounts=function(){var e=angular.copy(v.selectedSugarcrmAccounts);return v.selectedSugarcrmAccounts=[],e},v.deleteSelectedSugarcrmAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected sugarcrmAccounts?").htmlContent("<b>"+v.selectedSugarcrmAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SugarcrmAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedSugarcrmAccounts.forEach(function(e){A(e)}),v.selectedSugarcrmAccounts=[]})},v.deselectSugarcrmAccounts=function(){v.selectedSugarcrmAccounts=[]},v.selectAllSugarcrmAccounts=function(){v.selectedSugarcrmAccounts=v.sugarcrmAccounts.rows};var h=!0,b=1;function f(e){v.sugarcrmAccounts=e||{count:0,rows:[]}}function A(e){l.intSugarcrmAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.sugarcrmAccounts.rows,{id:e.id}),v.sugarcrmAccounts.count-=1,v.sugarcrmAccounts.rows.length||v.getSugarcrmAccounts(),c.success({title:"SugarcrmAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSugarcrmAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSugarcrmAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getSugarcrmAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","sugarcrmAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("SugarcrmAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_ZENDESKACCOUNT",m.zendeskAccount=angular.copy(s),m.zendeskAccounts=o,m.newZendeskAccount=!1,m.zendeskAccount||(m.zendeskAccount={type:"integrationTab",authType:"password",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},m.title="INTEGRATIONS.NEW_ZENDESKACCOUNT",m.newZendeskAccount=!0),m.addNewZendeskAccount=function(){m.errors=[],r.intZendeskAccount.save(m.zendeskAccount).$promise.then(function(e){m.zendeskAccounts.unshift(e.toJSON()),i.success({title:"ZendeskAccount properly created",msg:m.zendeskAccount.name?m.zendeskAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveZendeskAccount=function(){m.errors=[],r.intZendeskAccount.update({id:m.zendeskAccount.id},m.zendeskAccount).$promise.then(function(e){var t=_.find(m.zendeskAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ZendeskAccount properly saved!",msg:m.zendeskAccount.name?m.zendeskAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteZendeskAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The zendeskAccount will be deleted.").ariaLabel("Delete ZendeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intZendeskAccount.delete({id:m.zendeskAccount.id}).$promise.then(function(){_.remove(m.zendeskAccounts,{id:m.zendeskAccount.id}),i.success({title:"ZendeskAccount properly deleted!",msg:(m.zendeskAccount.name||"zendeskAccount")+" has been deleted!"}),u(m.zendeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","zendeskAccounts","zendeskAccount","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(){a.hide()}m.errors=[],m.title="INTEGRATIONS.EDIT_"+_.toUpper(d),m.item=angular.copy(r),m.items=s,m.type=d,m.newItem=!1,m.item||(m.item={type:"string"},m.item[_.capitalize(d)+"Id"]=o.id,m.title="INTEGRATIONS.NEW_"+_.toUpper(d),m.newItem=!0),m.addNewItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intZendeskField.save(m.item).$promise.then(function(e){m.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},m.saveItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intZendeskField.update({id:m.item.id},m.item).$promise.then(function(e){var t=_.find(m.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},m.deleteItem=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intZendeskField.delete({id:m.item.id}).$promise.then(function(){_.remove(m.items,{id:m.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},m.getSelectedVariable=function(){return void 0!==m.item.variableName?m.item.variableName:"Please select a variable"},m.closeDialog=u,c.variable.get({nolimit:!0}).$promise.then(function(e){return m.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return m.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){m.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZendeskAccount.getFields({id:l.id}).$promise.then(function(e){m.accountConnected=!0,m.fields=e.rows?e.rows:[],m.item.idField&&(m.customField=_.find(m.fields,{id:m.item.idField}))}).catch(function(e){m.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.zendeskAccount=d||e.params.zendeskAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoZendeskAccounts=function(){e.go("app.integrations.zendeskAccounts")},c.saveZendeskAccount=function(){s.intZendeskAccount.update({id:c.zendeskAccount.id},c.zendeskAccount).$promise.then(function(){r.success({title:"ZendeskAccount updated!",msg:c.zendeskAccount.name?c.zendeskAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZendeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","zendeskAccount"],angular.module("app.integrations").controller("ZendeskAccountController",e)}(),function(){"use strict";function e(a,n,i,o,e){var s=this;function r(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.subjects,{id:e.id}),o.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.descriptions,{id:e.id}),o.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(s.fields,{id:e.id}),o.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}s.currentUser=e.getCurrentUser(),s.zendeskAccount={},s.zendeskConfiguration={},s.zendeskConfigurations=[],s.selectedZendeskConfiguration=-1,s.init=function(e){s.zendeskAccount=e,i.intZendeskAccount.getConfigurations({id:s.zendeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return s.zendeskConfigurations=e.rows?e.rows:[],s.zendeskConfigurations.length&&s.getZendeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){s.variables=e.rows?e.rows:[],s.variablesById=_.keyBy(s.variables,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.getZendeskConfiguration=function(e){s.zendeskConfiguration=s.zendeskConfigurations[e],s.selectedZendeskConfiguration=e,i.intZendeskConfiguration.getSubjects({id:s.zendeskConfiguration.id}).$promise.then(function(e){return s.subjects=e.rows?e.rows:[],i.intZendeskConfiguration.getDescriptions({id:s.zendeskConfiguration.id}).$promise}).then(function(e){return s.descriptions=e.rows?e.rows:[],i.intZendeskConfiguration.getFields({id:s.zendeskConfiguration.id}).$promise}).then(function(e){s.fields=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intZendeskConfiguration.getTags({id:s.zendeskConfiguration.id}).$promise.then(function(e){s.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.createOrEditZendeskConfiguration=function(e,t){a.show({controller:"CreateOrEditZendeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskConfiguration:t,zendeskConfigurations:s.zendeskConfigurations,license:null,setting:null}}).finally(function(){s.getZendeskConfiguration(0)})},s.deleteZendeskConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the zendeskConfiguration?").htmlContent("<b>"+(t.name||"zendeskConfiguration")+"</b> will be deleted.").ariaLabel("delete zendeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intZendeskConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(s.zendeskConfigurations,{id:t.id}),o.success({title:"ZendeskConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){s.getZendeskConfiguration(0)})},function(){console.log("CANCEL")})},s.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:s.zendeskConfiguration.id},s.zendeskConfiguration).$promise.then(function(){o.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.selectedTags=[],s.selectTagsChanged=function(e){i.intZendeskConfiguration.setTags({id:s.zendeskConfiguration.id,ids:s.selectedTags}).$promise.then(function(){o.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){s.tags=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.selectedSubjects=[],s.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:s.subjects,configuration:s.zendeskConfiguration,account:s.zendeskAccount,license:null,setting:null}})},s.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},s.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+s.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedSubjects.forEach(function(e){r(e)}),s.selectedSubjects=[]})},s.selectedDescriptions=[],s.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:s.descriptions,configuration:s.zendeskConfiguration,account:s.zendeskAccount,license:null,setting:null}})},s.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},s.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+s.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedDescriptions.forEach(function(e){l(e)}),s.selectedDescriptions=[]})},s.selectedFields=[],s.createOrEditField=function(e,t){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:s.fields,configuration:s.zendeskConfiguration,account:s.zendeskAccount,license:null,setting:null}})},s.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},s.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+s.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedFields.forEach(function(e){d(e)}),s.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZendeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_ZENDESKCONFIGURATION",m.zendeskConfiguration=angular.copy(s),m.zendeskConfigurations=o,m.newZendeskConfiguration=!1,m.zendeskConfiguration||(m.zendeskConfiguration={channel:"voice",type:"inbound"},m.title="INTEGRATIONS.NEW_ZENDESKCONFIGURATION",m.newZendeskConfiguration=!0),m.addNewZendeskConfiguration=function(){m.errors=[],r.intZendeskAccount.addConfiguration({id:t.params.id},m.zendeskConfiguration).$promise.then(function(e){m.zendeskConfigurations.unshift(e.toJSON()),i.success({title:"ZendeskConfiguration properly created",msg:m.zendeskConfiguration.name?m.zendeskConfiguration.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveZendeskConfiguration=function(){m.errors=[],r.intZendeskConfiguration.update({id:m.zendeskConfiguration.id},m.zendeskConfiguration).$promise.then(function(e){var t=_.find(m.zendeskConfigurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ZendeskConfiguration properly saved!",msg:m.zendeskConfiguration.name?m.zendeskConfiguration.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteZendeskConfiguration=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The zendeskConfiguration will be deleted.").ariaLabel("Delete ZendeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intZendeskConfiguration.delete({id:m.zendeskConfiguration.id}).$promise.then(function(){_.remove(m.zendeskConfigurations,{id:m.zendeskConfiguration.id}),i.success({title:"ZendeskConfiguration properly deleted!",msg:(m.zendeskConfiguration.name||"zendeskConfiguration")+" has been deleted!"}),u(m.zendeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","zendeskConfigurations","zendeskConfiguration","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditZendeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.zendeskAccounts=r||{count:0,rows:[]},v.table="zendeskAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedZendeskAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",limit:10,page:1},v.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayauthType=_.keyBy([{option:"Password",value:"'password'"},{option:"Token",value:"'token'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.integrations.zendeskAccounts.edit",{id:e.id,zendeskAccount:e})},v.testtestintegrationaccount=function(e,t){return l.intZendeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){c.success({title:"ZendeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"ZendeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the zendeskAccount?").htmlContent("<b>"+(e.name||"zendeskAccount")+"</b> will be deleted.").ariaLabel("delete zendeskAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getZendeskAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.intZendeskAccount.get(v.query,f).$promise},v.createOrEditZendeskAccount=function(e,t){i.show({controller:"CreateOrEditZendeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskAccount:t,zendeskAccounts:v.zendeskAccounts.rows,license:v.license,setting:v.setting}})},v.deleteZendeskAccount=A,v.exportSelectedZendeskAccounts=function(){var e=angular.copy(v.selectedZendeskAccounts);return v.selectedZendeskAccounts=[],e},v.deleteSelectedZendeskAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected zendeskAccounts?").htmlContent("<b>"+v.selectedZendeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZendeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedZendeskAccounts.forEach(function(e){A(e)}),v.selectedZendeskAccounts=[]})},v.deselectZendeskAccounts=function(){v.selectedZendeskAccounts=[]},v.selectAllZendeskAccounts=function(){v.selectedZendeskAccounts=v.zendeskAccounts.rows};var h=!0,b=1;function f(e){v.zendeskAccounts=e||{count:0,rows:[]}}function A(e){l.intZendeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.zendeskAccounts.rows,{id:e.id}),v.zendeskAccounts.count-=1,v.zendeskAccounts.rows.length||v.getZendeskAccounts(),c.success({title:"ZendeskAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZendeskAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZendeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getZendeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","zendeskAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("ZendeskAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_ZOHOACCOUNT",m.zohoAccount=angular.copy(s),m.zohoAccounts=o,m.newZohoAccount=!1,m.zohoAccount||(m.zohoAccount={host:"zoho.com",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},m.title="INTEGRATIONS.NEW_ZOHOACCOUNT",m.newZohoAccount=!0),m.addNewZohoAccount=function(){m.errors=[],r.intZohoAccount.save(m.zohoAccount).$promise.then(function(e){m.zohoAccounts.unshift(e.toJSON()),i.success({title:"ZohoAccount properly created",msg:m.zohoAccount.name?m.zohoAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveZohoAccount=function(){m.errors=[],r.intZohoAccount.update({id:m.zohoAccount.id},m.zohoAccount).$promise.then(function(e){var t=_.find(m.zohoAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ZohoAccount properly saved!",msg:m.zohoAccount.name?m.zohoAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteZohoAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The zohoAccount will be deleted.").ariaLabel("Delete ZohoAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intZohoAccount.delete({id:m.zohoAccount.id}).$promise.then(function(){_.remove(m.zohoAccounts,{id:m.zohoAccount.id}),i.success({title:"ZohoAccount properly deleted!",msg:(m.zohoAccount.name||"zohoAccount")+" has been deleted!"}),u(m.zohoAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","zohoAccounts","zohoAccount","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditZohoAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,o,e){var s=this;function r(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(s.subjects,{id:e.id}),o.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(s.descriptions,{id:e.id}),o.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(s.fields,{id:e.id}),o.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}s.currentUser=e.getCurrentUser(),s.zohoAccount={},s.zohoConfiguration={},s.configurations=[],s.selectedZohoConfiguration=-1,s.init=function(e){s.zohoAccount=e,i.intZohoAccount.getConfigurations({id:s.zohoAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return s.configurations=e.rows?e.rows:[],s.configurations.length&&s.getZohoConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){s.variables=e.rows?e.rows:[],s.variablesById=_.keyBy(s.variables,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.getZohoConfiguration=function(e){s.zohoConfiguration=s.configurations[e],s.selectedZohoConfiguration=e,i.intZohoConfiguration.getSubjects({id:s.zohoConfiguration.id}).$promise.then(function(e){return s.subjects=e.rows?e.rows:[],i.intZohoConfiguration.getDescriptions({id:s.zohoConfiguration.id}).$promise}).then(function(e){return s.descriptions=e.rows?e.rows:[],i.intZohoConfiguration.getFields({id:s.zohoConfiguration.id}).$promise}).then(function(e){s.fields=e.rows?e.rows:[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.createOrEditZohoConfiguration=function(e,t){a.show({controller:"CreateOrEditZohoConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoConfiguration:t,configurations:s.configurations,license:null,setting:null}}).finally(function(){s.getZohoConfiguration(0)})},s.deleteZohoConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the zohoConfiguration?").htmlContent("<b>"+(t.name||"zohoConfiguration")+"</b> will be deleted.").ariaLabel("delete zohoConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intZohoConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(s.configurations,{id:t.id}),o.success({title:"ZohoConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){s.getZohoConfiguration(0)})},function(){console.log("CANCEL")})},s.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:s.zohoConfiguration.id},s.zohoConfiguration).$promise.then(function(){o.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.selectedSubjects=[],s.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:s.subjects,configuration:s.zohoConfiguration,account:s.zohoAccount,license:null,setting:null}})},s.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},s.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+s.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedSubjects.forEach(function(e){r(e)}),s.selectedSubjects=[]})},s.selectedDescriptions=[],s.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:s.descriptions,configuration:s.zohoConfiguration,account:s.zohoAccount,license:null,setting:null}})},s.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},s.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+s.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedDescriptions.forEach(function(e){l(e)}),s.selectedDescriptions=[]})},s.selectedFields=[],s.createOrEditField=function(e,t){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:s.fields,configuration:s.zohoConfiguration,account:s.zohoAccount,license:null,setting:null}})},s.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},s.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+s.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){s.selectedFields.forEach(function(e){d(e)}),s.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZohoAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="INTEGRATIONS.EDIT_ZOHOCONFIGURATION",m.zohoConfiguration=angular.copy(s),m.configurations=o,m.newZohoConfiguration=!1,m.zohoConfiguration||(m.zohoConfiguration={channel:"voice",type:"inbound"},m.title="INTEGRATIONS.NEW_ZOHOCONFIGURATION",m.newZohoConfiguration=!0),m.addNewZohoConfiguration=function(){m.errors=[],r.intZohoAccount.addConfiguration({id:t.params.id},m.zohoConfiguration).$promise.then(function(e){m.configurations.unshift(e.toJSON()),i.success({title:"ZohoConfiguration properly created",msg:m.zohoConfiguration.name?m.zohoConfiguration.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveZohoConfiguration=function(){m.errors=[],r.intZohoConfiguration.update({id:m.zohoConfiguration.id},m.zohoConfiguration).$promise.then(function(e){var t=_.find(m.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"ZohoConfiguration properly saved!",msg:m.zohoConfiguration.name?m.zohoConfiguration.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteZohoConfiguration=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The zohoConfiguration will be deleted.").ariaLabel("Delete ZohoConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.intZohoConfiguration.delete({id:m.zohoConfiguration.id}).$promise.then(function(){_.remove(m.configurations,{id:m.zohoConfiguration.id}),i.success({title:"ZohoConfiguration properly deleted!",msg:(m.zohoConfiguration.name||"zohoConfiguration")+" has been deleted!"}),u(m.zohoConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configurations","zohoConfiguration","api","Auth","license","setting"],angular.module("app.integrations").controller("CreateOrEditZohoConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(){a.hide()}m.errors=[],m.title="INTEGRATIONS.EDIT_"+_.toUpper(d),m.item=angular.copy(r),m.items=s,m.type=d,m.newItem=!1,m.item||(m.item={type:"string"},m.item[_.capitalize(d)+"Id"]=o.id,m.title="INTEGRATIONS.NEW_"+_.toUpper(d),m.newItem=!0),m.addNewItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intZohoField.save(m.item).$promise.then(function(e){m.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},m.saveItem=function(){m.errors=[],m.customField&&(m.item.idField=m.customField.id,m.item.nameField=m.customField.name,m.item.customField=m.customField.custom);c.intZohoField.update({id:m.item.id},m.item).$promise.then(function(e){var t=_.find(m.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},m.deleteItem=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intZohoField.delete({id:m.item.id}).$promise.then(function(){_.remove(m.items,{id:m.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),u()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},m.getSelectedVariable=function(){return void 0!==m.item.variableName?m.item.variableName:"Please select a variable"},m.closeDialog=u,c.variable.get({nolimit:!0}).$promise.then(function(e){return m.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return m.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){m.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),m.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZohoAccount.getFields({id:l.id}).$promise.then(function(e){m.accountConnected=!0,m.fields=e.rows?e.rows:[],m.item.idField&&(m.customField=_.find(m.fields,{id:m.item.idField}))}).catch(function(e){m.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api"],angular.module("app.integrations").controller("CreateOrEditZohoAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.zohoAccount=d||e.params.zohoAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoZohoAccounts=function(){e.go("app.integrations.zohoAccounts")},c.saveZohoAccount=function(){s.intZohoAccount.update({id:c.zohoAccount.id},c.zohoAccount).$promise.then(function(){r.success({title:"ZohoAccount updated!",msg:c.zohoAccount.name?c.zohoAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZohoAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","zohoAccount"],angular.module("app.integrations").controller("ZohoAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.zohoAccounts=r||{count:0,rows:[]},v.table="zohoAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedZohoAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,host,authToken,serverUrl,description",limit:10,page:1},v.arrayhost=_.keyBy([{option:"zoho.com",value:"'zoho.com'"},{option:"zoho.eu",value:"'zoho.eu'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.integrations.zohoAccounts.edit",{id:e.id,zohoAccount:e})},v.testtestintegrationaccount=function(e,t){return l.intZohoAccount.getFields({id:e.id,test:!0}).$promise.then(function(){c.success({title:"ZohoAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"ZohoAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the zohoAccount?").htmlContent("<b>"+(e.name||"zohoAccount")+"</b> will be deleted.").ariaLabel("delete zohoAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getZohoAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.intZohoAccount.get(v.query,f).$promise},v.createOrEditZohoAccount=function(e,t){i.show({controller:"CreateOrEditZohoAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoAccount:t,zohoAccounts:v.zohoAccounts.rows,license:v.license,setting:v.setting}})},v.deleteZohoAccount=A,v.exportSelectedZohoAccounts=function(){var e=angular.copy(v.selectedZohoAccounts);return v.selectedZohoAccounts=[],e},v.deleteSelectedZohoAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected zohoAccounts?").htmlContent("<b>"+v.selectedZohoAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZohoAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedZohoAccounts.forEach(function(e){A(e)}),v.selectedZohoAccounts=[]})},v.deselectZohoAccounts=function(){v.selectedZohoAccounts=[]},v.selectAllZohoAccounts=function(){v.selectedZohoAccounts=v.zohoAccounts.rows};var h=!0,b=1;function f(e){v.zohoAccounts=e||{count:0,rows:[]}}function A(e){l.intZohoAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.zohoAccounts.rows,{id:e.id}),v.zohoAccounts.count-=1,v.zohoAccounts.rows.length||v.getZohoAccounts(),c.success({title:"ZohoAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZohoAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZohoAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getZohoAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","zohoAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("ZohoAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="JSCRIPTY.EDIT_PROJECT",m.project=angular.copy(s),m.projects=o,m.newProject=!1,m.project||(m.project={enableUncompleteSave:!0},m.title="JSCRIPTY.NEW_PROJECT",m.newProject=!0),m.addNewProject=function(){m.errors=[],r.jscriptyProject.save(m.project).$promise.then(function(e){m.projects.unshift(e.toJSON()),i.success({title:"Project properly created",msg:m.project.name?m.project.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveProject=function(){m.errors=[],r.jscriptyProject.update({id:m.project.id},m.project).$promise.then(function(e){var t=_.find(m.projects,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Project properly saved!",msg:m.project.name?m.project.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteProject=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.jscriptyProject.delete({id:m.project.id}).$promise.then(function(){_.remove(m.projects,{id:m.project.id}),i.success({title:"Project properly deleted!",msg:(m.project.name||"project")+" has been deleted!"}),u(m.project)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","projects","project","api","Auth","license","setting"],angular.module("app.jscripty").controller("CreateOrEditProjectDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o){var s=this;s.project={},s.localizationMap=o;var r=new Date;r.setHours(0,0,0,0),s.pickerModel={dateStart:r,dateEnd:null,selectedTemplate:"TD"},s.init=function(e){s.project=e,s.getAnswers()},s.getSummary=function(){var e=n.document.createElement("a");e.href="/api/jscripty/projects/"+s.project.id+"/summary",e.target="_self",e.click()},s.getAnswers=function(){return s.hasIdAnswers=!1,a.jscriptyProject.getAnswers({id:s.project.id,sort:"-createdAt,questionId",dateStart:s.pickerModel.dateStart,dateEnd:s.pickerModel.dateEnd,nolimit:!0}).$promise.then(function(e){if(e&&e.rows&&e.hasOwnProperty("count")){s.answers={};for(var t=0,n=e.count;t<n;t++)e.rows[t].questionId&&(s.hasIdAnswers=!0,s.answers.hasOwnProperty(e.rows[t].questionId)||(s.answers[e.rows[t].questionId]={question:e.rows[t].question,answers:{},sum:0}),""===e.rows[t].answer&&(e.rows[t].answer="NO_ANSWER"),s.answers[e.rows[t].questionId].answers[e.rows[t].answer]?s.answers[e.rows[t].questionId].answers[e.rows[t].answer]+=1:s.answers[e.rows[t].questionId].answers[e.rows[t].answer]=1,s.answers[e.rows[t].questionId].sum+=1)}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETANSWERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$mdDialog","$document","$window","api","toasty","dateFilterLocalizationFactory"],angular.module("app.jscripty").controller("ProjectAnswersController",e)}(),function(){"use strict";angular.module("app.jscripty").controller("ProjectBuilderController",function(){var t=this;t.project={},t.optionsBuilder={questionTypes:["text","textarea","radio","checkbox","select","number","date","time","email","range","url"],elementTypes:["question","paragraph"]},t.init=function(e){t.project=e,_.isObjectLike(e.formData)?t.project.formData=e.formData:t.isJsonString(e.formData)?t.project.formData=JSON.parse(e.formData):t.project.formData={}},t.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0}})}(),function(){"use strict";function e(t,n,a,e,i,o,s){var r=this;function l(e){t.hide(e)}r.newProject=!0,r.project=angular.copy(i),r.projects=o,r.title=s.instant("JSCRIPTY.CLONE_PROJECT"),i&&i.name&&(r.title+=": "+i.name),r.cloneProject=function(){return e.jscriptyProject.clone({id:i.id},r.project).$promise.then(function(e){r.projects.unshift(e.toJSON()),a.success({title:"Project properly cloned",msg:r.project.name?r.project.name+" has been cloned!":""}),n.go("app.jscripty.projects.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.clone"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","project","projects","$translate"],angular.module("app.jscripty").controller("ProjectcloneController",e)}(),function(){"use strict";function e(a,i,t){var s=this;s.project={},s.responseData={},s.formViewer={},s.init=function(e){s.project=e,t.$on("mwForm.pageEvents.pageCurrentChanged",function(e,t){if(t.currentPage&&s.project.formData&&s.project.formData.pages)for(var n=0,a=s.project.formData.pages.length;n<a;n++)if(t.currentPage.number<n+1&&s.project.formData.pages[n].elements)for(var i=0,o=s.project.formData.pages[n].elements.length;i<o;i++)"question"===s.project.formData.pages[n].elements[i].type&&s.project.formData.pages[n].elements[i].question&&delete s.responseData[s.project.formData.pages[n].elements[i].question.id]})},s.onSubmit=function(e){var t=a.defer(),n=i.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("SAVE").cancel("CANCEL");return i.show(n).then(function(){t.resolve(!0)},function(){t.reject()}),t.promise},s.resetViewer=function(){s.formViewer.reset&&s.formViewer.reset()}}e.$inject=["$q","$mdDialog","$scope"],angular.module("app.jscripty").controller("ProjectViewerController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.project={},c.projectSessions={count:0,rows:[]},c.selectedProjectSessions=[],c.query={fields:"createdAt,updatedAt,id,starttime,endtime,membername,calleridnum,completed",sort:"-starttime",limit:10,page:1},c.init=function(e){c.project=e,c.query.id=c.project.id,c.getProjectSessions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the session?").htmlContent("<b>"+(e.name||"session")+"</b> will be deleted.").ariaLabel("delete session").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getProjectSessions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.jscriptyProject.getSessions(c.query,p).$promise},c.createOrEditProjectSession=function(e,t){o.show({controller:"CreateOrEditSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:c.project,session:t,sessions:c.projectSessions.rows,license:null,setting:null}})},c.showQuestionsProjectSession=function(e,n){o.show({controller:"ShowQuestionsSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,resolve:{questions:["apiResolver","$stateParams",function(e,t){return e.resolve("jscriptySessionReport@getQuestions",{fields:"question,answer",sort:"id",id:n.id})}]},locals:{project:c.project,session:n}})},c.exportSelectedProjectSessions=function(){var e=angular.copy(c.selectedProjectSessions);return c.selectedProjectSessions=[],e},c.deleteProjectSession=g,c.deleteSelectedProjectSessions=function(e){var t=o.confirm().title("Are you sure want to delete the selected sessions?").htmlContent("<b>"+c.selectedProjectSessions.length+" selected</b> will be deleted.").ariaLabel("delete sessions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedProjectSessions.forEach(function(e){g(e)}),c.selectedProjectSessions=[]})};var m=!0,u=1;function p(e){c.projectSessions=e||{count:0,rows:[]}}function g(e){l.jscriptySessionReport.delete({id:e.id}).$promise.then(function(){_.remove(c.projectSessions.rows,{id:e.id}),c.projectSessions.count-=1,c.projectSessions.rows.length||c.getProjectSessions(),r.success({title:"Session deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETjscriptyProject"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getProjectSessions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.jscripty").controller("ProjectSessionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l){this.title="JSCRIPTY.SESSION_RESULTS",this.session=o,this.questions=s,this.project=r,this.closeDialog=function(e){a.hide(e)}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","session","questions","project","api"],angular.module("app.jscripty").controller("ShowQuestionsSessionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.project=d||e.params.project||{},c.selectedTab=e.params.tab||0,c.clonedialog=function(e,t){n.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{project:e,projects:c.projects?c.projects.rows:[]}})},c.alert=r.info,c.gotoProjects=function(){e.go("app.jscripty.projects")},c.saveProject=function(){s.jscriptyProject.update({id:c.project.id},c.project).$promise.then(function(){r.success({title:"Project updated!",msg:c.project.name?c.project.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","project"],angular.module("app.jscripty").controller("JscriptyProjectController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.projects=r||{count:0,rows:[]},v.table="projects",v.listOrder="",v.listOrderAsc=null,v.selectedProjects=[],v.query={fields:"createdAt,updatedAt,id,name,enableUncompleteSave,description,createdAt,formData",sort:"-updatedAt",limit:10,page:1},v.editstate=function(e,t){n.go("app.jscripty.projects.edit",{id:e.id,project:e})},v.clonedialog=function(e,t){i.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{project:e,projects:v.projects?v.projects.rows:[]}})},v.sessionsgoto=function(e,t){n.go("app.jscripty.projects.edit",{id:e.id,tab:3})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the project?").htmlContent("<b>"+(e.name||"project")+"</b> will be deleted.").ariaLabel("delete project").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getProjects=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.jscriptyProject.get(v.query,f).$promise},v.createOrEditProject=function(e,t){i.show({controller:"CreateOrEditProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:t,projects:v.projects.rows,license:v.license,setting:v.setting}})},v.deleteProject=A,v.exportSelectedProjects=function(){var e=angular.copy(v.selectedProjects);return v.selectedProjects=[],e},v.deleteSelectedProjects=function(e){var t=i.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+v.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedProjects.forEach(function(e){A(e)}),v.selectedProjects=[]})},v.deselectProjects=function(){v.selectedProjects=[]},v.selectAllProjects=function(){v.selectedProjects=v.projects.rows};var h=!0,b=1;function f(e){v.projects=e||{count:0,rows:[]}}function A(e){l.jscriptyProject.delete({id:e.id}).$promise.then(function(){_.remove(v.projects.rows,{id:e.id}),v.projects.count-=1,v.projects.rows.length||v.getProjects(),c.success({title:"Project deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEjscriptyProject"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getProjects())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","projects","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.jscripty").controller("JscriptyProjectsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MAIL.EDIT_MAILACCOUNT",m.mailAccount=angular.copy(s),m.mailAccounts=o,m.newMailAccount=!1,m.mailAccount||(m.mailAccount={active:!0,cservice:"null",cauthentication:!0,fontSize:13,waitForTheAssignedAgent:10,notificationSound:!0},m.title="MAIL.NEW_MAILACCOUNT",m.newMailAccount=!0),t.params.id&&(m.mailAccount.MailAccountId=t.params.id),m.addNewMailAccount=function(){m.errors=[],r.mailAccount.save(m.mailAccount).$promise.then(function(e){m.mailAccounts.unshift(e.toJSON()),i.success({title:"MailAccount properly created",msg:m.mailAccount.name?m.mailAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMailAccount=function(){m.errors=[],r.mailAccount.update({id:m.mailAccount.id},m.mailAccount).$promise.then(function(e){var t=_.find(m.mailAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"MailAccount properly saved!",msg:m.mailAccount.name?m.mailAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMailAccount=function(e){if(m.mailAccount.service)return i.error({title:"Mail Account not deleted!",msg:"You can't remove service account"});m.errors=[];var t=a.confirm().title("Are you sure?").content("The mailAccount will be deleted.").ariaLabel("Delete MailAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.mailAccount.delete({id:m.mailAccount.id}).$promise.then(function(){_.remove(m.mailAccounts,{id:m.mailAccount.id}),i.success({title:"MailAccount properly deleted!",msg:(m.mailAccount.name||"mailAccount")+" has been deleted!"}),u(m.mailAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","mailAccounts","mailAccount","api","Auth","license","setting"],angular.module("app.mail").controller("CreateOrEditMailAccountDialogController",e)}(),function(){"use strict";function e(s,i,a,o,e){var r=this;function t(e,t){if(r.mailAccountApps.rows.length){var n=r.mailAccountApps.rows[t]?r.mailAccountApps.rows[t]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccountApp:n,mailAccount:r.mailAccount}}).then(function(e){e&&(e.id?r.mailAccountApps.rows[t]=e:r.mailAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.mailAccountApps.rows.length;n++,0){var a=r.mailAccountApps.rows[n],i=[],o=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.mailAccount.context,a.exten=r.mailAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(o.length?_.last(o).priority:a.priority)+1,t=_.concat(t,i,[a],o)}s.mailAccount.addApplications({id:r.mailAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.mailAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.mailAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.mailAccount={},r.mailAccountApps={count:0,rows:[]},r.selectedMailAccountApps=[],r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"MailQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",route:"mailQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"html",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e){r.mailAccount=e,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getMailAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.mailAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getMailAccountApps=function(){r.promise=s.mailAccount.getApplications(r.query,n).$promise},r.editMailAccountApp=t,r.editInterval=function(e,t){if(r.mailAccountApps.rows.length){var n=r.mailAccountApps.rows[t]?r.mailAccountApps.rows[t]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteMailAccountApp=function(e){_.remove(r.mailAccountApps.rows,{id:e.id}),l(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedMailAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedMailAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedMailAccountApps.forEach(function(e){_.remove(r.mailAccountApps.rows,{id:e.id})}),r.selectedMailAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return s.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.mail").controller("MailAccountActionsController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(e.appType||e.app).toUpperCase(),o.agent=angular.copy(e),o.agent.appdata)switch(o.agent.appType?o.agent.appType.toLowerCase():o.agent.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.agent.appdata.split(",");o.agent.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.agent.text=s.slice(1,s.length).join(",");break;case"message":o.agent.text=o.agent.appdata;break;case"set":o.agent.name=o.agent.appdata.split("=")[0],o.agent.value=o.agent.appdata.split("=")[1];break;case"agi":o.agent.project=o.agent.appdata;break;default:var r=o.agent.appdata.split(",");o.agent.agent=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.agent.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.agent.timeout=30;function l(e){t.hide(e)}o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outbounddial"===o.agent.appType.toLowerCase()&&(o.agent.prefix=o.agent.phone?o.agent.phone.split("$")[0]:void 0,o.agent.callerId=o.agent.callerID?"CALLERID(all)="+o.agent.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outboundDial"===o.agent.appType&&(o.agent.phone=a.cutdigits?(o.agent.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.agent.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.agent.options+="U(xcally-mixmonitor-context)"):o.agent.options=o.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.agents,{name:o.agent.agent});t&&(o.agent.UserId=t.id);if(o.agent.appType&&"custom"===o.agent.appType);else switch((o.agent.app||o.agent.appType).toLowerCase()){case"set":o.agent.appdata=o.agent.name+"="+o.agent.value;break;case"custom":break;default:e[0]=o.agent.agent,e[1]=o.agent.timeout,o.agent.appdata=e.join(",")}l(o.agent)},o.closeDialog=l,i.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){o.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(n.appType||n.app).toUpperCase(),o.autoreply=angular.copy(n),o.autoreply.appdata)switch(o.autoreply.appType?o.autoreply.appType.toLowerCase():o.autoreply.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.autoreply.appdata.split(",");o.autoreply.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.autoreply.text=s.slice(1,s.length).join(",");break;case"message":o.autoreply.text=o.autoreply.appdata;break;case"set":o.autoreply.name=o.autoreply.appdata.split("=")[0],o.autoreply.value=o.autoreply.appdata.split("=")[1];break;case"agi":o.autoreply.project=o.autoreply.appdata;break;default:var r=o.autoreply.appdata.split(",");o.autoreply.times=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.autoreply.text=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.autoreply.times=1;function l(e){t.hide(e)}o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outbounddial"===o.autoreply.appType.toLowerCase()&&(o.autoreply.prefix=o.autoreply.phone?o.autoreply.phone.split("$")[0]:void 0,o.autoreply.callerId=o.autoreply.callerID?"CALLERID(all)="+o.autoreply.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outboundDial"===o.autoreply.appType&&(o.autoreply.phone=a.cutdigits?(o.autoreply.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.autoreply.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.autoreply.options+="U(xcally-mixmonitor-context)"):o.autoreply.options=o.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(o.autoreply.appType&&"custom"===o.autoreply.appType);else switch((o.autoreply.app||o.autoreply.appType).toLowerCase()){case"set":o.autoreply.appdata=o.autoreply.name+"="+o.autoreply.value;break;case"custom":break;default:e[0]=o.autoreply.times,e[1]=o.autoreply.text,o.autoreply.appdata=e.join(",")}l(o.autoreply)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(n.appType||n.app).toUpperCase(),o.close=angular.copy(n),o.close.appdata)switch(o.close.appType?o.close.appType.toLowerCase():o.close.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.close.appdata.split(",");o.close.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.close.text=s.slice(1,s.length).join(",");break;case"message":o.close.text=o.close.appdata;break;case"set":o.close.name=o.close.appdata.split("=")[0],o.close.value=o.close.appdata.split("=")[1];break;case"agi":o.close.project=o.close.appdata;break;default:var r=o.close.appdata.split(",");o.close.disposition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outbounddial"===o.close.appType.toLowerCase()&&(o.close.prefix=o.close.phone?o.close.phone.split("$")[0]:void 0,o.close.callerId=o.close.callerID?"CALLERID(all)="+o.close.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outboundDial"===o.close.appType&&(o.close.phone=a.cutdigits?(o.close.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.close.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.close.options+="U(xcally-mixmonitor-context)"):o.close.options=o.close.options.replace("U(xcally-mixmonitor-context)",""));if(o.close.appType&&"custom"===o.close.appType);else switch((o.close.app||o.close.appType).toLowerCase()){case"set":o.close.appdata=o.close.name+"="+o.close.value;break;case"custom":break;default:e[0]=o.close.disposition,o.close.appdata=e.join(",")}l(o.close)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotoif=angular.copy(n),o.gotoif.appdata)switch(o.gotoif.appType?o.gotoif.appType.toLowerCase():o.gotoif.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotoif.appdata.split(",");o.gotoif.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotoif.text=s.slice(1,s.length).join(",");break;case"message":o.gotoif.text=o.gotoif.appdata;break;case"set":o.gotoif.name=o.gotoif.appdata.split("=")[0],o.gotoif.value=o.gotoif.appdata.split("=")[1];break;case"agi":o.gotoif.project=o.gotoif.appdata;break;default:var r=o.gotoif.appdata.split(",");o.gotoif.condition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.gotoif.truepriority=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.gotoif.falsepriority=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10)}function l(e){t.hide(e)}o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outbounddial"===o.gotoif.appType.toLowerCase()&&(o.gotoif.prefix=o.gotoif.phone?o.gotoif.phone.split("$")[0]:void 0,o.gotoif.callerId=o.gotoif.callerID?"CALLERID(all)="+o.gotoif.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outboundDial"===o.gotoif.appType&&(o.gotoif.phone=a.cutdigits?(o.gotoif.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotoif.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotoif.options+="U(xcally-mixmonitor-context)"):o.gotoif.options=o.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotoif.appType&&"custom"===o.gotoif.appType);else switch((o.gotoif.app||o.gotoif.appType).toLowerCase()){case"set":o.gotoif.appdata=o.gotoif.name+"="+o.gotoif.value;break;case"custom":break;default:e[0]=o.gotoif.condition,e[1]=o.gotoif.truepriority,e[2]=o.gotoif.falsepriority,o.gotoif.appdata=e.join(",")}l(o.gotoif)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotop=angular.copy(n),o.gotop.appdata)switch(o.gotop.appType?o.gotop.appType.toLowerCase():o.gotop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotop.appdata.split(",");o.gotop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotop.text=s.slice(1,s.length).join(",");break;case"message":o.gotop.text=o.gotop.appdata;break;case"set":o.gotop.name=o.gotop.appdata.split("=")[0],o.gotop.value=o.gotop.appdata.split("=")[1];break;case"agi":o.gotop.project=o.gotop.appdata;break;default:var r=o.gotop.appdata.split(",");o.gotop.priority=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outbounddial"===o.gotop.appType.toLowerCase()&&(o.gotop.prefix=o.gotop.phone?o.gotop.phone.split("$")[0]:void 0,o.gotop.callerId=o.gotop.callerID?"CALLERID(all)="+o.gotop.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outboundDial"===o.gotop.appType&&(o.gotop.phone=a.cutdigits?(o.gotop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotop.options+="U(xcally-mixmonitor-context)"):o.gotop.options=o.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotop.appType&&"custom"===o.gotop.appType);else switch((o.gotop.app||o.gotop.appType).toLowerCase()){case"set":o.gotop.appdata=o.gotop.name+"="+o.gotop.value;break;case"custom":break;default:e[0]=o.gotop.priority,o.gotop.appdata=e.join(",")}l(o.gotop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditMailAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(n.appType||n.app).toUpperCase(),o.noop=angular.copy(n),o.noop.appdata)switch(o.noop.appType?o.noop.appType.toLowerCase():o.noop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.noop.appdata.split(",");o.noop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.noop.text=s.slice(1,s.length).join(",");break;case"message":o.noop.text=o.noop.appdata;break;case"set":o.noop.name=o.noop.appdata.split("=")[0],o.noop.value=o.noop.appdata.split("=")[1];break;case"agi":o.noop.project=o.noop.appdata;break;default:var r=o.noop.appdata.split(",");o.noop.value=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outbounddial"===o.noop.appType.toLowerCase()&&(o.noop.prefix=o.noop.phone?o.noop.phone.split("$")[0]:void 0,o.noop.callerId=o.noop.callerID?"CALLERID(all)="+o.noop.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outboundDial"===o.noop.appType&&(o.noop.phone=a.cutdigits?(o.noop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.noop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.noop.options+="U(xcally-mixmonitor-context)"):o.noop.options=o.noop.options.replace("U(xcally-mixmonitor-context)",""));if(o.noop.appType&&"custom"===o.noop.appType);else switch((o.noop.app||o.noop.appType).toLowerCase()){case"set":o.noop.appdata=o.noop.name+"="+o.noop.value;break;case"custom":break;default:e[0]=o.noop.value,o.noop.appdata=e.join(",")}l(o.noop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(e.appType||e.app).toUpperCase(),o.queue=angular.copy(e),o.queue.appdata)switch(o.queue.appType?o.queue.appType.toLowerCase():o.queue.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.queue.appdata.split(",");o.queue.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.queue.text=s.slice(1,s.length).join(",");break;case"message":o.queue.text=o.queue.appdata;break;case"set":o.queue.name=o.queue.appdata.split("=")[0],o.queue.value=o.queue.appdata.split("=")[1];break;case"agi":o.queue.project=o.queue.appdata;break;default:var r=o.queue.appdata.split(",");o.queue.queue=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.queue.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.queue.queue=300,o.queue.timeout=300;function l(e){t.hide(e)}o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outbounddial"===o.queue.appType.toLowerCase()&&(o.queue.prefix=o.queue.phone?o.queue.phone.split("$")[0]:void 0,o.queue.callerId=o.queue.callerID?"CALLERID(all)="+o.queue.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outboundDial"===o.queue.appType&&(o.queue.phone=a.cutdigits?(o.queue.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.queue.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.queue.options+="U(xcally-mixmonitor-context)"):o.queue.options=o.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.queues,{name:o.queue.queue});t&&(o.queue[_.capitalize("mail")+"QueueId"]=t.id);if(o.queue.appType&&"custom"===o.queue.appType);else switch((o.queue.app||o.queue.appType).toLowerCase()){case"set":o.queue.appdata=o.queue.name+"="+o.queue.value;break;case"custom":break;default:e[0]=o.queue.queue,e[1]=o.queue.timeout,o.queue.appdata=e.join(",")}l(o.queue)},o.closeDialog=l,i.mailQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){o.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="MAIL.EDIT_"+(e.appType||e.app).toUpperCase(),o.system=angular.copy(e),o.system.appdata)switch(o.system.appType?o.system.appType.toLowerCase():o.system.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.system.appdata.split(",");o.system.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.system.text=s.slice(1,s.length).join(",");break;case"message":o.system.text=o.system.appdata;break;case"set":o.system.name=o.system.appdata.split("=")[0],o.system.value=o.system.appdata.split("=")[1];break;case"agi":o.system.project=o.system.appdata;break;default:var r=o.system.appdata.split(",");o.system.command=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.system.variable=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.system.variable="";function l(e){t.hide(e)}o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outbounddial"===o.system.appType.toLowerCase()&&(o.system.prefix=o.system.phone?o.system.phone.split("$")[0]:void 0,o.system.callerId=o.system.callerID?"CALLERID(all)="+o.system.callerID:void 0),o.saveMailAccountApp=function(){o.errors=[];var e=[];o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outboundDial"===o.system.appType&&(o.system.phone=a.cutdigits?(o.system.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.system.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.system.options+="U(xcally-mixmonitor-context)"):o.system.options=o.system.options.replace("U(xcally-mixmonitor-context)",""));if(o.system.appType&&"custom"===o.system.appType);else switch((o.system.app||o.system.appType).toLowerCase()){case"set":o.system.appdata=o.system.name+"="+o.system.value;break;case"custom":break;default:e[0]=o.system.command,e[1]=o.system.variable,o.system.appdata=e.join(",")}l(o.system)},o.closeDialog=l,i.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){o.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","mailAccountApp","mailAccount","api"],angular.module("app.mail").controller("EditMailAccountAppsystemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.mailAccount={},c.mailAccountInteractions={count:0,rows:[]},c.selectedMailAccountInteractions=[],c.query={fields:"createdAt,updatedAt,UserId,ContactId,MailAccountId,id,createdAt,Contact.firstName,Owner.name,closedAt,disposition,note,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e){c.mailAccount=e,c.query.id=c.mailAccount.id,c.getMailAccountInteractions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getMailAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.mailAccount.getInteractions(c.query,p).$promise},c.createOrEditMailAccountInteraction=function(e,t){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/interactions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:c.mailAccount,interaction:t,interactions:c.mailAccountInteractions.rows,license:null,setting:null}})},c.spymailInteraction=function(e,n){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"mail",interaction:n,spy:!0})}})},c.exportSelectedMailAccountInteractions=function(){var e=angular.copy(c.selectedMailAccountInteractions);return c.selectedMailAccountInteractions=[],e},c.deleteMailAccountInteraction=g,c.deleteSelectedMailAccountInteractions=function(e){var t=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedMailAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedMailAccountInteractions.forEach(function(e){g(e)}),c.selectedMailAccountInteractions=[]})};var m=!0,u=1;function p(e){c.mailAccountInteractions=e||{count:0,rows:[]}}function g(e){l.mailInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.mailAccountInteractions.rows,{id:e.id}),c.mailAccountInteractions.count-=1,c.mailAccountInteractions.rows.length||c.getMailAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMailAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountInteractionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.mailAccount={},c.mailAccountMailCannedAnswers={count:0,rows:[]},c.selectedMailAccountMailCannedAnswers=[],c.query={fields:"createdAt,updatedAt,id,key,value,description,createdAt",limit:10,page:1},c.init=function(e){c.mailAccount=e,c.query.id=c.mailAccount.id,c.query.MailAccountId=c.mailAccount.id,c.getMailAccountMailCannedAnswers()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the mailCannedAnswer?").htmlContent("<b>"+(e.name||"mailCannedAnswer")+"</b> will be deleted.").ariaLabel("delete mailCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getMailAccountMailCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.mailAccount.getAnswers(c.query,p).$promise},c.createOrEditMailAccountMailCannedAnswer=function(e,t){o.show({controller:"CreateOrEditMailCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:c.mailAccount,mailCannedAnswer:t,mailCannedAnswers:c.mailAccountMailCannedAnswers.rows,license:null,setting:null}})},c.exportSelectedMailAccountMailCannedAnswers=function(){var e=angular.copy(c.selectedMailAccountMailCannedAnswers);return c.selectedMailAccountMailCannedAnswers=[],e},c.deleteMailAccountMailCannedAnswer=g,c.deleteSelectedMailAccountMailCannedAnswers=function(e){var t=o.confirm().title("Are you sure want to delete the selected mailCannedAnswers?").htmlContent("<b>"+c.selectedMailAccountMailCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete mailCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedMailAccountMailCannedAnswers.forEach(function(e){g(e)}),c.selectedMailAccountMailCannedAnswers=[]})};var m=!0,u=1;function p(e){c.mailAccountMailCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.mailAccountMailCannedAnswers.rows,{id:e.id}),c.mailAccountMailCannedAnswers.count-=1,c.mailAccountMailCannedAnswers.rows.length||c.getMailAccountMailCannedAnswers(),r.success({title:"MailCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMailAccountMailCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountMailCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MAIL.EDIT_MAILCANNEDANSWER",m.mailCannedAnswer=angular.copy(s),m.mailCannedAnswers=o,m.newMailCannedAnswer=!1,m.mailCannedAnswer||(m.mailCannedAnswer={},m.title="MAIL.NEW_MAILCANNEDANSWER",m.newMailCannedAnswer=!0),t.params.id&&(m.mailCannedAnswer.MailAccountId=t.params.id),m.addNewMailCannedAnswer=function(){m.errors=[],r.cannedAnswer.save(m.mailCannedAnswer).$promise.then(function(e){m.mailCannedAnswers.unshift(e.toJSON()),i.success({title:"MailCannedAnswer properly created",msg:m.mailCannedAnswer.name?m.mailCannedAnswer.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMailCannedAnswer=function(){m.errors=[],r.cannedAnswer.update({id:m.mailCannedAnswer.id},m.mailCannedAnswer).$promise.then(function(e){var t=_.find(m.mailCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"MailCannedAnswer properly saved!",msg:m.mailCannedAnswer.name?m.mailCannedAnswer.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMailCannedAnswer=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The mailCannedAnswer will be deleted.").ariaLabel("Delete MailCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cannedAnswer.delete({id:m.mailCannedAnswer.id}).$promise.then(function(){_.remove(m.mailCannedAnswers,{id:m.mailCannedAnswer.id}),i.success({title:"MailCannedAnswer properly deleted!",msg:(m.mailCannedAnswer.name||"mailCannedAnswer")+" has been deleted!"}),u(m.mailCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","mailCannedAnswers","mailCannedAnswer","api","Auth","license","setting"],angular.module("app.mail").controller("CreateOrEditMailCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.mailAccount={},c.mailAccountMailDispositions={count:0,rows:[]},c.selectedMailAccountMailDispositions=[],c.query={fields:"createdAt,updatedAt,id,name,createdAt",limit:10,page:1},c.init=function(e){c.mailAccount=e,c.query.id=c.mailAccount.id,c.query.MailAccountId=c.mailAccount.id,c.getMailAccountMailDispositions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the mailDisposition?").htmlContent("<b>"+(e.name||"mailDisposition")+"</b> will be deleted.").ariaLabel("delete mailDisposition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getMailAccountMailDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.mailAccount.getDispositions(c.query,p).$promise},c.createOrEditMailAccountMailDisposition=function(e,t){o.show({controller:"CreateOrEditMailDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/mailDispositions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:c.mailAccount,mailDisposition:t,mailDispositions:c.mailAccountMailDispositions.rows,license:null,setting:null}})},c.exportSelectedMailAccountMailDispositions=function(){var e=angular.copy(c.selectedMailAccountMailDispositions);return c.selectedMailAccountMailDispositions=[],e},c.deleteMailAccountMailDisposition=g,c.deleteSelectedMailAccountMailDispositions=function(e){var t=o.confirm().title("Are you sure want to delete the selected mailDispositions?").htmlContent("<b>"+c.selectedMailAccountMailDispositions.length+" selected</b> will be deleted.").ariaLabel("delete mailDispositions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedMailAccountMailDispositions.forEach(function(e){g(e)}),c.selectedMailAccountMailDispositions=[]})};var m=!0,u=1;function p(e){c.mailAccountMailDispositions=e||{count:0,rows:[]}}function g(e){l.mailDisposition.delete({id:e.id}).$promise.then(function(){_.remove(c.mailAccountMailDispositions.rows,{id:e.id}),c.mailAccountMailDispositions.count-=1,c.mailAccountMailDispositions.rows.length||c.getMailAccountMailDispositions(),r.success({title:"MailDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMailAccountMailDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountMailDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MAIL.EDIT_MAILDISPOSITION",m.mailDisposition=angular.copy(s),m.mailDispositions=o,m.newMailDisposition=!1,m.mailDisposition||(m.mailDisposition={},m.title="MAIL.NEW_MAILDISPOSITION",m.newMailDisposition=!0),t.params.id&&(m.mailDisposition.MailAccountId=t.params.id),m.addNewMailDisposition=function(){m.errors=[],r.mailDisposition.save(m.mailDisposition).$promise.then(function(e){m.mailDispositions.unshift(e.toJSON()),i.success({title:"MailDisposition properly created",msg:m.mailDisposition.name?m.mailDisposition.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailDisposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailDisposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMailDisposition=function(){m.errors=[],r.mailDisposition.update({id:m.mailDisposition.id},m.mailDisposition).$promise.then(function(e){var t=_.find(m.mailDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"MailDisposition properly saved!",msg:m.mailDisposition.name?m.mailDisposition.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailDisposition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailDisposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMailDisposition=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The mailDisposition will be deleted.").ariaLabel("Delete MailDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.mailDisposition.delete({id:m.mailDisposition.id}).$promise.then(function(){_.remove(m.mailDispositions,{id:m.mailDisposition.id}),i.success({title:"MailDisposition properly deleted!",msg:(m.mailDisposition.name||"mailDisposition")+" has been deleted!"}),u(m.mailDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailDisposition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailDisposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","mailDispositions","mailDisposition","api","Auth","license","setting"],angular.module("app.mail").controller("CreateOrEditMailDispositionDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.mailAccount=d||n.params.mailAccount||{},c.selectedTab=n.params.tab||0,c.gotogoto=function(e,t){n.go("app.mail.realtime.accounts",{})},c.alert=r.info,c.gotoMailAccounts=function(){n.go("app.mail.mailAccounts")},c.saveMailAccount=function(){s.mailAccount.update({id:c.mailAccount.id},c.mailAccount).$promise.then(function(){r.success({title:"MailAccount updated!",msg:c.mailAccount.name?c.mailAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.lists=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","mailAccount"],angular.module("app.mail").controller("MailAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.mailAccounts=r||{count:0,rows:[]},v.table="mailAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedMailAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,page:1},v.arraycservice=_.keyBy([{option:"Custom",value:"null"},{option:"Gmail",value:"'gmail'"},{option:"Hotmail",value:"'hotmail'"},{option:"Yahoo",value:"'yahoo'"},{option:"Outlook365",value:"'outlook365'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v["arrayImap.service"]=_.keyBy([{option:"Custom",value:"null"},{option:"Gmail",value:"'gmail'"},{option:"Hotmail",value:"'hotmail'"},{option:"Yahoo",value:"'yahoo'"},{option:"Outlook365",value:"'outlook365'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v["arraySmtp.service"]=_.keyBy([{option:"Custom",value:"null"},{option:"Gmail",value:"'gmail'"},{option:"Hotmail",value:"'hotmail'"},{option:"Yahoo",value:"'yahoo'"},{option:"Outlook365",value:"'outlook365'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.mail.mailAccounts.edit",{id:e.id,mailAccount:e})},v.verifysmtpverifysmtp=function(e,t){{if(e&&e.id)return l.mailAccount.verifySmtp({id:e.id}).$promise.then(function(){c.success({title:"Smtp properly verified",msg:"Connection succeded!"})}).catch(function(e){c.error({title:"Smtp properly verified",msg:e.data?JSON.stringify(e.data):e.toString()})});c.error({title:"Smtp properly verified",msg:"Smpt id unknown"})}},v.interactionsgoto=function(e,t){n.go("app.mail.mailAccounts.edit",{id:e.id,tab:6})},v.gotorealtimegoto=function(e,t){n.go("app.mail.realtime.accounts",{})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the mailAccount?").htmlContent("<b>"+(e.name||"mailAccount")+"</b> will be deleted.").ariaLabel("delete mailAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getMailAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.mailAccount.get(v.query,f).$promise},v.createOrEditMailAccount=function(e,t){i.show({controller:"CreateOrEditMailAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:t,mailAccounts:v.mailAccounts.rows,license:v.license,setting:v.setting}})},v.deleteMailAccount=A,v.exportSelectedMailAccounts=function(){var e=angular.copy(v.selectedMailAccounts);return v.selectedMailAccounts=[],e},v.deleteSelectedMailAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected mailAccounts?").htmlContent("<b>"+v.selectedMailAccounts.length+" selected</b> will be deleted.").ariaLabel("delete MailAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedMailAccounts.forEach(function(e){A(e)}),v.selectedMailAccounts=[]})},v.deselectMailAccounts=function(){v.selectedMailAccounts=[]},v.selectAllMailAccounts=function(){v.selectedMailAccounts=v.mailAccounts.rows},l.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.lists=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.mailAccounts=e||{count:0,rows:[]}}function A(e){if(e.service)return c.error({title:"Mail Account not deleted!",msg:"You can't remove service account"});l.mailAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.mailAccounts.rows,{id:e.id}),v.mailAccounts.count-=1,v.mailAccounts.rows.length||v.getMailAccounts(),c.success({title:"MailAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getMailAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","mailAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.mail").controller("MailAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MAIL.EDIT_MAILQUEUE",m.mailQueue=angular.copy(s),m.mailQueues=o,m.newMailQueue=!1,m.mailQueue||(m.mailQueue={strategy:"beepall",timeout:10},m.title="MAIL.NEW_MAILQUEUE",m.newMailQueue=!0),m.addNewMailQueue=function(){m.errors=[],r.mailQueue.save(m.mailQueue).$promise.then(function(e){m.mailQueues.unshift(e.toJSON()),i.success({title:"MailQueue properly created",msg:m.mailQueue.name?m.mailQueue.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMailQueue=function(){m.errors=[],r.mailQueue.update({id:m.mailQueue.id},m.mailQueue).$promise.then(function(e){var t=_.find(m.mailQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"MailQueue properly saved!",msg:m.mailQueue.name?m.mailQueue.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMailQueue=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The mailQueue will be deleted.").ariaLabel("Delete MailQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.mailQueue.delete({id:m.mailQueue.id}).$promise.then(function(){_.remove(m.mailQueues,{id:m.mailQueue.id}),i.success({title:"MailQueue properly deleted!",msg:(m.mailQueue.name||"mailQueue")+" has been deleted!"}),u(m.mailQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","mailQueues","mailQueue","api","Auth","license","setting"],angular.module("app.mail").controller("CreateOrEditMailQueueDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.mailQueue[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.mailQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserMailQueue?"penalty "+e.UserMailQueue.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserMailQueue?"penalty "+e.UserMailQueue.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.mailQueue=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("MAIL.ALL_AGENTS"),labelSelected:s.instant("MAIL.SELECTED_AGENTS"),transferCallback:function(e,t){a.mailQueue[t?"removeAgents":"addAgents"]({id:l.mailQueue.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"MailQueue properly "+(t?"removed":"added"),msg:"MailQueue has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:mailQueue.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","mailQueue","mailQueues","realtime","$translate","Auth"],angular.module("app.mail").controller("MailQueueagentaddController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.mailQueue=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("MAIL.ALL_TEAMS"),labelSelected:i.instant("MAIL.SELECTED_TEAMS"),transferCallback:function(e,t){a.mailQueue[t?"removeTeams":"addTeams"]({id:o.mailQueue.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:mailQueue.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.mailQueue.getTeams({id:o.mailQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","mailQueue","$translate"],angular.module("app.mail").controller("MailQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.mailQueue=d||e.params.mailQueue||{},c.selectedTab=e.params.tab||0,c.teamadddialog=function(e,t){n.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:c.mailQueues?c.mailQueues.rows:[]}})},c.agentadddialog=function(e,t){n.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:c.mailQueues?c.mailQueues.rows:[],realtime:!1}})},c.alert=r.info,c.gotoMailQueues=function(){e.go("app.mail.mailQueues")},c.saveMailQueue=function(){s.mailQueue.update({id:c.mailQueue.id},c.mailQueue).$promise.then(function(){r.success({title:"MailQueue updated!",msg:c.mailQueue.name?c.mailQueue.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","mailQueue"],angular.module("app.mail").controller("MailQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.mailQueues=r||{count:0,rows:[]},v.table="mailQueues",v.listOrder="",v.listOrderAsc=null,v.selectedMailQueues=[],v.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,page:1},v.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.mail.mailQueues.edit",{id:e.id,mailQueue:e})},v.teamadddialog=function(e,t){i.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:v.mailQueues?v.mailQueues.rows:[]}})},v.agentadddialog=function(e,t){i.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:v.mailQueues?v.mailQueues.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the mailQueue?").htmlContent("<b>"+(e.name||"mailQueue")+"</b> will be deleted.").ariaLabel("delete mailQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.mail.realtime.queues",{})},v.success=f,v.getMailQueues=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.mailQueue.get(v.query,f).$promise},v.createOrEditMailQueue=function(e,t){i.show({controller:"CreateOrEditMailQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:t,mailQueues:v.mailQueues.rows,license:v.license,setting:v.setting}})},v.deleteMailQueue=A,v.exportSelectedMailQueues=function(){var e=angular.copy(v.selectedMailQueues);return v.selectedMailQueues=[],e},v.deleteSelectedMailQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected mailQueues?").htmlContent("<b>"+v.selectedMailQueues.length+" selected</b> will be deleted.").ariaLabel("delete MailQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedMailQueues.forEach(function(e){A(e)}),v.selectedMailQueues=[]})},v.deselectMailQueues=function(){v.selectedMailQueues=[]},v.selectAllMailQueues=function(){v.selectedMailQueues=v.mailQueues.rows};var h=!0,b=1;function f(e){v.mailQueues=e||{count:0,rows:[]}}function A(e){l.mailQueue.delete({id:e.id}).$promise.then(function(){_.remove(v.mailQueues.rows,{id:e.id}),v.mailQueues.count-=1,v.mailQueues.rows.length||v.getMailQueues(),c.success({title:"MailQueue deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailQueue"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getMailQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","mailQueues","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.mail").controller("MailQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MAIL.EDIT_MAILSUBSTATUS",m.mailSubstatus=angular.copy(s),m.mailSubtatuses=o,m.newMailSubstatus=!1,m.mailSubstatus||(m.mailSubstatus={},m.title="MAIL.NEW_MAILSUBSTATUS",m.newMailSubstatus=!0),m.addNewMailSubstatus=function(){m.errors=[],r.mailSubstatus.save(m.mailSubstatus).$promise.then(function(e){m.mailSubtatuses.unshift(e.toJSON()),i.success({title:"MailSubstatus properly created",msg:m.mailSubstatus.name?m.mailSubstatus.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMailSubstatus=function(){m.errors=[],r.mailSubstatus.update({id:m.mailSubstatus.id},m.mailSubstatus).$promise.then(function(e){var t=_.find(m.mailSubtatuses,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"MailSubstatus properly saved!",msg:m.mailSubstatus.name?m.mailSubstatus.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMailSubstatus=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The mailSubstatus will be deleted.").ariaLabel("Delete MailSubstatus").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.mailSubstatus.delete({id:m.mailSubstatus.id}).$promise.then(function(){_.remove(m.mailSubtatuses,{id:m.mailSubstatus.id}),i.success({title:"MailSubstatus properly deleted!",msg:(m.mailSubstatus.name||"mailSubstatus")+" has been deleted!"}),u(m.mailSubstatus)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","mailSubtatuses","mailSubstatus","api","Auth","license","setting"],angular.module("app.mail").controller("CreateOrEditMailSubstatusDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.mailSubtatuses=r||{count:0,rows:[]},v.table="mailSubtatuses",v.listOrder="",v.listOrderAsc=null,v.selectedMailSubstatuses=[],v.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailSubstatus:e,mailSubtatuses:v.mailSubtatuses.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the mailSubstatus?").htmlContent("<b>"+(e.name||"mailSubstatus")+"</b> will be deleted.").ariaLabel("delete mailSubstatus").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getMailSubstatuses=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.mailSubstatus.get(v.query,f).$promise},v.createOrEditMailSubstatus=function(e,t){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailSubstatus:t,mailSubtatuses:v.mailSubtatuses.rows,license:v.license,setting:v.setting}})},v.deleteMailSubstatus=A,v.exportSelectedMailSubstatuses=function(){var e=angular.copy(v.selectedMailSubstatuses);return v.selectedMailSubstatuses=[],e},v.deleteSelectedMailSubstatuses=function(e){var t=i.confirm().title("Are you sure want to delete the selected mailSubtatuses?").htmlContent("<b>"+v.selectedMailSubstatuses.length+" selected</b> will be deleted.").ariaLabel("delete MailSubstatuss").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedMailSubstatuses.forEach(function(e){A(e)}),v.selectedMailSubstatuses=[]})},v.deselectMailSubstatuses=function(){v.selectedMailSubstatuses=[]},v.selectAllMailSubstatuses=function(){v.selectedMailSubstatuses=v.mailSubtatuses.rows};var h=!0,b=1;function f(e){v.mailSubtatuses=e||{count:0,rows:[]}}function A(e){l.mailSubstatus.delete({id:e.id}).$promise.then(function(){_.remove(v.mailSubtatuses.rows,{id:e.id}),v.mailSubtatuses.count-=1,v.mailSubtatuses.rows.length||v.getMailSubstatuses(),c.success({title:"MailSubstatus deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailSubstatus"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailSubstatus",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getMailSubstatuses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","mailSubtatuses","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.mail").controller("MailSubstatusesController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d){var c=this;function m(){_.forIn(c.mailAccounts,function(e,t){c.rpcMailAccounts[t]&&_.merge(e,c.rpcMailAccounts[t])}),_.forIn(c.mailAccounts,function(t,e){var n={id:e,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss")};o.mailAccount.getMessages(n).$promise.then(function(e){return e&&(t.in=e.count||0,t.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),n.direction="out",o.mailAccount.getMessages(n).$promise}).then(function(e){e&&(t.out=e.count||0,t.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){console.log(e)})})}c.count=l&&l.count?l.count:0,c.mailAccounts=l?_.keyBy(l.rows?l.rows:[],"id"):{},c.rpcMailAccounts=d?_.keyBy(d.rows?d.rows:[],"id"):{},c.query={sort:"-name",limit:10,page:1},c.success=g,c.$onInit=m,c.getMailAccounts=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.mailAccount.get(c.query,g).$promise},c.onSave=function(e){c.mailAccounts[e.id]&&_.merge(c.mailAccounts[e.id],e)},c.onMailMessageSave=function(e){c.mailAccounts[e.MailAccountId]&&("in"==e.direction?(c.mailAccounts[e.MailAccountId].in+=1,c.mailAccounts[e.MailAccountId].lastIn=e.createdAt):(c.mailAccounts[e.MailAccountId].out+=1,c.mailAccounts[e.MailAccountId].lastOut=e.createdAt))},c.goToMailAccount=function(e,t){i.go("app.mail.mailAccounts.edit",{id:t.id,mailAccount:t})},c.verifySmtp=function(e,t){{if(t&&t.id)return o.mailAccount.verifySmtp({id:t.id}).$promise.then(function(){r.success({title:"Smtp properly verified",msg:"Connection succeded!"})}).catch(function(e){r.error({title:"Smtp properly verified",msg:e.data?JSON.stringify(e.data):e.toString()})});r.error({title:"Smtp properly verified",msg:"Smpt id unknown"})}},c.order=[],_.forIn(c.mailAccounts,function(e,t){c.order.push(e.id)}),s.on("mailAccount:save",c.onSave),s.on("mailAccount:update",c.onSave),s.on("mailMessage:save",c.onMailMessageSave);var u=!0,p=1;function g(e){if(c.mailAccounts=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){c.order=[];for(var t=0;t<e.rows.length;t++)c.order.push(e.rows[t].id)}m()}e.$watch("vm.query.filter",function(e,t){u?n(function(){u=!1}):(t||(p=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=p),c.getMailAccounts())}),e.$on("$destroy",function(){s.removeAllListeners("mailAccount:save"),s.removeAllListeners("mailAccount:update"),s.removeAllListeners("mailMessage:save")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$state","api","socket","toasty","mailAccounts","rpcMailAccounts"],angular.module("app.mail").controller("MailAccountsRealtimeController",e)}(),function(){"use strict";function e(e,s,t,n,a,i,o,r,l,d,c,m,u,p,g,v){var h=this,b=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum"],f=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var A in h.availableStates=["ringing","inuse","busy","onhold","not_inuse"],h.pauses=o||{count:0,rows:[]},h.license=g,h.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},h.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},h.paginatedAgents={},h.load=!1,h.order=[],h.agentInternal={},h.agents)h.agents.hasOwnProperty(A)&&(h.agents[A].init=!0);h.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},h.logout=function(e,t){return d.user.logout({id:e.id}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),h.agents[e.id]&&(h.agents[e.id].online=!1),h.rpcAgents[e.id]&&(h.rpcAgents[e.id].online=!1),y()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"mail",realtime:!0,direction:"inbound"}})},h.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},h.getAgentStatus=C,h.getAgentGlobalStatus=x,h.isPause=S,h.checkPause=function(e){return"pause"===e},h.isPartialPause=function(e){return"*pause"===e},h.onSave=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(_.omit(e,f),b)),_.merge(h.rpcAgents[e.id],_.pick(_.omit(e,f),b)),x(h.agents[e.id]))},h.onUpdate=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(e,b)),_.merge(h.rpcAgents[e.id],_.pick(e,b)),x(h.agents[e.id]))},h.onInit=y,h.onConnect=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(_.merge(h.agents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(h.rpcAgents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},h.onComplete=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(h.agents[h.agentInternal[e.destaccountcode]]=_.omit(h.agents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),h.rpcAgents[h.agentInternal[e.destaccountcode]]=_.omit(h.rpcAgents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",h.onSave),c.on("user:update",h.onUpdate),c.on("user:agentconnect",h.onConnect),c.on("user:agentcomplete",h.onComplete),y();var E=v(function(){h.load&&(h.load=!1,y())},999);function y(e){h.load=!1;var t,n,a=s.defer();h.promise=a.promise,h.filteredAgents=[],h.order=[],_.forIn(h.agents,function(e,t){h.rpcAgents[t]&&_.merge(e,_.pick(_.omit(h.rpcAgents[t],f),b)),x(e),e.online?(h.filteredAgents.push(e),h.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),h.query.globalStatusFilter&&_.remove(h.filteredAgents,function(e){return e.globalStatus!==h.query.globalStatusFilter}),h.query.pauseTypeFilter&&_.remove(h.filteredAgents,function(e){return e.pauseType!==h.query.pauseTypeFilter}),h.query.filter&&_.remove(h.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(h.query.filter.toLowerCase())<0}),h.filteredAgents=(t=h.filteredAgents,n=_.startsWith(h.query.order,"-")?"desc":"asc",_.orderBy(t,[h.query.order.replace("-","")],[n]));var i=(h.query.page-1)*h.query.limit;h.paginatedAgents=_.drop(h.filteredAgents,i).slice(0,h.query.limit);for(var o=0;o<h.paginatedAgents.length;o+=1)h.order.push(h.paginatedAgents[o].id);a.resolve(),h.load=!0}function S(e){return"pause"===e||"*pause"===e}function T(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function C(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function x(e){var t="unknown";t=_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"pause":_.some([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"*pause":_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],T)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=S(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),E&&(v.cancel(E),E=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","Auth","license","$interval"],angular.module("app.voice").controller("AgentsMailRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function g(){var n=[];return _.forIn(u.queues,function(e,t){e.paused=0,e.loggedInDb=0,u.queues[t].agents={},n.push(l.mailQueue.getMembers({id:t}).$promise),u.rpcQueues[t]&&_.merge(e,_.pick(u.rpcQueues[t],p))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&u.queues[e[t].rows[n].MailQueueId].paused++,u.queues[e[t].rows[n].MailQueueId].loggedInDb++,u.queues[e[t].rows[n].MailQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].MailQueueId}).catch(function(e){console.error(e)})}u.count=s.count?s.count:0,u.queues=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.hasRole("admin")?u.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:u.query={id:m.getCurrentUser().id,channel:"mail",type:"inbound",sort:"-updatedAt",limit:10,page:1},u.success=b,u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=l.mailQueue.get(u.query,b).$promise:u.promise=l.user.getQueues(u.query,b).$promise},u.createOrEditMailQueue=function(e,t){a.show({controller:"CreateOrEditMailQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:t,mailQueues:_.values(u.queues),license:null,setting:null}})},u.agentAdd=function(e,t){a.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:t,mailQueues:u.queues?u.queues.rows:[],realtime:!1}})},u.updateQueue=function(e){return l.mailQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},u.onSave=function(e){u.queues[e.id]&&_.merge(u.queues[e.id],_.pick(e,p))},u.onSaveMember=function(e){u.queues[e.MailQueueId]&&u.queues[e.MailQueueId].loggedInDb++},u.onRemoveMember=function(e){u.queues[e.MailQueueId]&&u.queues[e.MailQueueId].loggedInDb--},u.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(u.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(u.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},u.onLogin=function(e){console.log("onLogged",e),u.queues[e.MailQueueId]&&(u.queues[e.MailQueueId].loggedInDb+=1,u.queues[e.MailQueueId].agents[e.UserId]=e.MailQueueId)},u.onLogout=function(e){console.log("onLogout",e),u.queues[e.MailQueueId]&&0<u.queues[e.MailQueueId].loggedInDb&&(u.queues[e.MailQueueId].loggedInDb-=1,delete u.queues[e.MailQueueId].agents[e.UserId])},u.$onInit=g,u.order=[],_.forIn(u.queues,function(e,t){u.order.push(e.id)}),d.on("mail_queue:save",u.onSave),d.on("userMailQueue:save",u.onSaveMember),d.on("userMailQueue:remove",u.onRemoveMember),d.on("user:update",u.onPause),d.on("userVoiceQueue:remove",u.onLogout),d.on("userVoiceQueue:save",u.onLogin);var v=!0,h=1;function b(e){if(u.count=e.count,u.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){u.order=[];for(var t=0;t<e.rows.length;t++)u.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("mail_queue:save"),d.removeAllListeners("userMailQueue:remove"),d.removeAllListeners("userMailQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","Auth"],angular.module("app.mail").controller("QueuesMailRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.mail.realtime.agents":this.selectedTab=0;break;case"app.mail.realtime.queues":this.selectedTab=1;break;case"app.mail.realtime.accounts":this.selectedTab=2;break;default:this.selectedTab=0,n.go("app.mail.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.mail.realtime.agents");break;case 1:n.go("app.mail.realtime.queues");break;case 2:n.go("app.mail.realtime.accounts");break;default:n.go("app.mail.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.mail").controller("MailRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MOTIONDIALER.EDIT_IVRCAMPAIGN",m.ivrCampaign=angular.copy(s),m.ivrCampaigns=o,m.newIvrCampaign=!1,m.ivrCampaign||(m.ivrCampaign={active:!0,type:"ivr",dialCheckDuplicateType:"always",limitCalls:30,dialOriginateTimeout:30,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150,dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3},m.title="MOTIONDIALER.NEW_IVRCAMPAIGN",m.newIvrCampaign=!0),m.addNewIvrCampaign=function(){m.errors=[],r.campaign.save(m.ivrCampaign).$promise.then(function(e){m.ivrCampaigns.unshift(e.toJSON()),i.success({title:"IvrCampaign properly created",msg:m.ivrCampaign.name?m.ivrCampaign.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveIvrCampaign=function(){m.errors=[],r.campaign.update({id:m.ivrCampaign.id},m.ivrCampaign).$promise.then(function(e){var t=_.find(m.ivrCampaigns,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"IvrCampaign properly saved!",msg:m.ivrCampaign.name?m.ivrCampaign.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteIvrCampaign=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The ivrCampaign will be deleted.").ariaLabel("Delete IvrCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.campaign.delete({id:m.ivrCampaign.id}).$promise.then(function(){_.remove(m.ivrCampaigns,{id:m.ivrCampaign.id}),i.success({title:"IvrCampaign properly deleted!",msg:(m.ivrCampaign.name||"ivrCampaign")+" has been deleted!"}),u(m.ivrCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.trunks=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.projects=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){m.interval=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","ivrCampaigns","ivrCampaign","api","Auth","license","setting"],angular.module("app.motiondialer").controller("CreateOrEditIvrCampaignDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o){var s=this;s.ivrCampaign=t,s.items=[],s.selectedItems=[],s.loading=!1,s.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:i.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){s.loading=!0,a.campaign[t?"removeBlackLists":"addBlackLists"]({id:s.ivrCampaign.id,ids:_.map(e,"id")}).$promise.then(function(){n.success({title:"List properly "+(t?"removed":"added"),msg:"List has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ivrCampaign.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){s.loading=!1})}},s.closeDialog=function(){e.hide()},a.campaign.getBlackLists({id:s.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return s.selectedItems=e.rows?e.rows:[],s.dualMultiselectOptions.selectedItems=s.selectedItems,a.cmList.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){s.items=e.rows?e.rows:[],s.dualMultiselectOptions.items=_.differenceBy(s.items,s.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","ivrCampaign","$translate","$timeout"],angular.module("app.motiondialer").controller("IvrCampaignblacklistaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.ivrCampaign={},c.ivrCampaignHopperBlacks={count:0,rows:[]},c.selectedIvrCampaignHopperBlacks=[],c.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},c.init=function(e){c.ivrCampaign=e,c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHopperBlacks()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHopperBlacks=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHopperBlacks(c.query,p).$promise},c.createOrEditIvrCampaignHopperBlack=function(e,t){o.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopperBlack:t,hopperBlacks:c.ivrCampaignHopperBlacks.rows,license:null,setting:null}})},c.exportSelectedIvrCampaignHopperBlacks=function(){var e=angular.copy(c.selectedIvrCampaignHopperBlacks);return c.selectedIvrCampaignHopperBlacks=[],e},c.deleteIvrCampaignHopperBlack=g,c.deleteSelectedIvrCampaignHopperBlacks=function(e){var t=o.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+c.selectedIvrCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedIvrCampaignHopperBlacks.forEach(function(e){g(e)}),c.selectedIvrCampaignHopperBlacks=[]})};var m=!0,u=1;function p(e){c.ivrCampaignHopperBlacks=e||{count:0,rows:[]}}function g(e){l.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHopperBlacks.rows,{id:e.id}),c.ivrCampaignHopperBlacks.count-=1,c.ivrCampaignHopperBlacks.rows.length||c.getIvrCampaignHopperBlacks(),r.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHopperBlacks())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.contacts={},c.ivrCampaign={},c.ivrCampaignHopperFinals={count:0,rows:[]},c.selectedIvrCampaignHopperFinals=[],c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},c.init=function(e){c.ivrCampaign=e,c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHopperFinals()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHopperFinals=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHopperFinals(c.query,p).$promise},c.createOrEditIvrCampaignHopperFinal=function(e,t){o.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopperFinal:t,hopperFinals:c.ivrCampaignHopperFinals.rows,license:null,setting:null}})},c.exportSelectedIvrCampaignHopperFinals=function(){var e=angular.copy(c.selectedIvrCampaignHopperFinals);return c.selectedIvrCampaignHopperFinals=[],e},c.deleteIvrCampaignHopperFinal=g,c.deleteSelectedIvrCampaignHopperFinals=function(e){var t=o.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+c.selectedIvrCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedIvrCampaignHopperFinals.forEach(function(e){g(e)}),c.selectedIvrCampaignHopperFinals=[]})},c.moveIvrCampaignHopperFinal=v,c.moveContactsIvrCampaignHopperFinal=function(e){l.cmHopperFinal.moveContactsIvrCampaignHopperFinal({id:c.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?r.info({title:"Restored Contacts",msg:"0"}):r.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.countContactsIvrCampaignHopperFinal=function(e){l.cmHopperFinal.countContactsIvrCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(c.contacts,e[0])}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.moveConfirm=function(e,t){var n=o.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){v(e)},function(){console.log("CANCEL")})},c.moveSelectedIvrCampaignHopperFinals=function(e){var t=o.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedIvrCampaignHopperFinals.forEach(function(e){v(e)}),c.selectedIvrCampaignHopperFinals=[]})};var m=!0,u=1;function p(e){c.ivrCampaignHopperFinals=e||{count:0,rows:[]}}function g(e){l.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHopperFinals.rows,{id:e.id}),c.ivrCampaignHopperFinals.count-=1,c.ivrCampaignHopperFinals.rows.length||c.getIvrCampaignHopperFinals(),r.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){l.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){r.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var t,n;"Not Found"===e.data?l.cmHopper.save((t=a,n={},n.phone=t.calleridnum,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=0,n.countcongestionretry=0,n.countnoanswerretry=0,n.countglobal=0,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=t.deleted?null:t.UserId,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.priority=t.recallme?3:2,n.recallme=!!t.recallme,n)).$promise.then(function(e){var t,n;r.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&l.cmHopperHistory.save(((n={}).calleridnum=(t=a).calleridnum,n.calleridname=t.calleridname,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=t.countbusyretry,n.countcongestionretry=t.countcongestionretry,n.countnoanswerretry=t.countnoanswerretry,n.countglobal=t.countglobal,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=d.getCurrentUser().id,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),n.edited=!0,n.state=25,n.statedesc="Restored",n.campaign=t.campaign,n.campaigntype=t.VoiceQueueId?"queue":"ivr",n))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):r.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHopperFinals())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.ivrCampaign={},c.ivrCampaignHopperHistories={count:0,rows:[]},c.selectedIvrCampaignHopperHistories=[],c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},c.init=function(e){c.ivrCampaign=e,c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHopperHistories()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHopperHistories=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHopperHistories(c.query,p).$promise},c.createOrEditIvrCampaignHopperHistory=function(e,t){o.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopperHistory:t,hopperHistories:c.ivrCampaignHopperHistories.rows,license:null,setting:null}})},c.exportSelectedIvrCampaignHopperHistories=function(){var e=angular.copy(c.selectedIvrCampaignHopperHistories);return c.selectedIvrCampaignHopperHistories=[],e},c.deleteIvrCampaignHopperHistory=g,c.deleteSelectedIvrCampaignHopperHistories=function(e){var t=o.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+c.selectedIvrCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedIvrCampaignHopperHistories.forEach(function(e){g(e)}),c.selectedIvrCampaignHopperHistories=[]})};var m=!0,u=1;function p(e){c.ivrCampaignHopperHistories=e||{count:0,rows:[]}}function g(e){l.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHopperHistories.rows,{id:e.id}),c.ivrCampaignHopperHistories.count-=1,c.ivrCampaignHopperHistories.rows.length||c.getIvrCampaignHopperHistories(),r.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHopperHistories())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.ivrCampaign={},c.ivrCampaignHoppers={count:0,rows:[]},c.selectedIvrCampaignHoppers=[],c.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,scheduledat,priority",sort:"-updatedAt",limit:10,page:1},c.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e){c.ivrCampaign=e,c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHoppers()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHoppers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHoppers(c.query,p).$promise},c.createOrEditIvrCampaignHopper=function(e,t){o.show({controller:"CreateOrEditHopperCampaignIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopper:t,hoppers:c.ivrCampaignHoppers.rows,license:null,setting:null}})},c.exportSelectedIvrCampaignHoppers=function(){var e=angular.copy(c.selectedIvrCampaignHoppers);return c.selectedIvrCampaignHoppers=[],e},c.deleteIvrCampaignHopper=g,c.deleteSelectedIvrCampaignHoppers=function(e){var t=o.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+c.selectedIvrCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedIvrCampaignHoppers.forEach(function(e){g(e)}),c.selectedIvrCampaignHoppers=[]})},l.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){c.agents=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.ivrCampaignHoppers=e||{count:0,rows:[]}}function g(e){l.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHoppers.rows,{id:e.id}),c.ivrCampaignHoppers.count-=1,c.ivrCampaignHoppers.rows.length||c.getIvrCampaignHoppers(),r.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHoppers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHoppersController",e)}(),function(){"use strict";function e(e,t,n,a,s,i,o,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MOTIONDIALER.EDIT_HOPPER",m.hopper=angular.copy(o),m.hoppers=i,m.newHopper=!1,m.hopper||(m.hopper={},m.title="MOTIONDIALER.NEW_HOPPER",m.newHopper=!0),t.params.id&&(m.hopper.CampaignId=t.params.id),m.addNewHopper=function(){m.errors=[],r.cmHopper.save(m.hopper).$promise.then(function(e){m.hoppers.unshift(e.toJSON()),s.success({title:"Hopper properly created",msg:m.hopper.name?m.hopper.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var t=0;t<e.data.errors.length;t+=1)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveHopper=function(){var n,a,i,o;m.errors=[],m.hopper.UserId=m.hopper.recallme?m.hopper.UserId:null,r.cmHopper.get({id:m.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){n=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){r.cmHopper.update({id:m.hopper.id},_.omit(m.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,r.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){r.campaign.get({raw:!1,id:a.CampaignId,attributes:["name"]}).$promise.then(function(e){o=e.name}).catch(function(e){o=void 0}).finally(function(){r.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:n,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:o,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:l.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme})})});var t=_.find(m.hoppers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),s.success({title:"Hopper properly saved!",msg:m.hopper.name?m.hopper.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},m.deleteHopper=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cmHopper.delete({id:m.hopper.id}).$promise.then(function(){_.remove(m.hoppers,{id:m.hopper.id}),s.success({title:"Hopper properly deleted!",msg:(m.hopper.name||"hopper")+" has been deleted!"}),u(m.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","hoppers","hopper","api","Auth","license","setting"],angular.module("app.motiondialer").controller("CreateOrEditHopperCampaignIdDialogController",e)}(),function(){"use strict";function e(n,a){var i=this;i.ivrCampaign={},i.init=function(t){i.ivrCampaign=t,n.cmHopper.get({limit:0,CampaignId:t.id}).$promise.then(function(e){return i.total=e.count||0,n.cmHopper.get({limit:0,CampaignId:t.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,n.cmHopperFinal.get({limit:0,CampaignId:t.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("IvrCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,n,a,t,i,o){var s=this;s.ivrCampaign=t,s.items=[],s.selectedItems=[],s.loading=!1,s.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:i.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){s.loading=!0,a.campaign[t?"removeLists":"addLists"]({id:s.ivrCampaign.id,ids:_.map(e,"id")}).$promise.then(function(){n.success({title:"List properly "+(t?"removed":"added"),msg:"List has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ivrCampaign.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){s.loading=!1})}},s.closeDialog=function(){e.hide()},a.campaign.getLists({id:s.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return s.selectedItems=e.rows?e.rows:[],s.dualMultiselectOptions.selectedItems=s.selectedItems,a.cmList.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){s.items=e.rows?e.rows:[],s.dualMultiselectOptions.items=_.differenceBy(s.items,s.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","ivrCampaign","$translate","$timeout"],angular.module("app.motiondialer").controller("IvrCampaignlistaddController",e)}(),function(){"use strict";function e(e,t,a,i,o,n,s,r){var l=this;function d(){t.hide()}function c(e,t){var n=t.id;s.enqueue(function(){return i.campaign.removeLists({id:e,ids:n}).$promise.then(function(){return i.campaign.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=n||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,t){return-1<t.indexOf(e)},l.toggle=function(e,t){var n=t.indexOf(e);-1<n?t.splice(n,1):t.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,t){for(var n=0;n<l.selected.length;n+=1)c(o.id,l.selected[n]);var a;a=e,s.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","ivrCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("IvrCampaignresetlistController",e)}(),function(){"use strict";function e(n,e,i,o,t,a,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=t,c.setting=a,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.ivrCampaign=d||n.params.ivrCampaign||{},c.selectedTab=n.params.tab||0,c.listadddialog=function(e,t){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:c.ivrCampaigns?c.ivrCampaigns.rows:[]}})},c.blacklistadddialog=function(e,t){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:c.ivrCampaigns?c.ivrCampaigns.rows:[]}})},c.resetlistdialog=function(t,n){s.campaign.getLists({id:t.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))r.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(n).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,t,n;e=c.ivrCampaign.id,t=a.rows[0],n=t.id,s.campaign.removeLists({id:e,ids:n}).$promise.then(function(){return s.campaign.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){r.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ivrCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"IvrCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",parent:angular.element(o.body),targetEvent:n,clickOutsideToClose:!1,locals:{ivrCampaign:t,listsCampaign:a?a.rows:[]}})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.gotogoto=function(e,t){n.go("app.motiondialer.realtime.ivr_campaigns",{})},c.alert=r.info,c.gotoIvrCampaigns=function(){n.go("app.motiondialer.ivrCampaigns")},c.saveIvrCampaign=function(){s.campaign.update({id:c.ivrCampaign.id},c.ivrCampaign).$promise.then(function(){r.success({title:"IvrCampaign updated!",msg:c.ivrCampaign.name?c.ivrCampaign.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.trunks=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.projects=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){c.interval=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","ivrCampaign"],angular.module("app.motiondialer").controller("IvrCampaignController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.ivrCampaigns=r||{count:0,rows:[]},v.table="ivrCampaigns",v.listOrder="",v.listOrderAsc=null,v.selectedIvrCampaigns=[],v.query={fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,page:1},v.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.motiondialer.ivrCampaigns.edit",{id:e.id,ivrCampaign:e})},v.listadddialog=function(e,t){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:v.ivrCampaigns?v.ivrCampaigns.rows:[]}})},v.blacklistadddialog=function(e,t){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:v.ivrCampaigns?v.ivrCampaigns.rows:[]}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the ivrCampaign?").htmlContent("<b>"+(e.name||"ivrCampaign")+"</b> will be deleted.").ariaLabel("delete ivrCampaign").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.motiondialer.realtime.ivr_campaigns",{})},v.success=f,v.getIvrCampaigns=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.campaign.get(v.query,f).$promise},v.createOrEditIvrCampaign=function(e,t){i.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:t,ivrCampaigns:v.ivrCampaigns.rows,license:v.license,setting:v.setting}})},v.deleteIvrCampaign=A,v.exportSelectedIvrCampaigns=function(){var e=angular.copy(v.selectedIvrCampaigns);return v.selectedIvrCampaigns=[],e},v.deleteSelectedIvrCampaigns=function(e){var t=i.confirm().title("Are you sure want to delete the selected ivrCampaigns?").htmlContent("<b>"+v.selectedIvrCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete IvrCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedIvrCampaigns.forEach(function(e){A(e)}),v.selectedIvrCampaigns=[]})},v.deselectIvrCampaigns=function(){v.selectedIvrCampaigns=[]},v.selectAllIvrCampaigns=function(){v.selectedIvrCampaigns=v.ivrCampaigns.rows},l.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.trunks=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.projects=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){v.interval=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.ivrCampaigns=e||{count:0,rows:[]}}function A(e){l.campaign.delete({id:e.id}).$promise.then(function(){_.remove(v.ivrCampaigns.rows,{id:e.id}),v.ivrCampaigns.count-=1,v.ivrCampaigns.rows.length||v.getIvrCampaigns(),c.success({title:"IvrCampaign deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcampaign"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getIvrCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","ivrCampaigns","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.motiondialer").controller("IvrCampaignsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MOTIONDIALER.EDIT_QUEUECAMPAIGN",m.queueCampaign=angular.copy(s),m.queueCampaigns=o,m.newQueueCampaign=!1,m.queueCampaign||(m.queueCampaign={dialActive:!0,type:"outbound",dialCheckDuplicateType:"always",autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no",dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3,dialMethod:"progressive",dialPowerLevel:1,dialPredictiveOptimization:"dropRate",dialPredictiveOptimizationPercentage:3,dialPredictiveInterval:10,dialLimitQueue:0,dialOriginateTimeout:30,dialQueueOptions:"tTxX",dialQueueTimeout:3,strategy:"rrmemory",timeout:3,retry:3,weight:1,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150},m.title="MOTIONDIALER.NEW_QUEUECAMPAIGN",m.newQueueCampaign=!0),m.addNewQueueCampaign=function(){m.errors=[],r.voiceQueue.save(m.queueCampaign).$promise.then(function(e){m.queueCampaigns.unshift(e.toJSON()),i.success({title:"QueueCampaign properly created",msg:m.queueCampaign.name?m.queueCampaign.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveQueueCampaign=function(){m.errors=[],r.voiceQueue.update({id:m.queueCampaign.id},m.queueCampaign).$promise.then(function(e){var t=_.find(m.queueCampaigns,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"QueueCampaign properly saved!",msg:m.queueCampaign.name?m.queueCampaign.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteQueueCampaign=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The queueCampaign will be deleted.").ariaLabel("Delete QueueCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceQueue.delete({id:m.queueCampaign.id}).$promise.then(function(){_.remove(m.queueCampaigns,{id:m.queueCampaign.id}),i.success({title:"QueueCampaign properly deleted!",msg:(m.queueCampaign.name||"queueCampaign")+" has been deleted!"}),u(m.queueCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.trunks=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){m.interval=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","queueCampaigns","queueCampaign","api","Auth","license","setting"],angular.module("app.motiondialer").controller("CreateOrEditQueueCampaignDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.voiceQueue[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.queueCampaign.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserQueueCampaign?"penalty "+e.UserQueueCampaign.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserQueueCampaign?"penalty "+e.UserQueueCampaign.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.queueCampaign=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("MOTIONDIALER.ALL_AGENTS"),labelSelected:s.instant("MOTIONDIALER.SELECTED_AGENTS"),transferCallback:function(e,t){a.voiceQueue[t?"removeAgents":"addAgents"]({id:l.queueCampaign.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"QueueCampaign properly "+(t?"removed":"added"),msg:"QueueCampaign has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:voiceQueue.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","queueCampaign","queueCampaigns","realtime","$translate","Auth"],angular.module("app.motiondialer").controller("QueueCampaignagentaddController",e)}(),function(){"use strict";function e(e,n,a,t,i,o){var s=this;s.queueCampaign=t,s.items=[],s.selectedItems=[],s.loading=!1,s.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:i.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){s.loading=!0,a.voiceQueue[t?"removeBlackLists":"addBlackLists"]({id:s.queueCampaign.id,ids:_.map(e,"id")}).$promise.then(function(){n.success({title:"List properly "+(t?"removed":"added"),msg:"List has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){s.loading=!1})}},s.closeDialog=function(){e.hide()},a.voiceQueue.getBlackLists({id:s.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return s.selectedItems=e.rows?e.rows:[],s.dualMultiselectOptions.selectedItems=s.selectedItems,a.cmList.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){s.items=e.rows?e.rows:[],s.dualMultiselectOptions.items=_.differenceBy(s.items,s.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","queueCampaign","$translate","$timeout"],angular.module("app.motiondialer").controller("QueueCampaignblacklistaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.queueCampaign={},c.queueCampaignHopperBlacks={count:0,rows:[]},c.selectedQueueCampaignHopperBlacks=[],c.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},c.init=function(e){c.queueCampaign=e,c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHopperBlacks()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHopperBlacks=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHopperBlacks(c.query,p).$promise},c.createOrEditQueueCampaignHopperBlack=function(e,t){o.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopperBlack:t,hopperBlacks:c.queueCampaignHopperBlacks.rows,license:null,setting:null}})},c.exportSelectedQueueCampaignHopperBlacks=function(){var e=angular.copy(c.selectedQueueCampaignHopperBlacks);return c.selectedQueueCampaignHopperBlacks=[],e},c.deleteQueueCampaignHopperBlack=g,c.deleteSelectedQueueCampaignHopperBlacks=function(e){var t=o.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+c.selectedQueueCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedQueueCampaignHopperBlacks.forEach(function(e){g(e)}),c.selectedQueueCampaignHopperBlacks=[]})};var m=!0,u=1;function p(e){c.queueCampaignHopperBlacks=e||{count:0,rows:[]}}function g(e){l.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHopperBlacks.rows,{id:e.id}),c.queueCampaignHopperBlacks.count-=1,c.queueCampaignHopperBlacks.rows.length||c.getQueueCampaignHopperBlacks(),r.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHopperBlacks())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.contacts={},c.queueCampaign={},c.queueCampaignHopperFinals={count:0,rows:[]},c.selectedQueueCampaignHopperFinals=[],c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},c.init=function(e){c.queueCampaign=e,c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHopperFinals()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHopperFinals=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHopperFinals(c.query,p).$promise},c.createOrEditQueueCampaignHopperFinal=function(e,t){o.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopperFinal:t,hopperFinals:c.queueCampaignHopperFinals.rows,license:null,setting:null}})},c.exportSelectedQueueCampaignHopperFinals=function(){var e=angular.copy(c.selectedQueueCampaignHopperFinals);return c.selectedQueueCampaignHopperFinals=[],e},c.deleteQueueCampaignHopperFinal=g,c.deleteSelectedQueueCampaignHopperFinals=function(e){var t=o.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+c.selectedQueueCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedQueueCampaignHopperFinals.forEach(function(e){g(e)}),c.selectedQueueCampaignHopperFinals=[]})},c.moveQueueCampaignHopperFinal=v,c.moveContactsQueueCampaignHopperFinal=function(e){l.cmHopperFinal.moveContactsQueueCampaignHopperFinal({id:c.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?r.info({title:"Restored Contacts",msg:"0"}):r.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.countContactsQueueCampaignHopperFinal=function(e){l.cmHopperFinal.countContactsQueueCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(c.contacts,e[0])}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.moveConfirm=function(e,t){var n=o.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){v(e)},function(){console.log("CANCEL")})},c.moveSelectedQueueCampaignHopperFinals=function(e){var t=o.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedQueueCampaignHopperFinals.forEach(function(e){v(e)}),c.selectedQueueCampaignHopperFinals=[]})};var m=!0,u=1;function p(e){c.queueCampaignHopperFinals=e||{count:0,rows:[]}}function g(e){l.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHopperFinals.rows,{id:e.id}),c.queueCampaignHopperFinals.count-=1,c.queueCampaignHopperFinals.rows.length||c.getQueueCampaignHopperFinals(),r.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){l.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){r.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var t,n;"Not Found"===e.data?l.cmHopper.save((t=a,n={},n.phone=t.calleridnum,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=0,n.countcongestionretry=0,n.countnoanswerretry=0,n.countglobal=0,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=t.deleted?null:t.UserId,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.priority=t.recallme?3:2,n.recallme=!!t.recallme,n)).$promise.then(function(e){var t,n;r.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&l.cmHopperHistory.save(((n={}).calleridnum=(t=a).calleridnum,n.calleridname=t.calleridname,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=t.countbusyretry,n.countcongestionretry=t.countcongestionretry,n.countnoanswerretry=t.countnoanswerretry,n.countglobal=t.countglobal,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=d.getCurrentUser().id,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),n.edited=!0,n.state=25,n.statedesc="Restored",n.campaign=t.campaign,n.campaigntype=t.VoiceQueueId?"queue":"ivr",n))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):r.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHopperFinals())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.queueCampaign={},c.queueCampaignHopperHistories={count:0,rows:[]},c.selectedQueueCampaignHopperHistories=[],c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},c.init=function(e){c.queueCampaign=e,c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHopperHistories()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHopperHistories=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHopperHistories(c.query,p).$promise},c.createOrEditQueueCampaignHopperHistory=function(e,t){o.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopperHistory:t,hopperHistories:c.queueCampaignHopperHistories.rows,license:null,setting:null}})},c.exportSelectedQueueCampaignHopperHistories=function(){var e=angular.copy(c.selectedQueueCampaignHopperHistories);return c.selectedQueueCampaignHopperHistories=[],e},c.deleteQueueCampaignHopperHistory=g,c.deleteSelectedQueueCampaignHopperHistories=function(e){var t=o.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+c.selectedQueueCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedQueueCampaignHopperHistories.forEach(function(e){g(e)}),c.selectedQueueCampaignHopperHistories=[]})};var m=!0,u=1;function p(e){c.queueCampaignHopperHistories=e||{count:0,rows:[]}}function g(e){l.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHopperHistories.rows,{id:e.id}),c.queueCampaignHopperHistories.count-=1,c.queueCampaignHopperHistories.rows.length||c.getQueueCampaignHopperHistories(),r.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHopperHistories())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.queueCampaign={},c.queueCampaignHoppers={count:0,rows:[]},c.selectedQueueCampaignHoppers=[],c.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,scheduledat,priority,recallme,UserId",sort:"-updatedAt",limit:10,page:1},c.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e){c.queueCampaign=e,c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHoppers()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHoppers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHoppers(c.query,p).$promise},c.createOrEditQueueCampaignHopper=function(e,t){o.show({controller:"CreateOrEditHopperVoiceQueueIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopper:t,hoppers:c.queueCampaignHoppers.rows,license:null,setting:null}})},c.exportSelectedQueueCampaignHoppers=function(){var e=angular.copy(c.selectedQueueCampaignHoppers);return c.selectedQueueCampaignHoppers=[],e},c.deleteQueueCampaignHopper=g,c.deleteSelectedQueueCampaignHoppers=function(e){var t=o.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+c.selectedQueueCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedQueueCampaignHoppers.forEach(function(e){g(e)}),c.selectedQueueCampaignHoppers=[]})},l.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){c.agents=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.queueCampaignHoppers=e||{count:0,rows:[]}}function g(e){l.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHoppers.rows,{id:e.id}),c.queueCampaignHoppers.count-=1,c.queueCampaignHoppers.rows.length||c.getQueueCampaignHoppers(),r.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHoppers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHoppersController",e)}(),function(){"use strict";function e(e,t,n,a,s,i,o,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="MOTIONDIALER.EDIT_HOPPER",m.hopper=angular.copy(o),m.hoppers=i,m.newHopper=!1,m.hopper||(m.hopper={},m.title="MOTIONDIALER.NEW_HOPPER",m.newHopper=!0),t.params.id&&(m.hopper.VoiceQueueId=t.params.id),m.addNewHopper=function(){m.errors=[],r.cmHopper.save(m.hopper).$promise.then(function(e){m.hoppers.unshift(e.toJSON()),s.success({title:"Hopper properly created",msg:m.hopper.name?m.hopper.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var t=0;t<e.data.errors.length;t+=1)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveHopper=function(){var n,a,i,o;m.errors=[],m.hopper.UserId=m.hopper.recallme?m.hopper.UserId:null,r.cmHopper.get({id:m.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){n=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){r.cmHopper.update({id:m.hopper.id},_.omit(m.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,r.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){r.voiceQueue.get({raw:!1,id:a.VoiceQueueId,attributes:["name"]}).$promise.then(function(e){o=e.name}).catch(function(e){o=void 0}).finally(function(){r.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:n,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:o,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:l.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme})})});var t=_.find(m.hoppers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),s.success({title:"Hopper properly saved!",msg:m.hopper.name?m.hopper.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},m.deleteHopper=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cmHopper.delete({id:m.hopper.id}).$promise.then(function(){_.remove(m.hoppers,{id:m.hopper.id}),s.success({title:"Hopper properly deleted!",msg:(m.hopper.name||"hopper")+" has been deleted!"}),u(m.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","hoppers","hopper","api","Auth","license","setting"],angular.module("app.motiondialer").controller("CreateOrEditHopperVoiceQueueIdDialogController",e)}(),function(){"use strict";function e(n,a){var i=this;i.queueCampaign={},i.init=function(t){i.queueCampaign=t,n.cmHopper.get({limit:0,VoiceQueueId:t.id}).$promise.then(function(e){return i.total=e.count||0,n.cmHopper.get({limit:0,VoiceQueueId:t.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,n.cmHopperFinal.get({limit:0,VoiceQueueId:t.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("QueueCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,n,a,t,i,o){var s=this;s.queueCampaign=t,s.items=[],s.selectedItems=[],s.loading=!1,s.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:i.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){s.loading=!0,a.voiceQueue[t?"removeLists":"addLists"]({id:s.queueCampaign.id,ids:_.map(e,"id")}).$promise.then(function(){n.success({title:"List properly "+(t?"removed":"added"),msg:"List has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){s.loading=!1})}},s.closeDialog=function(){e.hide()},a.voiceQueue.getLists({id:s.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return s.selectedItems=e.rows?e.rows:[],s.dualMultiselectOptions.selectedItems=s.selectedItems,a.cmList.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){s.items=e.rows?e.rows:[],s.dualMultiselectOptions.items=_.differenceBy(s.items,s.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","queueCampaign","$translate","$timeout"],angular.module("app.motiondialer").controller("QueueCampaignlistaddController",e)}(),function(){"use strict";function e(e,t,a,i,o,n,s,r){var l=this;function d(){t.hide()}function c(e,t){var n=t.id;s.enqueue(function(){return i.voiceQueue.removeLists({id:e,ids:n}).$promise.then(function(){return i.voiceQueue.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=n||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,t){return-1<t.indexOf(e)},l.toggle=function(e,t){var n=t.indexOf(e);-1<n?t.splice(n,1):t.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,t){for(var n=0;n<l.selected.length;n+=1)c(o.id,l.selected[n]);var a;a=e,s.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","queueCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("QueueCampaignresetlistController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.queueCampaign=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("MOTIONDIALER.ALL_TEAMS"),labelSelected:i.instant("MOTIONDIALER.SELECTED_TEAMS"),transferCallback:function(e,t){a.voiceQueue[t?"removeTeams":"addTeams"]({id:o.queueCampaign.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.voiceQueue.getTeams({id:o.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","queueCampaign","$translate"],angular.module("app.motiondialer").controller("QueueCampaignteamaddController",e)}(),function(){"use strict";function e(n,e,i,o,t,a,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=t,c.setting=a,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.queueCampaign=d||n.params.queueCampaign||{},c.selectedTab=n.params.tab||0,c.listadddialog=function(e,t){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:c.queueCampaigns?c.queueCampaigns.rows:[]}})},c.blacklistadddialog=function(e,t){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:c.queueCampaigns?c.queueCampaigns.rows:[]}})},c.teamadddialog=function(e,t){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:c.queueCampaigns?c.queueCampaigns.rows:[]}})},c.agentadddialog=function(e,t){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:c.queueCampaigns?c.queueCampaigns.rows:[],realtime:!1}})},c.resetlistdialog=function(t,n){s.voiceQueue.getLists({id:t.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))r.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(n).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,t,n;e=c.queueCampaign.id,t=a.rows[0],n=t.id,s.voiceQueue.removeLists({id:e,ids:n}).$promise.then(function(){return s.voiceQueue.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){r.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"QueueCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",parent:angular.element(o.body),targetEvent:n,clickOutsideToClose:!1,locals:{queueCampaign:t,listsCampaign:a?a.rows:[]}})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.gotogoto=function(e,t){n.go("app.motiondialer.realtime.queues",{})},c.alert=r.info,c.gotoQueueCampaigns=function(){n.go("app.motiondialer.queueCampaigns")},c.saveQueueCampaign=function(){s.voiceQueue.update({id:c.queueCampaign.id},c.queueCampaign).$promise.then(function(){r.success({title:"QueueCampaign updated!",msg:c.queueCampaign.name?c.queueCampaign.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceMusicOnHold.get({fields:"name",nolimit:"true"}).$promise.then(function(e){c.musiconholds=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.trunks=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.squareProject.get({fields:"name",sort:"name"}).$promise.then(function(e){c.projects=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){c.interval=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","queueCampaign"],angular.module("app.motiondialer").controller("QueueCampaignController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.queueCampaigns=r||{count:0,rows:[]},v.table="queueCampaigns",v.listOrder="",v.listOrderAsc=null,v.selectedQueueCampaigns=[],v.query={fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},v.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraydialMethod=_.keyBy([{option:"Progressive",value:"'progressive'"},{option:"PowerDialing",value:"'power'"},{option:"Predictive",value:"'predictive'"},{option:"Preview",value:"'preview'"},{option:"BookedProgressive",value:"'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraydialPredictiveOptimization=_.keyBy([{option:"AgentBusyFactor",value:"'agentBusyFactor'"},{option:"DropRate",value:"'dropRate'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraystrategy=_.keyBy([{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Round Robin",value:"'roundrobin'",ngIf:"vm.queueCampaign.dialMethod === 'booked'"},{option:"Least Recent",value:"'leastrecent'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Fewest Calls",value:"'fewestcalls'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Random",value:"'random'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Linear",value:"'linear'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Weight Random",value:"'wrandom'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.motiondialer.queueCampaigns.edit",{id:e.id,queueCampaign:e})},v.listadddialog=function(e,t){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:v.queueCampaigns?v.queueCampaigns.rows:[]}})},v.blacklistadddialog=function(e,t){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:v.queueCampaigns?v.queueCampaigns.rows:[]}})},v.teamadddialog=function(e,t){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:v.queueCampaigns?v.queueCampaigns.rows:[]}})},v.agentadddialog=function(e,t){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:v.queueCampaigns?v.queueCampaigns.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the queueCampaign?").htmlContent("<b>"+(e.name||"queueCampaign")+"</b> will be deleted.").ariaLabel("delete queueCampaign").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.motiondialer.realtime.queues",{})},v.success=f,v.getQueueCampaigns=function(){v.query.offset=(v.query.page-1)*v.query.limit,m.hasRole("admin")?v.promise=l.voiceQueue.get(v.query,f).$promise:(v.query.id=v.currentUser.id,v.promise=l.user.getQueues(v.query,f).$promise)},v.createOrEditQueueCampaign=function(e,t){i.show({controller:"CreateOrEditQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:t,queueCampaigns:v.queueCampaigns.rows,license:v.license,setting:v.setting}})},v.deleteQueueCampaign=A,v.exportSelectedQueueCampaigns=function(){var e=angular.copy(v.selectedQueueCampaigns);return v.selectedQueueCampaigns=[],e},v.deleteSelectedQueueCampaigns=function(e){var t=i.confirm().title("Are you sure want to delete the selected queueCampaigns?").htmlContent("<b>"+v.selectedQueueCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete QueueCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedQueueCampaigns.forEach(function(e){A(e)}),v.selectedQueueCampaigns=[]})},v.deselectQueueCampaigns=function(){v.selectedQueueCampaigns=[]},v.selectAllQueueCampaigns=function(){v.selectedQueueCampaigns=v.queueCampaigns.rows},l.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.trunks=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){v.interval=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.queueCampaigns=e||{count:0,rows:[]}}function A(e){l.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(v.queueCampaigns.rows,{id:e.id}),v.queueCampaigns.count-=1,v.queueCampaigns.rows.length||v.getQueueCampaigns(),c.success({title:"QueueCampaign deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getQueueCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","queueCampaigns","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.motiondialer").controller("QueueCampaignsController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d,c,m){var u=this,p=!0;function g(){var e=i.localStorage.getItem("motion2.realtime.abandoned.bull.contacts:"+u.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(u.query=_.merge(e.query,_.omit(u.query,["sort","limit","page"])),u.query=_.omit(u.query,"filter")),s.voiceDisposition.get().$promise.then(function(e){u.disposition=e?e.rows:[]}).catch(function(e){console.log(e)}),s.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){u.queues=e||{count:0,rows:[]},u.queuesMap=_.mapValues(_.keyBy(u.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){u.getContacts()})}function v(e){u.contacts=e||{count:0,rows:[]},p=!1,u.refresh=!0}u.showTooltip=!1,u.refresh=!0,u.disable=[],u.agents=m||[],u.currentUser=r.getCurrentUser(),u.localizationMap=c,u.pickerModel={dateStart:null,dateEnd:null},u.queues={},u.contacts={count:0,rows:[]},u.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},u.clearAll=function(){u.query.dateStart=void 0,u.query.dateEnd=void 0,u.pickerModel={dateStart:null,dateEnd:null},u.getContacts()},u.getContacts=function(){u.refresh=!1,u.query.dateStart=void 0,u.query.dateEnd=void 0,u.pickerModel.dateStart&&!p&&(u.query.dateStart=u.pickerModel.dateStart,u.query.dateEnd=u.pickerModel.dateEnd);u.query.queue=u.query.queue,u.query.offset=(u.query.page-1)*u.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.bull.contacts:"+u.currentUser.id,JSON.stringify({query:_.omit(u.query,"queue")})),u.promise=s.voiceQueueReport.getVoiceQueuesReport(u.query,v).$promise},u.refreshContacts=function(){u.showTooltip=!1,u.getContacts()},u.onInit=g,u.assignedA=function(e,t){e&&(u.disable[e.id]=!0,s.voiceQueueReport.update({id:e.id,lastAssignedTo:t?t.name:null,assigned:!!t}).$promise.catch(function(e){console.log(e)}).finally(function(){u.disable[e.id]=!1}))},u.disposed=function(e,t){e&&s.voiceQueueReport.update({id:e.id,disposition:t||null}).$promise.catch(function(e){console.log(e)})},u.onSavevoiceQueueReport=function(e){e&&u.queuesMap&&"outbound"===e.type&&u.queuesMap[e.queue]&&(u.showTooltip=!0)},u.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(u.contacts.rows,["id",e.id]);0<=t&&_.merge(u.contacts.rows[t],e)}},l.onWithoutApply("voiceQueueReport:save",u.onSavevoiceQueueReport),l.on("voiceQueueReport:update",u.onUpdatevoiceQueueReport),g();var h=!0,b=1;e.$watch("vm.query.filter",function(e,t){h?n(function(){h=!1}):(t||(b=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=b),u.getContacts())}),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory","agents"],angular.module("app.motiondialer").controller("AbandonedCallsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,s,t,n,a,i,o,r,l,d,c,m,u,p,g,v){var h=this,b=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum"],f=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var A in h.availableStates=["ringing","inuse","busy","onhold","not_inuse"],h.pauses=o||{count:0,rows:[]},h.license=g,h.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},h.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},h.paginatedAgents={},h.load=!1,h.order=[],h.agentInternal={},h.agents)h.agents.hasOwnProperty(A)&&(h.agents[A].init=!0);h.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},h.logout=function(e,t){return d.user.logout({id:e.id}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),h.agents[e.id]&&(h.agents[e.id].online=!1),h.rpcAgents[e.id]&&(h.rpcAgents[e.id].online=!1),y()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"voice",realtime:!0,direction:"outbound"}})},h.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},h.getAgentStatus=C,h.getAgentGlobalStatus=x,h.isPause=S,h.checkPause=function(e){return"pause"===e},h.isPartialPause=function(e){return"*pause"===e},h.onSave=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(_.omit(e,f),b)),_.merge(h.rpcAgents[e.id],_.pick(_.omit(e,f),b)),x(h.agents[e.id]))},h.onUpdate=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(e,b)),_.merge(h.rpcAgents[e.id],_.pick(e,b)),x(h.agents[e.id]))},h.onInit=y,h.onConnect=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(_.merge(h.agents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(h.rpcAgents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},h.onComplete=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(h.agents[h.agentInternal[e.destaccountcode]]=_.omit(h.agents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),h.rpcAgents[h.agentInternal[e.destaccountcode]]=_.omit(h.rpcAgents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",h.onSave),c.on("user:update",h.onUpdate),c.on("user:agentconnect",h.onConnect),c.on("user:agentcomplete",h.onComplete),y();var E=v(function(){h.load&&(h.load=!1,y())},999);function y(e){h.load=!1;var t,n,a=s.defer();h.promise=a.promise,h.filteredAgents=[],h.order=[],_.forIn(h.agents,function(e,t){h.rpcAgents[t]&&_.merge(e,_.pick(_.omit(h.rpcAgents[t],f),b)),x(e),e.online?(h.filteredAgents.push(e),h.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),h.query.globalStatusFilter&&_.remove(h.filteredAgents,function(e){return e.globalStatus!==h.query.globalStatusFilter}),h.query.pauseTypeFilter&&_.remove(h.filteredAgents,function(e){return e.pauseType!==h.query.pauseTypeFilter}),h.query.filter&&_.remove(h.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(h.query.filter.toLowerCase())<0}),h.filteredAgents=(t=h.filteredAgents,n=_.startsWith(h.query.order,"-")?"desc":"asc",_.orderBy(t,[h.query.order.replace("-","")],[n]));var i=(h.query.page-1)*h.query.limit;h.paginatedAgents=_.drop(h.filteredAgents,i).slice(0,h.query.limit);for(var o=0;o<h.paginatedAgents.length;o+=1)h.order.push(h.paginatedAgents[o].id);a.resolve(),h.load=!0}function S(e){return"pause"===e||"*pause"===e}function T(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function C(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function x(e){var t="unknown";t=_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"pause":_.some([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"*pause":_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],T)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=S(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),E&&(v.cancel(E),E=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","Auth","license","$interval"],angular.module("app.voice").controller("AgentsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,a,i,t,o,s,r,l,d){var c=this,m=["name","active","limitCalls","message","originated","IntervalId","SquareProjectId","Trunk","TrunkId","ivrAnswerCallsDay","dialQueueProject","ivrTotalCallsDays","description"];function u(){_.forIn(c.campaigns,function(e,t){c.rpcCampaigns[t]&&_.merge(e,_.pick(c.rpcCampaigns[t],m))})}c.count=s.count,c.campaigns=s?_.keyBy(s.rows?s.rows:[],"id"):{},c.rpcCampaigns=o?_.keyBy(o.rows?o.rows:[],"id"):{},c.query={sort:"-updatedAt",limit:10,page:1},c.success=v,c.getCampaigns=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=r.campaign.get(c.query,v).$promise},c.onSave=function(e){c.campaigns[e.id]&&(_.merge(c.campaigns[e.id],_.pick(e,m)),_.merge(c.rpcCampaigns[e.id],_.pick(e,m)))},c.$onInit=u,c.createOrEditIvrCampaign=function(e,t){a.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:t,ivrCampaigns:_.values(c.campaigns),license:null,setting:null}})},l.onWithoutApply("campaign:save",c.onSave),c.interval=t(function(){},999);var p=!0,g=1;function v(e){c.count=e.count,c.campaigns=e?_.keyBy(e.rows?e.rows:[],"id"):{},u()}e.$watch("vm.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getCampaigns())}),e.$on("$destroy",function(){l.removeAllListeners("campaign:save"),c.interval&&t.cancel(c.interval)})}e.$inject=["$scope","$timeout","$mdDialog","$document","$interval","rpcCampaigns","campaigns","api","socket","Auth"],angular.module("app.motiondialer").controller("IvrCampaignsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,o,s,r,l){var d=this;d.agents=n||{count:0,rows:[]},d.rpcVoiceQueuesChannels=i?_.keyBy(i.rows?_.filter(i.rows,{type:"outbound"}):[],"uniqueid"):{},d.queryChannels={limit:10,page:1},d.getSize=function(e){return _.size(e)},d.onSave=function(e){"outbound"===e.type&&(d.rpcVoiceQueuesChannels[e.uniqueid]=e)},d.onRemove=function(e){d.rpcVoiceQueuesChannels[e.uniqueid]&&delete d.rpcVoiceQueuesChannels[e.uniqueid]},d.hangup=function(t){return o.rpc.getVoiceQueuesChannelHangup({uniqueid:t}).$promise.then(function(e){l.success({title:"Channel "+t+" properly hangup!",msg:e.message||""})}).catch(function(e){l.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},d.redirectToAgent=function(t,e){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e}).$promise.then(function(e){l.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){l.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},d.redirectToNumber=function(e,t){var n=a.prompt().title("Which number do you want transfer the call to?").placeholder("Number").targetEvent(e).ok("Ok").cancel("Cancel");return a.show(n).then(function(e){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e}).$promise}).then(function(e){l.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){l.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},s.on("voice_queue_channel:save",d.onSave),s.on("voice_queue_channel:remove",d.onRemove),e.$on("$destroy",function(){s.removeAllListeners("voice_queue_channel:save"),s.removeAllListeners("voice_queue_channel:remove")})}e.$inject=["$scope","$timeout","$mdDialog","agents","rpcVoiceQueuesChannels","api","socket","helperClasses","toasty"],angular.module("app.motiondialer").controller("QueueCallsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r){var l=this,d=["total","answered","sumHoldTime","sumDuration","sumBillable","outboundNoAnswerCallsDay","outboundBusyCallsDay","outboundCongestionCallsDay","outboundNoSuchCallsDay","outboundUnknownCallsDay","outboundDropCallsDayTimeout","outboundDropCallsDayCallersExit","outboundBlacklistCallsDay","outboundOriginateFailureCallsDay","outboundAnswerAgiCallsDay","outboundReCallsDay","outboundRejectCallsDay"];function c(){_.forIn(l.queues,function(e,t){l.rpcQueues[t]&&_.merge(e,_.pick(l.rpcQueues[t],d))})}l.count=a.count,l.queues=a?_.keyBy(a.rows?a.rows:[],"id"):{},l.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},r.hasRole("admin")?l.query={type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1}:l.query={id:r.getCurrentUser().id,channel:"voice",type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1},l.success=p,l.getQueues=function(){l.query.offset=(l.query.page-1)*l.query.limit,r.hasRole("admin")?l.promise=o.voiceQueue.get(l.query,p).$promise:l.promise=o.user.getQueues(l.query,p).$promise},l.onSave=function(e){l.queues[e.id]&&_.merge(l.queues[e.id],_.pick(e,d))},l.$onInit=c,s.onWithoutApply("voice_queue:save",l.onSave),l.interval=t(function(){},999);var m=!0,u=1;function p(e){l.count=e.count,l.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},c()}e.$watch("vm.query.filter",function(e,t){m?n(function(){m=!1}):(t||(u=l.query.page),e!==t&&(l.query.page=1),e||(l.query.page=u),l.getQueues())}),e.$on("$destroy",function(){s.removeAllListeners("voice_queue:save"),l.interval&&t.cancel(l.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","Auth"],angular.module("app.motiondialer").controller("QueueParamsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function g(){var n=[];return _.forIn(u.queues,function(e,t){e.paused=0,e.loggedInDb=0,u.queues[t].agents={},n.push(l.voiceQueue.getMembers({id:t}).$promise),u.rpcQueues[t]&&_.merge(e,_.pick(u.rpcQueues[t],p))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&u.queues[e[t].rows[n].VoiceQueueId].paused++,u.queues[e[t].rows[n].VoiceQueueId].loggedInDb++,u.queues[e[t].rows[n].VoiceQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].VoiceQueueId}).catch(function(e){console.error(e)})}u.count=s.count?s.count:0,u.queues=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.hasRole("admin")?u.query={type:"outbound",sort:"-updatedAt",limit:10,page:1}:u.query={id:m.getCurrentUser().id,channel:"voice",type:"outbound",sort:"-updatedAt",limit:10,page:1},u.success=b,u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=l.voiceQueue.get(u.query,b).$promise:u.promise=l.user.getQueues(u.query,b).$promise},u.createOrEditMotionDialerQueue=function(e,t){a.show({controller:"CreateOrEditQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:t,queueCampaigns:_.values(u.queues),license:null,setting:null}})},u.agentAdd=function(e,t){a.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:t,queueCampaigns:u.queues?u.queues.rows:[],realtime:!0}})},u.updateQueue=function(e){return l.voiceQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},u.onSave=function(e){u.queues[e.id]&&_.merge(u.queues[e.id],_.pick(e,p))},u.onSaveMember=function(e){u.queues[e.MotionDialerQueueId]&&u.queues[e.MotionDialerQueueId].loggedInDb++},u.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(u.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(u.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},u.onLogin=function(e){console.log("onLogged",e),u.queues[e.VoiceQueueId]&&(u.queues[e.VoiceQueueId].loggedInDb+=1,u.queues[e.VoiceQueueId].agents[e.UserId]=e.VoiceQueueId)},u.onLogout=function(e){console.log("onLogout",e),u.queues[e.VoiceQueueId]&&0<u.queues[e.VoiceQueueId].loggedInDb&&(u.queues[e.VoiceQueueId].loggedInDb-=1,delete u.queues[e.VoiceQueueId].agents[e.UserId])},u.$onInit=g,u.order=[],_.forIn(u.queues,function(e,t){u.order.push(e.id)}),d.onWithoutApply("voice_queue:save",u.onSave),u.interval=o(function(){},999),d.on("userVoiceQueueRt:save",u.onSaveMember),d.on("user:update",u.onPause),d.on("userVoiceQueue:remove",u.onLogout),d.on("userVoiceQueue:save",u.onLogin);var v=!0,h=1;function b(e){if(u.count=e.count,u.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){u.order=[];for(var t=0;t<e.rows.length;t++)u.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("voice_queue:save"),u.interval&&o.cancel(u.interval),d.removeAllListeners("userVoiceQueueRt:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","Auth"],angular.module("app.motiondialer").controller("QueuesMotionDialerRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.motiondialer.realtime.agents":this.selectedTab=0;break;case"app.motiondialer.realtime.queues":this.selectedTab=1;break;case"app.motiondialer.realtime.queue_calls":this.selectedTab=2;break;case"app.motiondialer.realtime.abandonedcalls":this.selectedTab=3;break;case"app.motiondialer.realtime.queue_params":this.selectedTab=4;break;case"app.motiondialer.realtime.ivr_campaigns":this.selectedTab=5;break;default:this.selectedTab=0,n.go("app.motiondialer.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.motiondialer.realtime.agents");break;case 1:n.go("app.motiondialer.realtime.queues");break;case 2:n.go("app.motiondialer.realtime.queue_calls");break;case 3:n.go("app.motiondialer.realtime.abandonedcalls");break;case 4:n.go("app.motiondialer.realtime.queue_params");break;case 5:n.go("app.motiondialer.realtime.ivr_campaigns");break;default:n.go("app.motiondialer.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.motiondialer").controller("MotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT",m.openchannelAccount=angular.copy(s),m.openchannelAccounts=o,m.newOpenchannelAccount=!1,m.openchannelAccount||(m.openchannelAccount={waitForTheAssignedAgent:10,notificationSound:!0},m.title="OPENCHANNEL.NEW_OPENCHANNELACCOUNT",m.newOpenchannelAccount=!0),t.params.id&&(m.openchannelAccount.OpenchannelAccountId=t.params.id),m.addNewOpenchannelAccount=function(){m.errors=[],r.openchannelAccount.save(m.openchannelAccount).$promise.then(function(e){m.openchannelAccounts.unshift(e.toJSON()),i.success({title:"OpenchannelAccount properly created",msg:m.openchannelAccount.name?m.openchannelAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveOpenchannelAccount=function(){m.errors=[],r.openchannelAccount.update({id:m.openchannelAccount.id},m.openchannelAccount).$promise.then(function(e){var t=_.find(m.openchannelAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"OpenchannelAccount properly saved!",msg:m.openchannelAccount.name?m.openchannelAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteOpenchannelAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelAccount will be deleted.").ariaLabel("Delete OpenchannelAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.openchannelAccount.delete({id:m.openchannelAccount.id}).$promise.then(function(){_.remove(m.openchannelAccounts,{id:m.openchannelAccount.id}),i.success({title:"OpenchannelAccount properly deleted!",msg:(m.openchannelAccount.name||"openchannelAccount")+" has been deleted!"}),u(m.openchannelAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","openchannelAccounts","openchannelAccount","api","Auth","license","setting"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelAccountDialogController",e)}(),function(){"use strict";function e(s,i,a,o,e){var r=this;function t(e,t){if(r.openchannelAccountApps.rows.length){var n=r.openchannelAccountApps.rows[t]?r.openchannelAccountApps.rows[t]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccountApp:n,openchannelAccount:r.openchannelAccount}}).then(function(e){e&&(e.id?r.openchannelAccountApps.rows[t]=e:r.openchannelAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.openchannelAccountApps.rows.length;n++,0){var a=r.openchannelAccountApps.rows[n],i=[],o=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.openchannelAccount.context,a.exten=r.openchannelAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(o.length?_.last(o).priority:a.priority)+1,t=_.concat(t,i,[a],o)}s.openchannelAccount.addApplications({id:r.openchannelAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.openchannelAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.openchannelAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.openchannelAccount={},r.openchannelAccountApps={count:0,rows:[]},r.selectedOpenchannelAccountApps=[],r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"OpenchannelQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",route:"openchannelQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",maxlength:255,required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e){r.openchannelAccount=e,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getOpenchannelAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.openchannelAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getOpenchannelAccountApps=function(){r.promise=s.openchannelAccount.getApplications(r.query,n).$promise},r.editOpenchannelAccountApp=t,r.editInterval=function(e,t){if(r.openchannelAccountApps.rows.length){var n=r.openchannelAccountApps.rows[t]?r.openchannelAccountApps.rows[t]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteOpenchannelAccountApp=function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id}),l(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedOpenchannelAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedOpenchannelAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedOpenchannelAccountApps.forEach(function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id})}),r.selectedOpenchannelAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return s.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountActionsController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(e.appType||e.app).toUpperCase(),o.agent=angular.copy(e),o.agent.appdata)switch(o.agent.appType?o.agent.appType.toLowerCase():o.agent.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.agent.appdata.split(",");o.agent.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.agent.text=s.slice(1,s.length).join(",");break;case"message":o.agent.text=o.agent.appdata;break;case"set":o.agent.name=o.agent.appdata.split("=")[0],o.agent.value=o.agent.appdata.split("=")[1];break;case"agi":o.agent.project=o.agent.appdata;break;default:var r=o.agent.appdata.split(",");o.agent.agent=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.agent.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.agent.timeout=30;function l(e){t.hide(e)}o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outbounddial"===o.agent.appType.toLowerCase()&&(o.agent.prefix=o.agent.phone?o.agent.phone.split("$")[0]:void 0,o.agent.callerId=o.agent.callerID?"CALLERID(all)="+o.agent.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outboundDial"===o.agent.appType&&(o.agent.phone=a.cutdigits?(o.agent.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.agent.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.agent.options+="U(xcally-mixmonitor-context)"):o.agent.options=o.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.agents,{name:o.agent.agent});t&&(o.agent.UserId=t.id);if(o.agent.appType&&"custom"===o.agent.appType);else switch((o.agent.app||o.agent.appType).toLowerCase()){case"set":o.agent.appdata=o.agent.name+"="+o.agent.value;break;case"custom":break;default:e[0]=o.agent.agent,e[1]=o.agent.timeout,o.agent.appdata=e.join(",")}l(o.agent)},o.closeDialog=l,i.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){o.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(n.appType||n.app).toUpperCase(),o.autoreply=angular.copy(n),o.autoreply.appdata)switch(o.autoreply.appType?o.autoreply.appType.toLowerCase():o.autoreply.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.autoreply.appdata.split(",");o.autoreply.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.autoreply.text=s.slice(1,s.length).join(",");break;case"message":o.autoreply.text=o.autoreply.appdata;break;case"set":o.autoreply.name=o.autoreply.appdata.split("=")[0],o.autoreply.value=o.autoreply.appdata.split("=")[1];break;case"agi":o.autoreply.project=o.autoreply.appdata;break;default:var r=o.autoreply.appdata.split(",");o.autoreply.times=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.autoreply.text=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.autoreply.times=1;function l(e){t.hide(e)}o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outbounddial"===o.autoreply.appType.toLowerCase()&&(o.autoreply.prefix=o.autoreply.phone?o.autoreply.phone.split("$")[0]:void 0,o.autoreply.callerId=o.autoreply.callerID?"CALLERID(all)="+o.autoreply.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outboundDial"===o.autoreply.appType&&(o.autoreply.phone=a.cutdigits?(o.autoreply.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.autoreply.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.autoreply.options+="U(xcally-mixmonitor-context)"):o.autoreply.options=o.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(o.autoreply.appType&&"custom"===o.autoreply.appType);else switch((o.autoreply.app||o.autoreply.appType).toLowerCase()){case"set":o.autoreply.appdata=o.autoreply.name+"="+o.autoreply.value;break;case"custom":break;default:e[0]=o.autoreply.times,e[1]=o.autoreply.text,o.autoreply.appdata=e.join(",")}l(o.autoreply)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(n.appType||n.app).toUpperCase(),o.close=angular.copy(n),o.close.appdata)switch(o.close.appType?o.close.appType.toLowerCase():o.close.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.close.appdata.split(",");o.close.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.close.text=s.slice(1,s.length).join(",");break;case"message":o.close.text=o.close.appdata;break;case"set":o.close.name=o.close.appdata.split("=")[0],o.close.value=o.close.appdata.split("=")[1];break;case"agi":o.close.project=o.close.appdata;break;default:var r=o.close.appdata.split(",");o.close.disposition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outbounddial"===o.close.appType.toLowerCase()&&(o.close.prefix=o.close.phone?o.close.phone.split("$")[0]:void 0,o.close.callerId=o.close.callerID?"CALLERID(all)="+o.close.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outboundDial"===o.close.appType&&(o.close.phone=a.cutdigits?(o.close.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.close.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.close.options+="U(xcally-mixmonitor-context)"):o.close.options=o.close.options.replace("U(xcally-mixmonitor-context)",""));if(o.close.appType&&"custom"===o.close.appType);else switch((o.close.app||o.close.appType).toLowerCase()){case"set":o.close.appdata=o.close.name+"="+o.close.value;break;case"custom":break;default:e[0]=o.close.disposition,o.close.appdata=e.join(",")}l(o.close)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotoif=angular.copy(n),o.gotoif.appdata)switch(o.gotoif.appType?o.gotoif.appType.toLowerCase():o.gotoif.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotoif.appdata.split(",");o.gotoif.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotoif.text=s.slice(1,s.length).join(",");break;case"message":o.gotoif.text=o.gotoif.appdata;break;case"set":o.gotoif.name=o.gotoif.appdata.split("=")[0],o.gotoif.value=o.gotoif.appdata.split("=")[1];break;case"agi":o.gotoif.project=o.gotoif.appdata;break;default:var r=o.gotoif.appdata.split(",");o.gotoif.condition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.gotoif.truepriority=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.gotoif.falsepriority=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10)}function l(e){t.hide(e)}o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outbounddial"===o.gotoif.appType.toLowerCase()&&(o.gotoif.prefix=o.gotoif.phone?o.gotoif.phone.split("$")[0]:void 0,o.gotoif.callerId=o.gotoif.callerID?"CALLERID(all)="+o.gotoif.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outboundDial"===o.gotoif.appType&&(o.gotoif.phone=a.cutdigits?(o.gotoif.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotoif.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotoif.options+="U(xcally-mixmonitor-context)"):o.gotoif.options=o.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotoif.appType&&"custom"===o.gotoif.appType);else switch((o.gotoif.app||o.gotoif.appType).toLowerCase()){case"set":o.gotoif.appdata=o.gotoif.name+"="+o.gotoif.value;break;case"custom":break;default:e[0]=o.gotoif.condition,e[1]=o.gotoif.truepriority,e[2]=o.gotoif.falsepriority,o.gotoif.appdata=e.join(",")}l(o.gotoif)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotop=angular.copy(n),o.gotop.appdata)switch(o.gotop.appType?o.gotop.appType.toLowerCase():o.gotop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotop.appdata.split(",");o.gotop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotop.text=s.slice(1,s.length).join(",");break;case"message":o.gotop.text=o.gotop.appdata;break;case"set":o.gotop.name=o.gotop.appdata.split("=")[0],o.gotop.value=o.gotop.appdata.split("=")[1];break;case"agi":o.gotop.project=o.gotop.appdata;break;default:var r=o.gotop.appdata.split(",");o.gotop.priority=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outbounddial"===o.gotop.appType.toLowerCase()&&(o.gotop.prefix=o.gotop.phone?o.gotop.phone.split("$")[0]:void 0,o.gotop.callerId=o.gotop.callerID?"CALLERID(all)="+o.gotop.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outboundDial"===o.gotop.appType&&(o.gotop.phone=a.cutdigits?(o.gotop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotop.options+="U(xcally-mixmonitor-context)"):o.gotop.options=o.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotop.appType&&"custom"===o.gotop.appType);else switch((o.gotop.app||o.gotop.appType).toLowerCase()){case"set":o.gotop.appdata=o.gotop.name+"="+o.gotop.value;break;case"custom":break;default:e[0]=o.gotop.priority,o.gotop.appdata=e.join(",")}l(o.gotop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditOpenchannelAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(n.appType||n.app).toUpperCase(),o.noop=angular.copy(n),o.noop.appdata)switch(o.noop.appType?o.noop.appType.toLowerCase():o.noop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.noop.appdata.split(",");o.noop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.noop.text=s.slice(1,s.length).join(",");break;case"message":o.noop.text=o.noop.appdata;break;case"set":o.noop.name=o.noop.appdata.split("=")[0],o.noop.value=o.noop.appdata.split("=")[1];break;case"agi":o.noop.project=o.noop.appdata;break;default:var r=o.noop.appdata.split(",");o.noop.value=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outbounddial"===o.noop.appType.toLowerCase()&&(o.noop.prefix=o.noop.phone?o.noop.phone.split("$")[0]:void 0,o.noop.callerId=o.noop.callerID?"CALLERID(all)="+o.noop.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outboundDial"===o.noop.appType&&(o.noop.phone=a.cutdigits?(o.noop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.noop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.noop.options+="U(xcally-mixmonitor-context)"):o.noop.options=o.noop.options.replace("U(xcally-mixmonitor-context)",""));if(o.noop.appType&&"custom"===o.noop.appType);else switch((o.noop.app||o.noop.appType).toLowerCase()){case"set":o.noop.appdata=o.noop.name+"="+o.noop.value;break;case"custom":break;default:e[0]=o.noop.value,o.noop.appdata=e.join(",")}l(o.noop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(e.appType||e.app).toUpperCase(),o.queue=angular.copy(e),o.queue.appdata)switch(o.queue.appType?o.queue.appType.toLowerCase():o.queue.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.queue.appdata.split(",");o.queue.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.queue.text=s.slice(1,s.length).join(",");break;case"message":o.queue.text=o.queue.appdata;break;case"set":o.queue.name=o.queue.appdata.split("=")[0],o.queue.value=o.queue.appdata.split("=")[1];break;case"agi":o.queue.project=o.queue.appdata;break;default:var r=o.queue.appdata.split(",");o.queue.queue=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.queue.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.queue.queue=300,o.queue.timeout=300;function l(e){t.hide(e)}o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outbounddial"===o.queue.appType.toLowerCase()&&(o.queue.prefix=o.queue.phone?o.queue.phone.split("$")[0]:void 0,o.queue.callerId=o.queue.callerID?"CALLERID(all)="+o.queue.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outboundDial"===o.queue.appType&&(o.queue.phone=a.cutdigits?(o.queue.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.queue.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.queue.options+="U(xcally-mixmonitor-context)"):o.queue.options=o.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.queues,{name:o.queue.queue});t&&(o.queue[_.capitalize("openChannel")+"QueueId"]=t.id);if(o.queue.appType&&"custom"===o.queue.appType);else switch((o.queue.app||o.queue.appType).toLowerCase()){case"set":o.queue.appdata=o.queue.name+"="+o.queue.value;break;case"custom":break;default:e[0]=o.queue.queue,e[1]=o.queue.timeout,o.queue.appdata=e.join(",")}l(o.queue)},o.closeDialog=l,i.openchannelQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){o.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="OPENCHANNEL.EDIT_"+(e.appType||e.app).toUpperCase(),o.system=angular.copy(e),o.system.appdata)switch(o.system.appType?o.system.appType.toLowerCase():o.system.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.system.appdata.split(",");o.system.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.system.text=s.slice(1,s.length).join(",");break;case"message":o.system.text=o.system.appdata;break;case"set":o.system.name=o.system.appdata.split("=")[0],o.system.value=o.system.appdata.split("=")[1];break;case"agi":o.system.project=o.system.appdata;break;default:var r=o.system.appdata.split(",");o.system.command=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.system.variable=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.system.variable="";function l(e){t.hide(e)}o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outbounddial"===o.system.appType.toLowerCase()&&(o.system.prefix=o.system.phone?o.system.phone.split("$")[0]:void 0,o.system.callerId=o.system.callerID?"CALLERID(all)="+o.system.callerID:void 0),o.saveOpenchannelAccountApp=function(){o.errors=[];var e=[];o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outboundDial"===o.system.appType&&(o.system.phone=a.cutdigits?(o.system.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.system.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.system.options+="U(xcally-mixmonitor-context)"):o.system.options=o.system.options.replace("U(xcally-mixmonitor-context)",""));if(o.system.appType&&"custom"===o.system.appType);else switch((o.system.app||o.system.appType).toLowerCase()){case"set":o.system.appdata=o.system.name+"="+o.system.value;break;case"custom":break;default:e[0]=o.system.command,e[1]=o.system.variable,o.system.appdata=e.join(",")}l(o.system)},o.closeDialog=l,i.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){o.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","openchannelAccountApp","openchannelAccount","api"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppsystemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.openchannelAccount={},c.openchannelAccountInteractions={count:0,rows:[]},c.selectedOpenchannelAccountInteractions=[],c.query={fields:"createdAt,updatedAt,id,createdAt,Contact.firstName,Owner.name,closedAt,disposition,note,UserId,ContactId,OpenchannelAccountId,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e){c.openchannelAccount=e,c.query.id=c.openchannelAccount.id,c.getOpenchannelAccountInteractions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getOpenchannelAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.openchannelAccount.getInteractions(c.query,p).$promise},c.createOrEditOpenchannelAccountInteraction=function(e,t){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/interactions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:c.openchannelAccount,interaction:t,interactions:c.openchannelAccountInteractions.rows,license:null,setting:null}})},c.spyopenchannelInteraction=function(e,n){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"openchannel",interaction:n,spy:!0})}})},c.exportSelectedOpenchannelAccountInteractions=function(){var e=angular.copy(c.selectedOpenchannelAccountInteractions);return c.selectedOpenchannelAccountInteractions=[],e},c.deleteOpenchannelAccountInteraction=g,c.deleteSelectedOpenchannelAccountInteractions=function(e){var t=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedOpenchannelAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedOpenchannelAccountInteractions.forEach(function(e){g(e)}),c.selectedOpenchannelAccountInteractions=[]})};var m=!0,u=1;function p(e){c.openchannelAccountInteractions=e||{count:0,rows:[]}}function g(e){l.openchannelInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.openchannelAccountInteractions.rows,{id:e.id}),c.openchannelAccountInteractions.count-=1,c.openchannelAccountInteractions.rows.length||c.getOpenchannelAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getOpenchannelAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountInteractionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.openchannelAccount={},c.openchannelAccountOpenchannelCannedAnswers={count:0,rows:[]},c.selectedOpenchannelAccountOpenchannelCannedAnswers=[],c.query={fields:"createdAt,updatedAt,id,key,value,description,createdAt",limit:10,page:1},c.init=function(e){c.openchannelAccount=e,c.query.id=c.openchannelAccount.id,c.query.OpenchannelAccountId=c.openchannelAccount.id,c.getOpenchannelAccountOpenchannelCannedAnswers()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the openchannelCannedAnswer?").htmlContent("<b>"+(e.name||"openchannelCannedAnswer")+"</b> will be deleted.").ariaLabel("delete openchannelCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getOpenchannelAccountOpenchannelCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.openchannelAccount.getAnswers(c.query,p).$promise},c.createOrEditOpenchannelAccountOpenchannelCannedAnswer=function(e,t){o.show({controller:"CreateOrEditOpenchannelCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:c.openchannelAccount,openchannelCannedAnswer:t,openchannelCannedAnswers:c.openchannelAccountOpenchannelCannedAnswers.rows,license:null,setting:null}})},c.exportSelectedOpenchannelAccountOpenchannelCannedAnswers=function(){var e=angular.copy(c.selectedOpenchannelAccountOpenchannelCannedAnswers);return c.selectedOpenchannelAccountOpenchannelCannedAnswers=[],e},c.deleteOpenchannelAccountOpenchannelCannedAnswer=g,c.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers=function(e){var t=o.confirm().title("Are you sure want to delete the selected openchannelCannedAnswers?").htmlContent("<b>"+c.selectedOpenchannelAccountOpenchannelCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete openchannelCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedOpenchannelAccountOpenchannelCannedAnswers.forEach(function(e){g(e)}),c.selectedOpenchannelAccountOpenchannelCannedAnswers=[]})};var m=!0,u=1;function p(e){c.openchannelAccountOpenchannelCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.openchannelAccountOpenchannelCannedAnswers.rows,{id:e.id}),c.openchannelAccountOpenchannelCannedAnswers.count-=1,c.openchannelAccountOpenchannelCannedAnswers.rows.length||c.getOpenchannelAccountOpenchannelCannedAnswers(),r.success({title:"OpenchannelCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getOpenchannelAccountOpenchannelCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountOpenchannelCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER",m.openchannelCannedAnswer=angular.copy(s),m.openchannelCannedAnswers=o,m.newOpenchannelCannedAnswer=!1,m.openchannelCannedAnswer||(m.openchannelCannedAnswer={},m.title="OPENCHANNEL.NEW_OPENCHANNELCANNEDANSWER",m.newOpenchannelCannedAnswer=!0),t.params.id&&(m.openchannelCannedAnswer.OpenchannelAccountId=t.params.id),m.addNewOpenchannelCannedAnswer=function(){m.errors=[],r.cannedAnswer.save(m.openchannelCannedAnswer).$promise.then(function(e){m.openchannelCannedAnswers.unshift(e.toJSON()),i.success({title:"OpenchannelCannedAnswer properly created",msg:m.openchannelCannedAnswer.name?m.openchannelCannedAnswer.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveOpenchannelCannedAnswer=function(){m.errors=[],r.cannedAnswer.update({id:m.openchannelCannedAnswer.id},m.openchannelCannedAnswer).$promise.then(function(e){var t=_.find(m.openchannelCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"OpenchannelCannedAnswer properly saved!",msg:m.openchannelCannedAnswer.name?m.openchannelCannedAnswer.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteOpenchannelCannedAnswer=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelCannedAnswer will be deleted.").ariaLabel("Delete OpenchannelCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cannedAnswer.delete({id:m.openchannelCannedAnswer.id}).$promise.then(function(){_.remove(m.openchannelCannedAnswers,{id:m.openchannelCannedAnswer.id}),i.success({title:"OpenchannelCannedAnswer properly deleted!",msg:(m.openchannelCannedAnswer.name||"openchannelCannedAnswer")+" has been deleted!"}),u(m.openchannelCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","openchannelCannedAnswers","openchannelCannedAnswer","api","Auth","license","setting"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.openchannelAccount={},c.openchannelAccountOpenchannelDispositions={count:0,rows:[]},c.selectedOpenchannelAccountOpenchannelDispositions=[],c.query={fields:"createdAt,updatedAt,id,name,createdAt",limit:10,page:1},c.init=function(e){c.openchannelAccount=e,c.query.id=c.openchannelAccount.id,c.query.OpenchannelAccountId=c.openchannelAccount.id,c.getOpenchannelAccountOpenchannelDispositions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the openchannelDisposition?").htmlContent("<b>"+(e.name||"openchannelDisposition")+"</b> will be deleted.").ariaLabel("delete openchannelDisposition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getOpenchannelAccountOpenchannelDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.openchannelAccount.getDispositions(c.query,p).$promise},c.createOrEditOpenchannelAccountOpenchannelDisposition=function(e,t){o.show({controller:"CreateOrEditOpenchannelDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelDispositions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:c.openchannelAccount,openchannelDisposition:t,openchannelDispositions:c.openchannelAccountOpenchannelDispositions.rows,license:null,setting:null}})},c.exportSelectedOpenchannelAccountOpenchannelDispositions=function(){var e=angular.copy(c.selectedOpenchannelAccountOpenchannelDispositions);return c.selectedOpenchannelAccountOpenchannelDispositions=[],e},c.deleteOpenchannelAccountOpenchannelDisposition=g,c.deleteSelectedOpenchannelAccountOpenchannelDispositions=function(e){var t=o.confirm().title("Are you sure want to delete the selected openchannelDispositions?").htmlContent("<b>"+c.selectedOpenchannelAccountOpenchannelDispositions.length+" selected</b> will be deleted.").ariaLabel("delete openchannelDispositions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedOpenchannelAccountOpenchannelDispositions.forEach(function(e){g(e)}),c.selectedOpenchannelAccountOpenchannelDispositions=[]})};var m=!0,u=1;function p(e){c.openchannelAccountOpenchannelDispositions=e||{count:0,rows:[]}}function g(e){l.openchannelDisposition.delete({id:e.id}).$promise.then(function(){_.remove(c.openchannelAccountOpenchannelDispositions.rows,{id:e.id}),c.openchannelAccountOpenchannelDispositions.count-=1,c.openchannelAccountOpenchannelDispositions.rows.length||c.getOpenchannelAccountOpenchannelDispositions(),r.success({title:"OpenchannelDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getOpenchannelAccountOpenchannelDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountOpenchannelDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="OPENCHANNEL.EDIT_OPENCHANNELDISPOSITION",m.openchannelDisposition=angular.copy(s),m.openchannelDispositions=o,m.newOpenchannelDisposition=!1,m.openchannelDisposition||(m.openchannelDisposition={},m.title="OPENCHANNEL.NEW_OPENCHANNELDISPOSITION",m.newOpenchannelDisposition=!0),t.params.id&&(m.openchannelDisposition.OpenchannelAccountId=t.params.id),m.addNewOpenchannelDisposition=function(){m.errors=[],r.openchannelDisposition.save(m.openchannelDisposition).$promise.then(function(e){m.openchannelDispositions.unshift(e.toJSON()),i.success({title:"OpenchannelDisposition properly created",msg:m.openchannelDisposition.name?m.openchannelDisposition.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelDisposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelDisposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveOpenchannelDisposition=function(){m.errors=[],r.openchannelDisposition.update({id:m.openchannelDisposition.id},m.openchannelDisposition).$promise.then(function(e){var t=_.find(m.openchannelDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"OpenchannelDisposition properly saved!",msg:m.openchannelDisposition.name?m.openchannelDisposition.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelDisposition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelDisposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteOpenchannelDisposition=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelDisposition will be deleted.").ariaLabel("Delete OpenchannelDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.openchannelDisposition.delete({id:m.openchannelDisposition.id}).$promise.then(function(){_.remove(m.openchannelDispositions,{id:m.openchannelDisposition.id}),i.success({title:"OpenchannelDisposition properly deleted!",msg:(m.openchannelDisposition.name||"openchannelDisposition")+" has been deleted!"}),u(m.openchannelDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelDisposition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelDisposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","openchannelDispositions","openchannelDisposition","api","Auth","license","setting"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelDispositionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.openchannelAccount=d||e.params.openchannelAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoOpenchannelAccounts=function(){e.go("app.openchannel.openchannelAccounts")},c.saveOpenchannelAccount=function(){s.openchannelAccount.update({id:c.openchannelAccount.id},c.openchannelAccount).$promise.then(function(){r.success({title:"OpenchannelAccount updated!",msg:c.openchannelAccount.name?c.openchannelAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.lists=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","openchannelAccount"],angular.module("app.openchannel").controller("OpenchannelAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.openchannelAccounts=r||{count:0,rows:[]},v.table="openchannelAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedOpenchannelAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,key,replyUri,ListId,waitForTheAssignedAgent,description,receiveUri,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,page:1},v.editstate=function(e,t){n.go("app.openchannel.openchannelAccounts.edit",{id:e.id,openchannelAccount:e})},v.interactionsgoto=function(e,t){n.go("app.openchannel.openchannelAccounts.edit",{id:e.id,tab:4})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the openchannelAccount?").htmlContent("<b>"+(e.name||"openchannelAccount")+"</b> will be deleted.").ariaLabel("delete openchannelAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getOpenchannelAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.openchannelAccount.get(v.query,f).$promise},v.createOrEditOpenchannelAccount=function(e,t){i.show({controller:"CreateOrEditOpenchannelAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:t,openchannelAccounts:v.openchannelAccounts.rows,license:v.license,setting:v.setting}})},v.deleteOpenchannelAccount=A,v.exportSelectedOpenchannelAccounts=function(){var e=angular.copy(v.selectedOpenchannelAccounts);return v.selectedOpenchannelAccounts=[],e},v.deleteSelectedOpenchannelAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected openchannelAccounts?").htmlContent("<b>"+v.selectedOpenchannelAccounts.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedOpenchannelAccounts.forEach(function(e){A(e)}),v.selectedOpenchannelAccounts=[]})},v.deselectOpenchannelAccounts=function(){v.selectedOpenchannelAccounts=[]},v.selectAllOpenchannelAccounts=function(){v.selectedOpenchannelAccounts=v.openchannelAccounts.rows},l.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.lists=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.openchannelAccounts=e||{count:0,rows:[]}}function A(e){l.openchannelAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.openchannelAccounts.rows,{id:e.id}),v.openchannelAccounts.count-=1,v.openchannelAccounts.rows.length||v.getOpenchannelAccounts(),c.success({title:"OpenchannelAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getOpenchannelAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","openchannelAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.openchannel").controller("OpenchannelAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="OPENCHANNEL.EDIT_OPENCHANNELQUEUE",m.openchannelQueue=angular.copy(s),m.openchannelQueues=o,m.newOpenchannelQueue=!1,m.openchannelQueue||(m.openchannelQueue={strategy:"beepall",timeout:10},m.title="OPENCHANNEL.NEW_OPENCHANNELQUEUE",m.newOpenchannelQueue=!0),m.addNewOpenchannelQueue=function(){m.errors=[],r.openchannelQueue.save(m.openchannelQueue).$promise.then(function(e){m.openchannelQueues.unshift(e.toJSON()),i.success({title:"OpenchannelQueue properly created",msg:m.openchannelQueue.name?m.openchannelQueue.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveOpenchannelQueue=function(){m.errors=[],r.openchannelQueue.update({id:m.openchannelQueue.id},m.openchannelQueue).$promise.then(function(e){var t=_.find(m.openchannelQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"OpenchannelQueue properly saved!",msg:m.openchannelQueue.name?m.openchannelQueue.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteOpenchannelQueue=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelQueue will be deleted.").ariaLabel("Delete OpenchannelQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.openchannelQueue.delete({id:m.openchannelQueue.id}).$promise.then(function(){_.remove(m.openchannelQueues,{id:m.openchannelQueue.id}),i.success({title:"OpenchannelQueue properly deleted!",msg:(m.openchannelQueue.name||"openchannelQueue")+" has been deleted!"}),u(m.openchannelQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","openchannelQueues","openchannelQueue","api","Auth","license","setting"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelQueueDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.openchannelQueue[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.openchannelQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserOpenchannelQueue?"penalty "+e.UserOpenchannelQueue.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserOpenchannelQueue?"penalty "+e.UserOpenchannelQueue.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.openchannelQueue=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("OPENCHANNEL.ALL_AGENTS"),labelSelected:s.instant("OPENCHANNEL.SELECTED_AGENTS"),transferCallback:function(e,t){a.openchannelQueue[t?"removeAgents":"addAgents"]({id:l.openchannelQueue.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"OpenchannelQueue properly "+(t?"removed":"added"),msg:"OpenchannelQueue has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:openchannelQueue.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","openchannelQueue","openchannelQueues","realtime","$translate","Auth"],angular.module("app.openchannel").controller("OpenchannelQueueagentaddController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.openchannelQueue=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("OPENCHANNEL.ALL_TEAMS"),labelSelected:i.instant("OPENCHANNEL.SELECTED_TEAMS"),transferCallback:function(e,t){a.openchannelQueue[t?"removeTeams":"addTeams"]({id:o.openchannelQueue.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:openchannelQueue.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.openchannelQueue.getTeams({id:o.openchannelQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","openchannelQueue","$translate"],angular.module("app.openchannel").controller("OpenchannelQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.openchannelQueue=d||e.params.openchannelQueue||{},c.selectedTab=e.params.tab||0,c.teamadddialog=function(e,t){n.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:c.openchannelQueues?c.openchannelQueues.rows:[]}})},c.agentadddialog=function(e,t){n.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:c.openchannelQueues?c.openchannelQueues.rows:[],realtime:!1}})},c.alert=r.info,c.gotoOpenchannelQueues=function(){e.go("app.openchannel.openchannelQueues")},c.saveOpenchannelQueue=function(){s.openchannelQueue.update({id:c.openchannelQueue.id},c.openchannelQueue).$promise.then(function(){r.success({title:"OpenchannelQueue updated!",msg:c.openchannelQueue.name?c.openchannelQueue.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","openchannelQueue"],angular.module("app.openchannel").controller("OpenchannelQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.openchannelQueues=r||{count:0,rows:[]},v.table="openchannelQueues",v.listOrder="",v.listOrderAsc=null,v.selectedOpenchannelQueues=[],v.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,page:1},v.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.openchannel.openchannelQueues.edit",{id:e.id,openchannelQueue:e})},v.teamadddialog=function(e,t){i.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:v.openchannelQueues?v.openchannelQueues.rows:[]}})},v.agentadddialog=function(e,t){i.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:v.openchannelQueues?v.openchannelQueues.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the openchannelQueue?").htmlContent("<b>"+(e.name||"openchannelQueue")+"</b> will be deleted.").ariaLabel("delete openchannelQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.openchannel.realtime.queues",{})},v.success=f,v.getOpenchannelQueues=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.openchannelQueue.get(v.query,f).$promise},v.createOrEditOpenchannelQueue=function(e,t){i.show({controller:"CreateOrEditOpenchannelQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:t,openchannelQueues:v.openchannelQueues.rows,license:v.license,setting:v.setting}})},v.deleteOpenchannelQueue=A,v.exportSelectedOpenchannelQueues=function(){var e=angular.copy(v.selectedOpenchannelQueues);return v.selectedOpenchannelQueues=[],e},v.deleteSelectedOpenchannelQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected openchannelQueues?").htmlContent("<b>"+v.selectedOpenchannelQueues.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedOpenchannelQueues.forEach(function(e){A(e)}),v.selectedOpenchannelQueues=[]})},v.deselectOpenchannelQueues=function(){v.selectedOpenchannelQueues=[]},v.selectAllOpenchannelQueues=function(){v.selectedOpenchannelQueues=v.openchannelQueues.rows};var h=!0,b=1;function f(e){v.openchannelQueues=e||{count:0,rows:[]}}function A(e){l.openchannelQueue.delete({id:e.id}).$promise.then(function(){_.remove(v.openchannelQueues.rows,{id:e.id}),v.openchannelQueues.count-=1,v.openchannelQueues.rows.length||v.getOpenchannelQueues(),c.success({title:"OpenchannelQueue deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelQueue"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getOpenchannelQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","openchannelQueues","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.openchannel").controller("OpenchannelQueuesController",e)}(),function(){"use strict";function e(e,s,t,n,a,i,o,r,l,d,c,m,u,p,g,v){var h=this,b=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum"],f=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var A in h.availableStates=["ringing","inuse","busy","onhold","not_inuse"],h.pauses=o||{count:0,rows:[]},h.license=g,h.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},h.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},h.paginatedAgents={},h.load=!1,h.order=[],h.agentInternal={},h.agents)h.agents.hasOwnProperty(A)&&(h.agents[A].init=!0);h.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},h.logout=function(e,t){return d.user.logout({id:e.id}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),h.agents[e.id]&&(h.agents[e.id].online=!1),h.rpcAgents[e.id]&&(h.rpcAgents[e.id].online=!1),y()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"openchannel",realtime:!0,direction:"inbound"}})},h.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},h.getAgentStatus=C,h.getAgentGlobalStatus=x,h.isPause=S,h.checkPause=function(e){return"pause"===e},h.isPartialPause=function(e){return"*pause"===e},h.onSave=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(_.omit(e,f),b)),_.merge(h.rpcAgents[e.id],_.pick(_.omit(e,f),b)),x(h.agents[e.id]))},h.onUpdate=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(e,b)),_.merge(h.rpcAgents[e.id],_.pick(e,b)),x(h.agents[e.id]))},h.onInit=y,h.onConnect=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(_.merge(h.agents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(h.rpcAgents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},h.onComplete=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(h.agents[h.agentInternal[e.destaccountcode]]=_.omit(h.agents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),h.rpcAgents[h.agentInternal[e.destaccountcode]]=_.omit(h.rpcAgents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",h.onSave),c.on("user:update",h.onUpdate),c.on("user:agentconnect",h.onConnect),c.on("user:agentcomplete",h.onComplete),y();var E=v(function(){h.load&&(h.load=!1,y())},999);function y(e){h.load=!1;var t,n,a=s.defer();h.promise=a.promise,h.filteredAgents=[],h.order=[],_.forIn(h.agents,function(e,t){h.rpcAgents[t]&&_.merge(e,_.pick(_.omit(h.rpcAgents[t],f),b)),x(e),e.online?(h.filteredAgents.push(e),h.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),h.query.globalStatusFilter&&_.remove(h.filteredAgents,function(e){return e.globalStatus!==h.query.globalStatusFilter}),h.query.pauseTypeFilter&&_.remove(h.filteredAgents,function(e){return e.pauseType!==h.query.pauseTypeFilter}),h.query.filter&&_.remove(h.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(h.query.filter.toLowerCase())<0}),h.filteredAgents=(t=h.filteredAgents,n=_.startsWith(h.query.order,"-")?"desc":"asc",_.orderBy(t,[h.query.order.replace("-","")],[n]));var i=(h.query.page-1)*h.query.limit;h.paginatedAgents=_.drop(h.filteredAgents,i).slice(0,h.query.limit);for(var o=0;o<h.paginatedAgents.length;o+=1)h.order.push(h.paginatedAgents[o].id);a.resolve(),h.load=!0}function S(e){return"pause"===e||"*pause"===e}function T(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function C(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function x(e){var t="unknown";t=_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"pause":_.some([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"*pause":_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],T)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=S(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),E&&(v.cancel(E),E=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","Auth","license","$interval"],angular.module("app.voice").controller("AgentsOpenchannelRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function g(){var n=[];return _.forIn(u.queues,function(e,t){e.paused=0,e.loggedInDb=0,u.queues[t].agents={},n.push(l.openchannelQueue.getMembers({id:t}).$promise),u.rpcQueues[t]&&_.merge(e,_.pick(u.rpcQueues[t],p))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&u.queues[e[t].rows[n].OpenchannelQueueId].paused++,u.queues[e[t].rows[n].OpenchannelQueueId].loggedInDb++,u.queues[e[t].rows[n].OpenchannelQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].OpenchannelQueueId}).catch(function(e){console.error(e)})}u.count=s.count?s.count:0,u.queues=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.hasRole("admin")?u.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:u.query={id:m.getCurrentUser().id,channel:"openchannel",type:"inbound",sort:"-updatedAt",limit:10,page:1},u.success=b,u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=l.openchannelQueue.get(u.query,b).$promise:u.promise=l.user.getQueues(u.query,b).$promise},u.createOrEditOpenchannelQueue=function(e,t){a.show({controller:"CreateOrEditOpenchannelQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:t,openchannelQueues:_.values(u.queues),license:null,setting:null}})},u.agentAdd=function(e,t){a.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:t,openchannelQueues:u.queues?u.queues.rows:[],realtime:!1}})},u.updateQueue=function(e){return l.openchannelQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},u.onSave=function(e){u.queues[e.id]&&_.merge(u.queues[e.id],_.pick(e,p))},u.onSaveMember=function(e){u.queues[e.OpenchannelQueueId]&&u.queues[e.OpenchannelQueueId].loggedInDb++},u.onRemoveMember=function(e){u.queues[e.OpenchannelQueueId]&&u.queues[e.OpenchannelQueueId].loggedInDb--},u.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(u.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(u.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},u.onLogin=function(e){console.log("onLogged",e),u.queues[e.OpenchannelQueueId]&&(u.queues[e.OpenchannelQueueId].loggedInDb+=1,u.queues[e.OpenchannelQueueId].agents[e.UserId]=e.OpenchannelQueueId)},u.onLogout=function(e){console.log("onLogout",e),u.queues[e.OpenchannelQueueId]&&0<u.queues[e.OpenchannelQueueId].loggedInDb&&(u.queues[e.OpenchannelQueueId].loggedInDb-=1,delete u.queues[e.OpenchannelQueueId].agents[e.UserId])},u.$onInit=g,u.order=[],_.forIn(u.queues,function(e,t){u.order.push(e.id)}),d.on("openchannel_queue:save",u.onSave),d.on("userOpenchannelQueue:save",u.onSaveMember),d.on("userOpenchannelQueue:remove",u.onRemoveMember),d.on("user:update",u.onPause),d.on("userVoiceQueue:remove",u.onLogout),d.on("userVoiceQueue:save",u.onLogin);var v=!0,h=1;function b(e){if(u.count=e.count,u.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){u.order=[];for(var t=0;t<e.rows.length;t++)u.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("openchannel_queue:save"),d.removeAllListeners("userOpenchannelQueue:remove"),d.removeAllListeners("userOpenchannelQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","Auth"],angular.module("app.openchannel").controller("QueuesOpenchannelRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.openchannel.realtime.agents":this.selectedTab=0;break;case"app.openchannel.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,n.go("app.openchannel.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.openchannel.realtime.agents");break;case 1:n.go("app.openchannel.realtime.queues");break;default:n.go("app.openchannel.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.openchannel").controller("OpenchannelRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SETTINGS.EDIT_CUSTOMIZATION",m.customization=angular.copy(s),m.customizations=o,m.newCustomization=!1,m.customization||(m.customization={},m.title="SETTINGS.NEW_CUSTOMIZATION",m.newCustomization=!0),m.addNewCustomization=function(){m.errors=[],r.setting.save(m.customization).$promise.then(function(e){m.customizations.unshift(e.toJSON()),i.success({title:"Customization properly created",msg:m.customization.name?m.customization.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveCustomization=function(){m.errors=[],r.setting.update({id:m.customization.id},m.customization).$promise.then(function(e){var t=_.find(m.customizations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Customization properly saved!",msg:m.customization.name?m.customization.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteCustomization=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The customization will be deleted.").ariaLabel("Delete Customization").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.setting.delete({id:m.customization.id}).$promise.then(function(){_.remove(m.customizations,{id:m.customization.id}),i.success({title:"Customization properly deleted!",msg:(m.customization.name||"customization")+" has been deleted!"}),u(m.customization)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","customizations","customization","api","Auth","license","setting"],angular.module("app.settings").controller("CreateOrEditCustomizationDialogController",e)}(),function(){"use strict";function e(e,t,n){var a=this;a.customizations=e,a.customization={},a.customizations&&a.customizations.rows&&a.customizations.rows.length&&(a.customization=a.customizations.rows[0]),a.saveCustomization=function(){a.customization.id?t.setting.update({id:a.customization.id},a.customization).$promise.then(function(){n.success({title:"Customization updated!",msg:a.customization.name?a.customization.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):t.setting.save(a.customization).$promise.then(function(e){_.merge(a.customization,e),n.success({title:"Customization updated!",msg:a.customization.name?a.customization.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["customizations","api","toasty"],angular.module("app.settings").controller("CustomizationsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size for image files is 8 Mb"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogoController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size for image files is 8 Mb"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo_login".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogologinController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SETTINGS.EDIT_GENERAL",m.general=angular.copy(s),m.generals=o,m.newGeneral=!1,m.general||(m.general={min_internal:1e3,phoneBarAutoUpdater:!0,phoneBarAutoUpdaterUrl:"https://www.xcally.com/bar/phonebar/autoupdater.xml"},m.title="SETTINGS.NEW_GENERAL",m.newGeneral=!0),m.addNewGeneral=function(){m.errors=[],r.setting.save(m.general).$promise.then(function(e){m.generals.unshift(e.toJSON()),i.success({title:"General properly created",msg:m.general.name?m.general.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveGeneral=function(){m.errors=[],r.setting.update({id:m.general.id},m.general).$promise.then(function(e){var t=_.find(m.generals,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"General properly saved!",msg:m.general.name?m.general.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteGeneral=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The general will be deleted.").ariaLabel("Delete General").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.setting.delete({id:m.general.id}).$promise.then(function(){_.remove(m.generals,{id:m.general.id}),i.success({title:"General properly deleted!",msg:(m.general.name||"general")+" has been deleted!"}),u(m.general)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","generals","general","api","Auth","license","setting"],angular.module("app.settings").controller("CreateOrEditGeneralDialogController",e)}(),function(){"use strict";function e(e,t,n){var a=this;a.generals=e,a.general={},a.generals&&a.generals.rows&&a.generals.rows.length&&(a.general=a.generals.rows[0]),a.saveGeneral=function(){a.general.id?t.setting.update({id:a.general.id},a.general).$promise.then(function(){n.success({title:"General updated!",msg:a.general.name?a.general.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):t.setting.save(a.general).$promise.then(function(e){_.merge(a.general,e),n.success({title:"General updated!",msg:a.general.name?a.general.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["generals","api","toasty"],angular.module("app.settings").controller("GeneralsController",e)}(),function(){"use strict";function e(t,n,a,i,o,s){var r=this;r.license=i||{},r.agents=0,r.users=0,r.telephones=0,r.license.gray&&(r.license.deadline=moment(r.license.gray).add(7,"days").format()),r.channels=[{name:"chat",icon:"icon-hangouts"},{name:"mail",icon:"icon-email"},{name:"messaging",icon:"icon-message-text"},{name:"fax",icon:"icon-deskphone"},{name:"openchannel",icon:"icon-google-earth"}],r.modules=[{name:"cm",icon:"icon-account-circle"},{name:"dialer",icon:"icon-crosshairs"},{name:"jscripty",icon:"icon-console"}],r.others=[{name:"callysquare",icon:"icon-sitemap"},{name:"webrtc",icon:"icon-server-plus"},{name:"jaws",icon:"icon-fish"},{name:"custom",icon:"icon-table-edit"},{name:"update",icon:"icon-cloud-download"}],r.requestLicense=function(e){n.show({controller:"RequestLicenseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/license/request/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:i,channels:r.channels,modules:r.modules,others:r.others}})},r.updateLicense=function(e){var t=n.prompt().title("Do you want to update your license manually?").textContent("Enter your license.").targetEvent(e).ok("Ok").cancel("Cancel");n.show(t).then(function(e){if(e)return s.license.update({id:1,license:e}).$promise.then(function(){o.success({title:"License properly updated!",msg:"The license has been updated!"})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATElicense",msg:e.data?JSON.stringify(e.data):e.toString()})})}).catch(function(e){e&&console.error(e)})},r.gotoProcess=function(e){a.go("app.settings.system",{tab:1})},s.user.get({fields:"id",role:"agent",online:!0}).$promise.then(function(e){return r.agents=e&&e.count?e.count:0,s.user.get({fields:"id",role:"user,admin"}).$promise}).then(function(e){return r.users=e&&e.count?e.count:0,s.user.get({fields:"id",role:"telephone"}).$promise}).then(function(e){r.telephones=e&&e.count?e.count:0}).catch(function(e){console.log(e)})}e.$inject=["$document","$mdDialog","$state","license","toasty","api"],angular.module("app.settings.license").controller("LicenseController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l){var d=this;function c(){e.hide()}d.errors=[],d.user=r.getCurrentUser(),d.license=angular.copy(n),d.channels=a,d.modules=i,d.others=o,d.license.name=d.user.fullname,d.license.email=d.user.email,d.sendRequest=function(){for(var e in d.errors=[],d.table="||FIELD||OLD||NEW||\n",d.license)d.license.hasOwnProperty(e)&&!_.includes(["$promise","$resolved"],e)&&(n[e]===d.license[e]?d.table+="|"+e+"|"+(void 0!==n[e]?n[e]:"")+"|"+d.license[e]+"|\n":d.table+="|"+e+"|{color:red}"+(void 0!==n[e]?n[e]:"")+"{color}|*"+d.license[e]+"*|\n");s.jira.save({key:"MOTLICENSE",summary:"Motion License Request",description:d.table,issuetype:"Task"}).$promise.then(function(e){t.success({title:"Request sent!",msg:l.instant("SETTINGS.LICENSE_REQUEST_SENT"),timeout:15e3}),c()}).catch(function(e){console.error(e),d.errors=[{message:l.instant("SETTINGS.JIRA_ERROR_MESSAGE"),type:"api.jira"}]})},d.closeDialog=c}e.$inject=["$mdDialog","toasty","license","channels","modules","others","api","Auth","$translate"],angular.module("app.settings.license").controller("RequestLicenseDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SETTINGS.EDIT_NETWORK",m.network=angular.copy(s),m.networks=o,m.newNetwork=!1,m.network||(m.network={type:"localnet"},m.title="SETTINGS.NEW_NETWORK",m.newNetwork=!0),m.addNewNetwork=function(){m.errors=[],r.network.save(m.network).$promise.then(function(e){m.networks.unshift(e.toJSON()),i.success({title:"Network properly created",msg:m.network.name?m.network.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.network.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveNetwork=function(){m.errors=[],r.network.update({id:m.network.id},m.network).$promise.then(function(e){var t=_.find(m.networks,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Network properly saved!",msg:m.network.name?m.network.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.network.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteNetwork=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The network will be deleted.").ariaLabel("Delete Network").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.network.delete({id:m.network.id}).$promise.then(function(){_.remove(m.networks,{id:m.network.id}),i.success({title:"Network properly deleted!",msg:(m.network.name||"network")+" has been deleted!"}),u(m.network)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.network.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","networks","network","api","Auth","license","setting"],angular.module("app.settings").controller("CreateOrEditNetworkDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.networks=r||{count:0,rows:[]},v.table="networks",v.listOrder="",v.listOrderAsc=null,v.selectedNetworks=[],v.query={fields:"createdAt,updatedAt,id,type,value,value,createdAt",sort:"-updatedAt",limit:10,page:1},v.arraytype=_.keyBy([{option:"LocalNET",value:"'localnet'"},{option:"ExternIP",value:"'externip'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editdialog=function(e,t){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{network:e,networks:v.networks.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the network?").htmlContent("<b>"+(e.name||"network")+"</b> will be deleted.").ariaLabel("delete network").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getNetworks=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.network.get(v.query,f).$promise},v.createOrEditNetwork=function(e,t){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{network:t,networks:v.networks.rows,license:v.license,setting:v.setting}})},v.deleteNetwork=A,v.exportSelectedNetworks=function(){var e=angular.copy(v.selectedNetworks);return v.selectedNetworks=[],e},v.deleteSelectedNetworks=function(e){var t=i.confirm().title("Are you sure want to delete the selected networks?").htmlContent("<b>"+v.selectedNetworks.length+" selected</b> will be deleted.").ariaLabel("delete Networks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedNetworks.forEach(function(e){A(e)}),v.selectedNetworks=[]})},v.deselectNetworks=function(){v.selectedNetworks=[]},v.selectAllNetworks=function(){v.selectedNetworks=v.networks.rows};var h=!0,b=1;function f(e){v.networks=e||{count:0,rows:[]}}function A(e){l.network.delete({id:e.id}).$promise.then(function(){_.remove(v.networks.rows,{id:e.id}),v.networks.count-=1,v.networks.rows.length||v.getNetworks(),c.success({title:"Network deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEnetwork"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEnetwork",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getNetworks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","networks","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.settings").controller("NetworksController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SETTINGS.EDIT_SMTP",m.smtp=angular.copy(s),m.smtps=o,m.newSmtp=!1,m.smtp||(m.smtp={service:!0},m.title="SETTINGS.NEW_SMTP",m.newSmtp=!0),m.addNewSmtp=function(){m.errors=[],r.mailAccount.save(m.smtp).$promise.then(function(e){m.smtps.unshift(e.toJSON()),i.success({title:"Smtp properly created",msg:m.smtp.name?m.smtp.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSmtp=function(){m.errors=[],r.mailAccount.update({id:m.smtp.id},m.smtp).$promise.then(function(e){var t=_.find(m.smtps,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Smtp properly saved!",msg:m.smtp.name?m.smtp.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSmtp=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The smtp will be deleted.").ariaLabel("Delete Smtp").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.mailAccount.delete({id:m.smtp.id}).$promise.then(function(){_.remove(m.smtps,{id:m.smtp.id}),i.success({title:"Smtp properly deleted!",msg:(m.smtp.name||"smtp")+" has been deleted!"}),u(m.smtp)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","smtps","smtp","api","Auth","license","setting"],angular.module("app.settings").controller("CreateOrEditSmtpDialogController",e)}(),function(){"use strict";function e(e,t,n){var a=this;a.smtps=e,a.smtp={},a.smtps&&a.smtps.rows&&a.smtps.rows.length?a.smtp=a.smtps.rows[0]:a.smtp={service:!0,Smtp:{service:null}},a.saveSmtp=function(){a.smtp.id?t.mailAccount.update({id:a.smtp.id},a.smtp).$promise.then(function(){n.success({title:"Smtp updated!",msg:a.smtp.name?a.smtp.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}):t.mailAccount.save(a.smtp).$promise.then(function(e){_.merge(a.smtp,e),n.success({title:"Smtp updated!",msg:a.smtp.name?a.smtp.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},a.verifySmtp=function(){a.smtp.id&&t.mailAccount.verifySmtp({id:a.smtp.id}).$promise.then(function(){n.success({title:"Smtp verified!",msg:a.smtp.name?a.smtp.name+" has been verified!":""})}).catch(function(e){n.error({title:"Smtp not verified! Remember to save before to verify!",msg:e.data?JSON.stringify(e.data):e.toString(),timeout:1e4})})}}e.$inject=["smtps","api","toasty"],angular.module("app.settings").controller("SmtpController",e)}(),function(){"use strict";function e(e,i,o,t,n,a,s,r){var l,d=this;d.system=n||{},d.processes=a?a.rows:[],d.processLimit=7,d.selectedTab=t.params.tab||0,d.getInfo=function(){return r.system.get().$promise.then(function(e){_.merge(d.system,e)}).catch(d.cancelInterval)},d.getProcesses=function(){return r.pm2.get().$promise.then(function(e){_.merge(d.processes,e?e.rows:[])}).catch(d.cancelInterval)},d.cancelInterval=function(e){i.cancel(l)},d.updateProcess=function(e,t,n){var a=o.confirm().title("Would you like to change the status of the process #"+t+"?").textContent("The status will be changed to: "+n.toUpperCase()).ariaLabel("Lucky day").targetEvent(e).ok("Ok").cancel("Cancel");o.show(a).then(function(){return r.pm2.update({id:t,status:n})}).then(function(){i(d.getProcesses,1e3,1)}).then(function(){s.success({title:"Process updated!",msg:"Status properly changed to: "+n})})},l=i(d.getInfo,5e3),e.$on("$destroy",function(){d.cancelInterval()})}e.$inject=["$scope","$interval","$mdDialog","$state","system","processes","toasty","api"],angular.module("app.settings.system").controller("SystemController",e)}(),function(){"use strict";function e(e,t,n,a,i){var o=this;o.title="SETTINGS.UPDATE",o.progress=0,o.updating=!0,o.output="Waiting...",o.success=!0,o.interval=t(function(){o.progress<90&&(o.progress+=1)},1e3),o.closeDialog=function(){e.hide()},o.reload=function(){n.location.reload()},o.stopInterval=function(){angular.isDefined(o.interval)&&(t.cancel(o.interval),o.interval=void 0);o.progress=100,o.updating=!1},i.version.fetch().$promise.then(function(e){return o.output=e.output+"...",i.version.reset().$promise}).then(function(e){return o.output=e.output+"...",i.version.pull().$promise}).then(function(e){return o.output=e.output+"...",i.version.migrations().$promise}).then(function(e){return o.output=e.output+"...",i.version.restart().$promise}).then(function(e){o.output="Waiting to restart motion...",a(function(){o.stopInterval()},3e4)}).catch(function(e){o.success=!1,o.stopInterval(),o.output=JSON.stringify(e)})}e.$inject=["$mdDialog","$interval","$window","$timeout","api"],angular.module("app.settings").controller("UpdateDialogController",e)}(),function(){"use strict";function e(n,e,a,t,i){this.version=t||{},this.updateConfirm=function(e){var t=n.confirm().title("Would you like to update your system?").htmlContent('The system request time for the update should be below 1 minute.<br><br>Do you agree the terms of this <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">End User License Agreement<a>?').ariaLabel("").targetEvent(e).clickOutsideToClose(!0).parent(angular.element(a.body)).ok("I agree").cancel("Disagree");n.show(t).then(function(){n.show({controller:"UpdateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/updates/update/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!1})})}}e.$inject=["$mdDialog","$interval","$document","version","toasty"],angular.module("app.settings").controller("UpdatesController",e)}(),function(){"use strict";function e(e,s,t,n,a,i,o,r,l,d,c,m,u,p,g,v){var h=this,b=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum"],f=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var A in h.availableStates=["ringing","inuse","busy","onhold","not_inuse"],h.pauses=o||{count:0,rows:[]},h.license=g,h.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},h.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},h.paginatedAgents={},h.load=!1,h.order=[],h.agentInternal={},h.agents)h.agents.hasOwnProperty(A)&&(h.agents[A].init=!0);h.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},h.logout=function(e,t){return d.user.logout({id:e.id}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),h.agents[e.id]&&(h.agents[e.id].online=!1),h.rpcAgents[e.id]&&(h.rpcAgents[e.id].online=!1),y()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"sms",realtime:!0,direction:"inbound"}})},h.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},h.getAgentStatus=C,h.getAgentGlobalStatus=x,h.isPause=S,h.checkPause=function(e){return"pause"===e},h.isPartialPause=function(e){return"*pause"===e},h.onSave=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(_.omit(e,f),b)),_.merge(h.rpcAgents[e.id],_.pick(_.omit(e,f),b)),x(h.agents[e.id]))},h.onUpdate=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(e,b)),_.merge(h.rpcAgents[e.id],_.pick(e,b)),x(h.agents[e.id]))},h.onInit=y,h.onConnect=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(_.merge(h.agents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(h.rpcAgents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},h.onComplete=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(h.agents[h.agentInternal[e.destaccountcode]]=_.omit(h.agents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),h.rpcAgents[h.agentInternal[e.destaccountcode]]=_.omit(h.rpcAgents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",h.onSave),c.on("user:update",h.onUpdate),c.on("user:agentconnect",h.onConnect),c.on("user:agentcomplete",h.onComplete),y();var E=v(function(){h.load&&(h.load=!1,y())},999);function y(e){h.load=!1;var t,n,a=s.defer();h.promise=a.promise,h.filteredAgents=[],h.order=[],_.forIn(h.agents,function(e,t){h.rpcAgents[t]&&_.merge(e,_.pick(_.omit(h.rpcAgents[t],f),b)),x(e),e.online?(h.filteredAgents.push(e),h.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),h.query.globalStatusFilter&&_.remove(h.filteredAgents,function(e){return e.globalStatus!==h.query.globalStatusFilter}),h.query.pauseTypeFilter&&_.remove(h.filteredAgents,function(e){return e.pauseType!==h.query.pauseTypeFilter}),h.query.filter&&_.remove(h.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(h.query.filter.toLowerCase())<0}),h.filteredAgents=(t=h.filteredAgents,n=_.startsWith(h.query.order,"-")?"desc":"asc",_.orderBy(t,[h.query.order.replace("-","")],[n]));var i=(h.query.page-1)*h.query.limit;h.paginatedAgents=_.drop(h.filteredAgents,i).slice(0,h.query.limit);for(var o=0;o<h.paginatedAgents.length;o+=1)h.order.push(h.paginatedAgents[o].id);a.resolve(),h.load=!0}function S(e){return"pause"===e||"*pause"===e}function T(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function C(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function x(e){var t="unknown";t=_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"pause":_.some([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"*pause":_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],T)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=S(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),E&&(v.cancel(E),E=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","Auth","license","$interval"],angular.module("app.voice").controller("AgentsSmsRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function g(){var n=[];return _.forIn(u.queues,function(e,t){e.paused=0,e.loggedInDb=0,u.queues[t].agents={},n.push(l.smsQueue.getMembers({id:t}).$promise),u.rpcQueues[t]&&_.merge(e,_.pick(u.rpcQueues[t],p))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&u.queues[e[t].rows[n].SmsQueueId].paused++,u.queues[e[t].rows[n].SmsQueueId].loggedInDb++,u.queues[e[t].rows[n].SmsQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].SmsQueueId}).catch(function(e){console.error(e)})}u.count=s.count?s.count:0,u.queues=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.hasRole("admin")?u.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:u.query={id:m.getCurrentUser().id,channel:"sms",type:"inbound",sort:"-updatedAt",limit:10,page:1},u.success=b,u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=l.smsQueue.get(u.query,b).$promise:u.promise=l.user.getQueues(u.query,b).$promise},u.createOrEditSmsQueue=function(e,t){a.show({controller:"CreateOrEditSmsQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:t,smsQueues:_.values(u.queues),license:null,setting:null}})},u.agentAdd=function(e,t){a.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:t,smsQueues:u.queues?u.queues.rows:[],realtime:!1}})},u.updateQueue=function(e){return l.smsQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},u.onSave=function(e){u.queues[e.id]&&_.merge(u.queues[e.id],_.pick(e,p))},u.onSaveMember=function(e){u.queues[e.SmsQueueId]&&u.queues[e.SmsQueueId].loggedInDb++},u.onRemoveMember=function(e){u.queues[e.SmsQueueId]&&u.queues[e.SmsQueueId].loggedInDb--},u.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(u.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(u.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},u.onLogin=function(e){console.log("onLogged",e),u.queues[e.SmsQueueId]&&(u.queues[e.SmsQueueId].loggedInDb+=1,u.queues[e.SmsQueueId].agents[e.UserId]=e.SmsQueueId)},u.onLogout=function(e){console.log("onLogout",e),u.queues[e.SmsQueueId]&&0<u.queues[e.SmsQueueId].loggedInDb&&(u.queues[e.SmsQueueId].loggedInDb-=1,delete u.queues[e.SmsQueueId].agents[e.UserId])},u.$onInit=g,u.order=[],_.forIn(u.queues,function(e,t){u.order.push(e.id)}),d.on("sms_queue:save",u.onSave),d.on("userSmsQueue:save",u.onSaveMember),d.on("userSmsQueue:remove",u.onRemoveMember),d.on("user:update",u.onPause),d.on("userVoiceQueue:remove",u.onLogout),d.on("userVoiceQueue:save",u.onLogin);var v=!0,h=1;function b(e){if(u.count=e.count,u.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){u.order=[];for(var t=0;t<e.rows.length;t++)u.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("sms_queue:save"),d.removeAllListeners("userSmsQueue:remove"),d.removeAllListeners("userSmsQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","Auth"],angular.module("app.sms").controller("QueuesSmsRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.sms.realtime.agents":this.selectedTab=0;break;case"app.sms.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,n.go("app.sms.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.sms.realtime.agents");break;case 1:n.go("app.sms.realtime.queues");break;default:n.go("app.sms.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.sms").controller("SmsRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SMS.EDIT_SMSACCOUNT",m.smsAccount=angular.copy(s),m.smsAccounts=o,m.newSmsAccount=!1,m.smsAccount||(m.smsAccount={remote:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():""),type:"twilio",waitForTheAssignedAgent:10,notificationSound:!0},m.title="SMS.NEW_SMSACCOUNT",m.newSmsAccount=!0),t.params.id&&(m.smsAccount.SmsAccountId=t.params.id),m.addNewSmsAccount=function(){m.errors=[],r.smsAccount.save(m.smsAccount).$promise.then(function(e){m.smsAccounts.unshift(e.toJSON()),i.success({title:"SmsAccount properly created",msg:m.smsAccount.name?m.smsAccount.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSmsAccount=function(){m.errors=[],r.smsAccount.update({id:m.smsAccount.id},m.smsAccount).$promise.then(function(e){var t=_.find(m.smsAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SmsAccount properly saved!",msg:m.smsAccount.name?m.smsAccount.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSmsAccount=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The smsAccount will be deleted.").ariaLabel("Delete SmsAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.smsAccount.delete({id:m.smsAccount.id}).$promise.then(function(){_.remove(m.smsAccounts,{id:m.smsAccount.id}),i.success({title:"SmsAccount properly deleted!",msg:(m.smsAccount.name||"smsAccount")+" has been deleted!"}),u(m.smsAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","smsAccounts","smsAccount","api","Auth","license","setting"],angular.module("app.sms").controller("CreateOrEditSmsAccountDialogController",e)}(),function(){"use strict";function e(s,i,a,o,e){var r=this;function t(e,t){if(r.smsAccountApps.rows.length){var n=r.smsAccountApps.rows[t]?r.smsAccountApps.rows[t]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccountApp:n,smsAccount:r.smsAccount}}).then(function(e){e&&(e.id?r.smsAccountApps.rows[t]=e:r.smsAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.smsAccountApps.rows.length;n++,0){var a=r.smsAccountApps.rows[n],i=[],o=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.smsAccount.context,a.exten=r.smsAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(o.length?_.last(o).priority:a.priority)+1,t=_.concat(t,i,[a],o)}s.smsAccount.addApplications({id:r.smsAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.smsAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.smsAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.smsAccount={},r.smsAccountApps={count:0,rows:[]},r.selectedSmsAccountApps=[],r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"SmsQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",route:"smsQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",maxlength:255,required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e){r.smsAccount=e,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getSmsAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.smsAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getSmsAccountApps=function(){r.promise=s.smsAccount.getApplications(r.query,n).$promise},r.editSmsAccountApp=t,r.editInterval=function(e,t){if(r.smsAccountApps.rows.length){var n=r.smsAccountApps.rows[t]?r.smsAccountApps.rows[t]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteSmsAccountApp=function(e){_.remove(r.smsAccountApps.rows,{id:e.id}),l(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedSmsAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedSmsAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedSmsAccountApps.forEach(function(e){_.remove(r.smsAccountApps.rows,{id:e.id})}),r.selectedSmsAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return s.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.sms").controller("SmsAccountActionsController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(e.appType||e.app).toUpperCase(),o.agent=angular.copy(e),o.agent.appdata)switch(o.agent.appType?o.agent.appType.toLowerCase():o.agent.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.agent.appdata.split(",");o.agent.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.agent.text=s.slice(1,s.length).join(",");break;case"message":o.agent.text=o.agent.appdata;break;case"set":o.agent.name=o.agent.appdata.split("=")[0],o.agent.value=o.agent.appdata.split("=")[1];break;case"agi":o.agent.project=o.agent.appdata;break;default:var r=o.agent.appdata.split(",");o.agent.agent=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.agent.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.agent.timeout=30;function l(e){t.hide(e)}o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outbounddial"===o.agent.appType.toLowerCase()&&(o.agent.prefix=o.agent.phone?o.agent.phone.split("$")[0]:void 0,o.agent.callerId=o.agent.callerID?"CALLERID(all)="+o.agent.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.agent.type&&"outbound"===o.agent.type.toLowerCase()&&"outboundDial"===o.agent.appType&&(o.agent.phone=a.cutdigits?(o.agent.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.agent.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.agent.options+="U(xcally-mixmonitor-context)"):o.agent.options=o.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.agents,{name:o.agent.agent});t&&(o.agent.UserId=t.id);if(o.agent.appType&&"custom"===o.agent.appType);else switch((o.agent.app||o.agent.appType).toLowerCase()){case"set":o.agent.appdata=o.agent.name+"="+o.agent.value;break;case"custom":break;default:e[0]=o.agent.agent,e[1]=o.agent.timeout,o.agent.appdata=e.join(",")}l(o.agent)},o.closeDialog=l,i.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){o.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(n.appType||n.app).toUpperCase(),o.autoreply=angular.copy(n),o.autoreply.appdata)switch(o.autoreply.appType?o.autoreply.appType.toLowerCase():o.autoreply.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.autoreply.appdata.split(",");o.autoreply.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.autoreply.text=s.slice(1,s.length).join(",");break;case"message":o.autoreply.text=o.autoreply.appdata;break;case"set":o.autoreply.name=o.autoreply.appdata.split("=")[0],o.autoreply.value=o.autoreply.appdata.split("=")[1];break;case"agi":o.autoreply.project=o.autoreply.appdata;break;default:var r=o.autoreply.appdata.split(",");o.autoreply.times=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.autoreply.text=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.autoreply.times=1;function l(e){t.hide(e)}o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outbounddial"===o.autoreply.appType.toLowerCase()&&(o.autoreply.prefix=o.autoreply.phone?o.autoreply.phone.split("$")[0]:void 0,o.autoreply.callerId=o.autoreply.callerID?"CALLERID(all)="+o.autoreply.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.autoreply.type&&"outbound"===o.autoreply.type.toLowerCase()&&"outboundDial"===o.autoreply.appType&&(o.autoreply.phone=a.cutdigits?(o.autoreply.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.autoreply.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.autoreply.options+="U(xcally-mixmonitor-context)"):o.autoreply.options=o.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(o.autoreply.appType&&"custom"===o.autoreply.appType);else switch((o.autoreply.app||o.autoreply.appType).toLowerCase()){case"set":o.autoreply.appdata=o.autoreply.name+"="+o.autoreply.value;break;case"custom":break;default:e[0]=o.autoreply.times,e[1]=o.autoreply.text,o.autoreply.appdata=e.join(",")}l(o.autoreply)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(n.appType||n.app).toUpperCase(),o.close=angular.copy(n),o.close.appdata)switch(o.close.appType?o.close.appType.toLowerCase():o.close.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.close.appdata.split(",");o.close.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.close.text=s.slice(1,s.length).join(",");break;case"message":o.close.text=o.close.appdata;break;case"set":o.close.name=o.close.appdata.split("=")[0],o.close.value=o.close.appdata.split("=")[1];break;case"agi":o.close.project=o.close.appdata;break;default:var r=o.close.appdata.split(",");o.close.disposition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outbounddial"===o.close.appType.toLowerCase()&&(o.close.prefix=o.close.phone?o.close.phone.split("$")[0]:void 0,o.close.callerId=o.close.callerID?"CALLERID(all)="+o.close.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.close.type&&"outbound"===o.close.type.toLowerCase()&&"outboundDial"===o.close.appType&&(o.close.phone=a.cutdigits?(o.close.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.close.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.close.options+="U(xcally-mixmonitor-context)"):o.close.options=o.close.options.replace("U(xcally-mixmonitor-context)",""));if(o.close.appType&&"custom"===o.close.appType);else switch((o.close.app||o.close.appType).toLowerCase()){case"set":o.close.appdata=o.close.name+"="+o.close.value;break;case"custom":break;default:e[0]=o.close.disposition,o.close.appdata=e.join(",")}l(o.close)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotoif=angular.copy(n),o.gotoif.appdata)switch(o.gotoif.appType?o.gotoif.appType.toLowerCase():o.gotoif.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotoif.appdata.split(",");o.gotoif.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotoif.text=s.slice(1,s.length).join(",");break;case"message":o.gotoif.text=o.gotoif.appdata;break;case"set":o.gotoif.name=o.gotoif.appdata.split("=")[0],o.gotoif.value=o.gotoif.appdata.split("=")[1];break;case"agi":o.gotoif.project=o.gotoif.appdata;break;default:var r=o.gotoif.appdata.split(",");o.gotoif.condition=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.gotoif.truepriority=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.gotoif.falsepriority=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10)}function l(e){t.hide(e)}o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outbounddial"===o.gotoif.appType.toLowerCase()&&(o.gotoif.prefix=o.gotoif.phone?o.gotoif.phone.split("$")[0]:void 0,o.gotoif.callerId=o.gotoif.callerID?"CALLERID(all)="+o.gotoif.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.gotoif.type&&"outbound"===o.gotoif.type.toLowerCase()&&"outboundDial"===o.gotoif.appType&&(o.gotoif.phone=a.cutdigits?(o.gotoif.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotoif.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotoif.options+="U(xcally-mixmonitor-context)"):o.gotoif.options=o.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotoif.appType&&"custom"===o.gotoif.appType);else switch((o.gotoif.app||o.gotoif.appType).toLowerCase()){case"set":o.gotoif.appdata=o.gotoif.name+"="+o.gotoif.value;break;case"custom":break;default:e[0]=o.gotoif.condition,e[1]=o.gotoif.truepriority,e[2]=o.gotoif.falsepriority,o.gotoif.appdata=e.join(",")}l(o.gotoif)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(n.appType||n.app).toUpperCase(),o.gotop=angular.copy(n),o.gotop.appdata)switch(o.gotop.appType?o.gotop.appType.toLowerCase():o.gotop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.gotop.appdata.split(",");o.gotop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.gotop.text=s.slice(1,s.length).join(",");break;case"message":o.gotop.text=o.gotop.appdata;break;case"set":o.gotop.name=o.gotop.appdata.split("=")[0],o.gotop.value=o.gotop.appdata.split("=")[1];break;case"agi":o.gotop.project=o.gotop.appdata;break;default:var r=o.gotop.appdata.split(",");o.gotop.priority=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outbounddial"===o.gotop.appType.toLowerCase()&&(o.gotop.prefix=o.gotop.phone?o.gotop.phone.split("$")[0]:void 0,o.gotop.callerId=o.gotop.callerID?"CALLERID(all)="+o.gotop.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.gotop.type&&"outbound"===o.gotop.type.toLowerCase()&&"outboundDial"===o.gotop.appType&&(o.gotop.phone=a.cutdigits?(o.gotop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.gotop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.gotop.options+="U(xcally-mixmonitor-context)"):o.gotop.options=o.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(o.gotop.appType&&"custom"===o.gotop.appType);else switch((o.gotop.app||o.gotop.appType).toLowerCase()){case"set":o.gotop.appdata=o.gotop.name+"="+o.gotop.value;break;case"custom":break;default:e[0]=o.gotop.priority,o.gotop.appdata=e.join(",")}l(o.gotop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditSmsAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(n.appType||n.app).toUpperCase(),o.noop=angular.copy(n),o.noop.appdata)switch(o.noop.appType?o.noop.appType.toLowerCase():o.noop.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.noop.appdata.split(",");o.noop.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.noop.text=s.slice(1,s.length).join(",");break;case"message":o.noop.text=o.noop.appdata;break;case"set":o.noop.name=o.noop.appdata.split("=")[0],o.noop.value=o.noop.appdata.split("=")[1];break;case"agi":o.noop.project=o.noop.appdata;break;default:var r=o.noop.appdata.split(",");o.noop.value=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outbounddial"===o.noop.appType.toLowerCase()&&(o.noop.prefix=o.noop.phone?o.noop.phone.split("$")[0]:void 0,o.noop.callerId=o.noop.callerID?"CALLERID(all)="+o.noop.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.noop.type&&"outbound"===o.noop.type.toLowerCase()&&"outboundDial"===o.noop.appType&&(o.noop.phone=a.cutdigits?(o.noop.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.noop.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.noop.options+="U(xcally-mixmonitor-context)"):o.noop.options=o.noop.options.replace("U(xcally-mixmonitor-context)",""));if(o.noop.appType&&"custom"===o.noop.appType);else switch((o.noop.app||o.noop.appType).toLowerCase()){case"set":o.noop.appdata=o.noop.name+"="+o.noop.value;break;case"custom":break;default:e[0]=o.noop.value,o.noop.appdata=e.join(",")}l(o.noop)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(e.appType||e.app).toUpperCase(),o.queue=angular.copy(e),o.queue.appdata)switch(o.queue.appType?o.queue.appType.toLowerCase():o.queue.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.queue.appdata.split(",");o.queue.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.queue.text=s.slice(1,s.length).join(",");break;case"message":o.queue.text=o.queue.appdata;break;case"set":o.queue.name=o.queue.appdata.split("=")[0],o.queue.value=o.queue.appdata.split("=")[1];break;case"agi":o.queue.project=o.queue.appdata;break;default:var r=o.queue.appdata.split(",");o.queue.queue=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.queue.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.queue.queue=300,o.queue.timeout=300;function l(e){t.hide(e)}o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outbounddial"===o.queue.appType.toLowerCase()&&(o.queue.prefix=o.queue.phone?o.queue.phone.split("$")[0]:void 0,o.queue.callerId=o.queue.callerID?"CALLERID(all)="+o.queue.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outboundDial"===o.queue.appType&&(o.queue.phone=a.cutdigits?(o.queue.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.queue.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.queue.options+="U(xcally-mixmonitor-context)"):o.queue.options=o.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(o.queues,{name:o.queue.queue});t&&(o.queue[_.capitalize("sms")+"QueueId"]=t.id);if(o.queue.appType&&"custom"===o.queue.appType);else switch((o.queue.app||o.queue.appType).toLowerCase()){case"set":o.queue.appdata=o.queue.name+"="+o.queue.value;break;case"custom":break;default:e[0]=o.queue.queue,e[1]=o.queue.timeout,o.queue.appdata=e.join(",")}l(o.queue)},o.closeDialog=l,i.smsQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){o.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="SMS.EDIT_"+(e.appType||e.app).toUpperCase(),o.system=angular.copy(e),o.system.appdata)switch(o.system.appType?o.system.appType.toLowerCase():o.system.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.system.appdata.split(",");o.system.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.system.text=s.slice(1,s.length).join(",");break;case"message":o.system.text=o.system.appdata;break;case"set":o.system.name=o.system.appdata.split("=")[0],o.system.value=o.system.appdata.split("=")[1];break;case"agi":o.system.project=o.system.appdata;break;default:var r=o.system.appdata.split(",");o.system.command=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.system.variable=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}else o.system.variable="";function l(e){t.hide(e)}o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outbounddial"===o.system.appType.toLowerCase()&&(o.system.prefix=o.system.phone?o.system.phone.split("$")[0]:void 0,o.system.callerId=o.system.callerID?"CALLERID(all)="+o.system.callerID:void 0),o.saveSmsAccountApp=function(){o.errors=[];var e=[];o.system.type&&"outbound"===o.system.type.toLowerCase()&&"outboundDial"===o.system.appType&&(o.system.phone=a.cutdigits?(o.system.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.system.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.system.options+="U(xcally-mixmonitor-context)"):o.system.options=o.system.options.replace("U(xcally-mixmonitor-context)",""));if(o.system.appType&&"custom"===o.system.appType);else switch((o.system.app||o.system.appType).toLowerCase()){case"set":o.system.appdata=o.system.name+"="+o.system.value;break;case"custom":break;default:e[0]=o.system.command,e[1]=o.system.variable,o.system.appdata=e.join(",")}l(o.system)},o.closeDialog=l,i.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){o.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","smsAccountApp","smsAccount","api"],angular.module("app.sms").controller("EditSmsAccountAppsystemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.smsAccount={},c.smsAccountInteractions={count:0,rows:[]},c.selectedSmsAccountInteractions=[],c.query={fields:"createdAt,updatedAt,id,createdAt,Contact.firstName,Owner.name,closedAt,disposition,note,UserId,ContactId,SmsAccountId,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e){c.smsAccount=e,c.query.id=c.smsAccount.id,c.getSmsAccountInteractions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getSmsAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.smsAccount.getInteractions(c.query,p).$promise},c.createOrEditSmsAccountInteraction=function(e,t){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/interactions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:c.smsAccount,interaction:t,interactions:c.smsAccountInteractions.rows,license:null,setting:null}})},c.spysmsInteraction=function(e,n){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"sms",interaction:n,spy:!0})}})},c.exportSelectedSmsAccountInteractions=function(){var e=angular.copy(c.selectedSmsAccountInteractions);return c.selectedSmsAccountInteractions=[],e},c.deleteSmsAccountInteraction=g,c.deleteSelectedSmsAccountInteractions=function(e){var t=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedSmsAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedSmsAccountInteractions.forEach(function(e){g(e)}),c.selectedSmsAccountInteractions=[]})};var m=!0,u=1;function p(e){c.smsAccountInteractions=e||{count:0,rows:[]}}function g(e){l.smsInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.smsAccountInteractions.rows,{id:e.id}),c.smsAccountInteractions.count-=1,c.smsAccountInteractions.rows.length||c.getSmsAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getSmsAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountInteractionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.smsAccount={},c.smsAccountSmsCannedAnswers={count:0,rows:[]},c.selectedSmsAccountSmsCannedAnswers=[],c.query={fields:"createdAt,updatedAt,id,key,value,description,createdAt",limit:10,page:1},c.init=function(e){c.smsAccount=e,c.query.id=c.smsAccount.id,c.query.SmsAccountId=c.smsAccount.id,c.getSmsAccountSmsCannedAnswers()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the smsCannedAnswer?").htmlContent("<b>"+(e.name||"smsCannedAnswer")+"</b> will be deleted.").ariaLabel("delete smsCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getSmsAccountSmsCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.smsAccount.getAnswers(c.query,p).$promise},c.createOrEditSmsAccountSmsCannedAnswer=function(e,t){o.show({controller:"CreateOrEditSmsCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:c.smsAccount,smsCannedAnswer:t,smsCannedAnswers:c.smsAccountSmsCannedAnswers.rows,license:null,setting:null}})},c.exportSelectedSmsAccountSmsCannedAnswers=function(){var e=angular.copy(c.selectedSmsAccountSmsCannedAnswers);return c.selectedSmsAccountSmsCannedAnswers=[],e},c.deleteSmsAccountSmsCannedAnswer=g,c.deleteSelectedSmsAccountSmsCannedAnswers=function(e){var t=o.confirm().title("Are you sure want to delete the selected smsCannedAnswers?").htmlContent("<b>"+c.selectedSmsAccountSmsCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete smsCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedSmsAccountSmsCannedAnswers.forEach(function(e){g(e)}),c.selectedSmsAccountSmsCannedAnswers=[]})};var m=!0,u=1;function p(e){c.smsAccountSmsCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.smsAccountSmsCannedAnswers.rows,{id:e.id}),c.smsAccountSmsCannedAnswers.count-=1,c.smsAccountSmsCannedAnswers.rows.length||c.getSmsAccountSmsCannedAnswers(),r.success({title:"SmsCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getSmsAccountSmsCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountSmsCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SMS.EDIT_SMSCANNEDANSWER",m.smsCannedAnswer=angular.copy(s),m.smsCannedAnswers=o,m.newSmsCannedAnswer=!1,m.smsCannedAnswer||(m.smsCannedAnswer={},m.title="SMS.NEW_SMSCANNEDANSWER",m.newSmsCannedAnswer=!0),t.params.id&&(m.smsCannedAnswer.SmsAccountId=t.params.id),m.addNewSmsCannedAnswer=function(){m.errors=[],r.cannedAnswer.save(m.smsCannedAnswer).$promise.then(function(e){m.smsCannedAnswers.unshift(e.toJSON()),i.success({title:"SmsCannedAnswer properly created",msg:m.smsCannedAnswer.name?m.smsCannedAnswer.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSmsCannedAnswer=function(){m.errors=[],r.cannedAnswer.update({id:m.smsCannedAnswer.id},m.smsCannedAnswer).$promise.then(function(e){var t=_.find(m.smsCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SmsCannedAnswer properly saved!",msg:m.smsCannedAnswer.name?m.smsCannedAnswer.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSmsCannedAnswer=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The smsCannedAnswer will be deleted.").ariaLabel("Delete SmsCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cannedAnswer.delete({id:m.smsCannedAnswer.id}).$promise.then(function(){_.remove(m.smsCannedAnswers,{id:m.smsCannedAnswer.id}),i.success({title:"SmsCannedAnswer properly deleted!",msg:(m.smsCannedAnswer.name||"smsCannedAnswer")+" has been deleted!"}),u(m.smsCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","smsCannedAnswers","smsCannedAnswer","api","Auth","license","setting"],angular.module("app.sms").controller("CreateOrEditSmsCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.smsAccount={},c.smsAccountSmsDispositions={count:0,rows:[]},c.selectedSmsAccountSmsDispositions=[],c.query={fields:"createdAt,updatedAt,id,name,createdAt",limit:10,page:1},c.init=function(e){c.smsAccount=e,c.query.id=c.smsAccount.id,c.query.SmsAccountId=c.smsAccount.id,c.getSmsAccountSmsDispositions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the smsDisposition?").htmlContent("<b>"+(e.name||"smsDisposition")+"</b> will be deleted.").ariaLabel("delete smsDisposition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getSmsAccountSmsDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.smsAccount.getDispositions(c.query,p).$promise},c.createOrEditSmsAccountSmsDisposition=function(e,t){o.show({controller:"CreateOrEditSmsDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/smsDispositions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:c.smsAccount,smsDisposition:t,smsDispositions:c.smsAccountSmsDispositions.rows,license:null,setting:null}})},c.exportSelectedSmsAccountSmsDispositions=function(){var e=angular.copy(c.selectedSmsAccountSmsDispositions);return c.selectedSmsAccountSmsDispositions=[],e},c.deleteSmsAccountSmsDisposition=g,c.deleteSelectedSmsAccountSmsDispositions=function(e){var t=o.confirm().title("Are you sure want to delete the selected smsDispositions?").htmlContent("<b>"+c.selectedSmsAccountSmsDispositions.length+" selected</b> will be deleted.").ariaLabel("delete smsDispositions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedSmsAccountSmsDispositions.forEach(function(e){g(e)}),c.selectedSmsAccountSmsDispositions=[]})};var m=!0,u=1;function p(e){c.smsAccountSmsDispositions=e||{count:0,rows:[]}}function g(e){l.smsDisposition.delete({id:e.id}).$promise.then(function(){_.remove(c.smsAccountSmsDispositions.rows,{id:e.id}),c.smsAccountSmsDispositions.count-=1,c.smsAccountSmsDispositions.rows.length||c.getSmsAccountSmsDispositions(),r.success({title:"SmsDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getSmsAccountSmsDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountSmsDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SMS.EDIT_SMSDISPOSITION",m.smsDisposition=angular.copy(s),m.smsDispositions=o,m.newSmsDisposition=!1,m.smsDisposition||(m.smsDisposition={},m.title="SMS.NEW_SMSDISPOSITION",m.newSmsDisposition=!0),t.params.id&&(m.smsDisposition.SmsAccountId=t.params.id),m.addNewSmsDisposition=function(){m.errors=[],r.smsDisposition.save(m.smsDisposition).$promise.then(function(e){m.smsDispositions.unshift(e.toJSON()),i.success({title:"SmsDisposition properly created",msg:m.smsDisposition.name?m.smsDisposition.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsDisposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsDisposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSmsDisposition=function(){m.errors=[],r.smsDisposition.update({id:m.smsDisposition.id},m.smsDisposition).$promise.then(function(e){var t=_.find(m.smsDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SmsDisposition properly saved!",msg:m.smsDisposition.name?m.smsDisposition.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsDisposition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsDisposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSmsDisposition=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The smsDisposition will be deleted.").ariaLabel("Delete SmsDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.smsDisposition.delete({id:m.smsDisposition.id}).$promise.then(function(){_.remove(m.smsDispositions,{id:m.smsDisposition.id}),i.success({title:"SmsDisposition properly deleted!",msg:(m.smsDisposition.name||"smsDisposition")+" has been deleted!"}),u(m.smsDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsDisposition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsDisposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","smsDispositions","smsDisposition","api","Auth","license","setting"],angular.module("app.sms").controller("CreateOrEditSmsDispositionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.smsAccount=d||e.params.smsAccount||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoSmsAccounts=function(){e.go("app.sms.smsAccounts")},c.saveSmsAccount=function(){s.smsAccount.update({id:c.smsAccount.id},c.smsAccount).$promise.then(function(){r.success({title:"SmsAccount updated!",msg:c.smsAccount.name?c.smsAccount.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.lists=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","smsAccount"],angular.module("app.sms").controller("SmsAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.smsAccounts=r||{count:0,rows:[]},v.table="smsAccounts",v.listOrder="",v.listOrderAsc=null,v.selectedSmsAccounts=[],v.query={fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,smsMethod,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,page:1},v.arraytype=_.keyBy([{option:"Twilio",value:"'twilio'"},{option:"Skebby",value:"'skebby'"},{option:"Connectel",value:"'connectel'"},{option:"ClickSend",value:"'clicksend'"},{option:"Plivo",value:"'plivo'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysmsMethod=_.keyBy([{option:"Basic",value:"'basic'"},{option:"Classic",value:"'classic'"},{option:"Classic+",value:"'classic+'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.sms.smsAccounts.edit",{id:e.id,smsAccount:e})},v.interactionsgoto=function(e,t){n.go("app.sms.smsAccounts.edit",{id:e.id,tab:5})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the smsAccount?").htmlContent("<b>"+(e.name||"smsAccount")+"</b> will be deleted.").ariaLabel("delete smsAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getSmsAccounts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.smsAccount.get(v.query,f).$promise},v.createOrEditSmsAccount=function(e,t){i.show({controller:"CreateOrEditSmsAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:t,smsAccounts:v.smsAccounts.rows,license:v.license,setting:v.setting}})},v.deleteSmsAccount=A,v.exportSelectedSmsAccounts=function(){var e=angular.copy(v.selectedSmsAccounts);return v.selectedSmsAccounts=[],e},v.deleteSelectedSmsAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected smsAccounts?").htmlContent("<b>"+v.selectedSmsAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SmsAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedSmsAccounts.forEach(function(e){A(e)}),v.selectedSmsAccounts=[]})},v.deselectSmsAccounts=function(){v.selectedSmsAccounts=[]},v.selectAllSmsAccounts=function(){v.selectedSmsAccounts=v.smsAccounts.rows},l.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.lists=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.smsAccounts=e||{count:0,rows:[]}}function A(e){l.smsAccount.delete({id:e.id}).$promise.then(function(){_.remove(v.smsAccounts.rows,{id:e.id}),v.smsAccounts.count-=1,v.smsAccounts.rows.length||v.getSmsAccounts(),c.success({title:"SmsAccount deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getSmsAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","smsAccounts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.sms").controller("SmsAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="SMS.EDIT_SMSQUEUE",m.smsQueue=angular.copy(s),m.smsQueues=o,m.newSmsQueue=!1,m.smsQueue||(m.smsQueue={strategy:"beepall",timeout:10},m.title="SMS.NEW_SMSQUEUE",m.newSmsQueue=!0),m.addNewSmsQueue=function(){m.errors=[],r.smsQueue.save(m.smsQueue).$promise.then(function(e){m.smsQueues.unshift(e.toJSON()),i.success({title:"SmsQueue properly created",msg:m.smsQueue.name?m.smsQueue.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSmsQueue=function(){m.errors=[],r.smsQueue.update({id:m.smsQueue.id},m.smsQueue).$promise.then(function(e){var t=_.find(m.smsQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"SmsQueue properly saved!",msg:m.smsQueue.name?m.smsQueue.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSmsQueue=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The smsQueue will be deleted.").ariaLabel("Delete SmsQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.smsQueue.delete({id:m.smsQueue.id}).$promise.then(function(){_.remove(m.smsQueues,{id:m.smsQueue.id}),i.success({title:"SmsQueue properly deleted!",msg:(m.smsQueue.name||"smsQueue")+" has been deleted!"}),u(m.smsQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","smsQueues","smsQueue","api","Auth","license","setting"],angular.module("app.sms").controller("CreateOrEditSmsQueueDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.smsQueue[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.smsQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserSmsQueue?"penalty "+e.UserSmsQueue.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserSmsQueue?"penalty "+e.UserSmsQueue.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.smsQueue=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("SMS.ALL_AGENTS"),labelSelected:s.instant("SMS.SELECTED_AGENTS"),transferCallback:function(e,t){a.smsQueue[t?"removeAgents":"addAgents"]({id:l.smsQueue.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"SmsQueue properly "+(t?"removed":"added"),msg:"SmsQueue has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:smsQueue.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","smsQueue","smsQueues","realtime","$translate","Auth"],angular.module("app.sms").controller("SmsQueueagentaddController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.smsQueue=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("SMS.ALL_TEAMS"),labelSelected:i.instant("SMS.SELECTED_TEAMS"),transferCallback:function(e,t){a.smsQueue[t?"removeTeams":"addTeams"]({id:o.smsQueue.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:smsQueue.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.smsQueue.getTeams({id:o.smsQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","smsQueue","$translate"],angular.module("app.sms").controller("SmsQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.smsQueue=d||e.params.smsQueue||{},c.selectedTab=e.params.tab||0,c.teamadddialog=function(e,t){n.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:c.smsQueues?c.smsQueues.rows:[]}})},c.agentadddialog=function(e,t){n.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:c.smsQueues?c.smsQueues.rows:[],realtime:!1}})},c.alert=r.info,c.gotoSmsQueues=function(){e.go("app.sms.smsQueues")},c.saveSmsQueue=function(){s.smsQueue.update({id:c.smsQueue.id},c.smsQueue).$promise.then(function(){r.success({title:"SmsQueue updated!",msg:c.smsQueue.name?c.smsQueue.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","smsQueue"],angular.module("app.sms").controller("SmsQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.smsQueues=r||{count:0,rows:[]},v.table="smsQueues",v.listOrder="",v.listOrderAsc=null,v.selectedSmsQueues=[],v.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",limit:10,page:1},v.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.sms.smsQueues.edit",{id:e.id,smsQueue:e})},v.teamadddialog=function(e,t){i.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:v.smsQueues?v.smsQueues.rows:[]}})},v.agentadddialog=function(e,t){i.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:v.smsQueues?v.smsQueues.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the smsQueue?").htmlContent("<b>"+(e.name||"smsQueue")+"</b> will be deleted.").ariaLabel("delete smsQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.sms.realtime.queues",{})},v.success=f,v.getSmsQueues=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.smsQueue.get(v.query,f).$promise},v.createOrEditSmsQueue=function(e,t){i.show({controller:"CreateOrEditSmsQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:t,smsQueues:v.smsQueues.rows,license:v.license,setting:v.setting}})},v.deleteSmsQueue=A,v.exportSelectedSmsQueues=function(){var e=angular.copy(v.selectedSmsQueues);return v.selectedSmsQueues=[],e},v.deleteSelectedSmsQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected smsQueues?").htmlContent("<b>"+v.selectedSmsQueues.length+" selected</b> will be deleted.").ariaLabel("delete SmsQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedSmsQueues.forEach(function(e){A(e)}),v.selectedSmsQueues=[]})},v.deselectSmsQueues=function(){v.selectedSmsQueues=[]},v.selectAllSmsQueues=function(){v.selectedSmsQueues=v.smsQueues.rows};var h=!0,b=1;function f(e){v.smsQueues=e||{count:0,rows:[]}}function A(e){l.smsQueue.delete({id:e.id}).$promise.then(function(){_.remove(v.smsQueues.rows,{id:e.id}),v.smsQueues.count-=1,v.smsQueues.rows.length||v.getSmsQueues(),c.success({title:"SmsQueue deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsQueue"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getSmsQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","smsQueues","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.sms").controller("SmsQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.agents=r||{count:0,rows:[]},v.table="agents",v.listOrder="",v.listOrderAsc=null,v.selectedAgents=[],v.query={fields:"createdAt,updatedAt,id,role,fullname,name,alias,email,phone,mobile,userpic,password,showWebBar,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,voicemail,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,passwordResetAt,passwordResetAt",role:"agent",sort:"-updatedAt",limit:10,page:1},v.arrayshowWebBar=_.keyBy([{option:"Phonebar",value:"0"},{option:"External",value:"1"},{option:"WebRTC (rc-1)",value:"2"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'",ngIf:"vm.agent.showWebBar == 1"},{option:"wss",value:"'wss'",ngIf:"vm.agent.showWebBar == 1"},{option:"tls",value:"'tls'",ngIf:"vm.agent.showWebBar == 1"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytype=_.keyBy([{option:"Friend",value:"'friend'"},{option:"User",value:"'user'"},{option:"Peer",value:"'peer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayextensionMonitor=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'WAV'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.staff.agents.edit",{id:e.id,agent:e})},v.teamadddialog=function(e,t){i.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:v.agents?v.agents.rows:[]}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the agent?").htmlContent("<b>"+(e.name||"agent")+"</b> will be deleted.").ariaLabel("delete agent").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getAgents=function(){v.query.offset=(v.query.page-1)*v.query.limit,m.hasRole("admin")?v.promise=l.user.get(v.query,f).$promise:(v.query.id=v.currentUser.id,v.promise=l.user.getAgents(v.query,f).$promise)},v.createOrEditAgent=function(e,t){i.show({controller:"CreateOrEditAgentDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{agent:t,agents:v.agents.rows,license:v.license,setting:v.setting}})},v.deleteAgent=A,v.exportSelectedAgents=function(){var e=angular.copy(v.selectedAgents);return v.selectedAgents=[],e},v.deleteSelectedAgents=function(e){var t=i.confirm().title("Are you sure want to delete the selected agents?").htmlContent("<b>"+v.selectedAgents.length+" selected</b> will be deleted.").ariaLabel("delete Agents").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedAgents.forEach(function(e){A(e)}),v.selectedAgents=[]})},v.deselectAgents=function(){v.selectedAgents=[]},v.selectAllAgents=function(){v.selectedAgents=v.agents.rows};var h=!0,b=1;function f(e){v.agents=e||{count:0,rows:[]}}function A(e){l.user.delete({id:e.id}).$promise.then(function(){_.remove(v.agents.rows,{id:e.id}),v.agents.count-=1,v.agents.rows.length||v.getAgents(),c.success({title:"Agent deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getAgents())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","agents","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("AgentsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="STAFF.EDIT_AGENT",m.agent=angular.copy(s),m.agents=o,m.newAgent=!1,m.agent||(m.agent={role:"agent",showWebBar:"0",autointernal:!0,type:"friend",context:"from-sip",phoneBarRemoteControl:!0,phoneBarRemoteControlPort:9888,allowmessenger:!0},m.title="STAFF.NEW_AGENT",m.newAgent=!0),m.addNewAgent=function(){m.errors=[],r.user.save(m.agent).$promise.then(function(e){m.agents.unshift(e.toJSON()),i.success({title:"Agent properly created",msg:m.agent.name?m.agent.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveAgent=function(){m.errors=[],r.user.update({id:m.agent.id},m.agent).$promise.then(function(e){var t=_.find(m.agents,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Agent properly saved!",msg:m.agent.name?m.agent.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteAgent=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The agent will be deleted.").ariaLabel("Delete Agent").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.user.delete({id:m.agent.id}).$promise.then(function(){_.remove(m.agents,{id:m.agent.id}),i.success({title:"Agent properly deleted!",msg:(m.agent.name||"agent")+" has been deleted!"}),u(m.agent)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","agents","agent","api","Auth","license","setting"],angular.module("app.staff").controller("CreateOrEditAgentDialogController",e)}(),function(){"use strict";function e(e,a){var i=this;i.agent={},i.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size for image files is 8 Mb"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.agent.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.agent.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.agent=angular.copy(e),i.ngFlowOptions.target="api/users/"+i.agent.id+"/avatar",i.agent.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Agentchange_avatarController",e)}(),function(){"use strict";function e(e,t,n,a,i){var o=this;function s(){e.hide()}o.errors=[],o.setting=i,o.passwordPattern=o.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",o.agent=a,o.password="",o.savePassword=function(){o.errors=[],n.user.changePassword({id:o.agent.id,newPassword:o.password}).$promise.then(function(){t.success({title:"Agent password properly updated!"}),s()}).catch(function(e){console.error(e),o.errors=e.data.errors||[{message:e.toString(),type:"api.agent.changePassword"}]})},o.closeDialog=s}e.$inject=["$mdDialog","toasty","api","agent","setting"],angular.module("app.staff").controller("AgentchangepasswordController",e)}(),function(){"use strict";function e(i,e,t,o){var s=this;s.agent={},s.navigation=t.getNavigation(),s.init=function(e){s.agent=e},s.onChange=function(t,n){if((n||t).enabled){if(n)n.enabled=!0,s.agent.permissions.push(n.id);else for(var e=0;e<t.children.length;e++)t.children[e].enabled=!0,s.agent.permissions.push(t.children[e].id);t.enabled=!0,s.agent.permissions.push(t.id)}else if(n)n.enabled=!1,_.remove(s.agent.permissions,function(e){return n.id===e}),_.filter(t.children,{enabled:!1}).length===t.children.length&&(t.enabled=!1,_.remove(s.agent.permissions,function(e){return t.id===e}));else{t.enabled=!1,_.remove(s.agent.permissions,function(e){return t.id===e});for(var a=0;a<t.children.length;a++)t.children[a].enabled=!1,_.remove(s.agent.permissions,function(e){return t.children[a].id===e})}return i.user.update({id:s.agent.id,permissions:_.uniq(s.agent.permissions)}).$promise.then(function(){o.success({title:"agent updated!",msg:s.agent.name?s.agent.name+" has been updated!":""})}).catch(function(e){console.error(e)})}}e.$inject=["api","msNavigationService","msNavigationAgentService","toasty"],angular.module("app.staff").controller("AgentPermissionsController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l){var d=this;function c(){a.user[d.isVoiceRealtime()?"getVoiceQueuesRt":"getQueues"]({id:d.agent.id,fields:d.isVoiceRealtime()?"VoiceQueueId,queue_name,penalty":"id,name,strategy,type",channel:i,nolimit:!0}).$promise.then(function(e){return d.isVoiceRealtime()?d.selectedItems=e.rows?_.map(e.rows,function(e){return{id:e.VoiceQueueId,name:e.queue_name,penalty:e.hasOwnProperty("penalty")?"penalty "+e.penalty:"penalty 0",strategy:""}}):[]:d.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",e}):[],l.hasRole("admin")?a[d.apiname].get({fields:"id,name,strategy,type",nolimit:!0,type:s}).$promise:a.user.getQueues({id:l.getCurrentUser().id,fields:"id,name,strategy,type",nolimit:!0,type:s,channel:i}).$promise}).then(function(e){d.items=e.rows?e.rows:[],d.selectedItems=_.intersectionBy(d.selectedItems,d.items,"id"),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.items,d.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETQUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})})}d.agent=t,d.penalty=0,d.apiname=i+"Queue",d.title=r.instant("STAFF.QUEUEADD_AGENT_"+i.toUpperCase()+"_"+s.toUpperCase()),d.items=[],d.selectedItems=[],d.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"name",line2:"type",line3:"agent"===d.agent.role?"penalty":"",labelAll:r.instant("STAFF.ALL_QUEUES_"+i.toUpperCase()+"_"+s.toUpperCase()),labelSelected:r.instant("STAFF.SELECTED_QUEUES_"+i.toUpperCase()+"_"+s.toUpperCase()),transferCallback:function(e,t){a.user[t?"removeQueues":"addQueues"]({id:d.agent.id,ids:_.map(e,"id"),channel:i,penalty:d.penalty||0,realtime:o}).$promise.then(function(){c(),n.success({title:"Queue properly "+(t?"removed":"added"),msg:"Queue has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USER.ADDQUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d.closeDialog=function(){e.hide()},d.isVoiceRealtime=function(){return o&&"voice"===i},d.isVoiceChannel=function(){return"voice"===i},c()}e.$inject=["$mdDialog","toasty","api","agent","channel","realtime","direction","$translate","Auth"],angular.module("app.staff").controller("AgentqueueaddController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.agent=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("STAFF.ALL_TEAMS"),labelSelected:i.instant("STAFF.SELECTED_TEAMS"),transferCallback:function(e,t){a.user[t?"removeTeams":"addTeams"]({id:o.agent.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:agent.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.user.getTeams({id:o.agent.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","agent","$translate"],angular.module("app.staff").controller("AgentteamaddController",e)}(),function(){"use strict";function e(e,t,i,o,n,a,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=n,c.setting=a,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.agent=d||e.params.agent||{},c.selectedTab=e.params.tab||0,c.queueaddchannel=function(e,t,n,a){i.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(o.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,agents:c.agents?c.agents.rows:[],channel:t,realtime:!1,direction:a||"inbound"}})},c.teamadddialog=function(e,t){i.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:c.agents?c.agents.rows:[]}})},c.changepassworddialog=function(e,t){i.show({controller:"AgentchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,setting:a,agents:c.agents?c.agents.rows:[]}})},c.alert=r.info,c.gotoAgents=function(){e.go("app.staff.agents")},c.saveAgent=function(){c.agent=_.omit(c.agent,"userpic"),s.user.update({id:c.agent.id},c.agent).$promise.then(function(){r.success({title:"Agent updated!",msg:c.agent.name?c.agent.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","agent"],angular.module("app.staff").controller("AgentController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="STAFF.EDIT_TEAM",m.team=angular.copy(s),m.teams=o,m.newTeam=!1,m.team||(m.team={},m.title="STAFF.NEW_TEAM",m.newTeam=!0),m.addNewTeam=function(){m.errors=[],r.team.save(m.team).$promise.then(function(e){m.teams.unshift(e.toJSON()),i.success({title:"Team properly created",msg:m.team.name?m.team.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.team.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveTeam=function(){m.errors=[],r.team.update({id:m.team.id},m.team).$promise.then(function(e){var t=_.find(m.teams,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Team properly saved!",msg:m.team.name?m.team.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.team.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteTeam=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The team will be deleted.").ariaLabel("Delete Team").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.team.delete({id:m.team.id}).$promise.then(function(){_.remove(m.teams,{id:m.team.id}),i.success({title:"Team properly deleted!",msg:(m.team.name||"team")+" has been deleted!"}),u(m.team)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.team.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","teams","team","api","Auth","license","setting"],angular.module("app.staff").controller("CreateOrEditTeamDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.team[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.team.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserTeam?"penalty "+e.UserTeam.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserTeam?"penalty "+e.UserTeam.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.team=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("STAFF.ALL_AGENTS"),labelSelected:s.instant("STAFF.SELECTED_AGENTS"),transferCallback:function(e,t){a.team[t?"removeAgents":"addAgents"]({id:l.team.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:team.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","team","teams","realtime","$translate","Auth"],angular.module("app.staff").controller("TeamagentaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.teams=r||{count:0,rows:[]},v.table="teams",v.listOrder="",v.listOrderAsc=null,v.selectedTeams=[],v.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{team:e,teams:v.teams.rows,license:v.license,setting:null}})},v.agentadddialog=function(e,t){i.show({controller:"TeamagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{team:e,teams:v.teams?v.teams.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the team?").htmlContent("<b>"+(e.name||"team")+"</b> will be deleted.").ariaLabel("delete team").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getTeams=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.team.get(v.query,f).$promise},v.createOrEditTeam=function(e,t){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{team:t,teams:v.teams.rows,license:v.license,setting:v.setting}})},v.deleteTeam=A,v.exportSelectedTeams=function(){var e=angular.copy(v.selectedTeams);return v.selectedTeams=[],e},v.deleteSelectedTeams=function(e){var t=i.confirm().title("Are you sure want to delete the selected teams?").htmlContent("<b>"+v.selectedTeams.length+" selected</b> will be deleted.").ariaLabel("delete Teams").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedTeams.forEach(function(e){A(e)}),v.selectedTeams=[]})},v.deselectTeams=function(){v.selectedTeams=[]},v.selectAllTeams=function(){v.selectedTeams=v.teams.rows};var h=!0,b=1;function f(e){v.teams=e||{count:0,rows:[]}}function A(e){l.team.delete({id:e.id}).$promise.then(function(){_.remove(v.teams.rows,{id:e.id}),v.teams.count-=1,v.teams.rows.length||v.getTeams(),c.success({title:"Team deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEteam"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEteam",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getTeams())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","teams","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("TeamsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="STAFF.EDIT_TELEPHONE",m.telephone=angular.copy(s),m.telephones=o,m.newTelephone=!1,m.telephone||(m.telephone={role:"telephone",autointernal:!0,context:"from-sip"},m.title="STAFF.NEW_TELEPHONE",m.newTelephone=!0),m.addNewTelephone=function(){m.errors=[],r.user.save(m.telephone).$promise.then(function(e){m.telephones.unshift(e.toJSON()),i.success({title:"Telephone properly created",msg:m.telephone.name?m.telephone.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveTelephone=function(){m.errors=[],r.user.update({id:m.telephone.id},m.telephone).$promise.then(function(e){var t=_.find(m.telephones,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Telephone properly saved!",msg:m.telephone.name?m.telephone.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteTelephone=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The telephone will be deleted.").ariaLabel("Delete Telephone").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.user.delete({id:m.telephone.id}).$promise.then(function(){_.remove(m.telephones,{id:m.telephone.id}),i.success({title:"Telephone properly deleted!",msg:(m.telephone.name||"telephone")+" has been deleted!"}),u(m.telephone)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","telephones","telephone","api","Auth","license","setting"],angular.module("app.staff").controller("CreateOrEditTelephoneDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i){var o=this;function s(){e.hide()}o.errors=[],o.setting=i,o.passwordPattern=o.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",o.telephone=a,o.password="",o.savePassword=function(){o.errors=[],n.user.changePassword({id:o.telephone.id,newPassword:o.password}).$promise.then(function(){t.success({title:"Telephone password properly updated!"}),s()}).catch(function(e){console.error(e),o.errors=e.data.errors||[{message:e.toString(),type:"api.telephone.changePassword"}]})},o.closeDialog=s}e.$inject=["$mdDialog","toasty","api","telephone","setting"],angular.module("app.staff").controller("TelephonechangepasswordController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.telephone=d||e.params.telephone||{},c.selectedTab=e.params.tab||0,c.changepassworddialog=function(e,t){n.show({controller:"TelephonechangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{telephone:e,setting:o,telephones:c.telephones?c.telephones.rows:[]}})},c.alert=r.info,c.gotoTelephones=function(){e.go("app.staff.telephones")},c.saveTelephone=function(){s.user.update({id:c.telephone.id},c.telephone).$promise.then(function(){r.success({title:"Telephone updated!",msg:c.telephone.name?c.telephone.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","telephone"],angular.module("app.staff").controller("TelephoneController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.telephones=r||{count:0,rows:[]},v.table="telephones",v.listOrder="",v.listOrderAsc=null,v.selectedTelephones=[],v.query={fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,page:1},v.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.staff.telephones.edit",{id:e.id,telephone:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the telephone?").htmlContent("<b>"+(e.name||"telephone")+"</b> will be deleted.").ariaLabel("delete telephone").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getTelephones=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.user.get(v.query,f).$promise},v.createOrEditTelephone=function(e,t){i.show({controller:"CreateOrEditTelephoneDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{telephone:t,telephones:v.telephones.rows,license:v.license,setting:v.setting}})},v.deleteTelephone=A,v.exportSelectedTelephones=function(){var e=angular.copy(v.selectedTelephones);return v.selectedTelephones=[],e},v.deleteSelectedTelephones=function(e){var t=i.confirm().title("Are you sure want to delete the selected telephones?").htmlContent("<b>"+v.selectedTelephones.length+" selected</b> will be deleted.").ariaLabel("delete Telephones").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedTelephones.forEach(function(e){A(e)}),v.selectedTelephones=[]})},v.deselectTelephones=function(){v.selectedTelephones=[]},v.selectAllTelephones=function(){v.selectedTelephones=v.telephones.rows};var h=!0,b=1;function f(e){v.telephones=e||{count:0,rows:[]}}function A(e){l.user.delete({id:e.id}).$promise.then(function(){_.remove(v.telephones.rows,{id:e.id}),v.telephones.count-=1,v.telephones.rows.length||v.getTelephones(),c.success({title:"Telephone deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getTelephones())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","telephones","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("TelephonesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="STAFF.EDIT_USER",m.user=angular.copy(s),m.users=o,m.newUser=!1,m.user||(m.user={role:"user",autointernal:!0,context:"from-sip",crudPermissions:"0"},m.title="STAFF.NEW_USER",m.newUser=!0),m.addNewUser=function(){m.errors=[],r.user.save(m.user).$promise.then(function(e){m.users.unshift(e.toJSON()),i.success({title:"User properly created",msg:m.user.name?m.user.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveUser=function(){m.errors=[],r.user.update({id:m.user.id},m.user).$promise.then(function(e){var t=_.find(m.users,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"User properly saved!",msg:m.user.name?m.user.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteUser=function(e){if(l.getCurrentUser().id===m.user.id)return i.error({title:"User not deleted!",msg:"You can't remove yourself"});m.errors=[];var t=a.confirm().title("Are you sure?").content("The user will be deleted.").ariaLabel("Delete User").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.user.delete({id:m.user.id}).$promise.then(function(){_.remove(m.users,{id:m.user.id}),i.success({title:"User properly deleted!",msg:(m.user.name||"user")+" has been deleted!"}),u(m.user)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","users","user","api","Auth","license","setting"],angular.module("app.staff").controller("CreateOrEditUserDialogController",e)}(),function(){"use strict";function e(e,a){var i=this;i.user={},i.ngFlowOptions={maxChunkRetries:1,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size for image files is 8 Mb"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.user.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.user.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.user=angular.copy(e),i.ngFlowOptions.target="api/users/"+i.user.id+"/avatar",i.user.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Userchange_avatarController",e)}(),function(){"use strict";function e(e,t,n,a,i){var o=this;function s(){e.hide()}o.errors=[],o.setting=i,o.passwordPattern=o.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",o.user=a,o.password="",o.savePassword=function(){o.errors=[],n.user.changePassword({id:o.user.id,newPassword:o.password}).$promise.then(function(){t.success({title:"User password properly updated!"}),s()}).catch(function(e){console.error(e),o.errors=e.data.errors||[{message:e.toString(),type:"api.user.changePassword"}]})},o.closeDialog=s}e.$inject=["$mdDialog","toasty","api","user","setting"],angular.module("app.staff").controller("UserchangepasswordController",e)}(),function(){"use strict";function e(i,e,t,o){var s=this;s.user={},s.navigation=e.getNavigation(),s.init=function(e){s.user=e},s.onChange=function(t,n){if((n||t).enabled){if(n)n.enabled=!0,s.user.permissions.push(n.id);else for(var e=0;e<t.children.length;e++)t.children[e].enabled=!0,s.user.permissions.push(t.children[e].id);t.enabled=!0,s.user.permissions.push(t.id)}else if(n)n.enabled=!1,_.remove(s.user.permissions,function(e){return n.id===e}),_.filter(t.children,{enabled:!1}).length===t.children.length&&(t.enabled=!1,_.remove(s.user.permissions,function(e){return t.id===e}));else{t.enabled=!1,_.remove(s.user.permissions,function(e){return t.id===e});for(var a=0;a<t.children.length;a++)t.children[a].enabled=!1,_.remove(s.user.permissions,function(e){return t.children[a].id===e})}return i.user.update({id:s.user.id,permissions:_.uniq(s.user.permissions)}).$promise.then(function(){o.success({title:"user updated!",msg:s.user.name?s.user.name+" has been updated!":""})}).catch(function(e){console.error(e)})}}e.$inject=["api","msNavigationService","msNavigationAgentService","toasty"],angular.module("app.staff").controller("UserPermissionsController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l){var d=this;function c(){a.user[d.isVoiceRealtime()?"getVoiceQueuesRt":"getQueues"]({id:d.user.id,fields:d.isVoiceRealtime()?"VoiceQueueId,queue_name,penalty":"id,name,strategy,type",channel:i,nolimit:!0}).$promise.then(function(e){return d.isVoiceRealtime()?d.selectedItems=e.rows?_.map(e.rows,function(e){return{id:e.VoiceQueueId,name:e.queue_name,penalty:e.hasOwnProperty("penalty")?"penalty "+e.penalty:"penalty 0",strategy:""}}):[]:d.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",e}):[],l.hasRole("admin")?a[d.apiname].get({fields:"id,name,strategy,type",nolimit:!0,type:s}).$promise:a.user.getQueues({id:l.getCurrentUser().id,fields:"id,name,strategy,type",nolimit:!0,type:s,channel:i}).$promise}).then(function(e){d.items=e.rows?e.rows:[],d.selectedItems=_.intersectionBy(d.selectedItems,d.items,"id"),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.items,d.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETQUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})})}d.user=t,d.penalty=0,d.apiname=i+"Queue",d.title=r.instant("STAFF.QUEUEADD_USER_"+i.toUpperCase()+"_"+s.toUpperCase()),d.items=[],d.selectedItems=[],d.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"name",line2:"type",line3:"agent"===d.user.role?"penalty":"",labelAll:r.instant("STAFF.ALL_QUEUES_"+i.toUpperCase()+"_"+s.toUpperCase()),labelSelected:r.instant("STAFF.SELECTED_QUEUES_"+i.toUpperCase()+"_"+s.toUpperCase()),transferCallback:function(e,t){a.user[t?"removeQueues":"addQueues"]({id:d.user.id,ids:_.map(e,"id"),channel:i,penalty:d.penalty||0,realtime:o}).$promise.then(function(){c(),n.success({title:"Queue properly "+(t?"removed":"added"),msg:"Queue has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USER.ADDQUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d.closeDialog=function(){e.hide()},d.isVoiceRealtime=function(){return o&&"voice"===i},d.isVoiceChannel=function(){return"voice"===i},c()}e.$inject=["$mdDialog","toasty","api","user","channel","realtime","direction","$translate","Auth"],angular.module("app.staff").controller("UserqueueaddController",e)}(),function(){"use strict";function e(e,t,i,o,n,a,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=n,c.setting=a,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.user=d||e.params.user||{},c.selectedTab=e.params.tab||0,c.queueaddchannel=function(e,t,n,a){i.show({controller:"UserqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/queueadd/queueadd.html",parent:angular.element(o.body),targetEvent:n,clickOutsideToClose:!0,locals:{user:e,users:c.users?c.users.rows:[],channel:t,realtime:!1,direction:a||"inbound"}})},c.changepassworddialog=function(e,t){i.show({controller:"UserchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/changepassword/changepassword.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{user:e,setting:a,users:c.users?c.users.rows:[]}})},c.alert=r.info,c.gotoUsers=function(){e.go("app.staff.users")},c.saveUser=function(){c.user=_.omit(c.user,"userpic"),s.user.update({id:c.user.id},c.user).$promise.then(function(){r.success({title:"User updated!",msg:c.user.name?c.user.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","user"],angular.module("app.staff").controller("UserController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.users=r||{count:0,rows:[]},v.table="users",v.listOrder="",v.listOrderAsc=null,v.selectedUsers=[],v.query={fields:"createdAt,updatedAt,role,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,permissions,crudPermissions,passwordResetAt,passwordResetAt",role:"admin,user",sort:"-updatedAt",limit:10,page:1},v.arrayrole=_.keyBy([{option:"Admin",value:"'admin'"},{option:"User",value:"'user'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraycrudPermissions=_.keyBy([{option:"readAndEditAndDelete",value:"0"},{option:"readAndEdit",value:"1"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.staff.users.edit",{id:e.id,user:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the user?").htmlContent("<b>"+(e.name||"user")+"</b> will be deleted.").ariaLabel("delete user").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getUsers=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.user.get(v.query,f).$promise},v.createOrEditUser=function(e,t){i.show({controller:"CreateOrEditUserDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{user:t,users:v.users.rows,license:v.license,setting:v.setting}})},v.deleteUser=A,v.exportSelectedUsers=function(){var e=angular.copy(v.selectedUsers);return v.selectedUsers=[],e},v.deleteSelectedUsers=function(e){var t=i.confirm().title("Are you sure want to delete the selected users?").htmlContent("<b>"+v.selectedUsers.length+" selected</b> will be deleted.").ariaLabel("delete Users").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedUsers.forEach(function(e){A(e)}),v.selectedUsers=[]})},v.deselectUsers=function(){v.selectedUsers=[]},v.selectAllUsers=function(){v.selectedUsers=v.users.rows};var h=!0,b=1;function f(e){v.users=e||{count:0,rows:[]}}function A(e){l.user.delete({id:e.id}).$promise.then(function(){_.remove(v.users.rows,{id:e.id}),v.users.count-=1,v.users.rows.length||v.getUsers(),c.success({title:"User deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getUsers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","users","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("UsersController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.cannedAnswers=r||{count:0,rows:[]},v.table="cannedAnswers",v.listOrder="",v.listOrderAsc=null,v.selectedCannedAnswers=[],v.query={fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{cannedAnswer:e,cannedAnswers:v.cannedAnswers.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the cannedAnswer?").htmlContent("<b>"+(e.name||"cannedAnswer")+"</b> will be deleted.").ariaLabel("delete cannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getCannedAnswers=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.cannedAnswer.get(v.query,f).$promise},v.createOrEditCannedAnswer=function(e,t){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{cannedAnswer:t,cannedAnswers:v.cannedAnswers.rows,license:v.license,setting:v.setting}})},v.deleteCannedAnswer=A,v.exportSelectedCannedAnswers=function(){var e=angular.copy(v.selectedCannedAnswers);return v.selectedCannedAnswers=[],e},v.deleteSelectedCannedAnswers=function(e){var t=i.confirm().title("Are you sure want to delete the selected cannedAnswers?").htmlContent("<b>"+v.selectedCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete CannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedCannedAnswers.forEach(function(e){A(e)}),v.selectedCannedAnswers=[]})},v.deselectCannedAnswers=function(){v.selectedCannedAnswers=[]},v.selectAllCannedAnswers=function(){v.selectedCannedAnswers=v.cannedAnswers.rows};var h=!0,b=1;function f(e){v.cannedAnswers=e||{count:0,rows:[]}}function A(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(v.cannedAnswers.rows,{id:e.id}),v.cannedAnswers.count-=1,v.cannedAnswers.rows.length||v.getCannedAnswers(),c.success({title:"CannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcannedAnswer"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcannedAnswer",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getCannedAnswers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","cannedAnswers","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("CannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_CANNEDANSWER",m.cannedAnswer=angular.copy(s),m.cannedAnswers=o,m.newCannedAnswer=!1,m.cannedAnswer||(m.cannedAnswer={},m.title="TOOLS.NEW_CANNEDANSWER",m.newCannedAnswer=!0),m.addNewCannedAnswer=function(){m.errors=[],r.cannedAnswer.save(m.cannedAnswer).$promise.then(function(e){m.cannedAnswers.unshift(e.toJSON()),i.success({title:"CannedAnswer properly created",msg:m.cannedAnswer.name?m.cannedAnswer.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveCannedAnswer=function(){m.errors=[],r.cannedAnswer.update({id:m.cannedAnswer.id},m.cannedAnswer).$promise.then(function(e){var t=_.find(m.cannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"CannedAnswer properly saved!",msg:m.cannedAnswer.name?m.cannedAnswer.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteCannedAnswer=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The cannedAnswer will be deleted.").ariaLabel("Delete CannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.cannedAnswer.delete({id:m.cannedAnswer.id}).$promise.then(function(){_.remove(m.cannedAnswers,{id:m.cannedAnswer.id}),i.success({title:"CannedAnswer properly deleted!",msg:(m.cannedAnswer.name||"cannedAnswer")+" has been deleted!"}),u(m.cannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","cannedAnswers","cannedAnswer","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_CUSTOMDASHBOARD",m.customDashboard=angular.copy(s),m.customDashboards=o,m.newCustomDashboard=!1,m.customDashboard||(m.customDashboard={},m.title="TOOLS.NEW_CUSTOMDASHBOARD",m.newCustomDashboard=!0),m.addNewCustomDashboard=function(){m.errors=[],r.dashboard.save(m.customDashboard).$promise.then(function(e){m.customDashboards.unshift(e.toJSON()),i.success({title:"CustomDashboard properly created",msg:m.customDashboard.name?m.customDashboard.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveCustomDashboard=function(){m.errors=[],r.dashboard.update({id:m.customDashboard.id},m.customDashboard).$promise.then(function(e){var t=_.find(m.customDashboards,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"CustomDashboard properly saved!",msg:m.customDashboard.name?m.customDashboard.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteCustomDashboard=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The customDashboard will be deleted.").ariaLabel("Delete CustomDashboard").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.dashboard.delete({id:m.customDashboard.id}).$promise.then(function(){_.remove(m.customDashboards,{id:m.customDashboard.id}),i.success({title:"CustomDashboard properly deleted!",msg:(m.customDashboard.name||"customDashboard")+" has been deleted!"}),u(m.customDashboard)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","customDashboards","customDashboard","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditCustomDashboardDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.customDashboards=r||{count:0,rows:[]},v.table="customDashboards",v.listOrder="",v.listOrderAsc=null,v.selectedCustomDashboards=[],v.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},v.editstate=function(e,t){n.go("app.tools.customDashboards.edit",{id:e.id,customDashboard:e})},v.useradddialog=function(e,t){i.show({controller:"CustomDashboarduseraddController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/useradd/useradd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:v.customDashboards?v.customDashboards.rows:[]}})},v.clonedialog=function(e,t){i.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:v.customDashboards?v.customDashboards.rows:[]}})},v.gotodashboardgoto=function(e,t){n.go("app.dashboards.custom",{id:e.id})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the customDashboard?").htmlContent("<b>"+(e.name||"customDashboard")+"</b> will be deleted.").ariaLabel("delete customDashboard").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getCustomDashboards=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.dashboard.get(v.query,f).$promise},v.createOrEditCustomDashboard=function(e,t){i.show({controller:"CreateOrEditCustomDashboardDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{customDashboard:t,customDashboards:v.customDashboards.rows,license:v.license,setting:v.setting}})},v.deleteCustomDashboard=A,v.exportSelectedCustomDashboards=function(){var e=angular.copy(v.selectedCustomDashboards);return v.selectedCustomDashboards=[],e},v.deleteSelectedCustomDashboards=function(e){var t=i.confirm().title("Are you sure want to delete the selected customDashboards?").htmlContent("<b>"+v.selectedCustomDashboards.length+" selected</b> will be deleted.").ariaLabel("delete CustomDashboards").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedCustomDashboards.forEach(function(e){A(e)}),v.selectedCustomDashboards=[]})},v.deselectCustomDashboards=function(){v.selectedCustomDashboards=[]},v.selectAllCustomDashboards=function(){v.selectedCustomDashboards=v.customDashboards.rows};var h=!0,b=1;function f(e){v.customDashboards=e||{count:0,rows:[]}}function A(e){l.dashboard.delete({id:e.id}).$promise.then(function(){_.remove(v.customDashboards.rows,{id:e.id}),v.customDashboards.count-=1,v.customDashboards.rows.length||v.getCustomDashboards(),c.success({title:"CustomDashboard deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdashboard"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getCustomDashboards())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","customDashboards","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("CustomDashboardsController",e)}(),function(){"use strict";function e(t,n,a,e,i,o,s){var r=this;function l(e){t.hide(e)}r.newCustomDashboard=!0,r.customDashboard=angular.copy(i),r.customDashboards=o,r.title=s.instant("TOOLS.CLONE_CUSTOMDASHBOARD"),i&&i.name&&(r.title+=": "+i.name),r.cloneCustomDashboard=function(){return e.dashboard.clone({id:i.id,includeAll:!0},r.customDashboard).$promise.then(function(e){r.customDashboards.unshift(e.toJSON()),a.success({title:"CustomDashboard properly cloned",msg:r.customDashboard.name?r.customDashboard.name+" has been cloned!":""}),n.go("app.tools.customDashboards.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.clone"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","customDashboard","customDashboards","$translate"],angular.module("app.tools").controller("CustomDashboardcloneController",e)}(),function(){"use strict";function e(n,a,e,i,o){var s=this;function t(e,t,n){return o.dashboardItem.update(n).$promise.catch(function(e){console.error(e)})}s.customDashboard={},s.voiceQueues=o.rpc.getVoiceQueues({fields:"id,name"}),s.init=function(e){return s.customDashboard=e,s.customDashboard.draggable={enabled:!0,handle:".draggable",stop:t},s.customDashboard.resizable={enabled:!0,handle:".resizable",stop:t},s.customDashboard.widgets=[],o.dashboard.getItems({id:e.id}).$promise.then(function(e){if(e&&e.count&&e.rows)for(var t=0;t<e.rows.length;t+=1)e.rows[t].voiceQueues=s.voiceQueues,e.rows[t].voiceQueuesSelected=_.map(s.voiceQueues.rows,"id"),e.rows[t].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[t].type+"/ms-widget-engine."+e.rows[t].type+".html",s.customDashboard.widgets.push(e.rows[t])}).catch(function(e){console.error(e)})},s.createOrEditWidget=function(e){if(e&&e.attrs)for(var t=0;t<e.attrs.length;t+=1)e[e.attrs[t].name]=e.attrs[t].value;n.show({controller:"CreateOrEditDashboardItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",parent:angular.element(a.body),clickOutsideToClose:!0,locals:{dashboarditem:e,dashboard:s.customDashboard.widgets,license:null,setting:null}}).then(function(e){for(var t=0;t<s.customDashboard.widgets.length;t+=1)s.customDashboard.widgets[t].id===e.id&&(s.customDashboard.widgets[t].attrs=e.attrs,s.customDashboard.widgets[t].voiceQueues=s.voiceQueues,s.customDashboard.widgets[t].voiceQueuesSelected=_.map(s.voiceQueues.rows,"id"),s.customDashboard.widgets[t].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+s.customDashboard.widgets[t].type+"/ms-widget-engine."+s.customDashboard.widgets[t].type+".html")})},s.deleteWidget=function(t){var e=n.confirm().title("Would you like to delete "+t.title+"?").textContent("").ariaLabel("Delete Widget").ok("YES").cancel("NO");n.show(e).then(function(){return o.dashboardItem.delete({id:t.id}).$promise.then(function(e){_.remove(s.customDashboard.widgets,{id:t.id}),i.success({title:"Widget deleted!",msg:t.name?t.name+" has been deleted!":"Widget has been deleted!"})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){s.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE.customDashboard"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()});console.error(e)})})}}e.$inject=["$mdDialog","$document","socket","toasty","api"],angular.module("app.tools").controller("CustomDashboardItemsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_DASHBOARDITEM",m.dashboarditem=angular.copy(s),m.dashboard=o,m.newDashboardItem=!1,m.dashboarditem||(m.dashboarditem={type:"counter",attrUrl:"https://",attrHourFormat:"HH:mm:ss",attrTimezone:"0.00",attrMetric:"total",attrSerie1:"total",attrSerie2:"null",attrSerie3:"null",attrRefresh:10,attrFontSize:20,foreground:"#2196f3",background:"#ffffff"},m.title="TOOLS.NEW_DASHBOARDITEM",m.newDashboardItem=!0),m.addNewDashboardItem=function(){m.errors=[],r.dashboard.addItem({id:t.params.id},m.dashboarditem).$promise.then(function(e){m.dashboard.unshift(e.toJSON()),i.success({title:"DashboardItem properly created",msg:m.dashboarditem.name?m.dashboarditem.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveDashboardItem=function(){m.errors=[],r.dashboardItem.update({id:m.dashboarditem.id},m.dashboarditem).$promise.then(function(e){var t=_.find(m.dashboard,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"DashboardItem properly saved!",msg:m.dashboarditem.name?m.dashboarditem.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteDashboardItem=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The dashboarditem will be deleted.").ariaLabel("Delete DashboardItem").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.dashboardItem.delete({id:m.dashboarditem.id}).$promise.then(function(){_.remove(m.dashboard,{id:m.dashboarditem.id}),i.success({title:"DashboardItem properly deleted!",msg:(m.dashboarditem.name||"dashboarditem")+" has been deleted!"}),u(m.dashboarditem)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.analyticCustomReport.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){m.customReports=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcustomReports",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.voiceQueue.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){m.voiceQueues=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","dashboard","dashboarditem","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditDashboardItemDialogController",e)}(),function(){"use strict";function e(e,i,o,s,t,n,a){var r=this;r.closeDialog=function(){e.hide()},r.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:n.instant("TOOLS.ALL_USERS"),labelSelected:n.instant("TOOLS.SELECTED_USERS"),transferCallback:function(e,t){for(var n=0,a=0;n<e.length;n+=1)a=99999+s.id,e[n].permissions=t?_.without(e[n].permissions,a):_.concat(e[n].permissions,a),o.user.update(e[n]).$promise.then(function(){i.success({title:"User properly "+(t?"removed":"added"),msg:"User has been "+(t?"removed":"added")+"!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:dashboard.ADDUSERS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},function(){if(s&&s.id){var t=99999+s.id;o.user.get({fields:"id,fullname,name,internal,permissions",role:"user",nolimit:!0}).$promise.then(function(e){r.dualMultiselectOptions.selectedItems=_.filter(e.rows,function(e){return _.includes(e.permissions,t)}),r.dualMultiselectOptions.items=_.differenceBy(e.rows,r.dualMultiselectOptions.selectedItems,"id")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}}()}e.$inject=["$mdDialog","toasty","api","customDashboard","customDashboards","$translate","Auth"],angular.module("app.tools").controller("CustomDashboarduseraddController",e)}(),function(){"use strict";function e(n,e,a,i,t,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=t,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.customDashboard=d||n.params.customDashboard||{},c.selectedTab=n.params.tab||0,c.useradddialog=function(e,t){a.show({controller:"CustomDashboarduseraddController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/useradd/useradd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:c.customDashboards?c.customDashboards.rows:[]}})},c.clonedialog=function(e,t){a.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:c.customDashboards?c.customDashboards.rows:[]}})},c.gotogoto=function(e,t){n.go("app.dashboards.custom",{id:e.id})},c.alert=r.info,c.gotoCustomDashboards=function(){n.go("app.tools.customDashboards")},c.saveCustomDashboard=function(){s.dashboard.update({id:c.customDashboard.id},c.customDashboard).$promise.then(function(){r.success({title:"CustomDashboard updated!",msg:c.customDashboard.name?c.customDashboard.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdashboard",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","customDashboard"],angular.module("app.tools").controller("CustomDashboardController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_INTERVAL",m.interval=angular.copy(s),m.intervals=o,m.newInterval=!1,m.interval||(m.interval={},m.title="TOOLS.NEW_INTERVAL",m.newInterval=!0),m.addNewInterval=function(){m.errors=[],r.interval.save(m.interval).$promise.then(function(e){m.intervals.unshift(e.toJSON()),i.success({title:"Interval properly created",msg:m.interval.name?m.interval.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveInterval=function(){m.errors=[],r.interval.update({id:m.interval.id},m.interval).$promise.then(function(e){var t=_.find(m.intervals,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Interval properly saved!",msg:m.interval.name?m.interval.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteInterval=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.interval.delete({id:m.interval.id}).$promise.then(function(){_.remove(m.intervals,{id:m.interval.id}),i.success({title:"Interval properly deleted!",msg:(m.interval.name||"interval")+" has been deleted!"}),u(m.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","intervals","interval","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditAppintervalDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.interval={},c.intervalIntervals={count:0,rows:[]},c.selectedIntervalIntervals=[],c.sortableTable={animation:100,onSort:function(e){l.interval.addIntervals({id:c.interval.id},e.models).$promise.then(function(e){c.intervalIntervals.rows=e}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SORTABLETABLE",msg:e.data?JSON.stringify(e.data):e.toString()})})}},c.query={fields:"createdAt,updatedAt,id,name,interval,createdAt",nolimit:"true",limit:10,page:1},c.init=function(e){c.interval=e,c.query.id=c.interval.id,c.getIntervalIntervals()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the interval?").htmlContent("<b>"+(e.name||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIntervalIntervals=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.interval.getIntervals(c.query,p).$promise},c.createOrEditIntervalInterval=function(e,t){o.show({controller:"EditAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:c.interval,interval:t,intervals:c.intervalIntervals.rows,license:null,setting:null}})},c.exportSelectedIntervalIntervals=function(){var e=angular.copy(c.selectedIntervalIntervals);return c.selectedIntervalIntervals=[],e},c.deleteIntervalInterval=g,c.deleteSelectedIntervalIntervals=function(e){var t=o.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+c.selectedIntervalIntervals.length+" selected</b> will be deleted.").ariaLabel("delete intervals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedIntervalIntervals.forEach(function(e){g(e)}),c.selectedIntervalIntervals=[]})};var m=!0,u=1;function p(e){c.intervalIntervals=e||{count:0,rows:[]}}function g(e){l.interval.delete({id:e.id}).$promise.then(function(){_.remove(c.intervalIntervals.rows,{id:e.id}),c.intervalIntervals.count-=1,c.intervalIntervals.rows.length||c.getIntervalIntervals(),r.success({title:"Interval deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETinterval"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIntervalIntervals())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("IntervalIntervalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_INTERVAL",m.interval=angular.copy(s),m.intervals=o,m.newInterval=!1,m.interval||(m.interval={},m.title="TOOLS.NEW_INTERVAL",m.newInterval=!0),m.addNewInterval=function(){m.errors=[],r.interval.save(m.interval).$promise.then(function(e){m.intervals.unshift(e.toJSON()),i.success({title:"Interval properly created",msg:m.interval.name?m.interval.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveInterval=function(){m.errors=[],r.interval.update({id:m.interval.id},m.interval).$promise.then(function(e){var t=_.find(m.intervals,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Interval properly saved!",msg:m.interval.name?m.interval.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteInterval=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.interval.delete({id:m.interval.id}).$promise.then(function(){_.remove(m.intervals,{id:m.interval.id}),i.success({title:"Interval properly deleted!",msg:(m.interval.name||"interval")+" has been deleted!"}),u(m.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","intervals","interval","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.interval=d||e.params.interval||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoIntervals=function(){e.go("app.tools.intervals")},c.saveInterval=function(){s.interval.update({id:c.interval.id},c.interval).$promise.then(function(){r.success({title:"Interval updated!",msg:c.interval.name?c.interval.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","interval"],angular.module("app.tools").controller("IntervalController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.intervals=r||{count:0,rows:[]},v.table="intervals",v.listOrder="",v.listOrderAsc=null,v.selectedIntervals=[],v.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,page:1},v.editstate=function(e,t){n.go("app.tools.intervals.edit",{id:e.id,interval:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the interval?").htmlContent("<b>"+(e.name||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getIntervals=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.interval.get(v.query,f).$promise},v.createOrEditInterval=function(e,t){i.show({controller:"CreateOrEditIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:t,intervals:v.intervals.rows,license:v.license,setting:v.setting}})},v.deleteInterval=A,v.exportSelectedIntervals=function(){var e=angular.copy(v.selectedIntervals);return v.selectedIntervals=[],e},v.deleteSelectedIntervals=function(e){var t=i.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+v.selectedIntervals.length+" selected</b> will be deleted.").ariaLabel("delete Intervals").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedIntervals.forEach(function(e){A(e)}),v.selectedIntervals=[]})},v.deselectIntervals=function(){v.selectedIntervals=[]},v.selectAllIntervals=function(){v.selectedIntervals=v.intervals.rows};var h=!0,b=1;function f(e){v.intervals=e||{count:0,rows:[]}}function A(e){l.interval.delete({id:e.id}).$promise.then(function(){_.remove(v.intervals.rows,{id:e.id}),v.intervals.count-=1,v.intervals.rows.length||v.getIntervals(),c.success({title:"Interval deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEinterval"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getIntervals())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","intervals","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("IntervalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_PAUSE",m.pause=angular.copy(s),m.pauses=o,m.newPause=!1,m.pause||(m.pause={},m.title="TOOLS.NEW_PAUSE",m.newPause=!0),m.addNewPause=function(){m.errors=[],r.pause.save(m.pause).$promise.then(function(e){m.pauses.unshift(e.toJSON()),i.success({title:"Pause properly created",msg:m.pause.name?m.pause.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.pause.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.savePause=function(){m.errors=[],r.pause.update({id:m.pause.id},m.pause).$promise.then(function(e){var t=_.find(m.pauses,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Pause properly saved!",msg:m.pause.name?m.pause.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.pause.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deletePause=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The pause will be deleted.").ariaLabel("Delete Pause").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.pause.delete({id:m.pause.id}).$promise.then(function(){_.remove(m.pauses,{id:m.pause.id}),i.success({title:"Pause properly deleted!",msg:(m.pause.name||"pause")+" has been deleted!"}),u(m.pause)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.pause.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","pauses","pause","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditPauseDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.pauses=r||{count:0,rows:[]},v.table="pauses",v.listOrder="",v.listOrderAsc=null,v.selectedPauses=[],v.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{pause:e,pauses:v.pauses.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the pause?").htmlContent("<b>"+(e.name||"pause")+"</b> will be deleted.").ariaLabel("delete pause").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getPauses=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.pause.get(v.query,f).$promise},v.createOrEditPause=function(e,t){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{pause:t,pauses:v.pauses.rows,license:v.license,setting:v.setting}})},v.deletePause=A,v.exportSelectedPauses=function(){var e=angular.copy(v.selectedPauses);return v.selectedPauses=[],e},v.deleteSelectedPauses=function(e){var t=i.confirm().title("Are you sure want to delete the selected pauses?").htmlContent("<b>"+v.selectedPauses.length+" selected</b> will be deleted.").ariaLabel("delete Pauses").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedPauses.forEach(function(e){A(e)}),v.selectedPauses=[]})},v.deselectPauses=function(){v.selectedPauses=[]},v.selectAllPauses=function(){v.selectedPauses=v.pauses.rows};var h=!0,b=1;function f(e){v.pauses=e||{count:0,rows:[]}}function A(e){l.pause.delete({id:e.id}).$promise.then(function(){_.remove(v.pauses.rows,{id:e.id}),v.pauses.count-=1,v.pauses.rows.length||v.getPauses(),c.success({title:"Pause deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEpause"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEpause",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getPauses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","pauses","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("PausesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_SCHEDULE",m.schedule=angular.copy(s),m.schedules=o,m.newSchedule=!1,m.schedule||(m.schedule={type:"custom",output:"xlsx",active:!0,startAt:new Date,endAt:new Date(Date.now()+2592e6),cron:"0 0 * * *",subtractNumber:1,subtractUnit:"days",sendMail:!1},m.title="TOOLS.NEW_SCHEDULE",m.newSchedule=!0),m.addNewSchedule=function(){m.errors=[],r.schedule.save(m.schedule).$promise.then(function(e){m.schedules.unshift(e.toJSON()),i.success({title:"Schedule properly created",msg:m.schedule.name?m.schedule.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSchedule=function(){m.errors=[],r.schedule.update({id:m.schedule.id},m.schedule).$promise.then(function(e){var t=_.find(m.schedules,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Schedule properly saved!",msg:m.schedule.name?m.schedule.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSchedule=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The schedule will be deleted.").ariaLabel("Delete Schedule").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.schedule.delete({id:m.schedule.id}).$promise.then(function(){_.remove(m.schedules,{id:m.schedule.id}),i.success({title:"Schedule properly deleted!",msg:(m.schedule.name||"schedule")+" has been deleted!"}),u(m.schedule)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.analyticCustomReport.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.customReports=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcustomReports",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.analyticDefaultReport.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.defaultReports=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdefaultReports",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.mailAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","schedules","schedule","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditScheduleDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.schedules=r||{count:0,rows:[]},v.table="schedules",v.listOrder="",v.listOrderAsc=null,v.selectedScheduler=[],v.query={fields:"createdAt,updatedAt,id,name,type,DefaultReportId,CustomReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,description",sort:"-updatedAt",limit:10,page:1},v.arraytype=_.keyBy([{option:"Default",value:"'default'"},{option:"Custom",value:"'custom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayoutput=_.keyBy([{option:"CSV",value:"'csv'"},{option:"PDF",value:"'pdf'"},{option:"Excel",value:"'xlsx'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysubtractUnit=_.keyBy([{option:"Minutes",value:"'minutes'"},{option:"Hours",value:"'hours'"},{option:"Days",value:"'days'"},{option:"Weeks",value:"'weeks'"},{option:"Months",value:"'months'"},{option:"Quarters",value:"'quarters'"},{option:"Years",value:"'years'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editdialog=function(e,t){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{schedule:e,schedules:v.schedules.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the schedule?").htmlContent("<b>"+(e.name||"schedule")+"</b> will be deleted.").ariaLabel("delete schedule").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getScheduler=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.schedule.get(v.query,f).$promise},v.createOrEditSchedule=function(e,t){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{schedule:t,schedules:v.schedules.rows,license:v.license,setting:v.setting}})},v.deleteSchedule=A,v.exportSelectedScheduler=function(){var e=angular.copy(v.selectedScheduler);return v.selectedScheduler=[],e},v.deleteSelectedScheduler=function(e){var t=i.confirm().title("Are you sure want to delete the selected schedules?").htmlContent("<b>"+v.selectedScheduler.length+" selected</b> will be deleted.").ariaLabel("delete Schedules").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedScheduler.forEach(function(e){A(e)}),v.selectedScheduler=[]})},v.deselectScheduler=function(){v.selectedScheduler=[]},v.selectAllScheduler=function(){v.selectedScheduler=v.schedules.rows},l.analyticCustomReport.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.customReports=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcustomReports",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.analyticDefaultReport.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.defaultReports=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdefaultReports",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){v.mailAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.schedules=e||{count:0,rows:[]}}function A(e){l.schedule.delete({id:e.id}).$promise.then(function(){_.remove(v.schedules.rows,{id:e.id}),v.schedules.count-=1,v.schedules.rows.length||v.getScheduler(),c.success({title:"Schedule deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEschedule"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEschedule",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getScheduler())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","schedules","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("SchedulesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_SOUND",m.sound=angular.copy(s),m.sounds=o,m.newSound=!1,m.sound||(m.sound={},m.title="TOOLS.NEW_SOUND",m.newSound=!0),m.addNewSound=function(){m.errors=[],r.sound.save(m.sound).$promise.then(function(e){m.sounds.unshift(e.toJSON()),i.success({title:"Sound properly created",msg:m.sound.name?m.sound.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.sound.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveSound=function(){m.errors=[],r.sound.update({id:m.sound.id},m.sound).$promise.then(function(e){var t=_.find(m.sounds,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Sound properly saved!",msg:m.sound.name?m.sound.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.sound.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteSound=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The sound will be deleted.").ariaLabel("Delete Sound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.sound.delete({id:m.sound.id}).$promise.then(function(){_.remove(m.sounds,{id:m.sound.id}),i.success({title:"Sound properly deleted!",msg:(m.sound.name||"sound")+" has been deleted!"}),u(m.sound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.sound.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","sounds","sound","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditSoundDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.sounds=r||{count:0,rows:[]},v.table="sounds",v.listOrder="",v.listOrderAsc=null,v.selectedSounds=[],v.query={fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{sound:e,sounds:v.sounds.rows,license:v.license,setting:null}})},v.downloadfile2=function(o,e){return l.sound.download({id:o.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=o.converted_format?o.save_name+"."+o.converted_format:o.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the sound?").htmlContent("<b>"+(e.name||"sound")+"</b> will be deleted.").ariaLabel("delete sound").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getSounds=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.sound.get(v.query,f).$promise},v.createOrEditSound=function(e,t){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{sound:t,sounds:v.sounds.rows,license:v.license,setting:v.setting}})},v.deleteSound=A,v.exportSelectedSounds=function(){var e=angular.copy(v.selectedSounds);return v.selectedSounds=[],e},v.deleteSelectedSounds=function(e){var t=i.confirm().title("Are you sure want to delete the selected sounds?").htmlContent("<b>"+v.selectedSounds.length+" selected</b> will be deleted.").ariaLabel("delete Sounds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedSounds.forEach(function(e){A(e)}),v.selectedSounds=[]})},v.deselectSounds=function(){v.selectedSounds=[]},v.selectAllSounds=function(){v.selectedSounds=v.sounds.rows},v.uploadSound=function(e){i.show({controller:"UploadSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/uploadsound/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{sounds:v.sounds.rows}})};var h=!0,b=1;function f(e){v.sounds=e||{count:0,rows:[]}}function A(e){l.sound.delete({id:e.id}).$promise.then(function(){_.remove(v.sounds.rows,{id:e.id}),v.sounds.count-=1,v.sounds.rows.length||v.getSounds(),c.success({title:"Sound deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsound"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsound",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getSounds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","sounds","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("SoundsController",e)}(),function(){"use strict";function e(e,t,a,n,i){var o=this;o.errors=[],o.title="TOOLS.UPLOAD_SOUND",o.sounds=n,o.uploadSounds=[],o.sound={},o.ngFlowOptions={maxChunkRetries:1,chunkSize:15728640,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,target:"api/sounds",allowDuplicateUploads:!0},o.ngFlow={flow:{}},o.dropping=!1,o.fileAdded=function(e){var t=["wav","mp3","gsm"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported only: "+t.join()}),!1;if(15728640<e.size)return a.error({title:"File too big",msg:"The max allowed size for audio files is 15 Mb"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return o.uploadSounds.unshift(n),!0},o.upload=function(){o.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},o.ngFlow.flow.upload()},o.fileSuccess=function(a,e){o.sounds.unshift(JSON.parse(e)),angular.forEach(o.uploadSounds,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="sound"}})},o.closeDialog=function(){t.hide()}}e.$inject=["$cookies","$mdDialog","toasty","sounds","api"],angular.module("app.tools").controller("UploadSoundDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_TAG",m.tag=angular.copy(s),m.tags=o,m.newTag=!1,m.tag||(m.tag={},m.title="TOOLS.NEW_TAG",m.newTag=!0),m.addNewTag=function(){m.errors=[],r.tag.save(m.tag).$promise.then(function(e){m.tags.unshift(e.toJSON()),i.success({title:"Tag properly created",msg:m.tag.name?m.tag.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.tag.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveTag=function(){m.errors=[],r.tag.update({id:m.tag.id},m.tag).$promise.then(function(e){var t=_.find(m.tags,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Tag properly saved!",msg:m.tag.name?m.tag.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.tag.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteTag=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The tag will be deleted.").ariaLabel("Delete Tag").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.tag.delete({id:m.tag.id}).$promise.then(function(){_.remove(m.tags,{id:m.tag.id}),i.success({title:"Tag properly deleted!",msg:(m.tag.name||"tag")+" has been deleted!"}),u(m.tag)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.tag.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","tags","tag","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditTagDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.tags=r||{count:0,rows:[]},v.table="tags",v.listOrder="",v.listOrderAsc=null,v.selectedTags=[],v.query={fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{tag:e,tags:v.tags.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the tag?").htmlContent("<b>"+(e.name||"tag")+"</b> will be deleted.").ariaLabel("delete tag").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getTags=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.tag.get(v.query,f).$promise},v.createOrEditTag=function(e,t){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{tag:t,tags:v.tags.rows,license:v.license,setting:v.setting}})},v.deleteTag=A,v.exportSelectedTags=function(){var e=angular.copy(v.selectedTags);return v.selectedTags=[],e},v.deleteSelectedTags=function(e){var t=i.confirm().title("Are you sure want to delete the selected tags?").htmlContent("<b>"+v.selectedTags.length+" selected</b> will be deleted.").ariaLabel("delete Tags").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedTags.forEach(function(e){A(e)}),v.selectedTags=[]})},v.deselectTags=function(){v.selectedTags=[]},v.selectAllTags=function(){v.selectedTags=v.tags.rows};var h=!0,b=1;function f(e){v.tags=e||{count:0,rows:[]}}function A(e){l.tag.delete({id:e.id}).$promise.then(function(){_.remove(v.tags.rows,{id:e.id}),v.tags.count-=1,v.tags.rows.length||v.getTags(),c.success({title:"Tag deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtag"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtag",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getTags())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","tags","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TagsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_TEMPLATE",m.template=angular.copy(s),m.templates=o,m.newTemplate=!1,m.template||(m.template={},m.title="TOOLS.NEW_TEMPLATE",m.newTemplate=!0),m.addNewTemplate=function(){m.errors=[],r.template.save(m.template).$promise.then(function(e){m.templates.unshift(e.toJSON()),i.success({title:"Template properly created",msg:m.template.name?m.template.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.template.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveTemplate=function(){m.errors=[],r.template.update({id:m.template.id},m.template).$promise.then(function(e){var t=_.find(m.templates,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Template properly saved!",msg:m.template.name?m.template.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.template.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteTemplate=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The template will be deleted.").ariaLabel("Delete Template").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.template.delete({id:m.template.id}).$promise.then(function(){_.remove(m.templates,{id:m.template.id}),i.success({title:"Template properly deleted!",msg:(m.template.name||"template")+" has been deleted!"}),u(m.template)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.template.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","templates","template","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditTemplateDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.templates=r||{count:0,rows:[]},v.table="templates",v.listOrder="",v.listOrderAsc=null,v.selectedTemplates=[],v.query={fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{template:e,templates:v.templates.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the template?").htmlContent("<b>"+(e.name||"template")+"</b> will be deleted.").ariaLabel("delete template").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getTemplates=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.template.get(v.query,f).$promise},v.createOrEditTemplate=function(e,t){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{template:t,templates:v.templates.rows,license:v.license,setting:v.setting}})},v.deleteTemplate=A,v.exportSelectedTemplates=function(){var e=angular.copy(v.selectedTemplates);return v.selectedTemplates=[],e},v.deleteSelectedTemplates=function(e){var t=i.confirm().title("Are you sure want to delete the selected templates?").htmlContent("<b>"+v.selectedTemplates.length+" selected</b> will be deleted.").ariaLabel("delete Templates").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedTemplates.forEach(function(e){A(e)}),v.selectedTemplates=[]})},v.deselectTemplates=function(){v.selectedTemplates=[]},v.selectAllTemplates=function(){v.selectedTemplates=v.templates.rows};var h=!0,b=1;function f(e){v.templates=e||{count:0,rows:[]}}function A(e){l.template.delete({id:e.id}).$promise.then(function(){_.remove(v.templates.rows,{id:e.id}),v.templates.count-=1,v.templates.rows.length||v.getTemplates(),c.success({title:"Template deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtemplate"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtemplate",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getTemplates())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","templates","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TemplatesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_TRIGGER",m.trigger=angular.copy(s),m.triggers=o,m.newTrigger=!1,m.trigger||(m.trigger={channel:"voice"},m.title="TOOLS.NEW_TRIGGER",m.newTrigger=!0),m.addNewTrigger=function(){m.errors=[],r.trigger.save(m.trigger).$promise.then(function(e){m.triggers.unshift(e.toJSON()),i.success({title:"Trigger properly created",msg:m.trigger.name?m.trigger.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveTrigger=function(){m.errors=[],r.trigger.update({id:m.trigger.id},m.trigger).$promise.then(function(e){var t=_.find(m.triggers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Trigger properly saved!",msg:m.trigger.name?m.trigger.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteTrigger=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The trigger will be deleted.").ariaLabel("Delete Trigger").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.trigger.delete({id:m.trigger.id}).$promise.then(function(){_.remove(m.triggers,{id:m.trigger.id}),i.success({title:"Trigger properly deleted!",msg:(m.trigger.name||"trigger")+" has been deleted!"}),u(m.trigger)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","triggers","trigger","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditTriggerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.trigger={},c.triggerActions={count:0,rows:[]},c.selectedTriggerActions=[],c.query={fields:"createdAt,updatedAt,id,action,data1,data1,data1,data2,data1,data2,data2,data1,data2,data2,data2,data2,data2,data2,data3,data3,data3,data3,data3,data3,data1,data2,data2,data3,data2,data2,data2,data3,data4,data5,data6,createdAt",limit:10,page:1},c.arrayaction=_.keyBy([{option:"CONTACT_MANAGER",value:"'contactManager'",ngIf:"vm.trigger.channel == 'voice'"},{option:"INTEGRATIONS",value:"'integration'",ngIf:"vm.trigger.channel == 'voice'"},{option:"MOTION_BAR",value:"'motionbar'"},{option:"JSCRIPTY",value:"'jscripty'",ngIf:"vm.trigger.channel == 'voice'"},{option:"URL_FORWARD",value:"'urlForward'"},{option:"BROWSER",value:"'browser'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.browserValues=_.keyBy([{option:"Popup",value:"'0'"},{option:"CTI URL",value:"'1'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.autoCreateContact=_.keyBy([{option:"yes",value:"'1'"},{option:"no",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.urlForwardValues=_.keyBy([{option:"GET",value:"'GET'"},{option:"POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.integrationValues=_.keyBy([{option:"Zendesk",value:"'zendesk'"},{option:"Salesforce",value:"'salesforce'"},{option:"SugarCRM",value:"'sugarcrm'"},{option:"Freshdesk",value:"'freshdesk'"},{option:"Desk",value:"'desk'"},{option:"Zoho",value:"'zoho'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.motionbarValues=_.keyBy([{option:"Popup",value:"'0'"},{option:"CTI URL",value:"'1'"},{option:"Windows App",value:"'2'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.eventVariables=_.keyBy([{option:"yes",value:"'1'"},{option:"no",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.location=_.keyBy([{option:"NEW_TAB",value:"'0'"},{option:"NEW_WINDOW",value:"'1'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e){c.trigger=e,c.query.id=c.trigger.id,c.query.ActionId=c.trigger.id,c.getTriggerActions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the action?").htmlContent("<b>"+(e.name||"action")+"</b> will be deleted.").ariaLabel("delete action").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getTriggerActions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.trigger.getActions(c.query,p).$promise},c.createOrEditTriggerAction=function(e,t){o.show({controller:"CreateOrEditActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/actions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:c.trigger,action:t,actions:c.triggerActions.rows,license:null,setting:null}})},c.exportSelectedTriggerActions=function(){var e=angular.copy(c.selectedTriggerActions);return c.selectedTriggerActions=[],e},c.deleteTriggerAction=g,c.deleteSelectedTriggerActions=function(e){var t=o.confirm().title("Are you sure want to delete the selected actions?").htmlContent("<b>"+c.selectedTriggerActions.length+" selected</b> will be deleted.").ariaLabel("delete actions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedTriggerActions.forEach(function(e){g(e)}),c.selectedTriggerActions=[]})},l.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){c.lists=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){c.projects=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZendeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zendeskAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzendeskAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.deskAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdeskAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZohoAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zohoAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzohoAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSalesforceAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.salesforceAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsalesforceAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSugarcrmAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.sugarcrmAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsugarcrmAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intFreshdeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.freshdeskAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfreshdeskAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZendeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zendeskConfigurations=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzendeskConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.deskConfigurations=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdeskConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZohoConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zohoConfigurations=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzohoConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSalesforceConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.salesforceConfigurations=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsalesforceConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSugarcrmConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.sugarcrmConfigurations=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsugarcrmConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intFreshdeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.freshdeskConfigurations=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfreshdeskConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.templates=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtemplates",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.triggerActions=e||{count:0,rows:[]}}function g(e){l.action.delete({id:e.id}).$promise.then(function(){_.remove(c.triggerActions.rows,{id:e.id}),c.triggerActions.count-=1,c.triggerActions.rows.length||c.getTriggerActions(),r.success({title:"Action deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getTriggerActions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerActionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m){var u=this;function p(e){a.hide(e)}u.errors=[],u.setting=m,u.license=c,u.passwordPattern=u.setting&&u.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",u.title="TOOLS.EDIT_ACTION",u.action=angular.copy(s),u.actions=o,u.newAction=!1,u.trigger=angular.copy(r),u.action||(u.action={data3:"0",data4:"0",data5:"800",data6:"600"},u.title="TOOLS.NEW_ACTION",u.newAction=!0),t.params.id&&(u.action.ActionId=t.params.id),u.addNewAction=function(){u.errors=[],l.trigger.addAction({id:t.params.id},u.action).$promise.then(function(e){u.actions.unshift(e.toJSON()),i.success({title:"Action properly created",msg:u.action.name?u.action.name+" has been created!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.saveAction=function(){u.errors=[],l.action.update({id:u.action.id},u.action).$promise.then(function(e){var t=_.find(u.actions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Action properly saved!",msg:u.action.name?u.action.name+" has been saved!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.deleteAction=function(e){u.errors=[];var t=a.confirm().title("Are you sure?").content("The action will be deleted.").ariaLabel("Delete Action").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){l.action.delete({id:u.action.id}).$promise.then(function(){_.remove(u.actions,{id:u.action.id}),i.success({title:"Action properly deleted!",msg:(u.action.name||"action")+" has been deleted!"}),p(u.action)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},u.getDateFromString=function(e){return new Date(e)},u.closeDialog=p,l.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZendeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.zendeskAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzendeskAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.deskAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdeskAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZohoAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.zohoAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzohoAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSalesforceAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.salesforceAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsalesforceAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSugarcrmAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.sugarcrmAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsugarcrmAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intFreshdeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.freshdeskAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfreshdeskAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZendeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.zendeskConfigurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzendeskConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.deskConfigurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdeskConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZohoConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.zohoConfigurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETzohoConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSalesforceConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.salesforceConfigurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsalesforceConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSugarcrmConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.sugarcrmConfigurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsugarcrmConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intFreshdeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.freshdeskConfigurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfreshdeskConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.templates=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtemplates",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","actions","action","trigger","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditActionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.trigger={},c.triggerAllConditions={count:0,rows:[]},c.selectedTriggerAllConditions=[],c.query={fields:"createdAt,updatedAt,id,field,operator,value,value,value,value,value,value,value,value,value,value,value,createdAt",limit:10,page:1},c.arrayfield=_.keyBy([{option:"Queue",value:"'queue'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Call_Status",value:"'lastevent'",ngIf:"vm.trigger.channel == 'voice'"},{option:"OutboundRoute",value:"'routeId'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Account",value:"'account'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Interaction",value:"'interaction'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Message",value:"'message'",ngIf:"vm.trigger.channel != 'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.arrayoperator=_.keyBy([{option:"Equals",value:"'equals'"},{option:"Not_Equals",value:"'not_equals'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.callStatusValues=_.keyBy([{option:"Abandon",value:"'abandoned'"},{option:"Hangup",value:"'complete'"},{option:"Reject",value:"'rejected'"},{option:"Ring",value:"'called'"},{option:"Answer",value:"'connect'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.interactionStatusValues=_.keyBy([{option:"Opened",value:"'opened'"},{option:"Closed",value:"'closed'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.messageStatusValues=_.keyBy([{option:"Incoming",value:"'in'"},{option:"Outgoing",value:"'out'"},{option:"Accepted",value:"'accept'"},{option:"Rejected",value:"'reject'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e){c.trigger=e,c.query.id=c.trigger.id,c.query.TriggerAllId=c.trigger.id,c.getTriggerAllConditions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the allCondition?").htmlContent("<b>"+(e.name||"allCondition")+"</b> will be deleted.").ariaLabel("delete allCondition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getTriggerAllConditions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.trigger.getAllConditions(c.query,p).$promise},c.createOrEditTriggerAllCondition=function(e,t){o.show({controller:"CreateOrEditAllConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/allconditions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:c.trigger,allCondition:t,allconditions:c.triggerAllConditions.rows,license:null,setting:null}})},c.exportSelectedTriggerAllConditions=function(){var e=angular.copy(c.selectedTriggerAllConditions);return c.selectedTriggerAllConditions=[],e},c.deleteTriggerAllCondition=g,c.deleteSelectedTriggerAllConditions=function(e){var t=o.confirm().title("Are you sure want to delete the selected allconditions?").htmlContent("<b>"+c.selectedTriggerAllConditions.length+" selected</b> will be deleted.").ariaLabel("delete allconditions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedTriggerAllConditions.forEach(function(e){g(e)}),c.selectedTriggerAllConditions=[]})},l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.chatAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.mailAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.smsAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.faxAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.openchannelAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){c.queues=_.keyBy(e.rows||[],"name")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){c.outboundRoutes=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.triggerAllConditions=e||{count:0,rows:[]}}function g(e){l.condition.delete({id:e.id}).$promise.then(function(){_.remove(c.triggerAllConditions.rows,{id:e.id}),c.triggerAllConditions.count-=1,c.triggerAllConditions.rows.length||c.getTriggerAllConditions(),r.success({title:"AllCondition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getTriggerAllConditions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAllConditionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m){var u=this;function p(e){a.hide(e)}u.errors=[],u.setting=m,u.license=c,u.passwordPattern=u.setting&&u.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",u.title="TOOLS.EDIT_ALLCONDITION",u.allCondition=angular.copy(s),u.allconditions=o,u.newAllCondition=!1,u.trigger=angular.copy(r),u.allCondition||(u.allCondition={field:"queue",operator:"equals",value:"abandoned",value:"opened",value:"in"},u.title="TOOLS.NEW_ALLCONDITION",u.newAllCondition=!0),t.params.id&&(u.allCondition.TriggerAllId=t.params.id),u.addNewAllCondition=function(){u.errors=[],l.trigger.addAllCondition({id:t.params.id},u.allCondition).$promise.then(function(e){u.allconditions.unshift(e.toJSON()),i.success({title:"AllCondition properly created",msg:u.allCondition.name?u.allCondition.name+" has been created!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.saveAllCondition=function(){u.errors=[],l.condition.update({id:u.allCondition.id},u.allCondition).$promise.then(function(e){var t=_.find(u.allconditions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"AllCondition properly saved!",msg:u.allCondition.name?u.allCondition.name+" has been saved!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.deleteAllCondition=function(e){u.errors=[];var t=a.confirm().title("Are you sure?").content("The allCondition will be deleted.").ariaLabel("Delete AllCondition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){l.condition.delete({id:u.allCondition.id}).$promise.then(function(){_.remove(u.allconditions,{id:u.allCondition.id}),i.success({title:"AllCondition properly deleted!",msg:(u.allCondition.name||"allCondition")+" has been deleted!"}),p(u.allCondition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},u.getDateFromString=function(e){return new Date(e)},u.closeDialog=p,l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.chatAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.mailAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.smsAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.faxAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.openchannelAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u.queues=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","allconditions","allCondition","trigger","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditAllConditionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.trigger={},c.triggerAnyConditions={count:0,rows:[]},c.selectedTriggerAnyConditions=[],c.query={fields:"createdAt,updatedAt,id,field,operator,value,value,value,value,value,value,value,value,value,value,value,createdAt",limit:10,page:1},c.arrayfield=_.keyBy([{option:"Queue",value:"'queue'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Call_Status",value:"'lastevent'",ngIf:"vm.trigger.channel == 'voice'"},{option:"OutboundRoute",value:"'routeId'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Account",value:"'account'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Interaction",value:"'interaction'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Message",value:"'message'",ngIf:"vm.trigger.channel != 'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.arrayoperator=_.keyBy([{option:"Equals",value:"'equals'"},{option:"Not_Equals",value:"'not_equals'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.callStatusValues=_.keyBy([{option:"Abandon",value:"'abandoned'"},{option:"Hangup",value:"'complete'"},{option:"Reject",value:"'rejected'"},{option:"Ring",value:"'called'"},{option:"Answer",value:"'connect'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.interactionStatusValues=_.keyBy([{option:"Opened",value:"'opened'"},{option:"Closed",value:"'closed'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.messageStatusValues=_.keyBy([{option:"Incoming",value:"'in'"},{option:"Outgoing",value:"'out'"},{option:"Accepted",value:"'accept'"},{option:"Rejected",value:"'reject'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e){c.trigger=e,c.query.id=c.trigger.id,c.query.TriggerAnyId=c.trigger.id,c.getTriggerAnyConditions()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the anyCondition?").htmlContent("<b>"+(e.name||"anyCondition")+"</b> will be deleted.").ariaLabel("delete anyCondition").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getTriggerAnyConditions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.trigger.getAnyConditions(c.query,p).$promise},c.createOrEditTriggerAnyCondition=function(e,t){o.show({controller:"CreateOrEditAnyConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/anyconditions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:c.trigger,anyCondition:t,anyconditions:c.triggerAnyConditions.rows,license:null,setting:null}})},c.exportSelectedTriggerAnyConditions=function(){var e=angular.copy(c.selectedTriggerAnyConditions);return c.selectedTriggerAnyConditions=[],e},c.deleteTriggerAnyCondition=g,c.deleteSelectedTriggerAnyConditions=function(e){var t=o.confirm().title("Are you sure want to delete the selected anyconditions?").htmlContent("<b>"+c.selectedTriggerAnyConditions.length+" selected</b> will be deleted.").ariaLabel("delete anyconditions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedTriggerAnyConditions.forEach(function(e){g(e)}),c.selectedTriggerAnyConditions=[]})},l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.chatAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.mailAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.smsAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.faxAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.openchannelAccounts=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){c.queues=_.keyBy(e.rows||[],"name")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){c.outboundRoutes=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.triggerAnyConditions=e||{count:0,rows:[]}}function g(e){l.condition.delete({id:e.id}).$promise.then(function(){_.remove(c.triggerAnyConditions.rows,{id:e.id}),c.triggerAnyConditions.count-=1,c.triggerAnyConditions.rows.length||c.getTriggerAnyConditions(),r.success({title:"AnyCondition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getTriggerAnyConditions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAnyConditionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m){var u=this;function p(e){a.hide(e)}u.errors=[],u.setting=m,u.license=c,u.passwordPattern=u.setting&&u.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",u.title="TOOLS.EDIT_ANYCONDITION",u.anyCondition=angular.copy(s),u.anyconditions=o,u.newAnyCondition=!1,u.trigger=angular.copy(r),u.anyCondition||(u.anyCondition={field:"queue",operator:"equals",value:"abandoned",value:"opened",value:"in"},u.title="TOOLS.NEW_ANYCONDITION",u.newAnyCondition=!0),t.params.id&&(u.anyCondition.TriggerAnyId=t.params.id),u.addNewAnyCondition=function(){u.errors=[],l.trigger.addAnyCondition({id:t.params.id},u.anyCondition).$promise.then(function(e){u.anyconditions.unshift(e.toJSON()),i.success({title:"AnyCondition properly created",msg:u.anyCondition.name?u.anyCondition.name+" has been created!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.saveAnyCondition=function(){u.errors=[],l.condition.update({id:u.anyCondition.id},u.anyCondition).$promise.then(function(e){var t=_.find(u.anyconditions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"AnyCondition properly saved!",msg:u.anyCondition.name?u.anyCondition.name+" has been saved!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.deleteAnyCondition=function(e){u.errors=[];var t=a.confirm().title("Are you sure?").content("The anyCondition will be deleted.").ariaLabel("Delete AnyCondition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){l.condition.delete({id:u.anyCondition.id}).$promise.then(function(){_.remove(u.anyconditions,{id:u.anyCondition.id}),i.success({title:"AnyCondition properly deleted!",msg:(u.anyCondition.name||"anyCondition")+" has been deleted!"}),p(u.anyCondition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},u.getDateFromString=function(e){return new Date(e)},u.closeDialog=p,l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.chatAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.mailAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.smsAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.faxAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.openchannelAccounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u.queues=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","anyconditions","anyCondition","trigger","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditAnyConditionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.trigger=d||e.params.trigger||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoTriggers=function(){e.go("app.tools.triggers")},c.saveTrigger=function(){s.trigger.update({id:c.trigger.id},c.trigger).$promise.then(function(){r.success({title:"Trigger updated!",msg:c.trigger.name?c.trigger.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","trigger"],angular.module("app.tools").controller("TriggerController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.triggers=r||{count:0,rows:[]},v.table="triggers",v.listOrder="",v.listOrderAsc=null,v.selectedTriggers=[],v.query={fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,page:1},v.arraychannel=_.keyBy([{option:"Voice",value:"'voice'"},{option:"Openchannel",value:"'openchannel'",ngIf:"vm.license.openchannel"},{option:"Chat",value:"'chat'",ngIf:"vm.license.chat"},{option:"Mail",value:"'mail'",ngIf:"vm.license.mail"},{option:"Sms",value:"'sms'",ngIf:"vm.license.messaging"},{option:"Fax",value:"'fax'",ngIf:"vm.license.fax"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.tools.triggers.edit",{id:e.id,trigger:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the trigger?").htmlContent("<b>"+(e.name||"trigger")+"</b> will be deleted.").ariaLabel("delete trigger").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getTriggers=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.trigger.get(v.query,f).$promise},v.createOrEditTrigger=function(e,t){i.show({controller:"CreateOrEditTriggerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:t,triggers:v.triggers.rows,license:v.license,setting:v.setting}})},v.deleteTrigger=A,v.exportSelectedTriggers=function(){var e=angular.copy(v.selectedTriggers);return v.selectedTriggers=[],e},v.deleteSelectedTriggers=function(e){var t=i.confirm().title("Are you sure want to delete the selected triggers?").htmlContent("<b>"+v.selectedTriggers.length+" selected</b> will be deleted.").ariaLabel("delete Triggers").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedTriggers.forEach(function(e){A(e)}),v.selectedTriggers=[]})},v.deselectTriggers=function(){v.selectedTriggers=[]},v.selectAllTriggers=function(){v.selectedTriggers=v.triggers.rows};var h=!0,b=1;function f(e){v.triggers=e||{count:0,rows:[]}}function A(e){l.trigger.delete({id:e.id}).$promise.then(function(){_.remove(v.triggers.rows,{id:e.id}),v.triggers.count-=1,v.triggers.rows.length||v.getTriggers(),c.success({title:"Trigger deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrigger"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getTriggers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","triggers","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TriggersController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_TRUNK",m.trunk=angular.copy(s),m.trunks=o,m.newTrunk=!1,m.trunk||(m.trunk={active:!0,type:"friend",dtmfmode:"rfc2833",qualify:"yes",t38pt_udptl:"no"},m.title="TOOLS.NEW_TRUNK",m.newTrunk=!0),m.addNewTrunk=function(){m.errors=[],r.trunk.save(m.trunk).$promise.then(function(e){m.trunks.unshift(e.toJSON()),i.success({title:"Trunk properly created",msg:m.trunk.name?m.trunk.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveTrunk=function(){m.errors=[],r.trunk.update({id:m.trunk.id},m.trunk).$promise.then(function(e){var t=_.find(m.trunks,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Trunk properly saved!",msg:m.trunk.name?m.trunk.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteTrunk=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The trunk will be deleted.").ariaLabel("Delete Trunk").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.trunk.delete({id:m.trunk.id}).$promise.then(function(){_.remove(m.trunks,{id:m.trunk.id}),i.success({title:"Trunk properly deleted!",msg:(m.trunk.name||"trunk")+" has been deleted!"}),u(m.trunk)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","trunks","trunk","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditTrunkDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.trunk=d||n.params.trunk||{},c.selectedTab=n.params.tab||0,c.gotogoto=function(e,t){n.go("app.voice.realtime.trunks",{})},c.alert=r.info,c.gotoTrunks=function(){n.go("app.tools.trunks")},c.saveTrunk=function(){s.trunk.update({id:c.trunk.id},c.trunk).$promise.then(function(){r.success({title:"Trunk updated!",msg:c.trunk.name?c.trunk.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunk",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","trunk"],angular.module("app.tools").controller("TrunkController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.trunks=r||{count:0,rows:[]},v.table="trunks",v.listOrder="",v.listOrderAsc=null,v.selectedTrunks=[],v.query={fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,otherFields",sort:"-updatedAt",limit:10,page:1},v.arraytype=_.keyBy([{option:"Friend",value:"'friend'"},{option:"User",value:"'user'"},{option:"Peer",value:"'peer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraydtmfmode=_.keyBy([{option:"rfc2833",value:"'rfc2833'"},{option:"info",value:"'info'"},{option:"shortinfo",value:"'shortinfo'"},{option:"inband",value:"'inband'"},{option:"auto",value:"'auto'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayqualify=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g723",value:"'g723'"},{option:"g726",value:"'g726'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"ilbc",value:"'ilbc'"},{option:"opus",value:"'opus'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayinsecure=_.keyBy([{option:"port",value:"'port'"},{option:"invite",value:"'invite'"},{option:"very",value:"'very'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraydirectmedia=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"nonat",value:"'nonat'"},{option:"update",value:"'update'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraycallcounter=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayusereqphone=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytrustrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysendrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"pai",value:"'pai'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.tools.trunks.edit",{id:e.id,trunk:e})},v.gotorealtimegoto=function(e,t){n.go("app.voice.realtime.trunks",{})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the trunk?").htmlContent("<b>"+(e.name||"trunk")+"</b> will be deleted.").ariaLabel("delete trunk").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getTrunks=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.trunk.get(v.query,f).$promise},v.createOrEditTrunk=function(e,t){i.show({controller:"CreateOrEditTrunkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{trunk:t,trunks:v.trunks.rows,license:v.license,setting:v.setting}})},v.deleteTrunk=A,v.exportSelectedTrunks=function(){var e=angular.copy(v.selectedTrunks);return v.selectedTrunks=[],e},v.deleteSelectedTrunks=function(e){var t=i.confirm().title("Are you sure want to delete the selected trunks?").htmlContent("<b>"+v.selectedTrunks.length+" selected</b> will be deleted.").ariaLabel("delete Trunks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedTrunks.forEach(function(e){A(e)}),v.selectedTrunks=[]})},v.deselectTrunks=function(){v.selectedTrunks=[]},v.selectAllTrunks=function(){v.selectedTrunks=v.trunks.rows};var h=!0,b=1;function f(e){v.trunks=e||{count:0,rows:[]}}function A(e){l.trunk.delete({id:e.id}).$promise.then(function(){_.remove(v.trunks.rows,{id:e.id}),v.trunks.count-=1,v.trunks.rows.length||v.getTrunks(),c.success({title:"Trunk deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrunk"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrunk",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getTrunks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","trunks","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TrunksController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="TOOLS.EDIT_VARIABLE",m.variable=angular.copy(s),m.variables=o,m.newVariable=!1,m.variable||(m.variable={},m.title="TOOLS.NEW_VARIABLE",m.newVariable=!0),m.addNewVariable=function(){m.errors=[],r.variable.save(m.variable).$promise.then(function(e){m.variables.unshift(e.toJSON()),i.success({title:"Variable properly created",msg:m.variable.name?m.variable.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.variable.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveVariable=function(){m.errors=[],r.variable.update({id:m.variable.id},m.variable).$promise.then(function(e){var t=_.find(m.variables,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Variable properly saved!",msg:m.variable.name?m.variable.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteVariable=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The variable will be deleted.").ariaLabel("Delete Variable").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.variable.delete({id:m.variable.id}).$promise.then(function(){_.remove(m.variables,{id:m.variable.id}),i.success({title:"Variable properly deleted!",msg:(m.variable.name||"variable")+" has been deleted!"}),u(m.variable)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.variable.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","variables","variable","api","Auth","license","setting"],angular.module("app.tools").controller("CreateOrEditVariableDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.variables=r||{count:0,rows:[]},v.table="variables",v.listOrder="",v.listOrderAsc=null,v.selectedVariables=[],v.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{variable:e,variables:v.variables.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the variable?").htmlContent("<b>"+(e.name||"variable")+"</b> will be deleted.").ariaLabel("delete variable").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getVariables=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.variable.get(v.query,f).$promise},v.createOrEditVariable=function(e,t){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{variable:t,variables:v.variables.rows,license:v.license,setting:v.setting}})},v.deleteVariable=A,v.exportSelectedVariables=function(){var e=angular.copy(v.selectedVariables);return v.selectedVariables=[],e},v.deleteSelectedVariables=function(e){var t=i.confirm().title("Are you sure want to delete the selected variables?").htmlContent("<b>"+v.selectedVariables.length+" selected</b> will be deleted.").ariaLabel("delete Variables").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedVariables.forEach(function(e){A(e)}),v.selectedVariables=[]})},v.deselectVariables=function(){v.selectedVariables=[]},v.selectAllVariables=function(){v.selectedVariables=v.variables.rows};var h=!0,b=1;function f(e){v.variables=e||{count:0,rows:[]}}function A(e){l.variable.delete({id:e.id}).$promise.then(function(){_.remove(v.variables.rows,{id:e.id}),v.variables.count-=1,v.variables.rows.length||v.getVariables(),c.success({title:"Variable deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvariable"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvariable",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getVariables())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","variables","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("VariablesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.chanSpies=r||{count:0,rows:[]},v.table="chanSpies",v.listOrder="",v.listOrderAsc=null,v.selectedChanSpies=[],v.query={fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,page:1},v.arrayoptions=_.keyBy([{option:"b: Only spy on channels involved in a bridged call.",value:"'b'"},{option:"B: Instead of whispering on a single channel barge in on both channels involved in the call.",value:"'B'"},{option:"E: Exit when the spied-on channel hangs up.",value:"'E'"},{option:"o: Only listen to audio coming from this channel.",value:"'o'"},{option:"q: Don't play a beep when beginning to spy on a channel, or speak the selected channel name.",value:"'q'"},{option:"s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.",value:"'s'"},{option:"S: Stop when no more channels are left to spy on.",value:"'S'"},{option:"w: Enable whisper mode, so the spying channel can talk to the spied-on channel.",value:"'w'"},{option:"W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.",value:"'W'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayrecordingFormat=_.keyBy([{option:"wav",value:"'wav'"},{option:"gsm",value:"'gsm'"},{option:"wav49",value:"'WAV'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editdialog=function(e,t){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{chanSpy:e,chanSpies:v.chanSpies.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the chanSpy?").htmlContent("<b>"+(e.name||"chanSpy")+"</b> will be deleted.").ariaLabel("delete chanSpy").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getChanSpies=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceChanSpy.get(v.query,f).$promise},v.createOrEditchanSpy=function(e,t){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chanSpy:t,chanSpies:v.chanSpies.rows,license:v.license,setting:v.setting}})},v.deletechanSpy=A,v.exportSelectedChanSpies=function(){var e=angular.copy(v.selectedChanSpies);return v.selectedChanSpies=[],e},v.deleteSelectedChanSpies=function(e){var t=i.confirm().title("Are you sure want to delete the selected chanSpies?").htmlContent("<b>"+v.selectedChanSpies.length+" selected</b> will be deleted.").ariaLabel("delete chanSpys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedChanSpies.forEach(function(e){A(e)}),v.selectedChanSpies=[]})},v.deselectChanSpies=function(){v.selectedChanSpies=[]},v.selectAllChanSpies=function(){v.selectedChanSpies=v.chanSpies.rows};var h=!0,b=1;function f(e){v.chanSpies=e||{count:0,rows:[]}}function A(e){l.voiceChanSpy.delete({id:e.id}).$promise.then(function(){_.remove(v.chanSpies.rows,{id:e.id}),v.chanSpies.count-=1,v.chanSpies.rows.length||v.getChanSpies(),c.success({title:"chanSpy deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceChanSpy"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceChanSpy",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getChanSpies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","chanSpies","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("ChanSpiesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_CHANSPY",m.chanSpy=angular.copy(s),m.chanSpies=o,m.newchanSpy=!1,m.chanSpy||(m.chanSpy={recordingFormat:"wav"},m.title="VOICE.NEW_CHANSPY",m.newchanSpy=!0),m.addNewchanSpy=function(){m.errors=[],r.voiceChanSpy.save(m.chanSpy).$promise.then(function(e){m.chanSpies.unshift(e.toJSON()),i.success({title:"chanSpy properly created",msg:m.chanSpy.name?m.chanSpy.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.savechanSpy=function(){m.errors=[],r.voiceChanSpy.update({id:m.chanSpy.id},m.chanSpy).$promise.then(function(e){var t=_.find(m.chanSpies,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"chanSpy properly saved!",msg:m.chanSpy.name?m.chanSpy.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deletechanSpy=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The chanSpy will be deleted.").ariaLabel("Delete chanSpy").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceChanSpy.delete({id:m.chanSpy.id}).$promise.then(function(){_.remove(m.chanSpies,{id:m.chanSpy.id}),i.success({title:"chanSpy properly deleted!",msg:(m.chanSpy.name||"chanSpy")+" has been deleted!"}),u(m.chanSpy)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","chanSpies","chanSpy","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditchanSpyDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.contexts=r||{count:0,rows:[]},v.table="contexts",v.listOrder="",v.listOrderAsc=null,v.selectedContexts=[],v.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,page:1},v.editdialog=function(e,t){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{context:e,contexts:v.contexts.rows,license:v.license,setting:null}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the context?").htmlContent("<b>"+(e.name||"context")+"</b> will be deleted.").ariaLabel("delete context").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getContexts=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceContext.get(v.query,f).$promise},v.createOrEditContext=function(e,t){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{context:t,contexts:v.contexts.rows,license:v.license,setting:v.setting}})},v.deleteContext=A,v.exportSelectedContexts=function(){var e=angular.copy(v.selectedContexts);return v.selectedContexts=[],e},v.deleteSelectedContexts=function(e){var t=i.confirm().title("Are you sure want to delete the selected contexts?").htmlContent("<b>"+v.selectedContexts.length+" selected</b> will be deleted.").ariaLabel("delete Contexts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedContexts.forEach(function(e){A(e)}),v.selectedContexts=[]})},v.deselectContexts=function(){v.selectedContexts=[]},v.selectAllContexts=function(){v.selectedContexts=v.contexts.rows};var h=!0,b=1;function f(e){v.contexts=e||{count:0,rows:[]}}function A(e){l.voiceContext.delete({id:e.id}).$promise.then(function(){_.remove(v.contexts.rows,{id:e.id}),v.contexts.count-=1,v.contexts.rows.length||v.getContexts(),c.success({title:"Context deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceContext"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceContext",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getContexts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","contexts","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("ContextsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_CONTEXT",m.context=angular.copy(s),m.contexts=o,m.newContext=!1,m.context||(m.context={},m.title="VOICE.NEW_CONTEXT",m.newContext=!0),m.addNewContext=function(){m.errors=[],r.voiceContext.save(m.context).$promise.then(function(e){m.contexts.unshift(e.toJSON()),i.success({title:"Context properly created",msg:m.context.name?m.context.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveContext=function(){m.errors=[],r.voiceContext.update({id:m.context.id},m.context).$promise.then(function(e){var t=_.find(m.contexts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Context properly saved!",msg:m.context.name?m.context.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteContext=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The context will be deleted.").ariaLabel("Delete Context").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceContext.delete({id:m.context.id}).$promise.then(function(){_.remove(m.contexts,{id:m.context.id}),i.success({title:"Context properly deleted!",msg:(m.context.name||"context")+" has been deleted!"}),u(m.context)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","contexts","context","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditContextDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_INBOUNDROUTE",m.inboundroute=angular.copy(s),m.inboundroutes=o,m.newInboundRoute=!1,m.inboundroute||(m.inboundroute={appdata:"Inbound Call",type:"inbound",context:"from-voip-provider"},m.title="VOICE.NEW_INBOUNDROUTE",m.newInboundRoute=!0),m.addNewInboundRoute=function(){m.errors=[],r.voiceExtension.save(m.inboundroute).$promise.then(function(e){m.inboundroutes.unshift(e.toJSON()),i.success({title:"InboundRoute properly created",msg:m.inboundroute.name?m.inboundroute.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveInboundRoute=function(){m.errors=[],r.voiceExtension.update({id:m.inboundroute.id},m.inboundroute).$promise.then(function(e){var t=_.find(m.inboundroutes,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"InboundRoute properly saved!",msg:m.inboundroute.name?m.inboundroute.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteInboundRoute=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The inboundroute will be deleted.").ariaLabel("Delete InboundRoute").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceExtension.delete({id:m.inboundroute.id}).$promise.then(function(){_.remove(m.inboundroutes,{id:m.inboundroute.id}),i.success({title:"InboundRoute properly deleted!",msg:(m.inboundroute.name||"inboundroute")+" has been deleted!"}),u(m.inboundroute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","inboundroutes","inboundroute","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditInboundRouteDialogController",e)}(),function(){"use strict";function e(m,i,a,o,e){var u=this;function t(e,t){if(u.inboundrouteApps.rows.length){var n=u.inboundrouteApps.rows[t]?u.inboundrouteApps.rows[t]:u.inboundrouteApps.rows[0];i.show({controller:"EditInboundApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundroutes/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{inboundrouteApp:n,inboundroute:u.inboundroute}}).then(function(e){e&&(e.id?u.inboundrouteApps.rows[t]=e:u.inboundrouteApps.rows.splice(t,0,e),s())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function s(){var e=["queue","playback"],t=2,n=[];n.push({type:"inbound",app:"Set",appdata:"CDR(type)=inbound",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id}),n.push({type:"inbound",app:"Set",appdata:"XCALLY-MOTION-ANSWER=0",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id}),n.push({type:"inbound",app:"Set",appdata:"XCALLY-MOTION-PROGRESS=0",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id}),n.push({type:"inbound",app:"Set",appdata:"MONITOR_OPTIONS=ab",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id});for(var a=0,i=0;a<u.inboundrouteApps.rows.length;a++,i=0){var o=u.inboundrouteApps.rows[a],s=[],r=[];o.intervals="*,*,*,*"!==o.interval?[o.interval]:o.IntervalId?_.map(_.filter(u.intervals.rows,{IntervalId:o.IntervalId}),"interval"):[],o.context=u.inboundroute.context,o.exten=u.inboundroute.exten,o.type&&(o.type=o.type.toLowerCase()),o.hasOwnProperty("answer")&&e.includes(o.app.toLowerCase())&&"custom"!==o.appType&&(o.answer?(s.push({type:o.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-ANSWER}=0]?Answer",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id}),s.push({type:o.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-ANSWER=1",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id})):(s.push({type:o.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-PROGRESS}=0]?Progress",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id}),s.push({type:o.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-PROGRESS=1",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id})));for(var l=0;l<o.intervals.length;l++){var d=t+o.intervals.length,c=l===o.intervals.length-1?t+s.length+r.length+2:t+l+1;s.splice(l,0,{type:"inbound",app:"GotoIfTime",appdata:o.intervals[l]+"?"+u.inboundroute.context+",${EXTEN},"+d+":"+u.inboundroute.context+",${EXTEN},"+c,exten:u.inboundroute.exten,context:u.inboundroute.context,priority:t+l,VoiceExtensionId:u.inboundroute.id})}o.priority=s.length?_.last(s).priority+1:t,t=(r.length?_.last(r).priority:o.priority)+1,n=_.concat(n,s,[o],r)}n.push({type:"inbound",app:"Hangup",exten:u.inboundroute.exten,context:u.inboundroute.context,priority:t,VoiceExtensionId:u.inboundroute.id}),m.voiceExtension.addApplications({id:u.inboundroute.id},_.sortBy(n,"priority")).$promise.then(function(e){u.inboundrouteApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){u.inboundrouteApps=e||{count:0,rows:[]}}u.currentUser=e.getCurrentUser(),u.inboundroute={},u.inboundrouteApps={count:0,rows:[]},u.selectedInboundRouteApps=[],u.query={sort:"priority"},u.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"Queue",appType:"queue",context:"from-voip-provider",type:"Inbound",appdata:",xX,,,300,,,,,",icon:"icon-apps",options:"xX",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",route:"sound",filters:{fields:"name,save_name",sort:"name"}},{name:"queues",route:"voiceQueue",filters:{type:"inbound",fields:"id,name,type",sort:"name",nolimit:!0}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Url",name:"URL",type:"text",param:2},{title:"Announce_Overrides",name:"sound",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}'",option:"sound.name",defaultValues:[{value:"''",option:"None"}],param:3},{title:"Timeout",name:"timeout",type:"number",min:0,param:4},{title:"Agi",name:"agi",type:"text",param:5},{title:"Macro",name:"macro",type:"text",param:6},{title:"GoSub",name:"gosub",type:"text",param:7},{title:"Rule",name:"rule",type:"text",param:8},{title:"Position",name:"position",type:"number",min:0,param:9},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Playback",appType:"playback",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",route:"sound",filters:{fields:"name,save_name",sort:"name"}}],fields:[{title:"Audio_Files",name:"appdata",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}'",option:"appdata.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Dial",appType:"dial",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,fields:[{title:"Technology/Resource",name:"tech",type:"text",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"internalDial",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"users",route:"user",filters:{fields:"name",sort:"name"}}],fields:[{title:"User",name:"user",type:"apiselect",values:"users",value:"'SIP/{{user.name}}'",option:"user.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"externalDial",context:"from-voip-provider",type:"inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"trunks",route:"trunk",filters:{fields:"name",sort:"name"}}],fields:[{title:"Trunk",name:"trunk",type:"apiselect",values:"trunks",value:"trunk.name",option:"trunk.name",required:!0,param:0},{title:"Phone",name:"phone",required:!0,type:"text"},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"ringGroup",context:"from-voip-provider",type:"inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"users",route:"user",filters:{fields:"name",sort:"name"}}],fields:[{title:"User",name:"multipleUsers",type:"apiselect",multiple:!0,values:"users",value:"'SIP/{{multipleUsers.name}}'",option:"multipleUsers.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"AGI",alias:"CallySquare",appType:"agi",context:"from-voip-provider",type:"inbound",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"projects",route:"squareProject",filters:{fields:"name",sort:"name"}}],fields:[{title:"Project",name:"project",type:"apiselect",values:"projects",value:"'agi://127.0.0.1/square,{{project.name}}'",option:"project.name",required:!0,param:0}]},{app:"goto",appType:"goTo",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"contexts",route:"voiceContext",filters:{fields:"name",sort:"name"}}],fields:[{title:"Context",name:"context",type:"apiselect",values:"contexts",value:"context.name",option:"context.name",required:!0,param:0},{title:"Extension",name:"extension",type:"text",required:!0,param:1},{title:"Priority",name:"priority",type:"text",required:!0,param:2}]},{app:"hangup",appType:"hangup",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Hangup_Cause",name:"appdata",type:"select",param:0,values:[{option:"HANGUPCAUSE_1",value:"'1'"},{option:"HANGUPCAUSE_16",value:"'16'"},{option:"HANGUPCAUSE_17",value:"'17'"},{option:"HANGUPCAUSE_18",value:"'18'"},{option:"HANGUPCAUSE_21",value:"'21'"},{option:"HANGUPCAUSE_22",value:"'22'"},{option:"HANGUPCAUSE_27",value:"'27'"},{option:"HANGUPCAUSE_38",value:"'38'"},{option:"HANGUPCAUSE_41",value:"'41'"}],translate:!0,required:!0,general:!0}]},{app:"Set",appType:"set",context:"from-voip-provider",type:"Inbound",separator:"=",icon:"icon-apps",interval:"*,*,*,*",extraApi:[{name:"variables",route:"variable",filters:{fields:"name",sort:"name"}}],isApp:!0,fields:[{title:"Variable",name:"name",type:"apiselect",values:"variables",value:"name.name",option:"name.name",required:!0,param:0},{title:"Value",name:"value",type:"text",required:!0,param:1}]},{app:null,appType:"custom",icon:"icon-apps",type:"Inbound",interval:"*,*,*,*",isApp:!0,fields:[{title:"Application_Name",name:"app",type:"text",required:!0,param:0},{title:"Arguments",name:"appdata",type:"text",param:1}]},{app:"Voicemail",appType:"voicemail",context:"from-voip-provider",icon:"icon-apps",type:"Inbound",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"voiceMails",route:"voiceMail",filters:{fields:"mailbox",sort:"mailbox"}}],fields:[{title:"Mailbox@Context",name:"voiceMail",type:"apiselect",values:"voiceMails",value:"'{{voiceMail.mailbox}}@from-voicemail'",option:"voiceMail.mailbox",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1}]}],["app"]),{isApp:!1}),u.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},u.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){s()}},u.init=function(e){u.inboundroute=e,u.query.VoiceExtensionId=e.id,u.query.isApp=!0,u.query.nolimit=!0,u.getInboundRouteApps(),u.getIntervals()},u.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){u.inboundrouteApps.rows.splice(t,1),s()},function(){console.log("CANCEL")})},u.getInboundRouteApps=function(){u.promise=m.voiceExtension.get(u.query,n).$promise},u.editInboundRouteApp=t,u.editInterval=function(e,t){if(u.inboundrouteApps.rows.length){var n=u.inboundrouteApps.rows[t]?u.inboundrouteApps.rows[t]:u.inboundrouteApps.rows[0];i.show({controller:"EditInboundAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundroutes/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,s())})}},u.deleteInboundRouteApp=function(e){_.remove(u.inboundrouteApps.rows,{id:e.id}),s(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},u.deleteSelectedInboundRouteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+u.selectedInboundRouteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){u.selectedInboundRouteApps.forEach(function(e){_.remove(u.inboundrouteApps.rows,{id:e.id})}),u.selectedInboundRouteApps=[],s()})},u.rewriteRouting=s,u.getIntervals=function(){return m.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){u.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.voice").controller("InboundRouteActionsController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.agi=angular.copy(e),o.agi.appdata)switch(o.agi.appType?o.agi.appType.toLowerCase():o.agi.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.agi.appdata.split(",");o.agi.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.agi.text=s.slice(1,s.length).join(",");break;case"message":o.agi.text=o.agi.appdata;break;case"set":o.agi.name=o.agi.appdata.split("=")[0],o.agi.value=o.agi.appdata.split("=")[1];break;case"agi":o.agi.project=o.agi.appdata;break;default:var r=o.agi.appdata.split(",");o.agi.project=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.agi.type&&"outbound"===o.agi.type.toLowerCase()&&"outbounddial"===o.agi.appType.toLowerCase()&&(o.agi.prefix=o.agi.phone?o.agi.phone.split("$")[0]:void 0,o.agi.callerId=o.agi.callerID?"CALLERID(all)="+o.agi.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.agi.type&&"outbound"===o.agi.type.toLowerCase()&&"outboundDial"===o.agi.appType&&(o.agi.phone=a.cutdigits?(o.agi.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.agi.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.agi.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.agi.options+="U(xcally-mixmonitor-context)"):o.agi.options=o.agi.options.replace("U(xcally-mixmonitor-context)",""));if(o.agi.appType&&"custom"===o.agi.appType);else switch((o.agi.app||o.agi.appType).toLowerCase()){case"set":o.agi.appdata=o.agi.name+"="+o.agi.value;break;case"custom":break;default:e[0]=o.agi.project,o.agi.appdata=e.join(",")}l(o.agi)},o.closeDialog=l,i.squareProject.get({fields:"name",sort:"name"}).$promise.then(function(e){o.projects=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppagiDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(n.appType||n.app).toUpperCase(),o.custom=angular.copy(n),o.custom.appdata)switch(o.custom.appType?o.custom.appType.toLowerCase():o.custom.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.custom.appdata.split(",");o.custom.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.custom.text=s.slice(1,s.length).join(",");break;case"message":o.custom.text=o.custom.appdata;break;case"set":o.custom.name=o.custom.appdata.split("=")[0],o.custom.value=o.custom.appdata.split("=")[1];break;case"agi":o.custom.project=o.custom.appdata;break;default:var r=o.custom.appdata.split(",");o.custom.app=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.custom.appdata=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.custom.type&&"outbound"===o.custom.type.toLowerCase()&&"outbounddial"===o.custom.appType.toLowerCase()&&(o.custom.prefix=o.custom.phone?o.custom.phone.split("$")[0]:void 0,o.custom.callerId=o.custom.callerID?"CALLERID(all)="+o.custom.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.custom.type&&"outbound"===o.custom.type.toLowerCase()&&"outboundDial"===o.custom.appType&&(o.custom.phone=a.cutdigits?(o.custom.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.custom.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.custom.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.custom.options+="U(xcally-mixmonitor-context)"):o.custom.options=o.custom.options.replace("U(xcally-mixmonitor-context)",""));if(o.custom.appType&&"custom"===o.custom.appType);else switch((o.custom.app||o.custom.appType).toLowerCase()){case"set":o.custom.appdata=o.custom.name+"="+o.custom.value;break;case"custom":break;default:e[0]=o.custom.app,e[1]=o.custom.appdata,o.custom.appdata=e.join(",")}l(o.custom)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppcustomDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(n.appType||n.app).toUpperCase(),o.dial=angular.copy(n),o.dial.appdata)switch(o.dial.appType?o.dial.appType.toLowerCase():o.dial.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.dial.appdata.split(",");o.dial.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.dial.text=s.slice(1,s.length).join(",");break;case"message":o.dial.text=o.dial.appdata;break;case"set":o.dial.name=o.dial.appdata.split("=")[0],o.dial.value=o.dial.appdata.split("=")[1];break;case"agi":o.dial.project=o.dial.appdata;break;default:var r=o.dial.appdata.split(",");o.dial.tech=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.dial.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.dial.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.dial.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.dial.type&&"outbound"===o.dial.type.toLowerCase()&&"outbounddial"===o.dial.appType.toLowerCase()&&(o.dial.prefix=o.dial.phone?o.dial.phone.split("$")[0]:void 0,o.dial.callerId=o.dial.callerID?"CALLERID(all)="+o.dial.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.dial.type&&"outbound"===o.dial.type.toLowerCase()&&"outboundDial"===o.dial.appType&&(o.dial.phone=a.cutdigits?(o.dial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.dial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.dial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.dial.options+="U(xcally-mixmonitor-context)"):o.dial.options=o.dial.options.replace("U(xcally-mixmonitor-context)",""));if(o.dial.appType&&"custom"===o.dial.appType);else switch((o.dial.app||o.dial.appType).toLowerCase()){case"set":o.dial.appdata=o.dial.name+"="+o.dial.value;break;case"custom":break;default:e[0]=o.dial.tech,e[1]=o.dial.timeout,e[2]=o.dial.options,e[3]=o.dial.url,o.dial.appdata=e.join(",")}l(o.dial)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppdialDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.externaldial=angular.copy(e),o.externaldial.appdata)switch(o.externaldial.appType?o.externaldial.appType.toLowerCase():o.externaldial.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.externaldial.appdata.split(",");o.externaldial.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.externaldial.text=s.slice(1,s.length).join(",");break;case"message":o.externaldial.text=o.externaldial.appdata;break;case"set":o.externaldial.name=o.externaldial.appdata.split("=")[0],o.externaldial.value=o.externaldial.appdata.split("=")[1];break;case"agi":o.externaldial.project=o.externaldial.appdata;break;default:var r=o.externaldial.appdata.split(",");o.externaldial.trunk=r[0].split("/")[1],o.externaldial.phone=r[0].split("/")[2],o.externaldial.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.externaldial.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.externaldial.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.externaldial.type&&"outbound"===o.externaldial.type.toLowerCase()&&"outbounddial"===o.externaldial.appType.toLowerCase()&&(o.externaldial.prefix=o.externaldial.phone?o.externaldial.phone.split("$")[0]:void 0,o.externaldial.callerId=o.externaldial.callerID?"CALLERID(all)="+o.externaldial.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.externaldial.type&&"outbound"===o.externaldial.type.toLowerCase()&&"outboundDial"===o.externaldial.appType&&(o.externaldial.phone=a.cutdigits?(o.externaldial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.externaldial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.externaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.externaldial.options+="U(xcally-mixmonitor-context)"):o.externaldial.options=o.externaldial.options.replace("U(xcally-mixmonitor-context)",""));if(o.externaldial.appType&&"custom"===o.externaldial.appType);else switch((o.externaldial.app||o.externaldial.appType).toLowerCase()){case"set":o.externaldial.appdata=o.externaldial.name+"="+o.externaldial.value;break;case"custom":break;default:e[0]=["SIP",o.externaldial.trunk,o.externaldial.phone].join("/"),e[1]=o.externaldial.timeout,e[2]=o.externaldial.options,e[3]=o.externaldial.url,o.externaldial.appdata=e.join(",")}l(o.externaldial)},o.closeDialog=l,i.trunk.get({fields:"name",sort:"name"}).$promise.then(function(e){o.trunks=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppexternaldialDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.goto=angular.copy(e),o.goto.appdata)switch(o.goto.appType?o.goto.appType.toLowerCase():o.goto.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.goto.appdata.split(",");o.goto.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.goto.text=s.slice(1,s.length).join(",");break;case"message":o.goto.text=o.goto.appdata;break;case"set":o.goto.name=o.goto.appdata.split("=")[0],o.goto.value=o.goto.appdata.split("=")[1];break;case"agi":o.goto.project=o.goto.appdata;break;default:var r=o.goto.appdata.split(",");o.goto.context=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.goto.extension=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.goto.priority=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10)}function l(e){t.hide(e)}o.goto.type&&"outbound"===o.goto.type.toLowerCase()&&"outbounddial"===o.goto.appType.toLowerCase()&&(o.goto.prefix=o.goto.phone?o.goto.phone.split("$")[0]:void 0,o.goto.callerId=o.goto.callerID?"CALLERID(all)="+o.goto.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.goto.type&&"outbound"===o.goto.type.toLowerCase()&&"outboundDial"===o.goto.appType&&(o.goto.phone=a.cutdigits?(o.goto.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.goto.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.goto.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.goto.options+="U(xcally-mixmonitor-context)"):o.goto.options=o.goto.options.replace("U(xcally-mixmonitor-context)",""));if(o.goto.appType&&"custom"===o.goto.appType);else switch((o.goto.app||o.goto.appType).toLowerCase()){case"set":o.goto.appdata=o.goto.name+"="+o.goto.value;break;case"custom":break;default:e[0]=o.goto.context,e[1]=o.goto.extension,e[2]=o.goto.priority,o.goto.appdata=e.join(",")}l(o.goto)},o.closeDialog=l,i.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){o.contexts=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppgotoDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(n.appType||n.app).toUpperCase(),o.hangup=angular.copy(n),o.hangup.appdata)switch(o.hangup.appType?o.hangup.appType.toLowerCase():o.hangup.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.hangup.appdata.split(",");o.hangup.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.hangup.text=s.slice(1,s.length).join(",");break;case"message":o.hangup.text=o.hangup.appdata;break;case"set":o.hangup.name=o.hangup.appdata.split("=")[0],o.hangup.value=o.hangup.appdata.split("=")[1];break;case"agi":o.hangup.project=o.hangup.appdata;break;default:var r=o.hangup.appdata.split(",");o.hangup.appdata=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.hangup.type&&"outbound"===o.hangup.type.toLowerCase()&&"outbounddial"===o.hangup.appType.toLowerCase()&&(o.hangup.prefix=o.hangup.phone?o.hangup.phone.split("$")[0]:void 0,o.hangup.callerId=o.hangup.callerID?"CALLERID(all)="+o.hangup.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.hangup.type&&"outbound"===o.hangup.type.toLowerCase()&&"outboundDial"===o.hangup.appType&&(o.hangup.phone=a.cutdigits?(o.hangup.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.hangup.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.hangup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.hangup.options+="U(xcally-mixmonitor-context)"):o.hangup.options=o.hangup.options.replace("U(xcally-mixmonitor-context)",""));if(o.hangup.appType&&"custom"===o.hangup.appType);else switch((o.hangup.app||o.hangup.appType).toLowerCase()){case"set":o.hangup.appdata=o.hangup.name+"="+o.hangup.value;break;case"custom":break;default:e[0]=o.hangup.appdata,o.hangup.appdata=e.join(",")}l(o.hangup)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundApphangupDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.internaldial=angular.copy(e),o.internaldial.appdata)switch(o.internaldial.appType?o.internaldial.appType.toLowerCase():o.internaldial.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.internaldial.appdata.split(",");o.internaldial.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.internaldial.text=s.slice(1,s.length).join(",");break;case"message":o.internaldial.text=o.internaldial.appdata;break;case"set":o.internaldial.name=o.internaldial.appdata.split("=")[0],o.internaldial.value=o.internaldial.appdata.split("=")[1];break;case"agi":o.internaldial.project=o.internaldial.appdata;break;default:var r=o.internaldial.appdata.split(",");o.internaldial.user=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.internaldial.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.internaldial.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.internaldial.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.internaldial.type&&"outbound"===o.internaldial.type.toLowerCase()&&"outbounddial"===o.internaldial.appType.toLowerCase()&&(o.internaldial.prefix=o.internaldial.phone?o.internaldial.phone.split("$")[0]:void 0,o.internaldial.callerId=o.internaldial.callerID?"CALLERID(all)="+o.internaldial.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.internaldial.type&&"outbound"===o.internaldial.type.toLowerCase()&&"outboundDial"===o.internaldial.appType&&(o.internaldial.phone=a.cutdigits?(o.internaldial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.internaldial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.internaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.internaldial.options+="U(xcally-mixmonitor-context)"):o.internaldial.options=o.internaldial.options.replace("U(xcally-mixmonitor-context)",""));if(o.internaldial.appType&&"custom"===o.internaldial.appType);else switch((o.internaldial.app||o.internaldial.appType).toLowerCase()){case"set":o.internaldial.appdata=o.internaldial.name+"="+o.internaldial.value;break;case"custom":break;default:e[0]=o.internaldial.user,e[1]=o.internaldial.timeout,e[2]=o.internaldial.options,e[3]=o.internaldial.url,o.internaldial.appdata=e.join(",")}l(o.internaldial)},o.closeDialog=l,i.user.get({fields:"name",sort:"name"}).$promise.then(function(e){o.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppinternaldialDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditInboundAppintervalDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.playback=angular.copy(e),o.playback.appdata)switch(o.playback.appType?o.playback.appType.toLowerCase():o.playback.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.playback.appdata.split(",");o.playback.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.playback.text=s.slice(1,s.length).join(",");break;case"message":o.playback.text=o.playback.appdata;break;case"set":o.playback.name=o.playback.appdata.split("=")[0],o.playback.value=o.playback.appdata.split("=")[1];break;case"agi":o.playback.project=o.playback.appdata;break;default:var r=o.playback.appdata.split(",");o.playback.appdata=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.playback.options=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.playback.type&&"outbound"===o.playback.type.toLowerCase()&&"outbounddial"===o.playback.appType.toLowerCase()&&(o.playback.prefix=o.playback.phone?o.playback.phone.split("$")[0]:void 0,o.playback.callerId=o.playback.callerID?"CALLERID(all)="+o.playback.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.playback.type&&"outbound"===o.playback.type.toLowerCase()&&"outboundDial"===o.playback.appType&&(o.playback.phone=a.cutdigits?(o.playback.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.playback.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.playback.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.playback.options+="U(xcally-mixmonitor-context)"):o.playback.options=o.playback.options.replace("U(xcally-mixmonitor-context)",""));if(o.playback.appType&&"custom"===o.playback.appType);else switch((o.playback.app||o.playback.appType).toLowerCase()){case"set":o.playback.appdata=o.playback.name+"="+o.playback.value;break;case"custom":break;default:e[0]=o.playback.appdata,e[1]=o.playback.options,o.playback.appdata=e.join(",")}l(o.playback)},o.closeDialog=l,i.sound.get({fields:"name,save_name",sort:"name"}).$promise.then(function(e){o.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppplaybackDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.queue=angular.copy(e),o.queue.appdata)switch(o.queue.appType?o.queue.appType.toLowerCase():o.queue.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.queue.appdata.split(",");o.queue.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.queue.text=s.slice(1,s.length).join(",");break;case"message":o.queue.text=o.queue.appdata;break;case"set":o.queue.name=o.queue.appdata.split("=")[0],o.queue.value=o.queue.appdata.split("=")[1];break;case"agi":o.queue.project=o.queue.appdata;break;default:var r=o.queue.appdata.split(",");o.queue.queue=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.queue.options=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.queue.URL=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.queue.sound=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10),o.queue.timeout=_.isEmpty(r[4])?r[4]:isNaN(r[4])?r[4]:parseInt(r[4],10),o.queue.agi=_.isEmpty(r[5])?r[5]:isNaN(r[5])?r[5]:parseInt(r[5],10),o.queue.macro=_.isEmpty(r[6])?r[6]:isNaN(r[6])?r[6]:parseInt(r[6],10),o.queue.gosub=_.isEmpty(r[7])?r[7]:isNaN(r[7])?r[7]:parseInt(r[7],10),o.queue.rule=_.isEmpty(r[8])?r[8]:isNaN(r[8])?r[8]:parseInt(r[8],10),o.queue.position=_.isEmpty(r[9])?r[9]:isNaN(r[9])?r[9]:parseInt(r[9],10)}function l(e){t.hide(e)}o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outbounddial"===o.queue.appType.toLowerCase()&&(o.queue.prefix=o.queue.phone?o.queue.phone.split("$")[0]:void 0,o.queue.callerId=o.queue.callerID?"CALLERID(all)="+o.queue.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outboundDial"===o.queue.appType&&(o.queue.phone=a.cutdigits?(o.queue.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.queue.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.queue.options+="U(xcally-mixmonitor-context)"):o.queue.options=o.queue.options.replace("U(xcally-mixmonitor-context)",""));if(o.queue.appType&&"custom"===o.queue.appType);else switch((o.queue.app||o.queue.appType).toLowerCase()){case"set":o.queue.appdata=o.queue.name+"="+o.queue.value;break;case"custom":break;default:e[0]=o.queue.queue,e[1]=o.queue.options,e[2]=o.queue.URL,e[3]=o.queue.sound,e[4]=o.queue.timeout,e[5]=o.queue.agi,e[6]=o.queue.macro,e[7]=o.queue.gosub,e[8]=o.queue.rule,e[9]=o.queue.position,o.queue.appdata=e.join(",")}l(o.queue)},o.closeDialog=l,i.sound.get({fields:"name,save_name",sort:"name"}).$promise.then(function(e){o.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.voiceQueue.get({type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){o.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppqueueDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.ringgroup=angular.copy(e),o.ringgroup.appdata)switch(o.ringgroup.appType?o.ringgroup.appType.toLowerCase():o.ringgroup.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.ringgroup.appdata.split(",");o.ringgroup.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.ringgroup.text=s.slice(1,s.length).join(",");break;case"message":o.ringgroup.text=o.ringgroup.appdata;break;case"set":o.ringgroup.name=o.ringgroup.appdata.split("=")[0],o.ringgroup.value=o.ringgroup.appdata.split("=")[1];break;case"agi":o.ringgroup.project=o.ringgroup.appdata;break;default:var r=o.ringgroup.appdata.split(",");o.ringgroup.multipleUsers=r[0].split("&"),o.ringgroup.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.ringgroup.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.ringgroup.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.ringgroup.type&&"outbound"===o.ringgroup.type.toLowerCase()&&"outbounddial"===o.ringgroup.appType.toLowerCase()&&(o.ringgroup.prefix=o.ringgroup.phone?o.ringgroup.phone.split("$")[0]:void 0,o.ringgroup.callerId=o.ringgroup.callerID?"CALLERID(all)="+o.ringgroup.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.ringgroup.type&&"outbound"===o.ringgroup.type.toLowerCase()&&"outboundDial"===o.ringgroup.appType&&(o.ringgroup.phone=a.cutdigits?(o.ringgroup.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.ringgroup.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.ringgroup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.ringgroup.options+="U(xcally-mixmonitor-context)"):o.ringgroup.options=o.ringgroup.options.replace("U(xcally-mixmonitor-context)",""));if(o.ringgroup.appType&&"custom"===o.ringgroup.appType);else switch((o.ringgroup.app||o.ringgroup.appType).toLowerCase()){case"set":o.ringgroup.appdata=o.ringgroup.name+"="+o.ringgroup.value;break;case"custom":break;default:e[0]=o.ringgroup.multipleUsers.join("&"),e[1]=o.ringgroup.timeout,e[2]=o.ringgroup.options,e[3]=o.ringgroup.url,o.ringgroup.appdata=e.join(",")}l(o.ringgroup)},o.closeDialog=l,i.user.get({fields:"name",sort:"name"}).$promise.then(function(e){o.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppringgroupDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.set=angular.copy(e),o.set.appdata)switch(o.set.appType?o.set.appType.toLowerCase():o.set.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.set.appdata.split(",");o.set.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.set.text=s.slice(1,s.length).join(",");break;case"message":o.set.text=o.set.appdata;break;case"set":o.set.name=o.set.appdata.split("=")[0],o.set.value=o.set.appdata.split("=")[1];break;case"agi":o.set.project=o.set.appdata;break;default:var r=o.set.appdata.split("=");o.set.name=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.set.value=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.set.type&&"outbound"===o.set.type.toLowerCase()&&"outbounddial"===o.set.appType.toLowerCase()&&(o.set.prefix=o.set.phone?o.set.phone.split("$")[0]:void 0,o.set.callerId=o.set.callerID?"CALLERID(all)="+o.set.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.set.type&&"outbound"===o.set.type.toLowerCase()&&"outboundDial"===o.set.appType&&(o.set.phone=a.cutdigits?(o.set.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.set.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.set.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.set.options+="U(xcally-mixmonitor-context)"):o.set.options=o.set.options.replace("U(xcally-mixmonitor-context)",""));if(o.set.appType&&"custom"===o.set.appType);else switch((o.set.app||o.set.appType).toLowerCase()){case"set":o.set.appdata=o.set.name+"="+o.set.value;break;case"custom":break;default:e[0]=o.set.name,e[1]=o.set.value,o.set.appdata=e.join("=")}l(o.set)},o.closeDialog=l,i.variable.get({fields:"name",sort:"name"}).$promise.then(function(e){o.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppsetDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.voicemail=angular.copy(e),o.voicemail.appdata)switch(o.voicemail.appType?o.voicemail.appType.toLowerCase():o.voicemail.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.voicemail.appdata.split(",");o.voicemail.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.voicemail.text=s.slice(1,s.length).join(",");break;case"message":o.voicemail.text=o.voicemail.appdata;break;case"set":o.voicemail.name=o.voicemail.appdata.split("=")[0],o.voicemail.value=o.voicemail.appdata.split("=")[1];break;case"agi":o.voicemail.project=o.voicemail.appdata;break;default:var r=o.voicemail.appdata.split(",");o.voicemail.voiceMail=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.voicemail.options=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.voicemail.type&&"outbound"===o.voicemail.type.toLowerCase()&&"outbounddial"===o.voicemail.appType.toLowerCase()&&(o.voicemail.prefix=o.voicemail.phone?o.voicemail.phone.split("$")[0]:void 0,o.voicemail.callerId=o.voicemail.callerID?"CALLERID(all)="+o.voicemail.callerID:void 0),o.saveInboundRouteApp=function(){o.errors=[];var e=[];o.voicemail.type&&"outbound"===o.voicemail.type.toLowerCase()&&"outboundDial"===o.voicemail.appType&&(o.voicemail.phone=a.cutdigits?(o.voicemail.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.voicemail.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.voicemail.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.voicemail.options+="U(xcally-mixmonitor-context)"):o.voicemail.options=o.voicemail.options.replace("U(xcally-mixmonitor-context)",""));if(o.voicemail.appType&&"custom"===o.voicemail.appType);else switch((o.voicemail.app||o.voicemail.appType).toLowerCase()){case"set":o.voicemail.appdata=o.voicemail.name+"="+o.voicemail.value;break;case"custom":break;default:e[0]=o.voicemail.voiceMail,e[1]=o.voicemail.options,o.voicemail.appdata=e.join(",")}l(o.voicemail)},o.closeDialog=l,i.voiceMail.get({fields:"mailbox",sort:"mailbox"}).$promise.then(function(e){o.voiceMails=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMails",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","inboundrouteApp","inboundroute","api"],angular.module("app.voice").controller("EditInboundAppvoicemailDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.inboundroute=d||e.params.inboundroute||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoInboundRoutes=function(){e.go("app.voice.inboundroutes")},c.saveInboundRoute=function(){s.voiceExtension.update({id:c.inboundroute.id},c.inboundroute).$promise.then(function(){r.success({title:"InboundRoute updated!",msg:c.inboundroute.name?c.inboundroute.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","inboundroute"],angular.module("app.voice").controller("InboundRouteController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.inboundroutes=r||{count:0,rows:[]},v.table="inboundroutes",v.listOrder="",v.listOrderAsc=null,v.selectedInboundRoutes=[],v.query={fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},v.editstate=function(e,t){n.go("app.voice.inboundroutes.edit",{id:e.id,inboundroute:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the inboundroute?").htmlContent("<b>"+(e.name||"inboundroute")+"</b> will be deleted.").ariaLabel("delete inboundroute").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getInboundRoutes=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceExtension.get(v.query,f).$promise},v.createOrEditInboundRoute=function(e,t){i.show({controller:"CreateOrEditInboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundroutes/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{inboundroute:t,inboundroutes:v.inboundroutes.rows,license:v.license,setting:v.setting}})},v.deleteInboundRoute=A,v.exportSelectedInboundRoutes=function(){var e=angular.copy(v.selectedInboundRoutes);return v.selectedInboundRoutes=[],e},v.deleteSelectedInboundRoutes=function(e){var t=i.confirm().title("Are you sure want to delete the selected inboundroutes?").htmlContent("<b>"+v.selectedInboundRoutes.length+" selected</b> will be deleted.").ariaLabel("delete InboundRoutes").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedInboundRoutes.forEach(function(e){A(e)}),v.selectedInboundRoutes=[]})},v.deselectInboundRoutes=function(){v.selectedInboundRoutes=[]},v.selectAllInboundRoutes=function(){v.selectedInboundRoutes=v.inboundroutes.rows},l.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){v.contexts=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.inboundroutes=e||{count:0,rows:[]}}function A(e){l.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(v.inboundroutes.rows,{id:e.id}),v.inboundroutes.count-=1,v.inboundroutes.rows.length||v.getInboundRoutes(),c.success({title:"InboundRoute deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getInboundRoutes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","inboundroutes","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("InboundRoutesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_INTERNALROUTE",m.internalroute=angular.copy(s),m.internalroutes=o,m.newInternalRoute=!1,m.internalroute||(m.internalroute={appdata:"Internal Call",type:"internal",context:"from-sip"},m.title="VOICE.NEW_INTERNALROUTE",m.newInternalRoute=!0),m.addNewInternalRoute=function(){m.errors=[],r.voiceExtension.save(m.internalroute).$promise.then(function(e){m.internalroutes.unshift(e.toJSON()),i.success({title:"InternalRoute properly created",msg:m.internalroute.name?m.internalroute.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveInternalRoute=function(){m.errors=[],r.voiceExtension.update({id:m.internalroute.id},m.internalroute).$promise.then(function(e){var t=_.find(m.internalroutes,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"InternalRoute properly saved!",msg:m.internalroute.name?m.internalroute.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteInternalRoute=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The internalroute will be deleted.").ariaLabel("Delete InternalRoute").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceExtension.delete({id:m.internalroute.id}).$promise.then(function(){_.remove(m.internalroutes,{id:m.internalroute.id}),i.success({title:"InternalRoute properly deleted!",msg:(m.internalroute.name||"internalroute")+" has been deleted!"}),u(m.internalroute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","internalroutes","internalroute","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditInternalRouteDialogController",e)}(),function(){"use strict";function e(m,i,a,o,e){var u=this;function t(e,t){if(u.internalrouteApps.rows.length){var n=u.internalrouteApps.rows[t]?u.internalrouteApps.rows[t]:u.internalrouteApps.rows[0];i.show({controller:"EditInternalApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalroutes/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{internalrouteApp:n,internalroute:u.internalroute}}).then(function(e){e&&(e.id?u.internalrouteApps.rows[t]=e:u.internalrouteApps.rows.splice(t,0,e),s())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function s(){var e=["queue","playback"],t=2,n=[];n.push({type:"internal",app:"Set",appdata:"CDR(type)=internal",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id}),n.push({type:"internal",app:"Set",appdata:"XCALLY-MOTION-ANSWER=0",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id}),n.push({type:"internal",app:"Set",appdata:"XCALLY-MOTION-PROGRESS=0",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id}),n.push({type:"internal",app:"Set",appdata:"MONITOR_OPTIONS=ab",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id});for(var a=0,i=0;a<u.internalrouteApps.rows.length;a++,i=0){var o=u.internalrouteApps.rows[a],s=[],r=[];o.intervals="*,*,*,*"!==o.interval?[o.interval]:o.IntervalId?_.map(_.filter(u.intervals.rows,{IntervalId:o.IntervalId}),"interval"):[],o.context=u.internalroute.context,o.exten=u.internalroute.exten,o.type&&(o.type=o.type.toLowerCase()),o.hasOwnProperty("answer")&&e.includes(o.app.toLowerCase())&&"custom"!==o.appType&&(o.answer?(s.push({type:o.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-ANSWER}=0]?Answer",context:u.internalroute.context,exten:u.internalroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id}),s.push({type:o.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-ANSWER=1",context:u.internalroute.context,exten:u.internalroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id})):(s.push({type:o.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-PROGRESS}=0]?Progress",context:u.internalroute.context,exten:u.internalroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id}),s.push({type:o.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-PROGRESS=1",context:u.internalroute.context,exten:u.internalroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id})));for(var l=0;l<o.intervals.length;l++){var d=t+o.intervals.length,c=l===o.intervals.length-1?t+s.length+r.length+2:t+l+1;s.splice(l,0,{type:"internal",app:"GotoIfTime",appdata:o.intervals[l]+"?"+u.internalroute.context+",${EXTEN},"+d+":"+u.internalroute.context+",${EXTEN},"+c,exten:u.internalroute.exten,context:u.internalroute.context,priority:t+l,VoiceExtensionId:u.internalroute.id})}o.priority=s.length?_.last(s).priority+1:t,t=(r.length?_.last(r).priority:o.priority)+1,n=_.concat(n,s,[o],r)}n.push({type:"internal",app:"Hangup",exten:u.internalroute.exten,context:u.internalroute.context,priority:t,VoiceExtensionId:u.internalroute.id}),m.voiceExtension.addApplications({id:u.internalroute.id},_.sortBy(n,"priority")).$promise.then(function(e){u.internalrouteApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){u.internalrouteApps=e||{count:0,rows:[]}}u.currentUser=e.getCurrentUser(),u.internalroute={},u.internalrouteApps={count:0,rows:[]},u.selectedInternalRouteApps=[],u.query={sort:"priority"},u.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",type:"Internal",types:["always","custom","list"],fields:[],isApp:!1},{app:"Queue",appType:"queue",context:"from-sip",type:"Internal",options:"xX",appdata:",xX,,,300,,,,,",icon:"icon-apps",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",route:"sound",filters:{fields:"name,save_name",sort:"name"}},{name:"queues",route:"voiceQueue",filters:{type:"inbound",fields:"id,name,type",sort:"name",nolimit:!0}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Url",name:"URL",type:"text",param:2},{title:"Announce_Overrides",name:"sound",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}'",option:"sound.name",defaultValues:[{value:"''",option:"None"}],param:3},{title:"Timeout",name:"timeout",type:"number",min:0,param:4},{title:"Agi",name:"agi",type:"text",param:5},{title:"Macro",name:"macro",type:"text",param:6},{title:"GoSub",name:"gosub",type:"text",param:7},{title:"Rule",name:"rule",type:"text",param:8},{title:"Position",name:"position",type:"number",min:0,param:9},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Playback",appType:"playback",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",route:"sound",filters:{fields:"name,save_name",sort:"name"}}],fields:[{title:"Audio_Files",name:"appdata",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}'",option:"appdata.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Dial",appType:"dial",context:"from-sip",type:"Internal",icon:"icon-apps",options:"xX",interval:"*,*,*,*",isApp:!0,fields:[{title:"Technology/Resource",name:"tech",type:"text",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"internalDial",context:"from-sip",type:"Internal",icon:"icon-apps",options:"xX",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"users",route:"user",filters:{fields:"name",sort:"name"}}],fields:[{title:"User",name:"user",type:"apiselect",values:"users",value:"'SIP/{{user.name}}'",option:"user.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"externalDial",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"trunks",route:"trunk",filters:{fields:"name",sort:"name"}}],fields:[{title:"Trunk",name:"trunk",type:"apiselect",values:"trunks",value:"trunk.name",option:"trunk.name",required:!0,param:0},{title:"Phone",name:"phone",type:"text"},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"ringGroup",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"users",route:"user",filters:{fields:"name",sort:"name"}}],fields:[{title:"User",name:"multipleUsers",type:"apiselect",multiple:!0,values:"users",value:"'SIP/{{multipleUsers.name}}'",option:"multipleUsers.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"AGI",alias:"CallySquare",appType:"agi",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"projects",route:"squareProject",filters:{fields:"name",sort:"name"}}],fields:[{title:"Project",name:"project",type:"apiselect",values:"projects",value:"'agi://127.0.0.1/square,{{project.name}}'",option:"project.name",required:!0,param:0}]},{app:"goto",appType:"goTo",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"contexts",route:"voiceContext",filters:{fields:"name",sort:"name"}}],fields:[{title:"Context",name:"context",type:"apiselect",values:"contexts",value:"context.name",option:"context.name",required:!0,param:0},{title:"Extension",name:"extension",type:"text",required:!0,param:1},{title:"Priority",name:"priority",type:"text",required:!0,param:2}]},{app:"hangup",appType:"hangup",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Hangup_Cause",name:"appdata",type:"select",param:0,values:[{option:"HANGUPCAUSE_1",value:"'1'"},{option:"HANGUPCAUSE_16",value:"'16'"},{option:"HANGUPCAUSE_17",value:"'17'"},{option:"HANGUPCAUSE_18",value:"'18'"},{option:"HANGUPCAUSE_21",value:"'21'"},{option:"HANGUPCAUSE_22",value:"'22'"},{option:"HANGUPCAUSE_27",value:"'27'"},{option:"HANGUPCAUSE_38",value:"'38'"},{option:"HANGUPCAUSE_41",value:"'41'"}],translate:!0,required:!0,general:!0}]},{app:"Set",appType:"set",context:"from-sip",type:"Internal",separator:"=",icon:"icon-apps",interval:"*,*,*,*",extraApi:[{name:"variables",route:"variable",filters:{fields:"name",sort:"name"}}],isApp:!0,fields:[{title:"Variable",name:"name",type:"apiselect",values:"variables",value:"name.name",option:"name.name",required:!0,param:0},{title:"Value",name:"value",type:"text",required:!0,param:1}]},{app:null,appType:"custom",icon:"icon-apps",type:"Internal",interval:"*,*,*,*",isApp:!0,fields:[{title:"Application_Name",name:"app",type:"text",required:!0,param:0},{title:"Arguments",name:"appdata",type:"text",param:1}]},{app:"Voicemail",appType:"voicemail",context:"from-sip",icon:"icon-apps",type:"Internal",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"voiceMails",route:"voiceMail",filters:{fields:"mailbox",sort:"mailbox"}}],fields:[{title:"Mailbox@Context",name:"voiceMail",type:"apiselect",values:"voiceMails",value:"'{{voiceMail.mailbox}}@from-voicemail'",option:"voiceMail.mailbox",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1}]}],["app"]),{isApp:!1}),u.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},u.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){s()}},u.init=function(e){u.internalroute=e,u.query.VoiceExtensionId=e.id,u.query.isApp=!0,u.query.nolimit=!0,u.getInternalRouteApps(),u.getIntervals()},u.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){u.internalrouteApps.rows.splice(t,1),s()},function(){console.log("CANCEL")})},u.getInternalRouteApps=function(){u.promise=m.voiceExtension.get(u.query,n).$promise},u.editInternalRouteApp=t,u.editInterval=function(e,t){if(u.internalrouteApps.rows.length){var n=u.internalrouteApps.rows[t]?u.internalrouteApps.rows[t]:u.internalrouteApps.rows[0];i.show({controller:"EditInternalAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalroutes/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,s())})}},u.deleteInternalRouteApp=function(e){_.remove(u.internalrouteApps.rows,{id:e.id}),s(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},u.deleteSelectedInternalRouteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+u.selectedInternalRouteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){u.selectedInternalRouteApps.forEach(function(e){_.remove(u.internalrouteApps.rows,{id:e.id})}),u.selectedInternalRouteApps=[],s()})},u.rewriteRouting=s,u.getIntervals=function(){return m.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){u.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.voice").controller("InternalRouteActionsController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.agi=angular.copy(e),o.agi.appdata)switch(o.agi.appType?o.agi.appType.toLowerCase():o.agi.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.agi.appdata.split(",");o.agi.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.agi.text=s.slice(1,s.length).join(",");break;case"message":o.agi.text=o.agi.appdata;break;case"set":o.agi.name=o.agi.appdata.split("=")[0],o.agi.value=o.agi.appdata.split("=")[1];break;case"agi":o.agi.project=o.agi.appdata;break;default:var r=o.agi.appdata.split(",");o.agi.project=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.agi.type&&"outbound"===o.agi.type.toLowerCase()&&"outbounddial"===o.agi.appType.toLowerCase()&&(o.agi.prefix=o.agi.phone?o.agi.phone.split("$")[0]:void 0,o.agi.callerId=o.agi.callerID?"CALLERID(all)="+o.agi.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.agi.type&&"outbound"===o.agi.type.toLowerCase()&&"outboundDial"===o.agi.appType&&(o.agi.phone=a.cutdigits?(o.agi.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.agi.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.agi.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.agi.options+="U(xcally-mixmonitor-context)"):o.agi.options=o.agi.options.replace("U(xcally-mixmonitor-context)",""));if(o.agi.appType&&"custom"===o.agi.appType);else switch((o.agi.app||o.agi.appType).toLowerCase()){case"set":o.agi.appdata=o.agi.name+"="+o.agi.value;break;case"custom":break;default:e[0]=o.agi.project,o.agi.appdata=e.join(",")}l(o.agi)},o.closeDialog=l,i.squareProject.get({fields:"name",sort:"name"}).$promise.then(function(e){o.projects=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppagiDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(n.appType||n.app).toUpperCase(),o.custom=angular.copy(n),o.custom.appdata)switch(o.custom.appType?o.custom.appType.toLowerCase():o.custom.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.custom.appdata.split(",");o.custom.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.custom.text=s.slice(1,s.length).join(",");break;case"message":o.custom.text=o.custom.appdata;break;case"set":o.custom.name=o.custom.appdata.split("=")[0],o.custom.value=o.custom.appdata.split("=")[1];break;case"agi":o.custom.project=o.custom.appdata;break;default:var r=o.custom.appdata.split(",");o.custom.app=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.custom.appdata=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.custom.type&&"outbound"===o.custom.type.toLowerCase()&&"outbounddial"===o.custom.appType.toLowerCase()&&(o.custom.prefix=o.custom.phone?o.custom.phone.split("$")[0]:void 0,o.custom.callerId=o.custom.callerID?"CALLERID(all)="+o.custom.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.custom.type&&"outbound"===o.custom.type.toLowerCase()&&"outboundDial"===o.custom.appType&&(o.custom.phone=a.cutdigits?(o.custom.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.custom.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.custom.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.custom.options+="U(xcally-mixmonitor-context)"):o.custom.options=o.custom.options.replace("U(xcally-mixmonitor-context)",""));if(o.custom.appType&&"custom"===o.custom.appType);else switch((o.custom.app||o.custom.appType).toLowerCase()){case"set":o.custom.appdata=o.custom.name+"="+o.custom.value;break;case"custom":break;default:e[0]=o.custom.app,e[1]=o.custom.appdata,o.custom.appdata=e.join(",")}l(o.custom)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppcustomDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(n.appType||n.app).toUpperCase(),o.dial=angular.copy(n),o.dial.appdata)switch(o.dial.appType?o.dial.appType.toLowerCase():o.dial.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.dial.appdata.split(",");o.dial.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.dial.text=s.slice(1,s.length).join(",");break;case"message":o.dial.text=o.dial.appdata;break;case"set":o.dial.name=o.dial.appdata.split("=")[0],o.dial.value=o.dial.appdata.split("=")[1];break;case"agi":o.dial.project=o.dial.appdata;break;default:var r=o.dial.appdata.split(",");o.dial.tech=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.dial.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.dial.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.dial.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.dial.type&&"outbound"===o.dial.type.toLowerCase()&&"outbounddial"===o.dial.appType.toLowerCase()&&(o.dial.prefix=o.dial.phone?o.dial.phone.split("$")[0]:void 0,o.dial.callerId=o.dial.callerID?"CALLERID(all)="+o.dial.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.dial.type&&"outbound"===o.dial.type.toLowerCase()&&"outboundDial"===o.dial.appType&&(o.dial.phone=a.cutdigits?(o.dial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.dial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.dial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.dial.options+="U(xcally-mixmonitor-context)"):o.dial.options=o.dial.options.replace("U(xcally-mixmonitor-context)",""));if(o.dial.appType&&"custom"===o.dial.appType);else switch((o.dial.app||o.dial.appType).toLowerCase()){case"set":o.dial.appdata=o.dial.name+"="+o.dial.value;break;case"custom":break;default:e[0]=o.dial.tech,e[1]=o.dial.timeout,e[2]=o.dial.options,e[3]=o.dial.url,o.dial.appdata=e.join(",")}l(o.dial)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppdialDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.externaldial=angular.copy(e),o.externaldial.appdata)switch(o.externaldial.appType?o.externaldial.appType.toLowerCase():o.externaldial.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.externaldial.appdata.split(",");o.externaldial.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.externaldial.text=s.slice(1,s.length).join(",");break;case"message":o.externaldial.text=o.externaldial.appdata;break;case"set":o.externaldial.name=o.externaldial.appdata.split("=")[0],o.externaldial.value=o.externaldial.appdata.split("=")[1];break;case"agi":o.externaldial.project=o.externaldial.appdata;break;default:var r=o.externaldial.appdata.split(",");o.externaldial.trunk=r[0].split("/")[1],o.externaldial.phone=r[0].split("/")[2],o.externaldial.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.externaldial.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.externaldial.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.externaldial.type&&"outbound"===o.externaldial.type.toLowerCase()&&"outbounddial"===o.externaldial.appType.toLowerCase()&&(o.externaldial.prefix=o.externaldial.phone?o.externaldial.phone.split("$")[0]:void 0,o.externaldial.callerId=o.externaldial.callerID?"CALLERID(all)="+o.externaldial.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.externaldial.type&&"outbound"===o.externaldial.type.toLowerCase()&&"outboundDial"===o.externaldial.appType&&(o.externaldial.phone=a.cutdigits?(o.externaldial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.externaldial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.externaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.externaldial.options+="U(xcally-mixmonitor-context)"):o.externaldial.options=o.externaldial.options.replace("U(xcally-mixmonitor-context)",""));if(o.externaldial.appType&&"custom"===o.externaldial.appType);else switch((o.externaldial.app||o.externaldial.appType).toLowerCase()){case"set":o.externaldial.appdata=o.externaldial.name+"="+o.externaldial.value;break;case"custom":break;default:e[0]=["SIP",o.externaldial.trunk,o.externaldial.phone].join("/"),e[1]=o.externaldial.timeout,e[2]=o.externaldial.options,e[3]=o.externaldial.url,o.externaldial.appdata=e.join(",")}l(o.externaldial)},o.closeDialog=l,i.trunk.get({fields:"name",sort:"name"}).$promise.then(function(e){o.trunks=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppexternaldialDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.goto=angular.copy(e),o.goto.appdata)switch(o.goto.appType?o.goto.appType.toLowerCase():o.goto.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.goto.appdata.split(",");o.goto.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.goto.text=s.slice(1,s.length).join(",");break;case"message":o.goto.text=o.goto.appdata;break;case"set":o.goto.name=o.goto.appdata.split("=")[0],o.goto.value=o.goto.appdata.split("=")[1];break;case"agi":o.goto.project=o.goto.appdata;break;default:var r=o.goto.appdata.split(",");o.goto.context=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.goto.extension=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.goto.priority=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10)}function l(e){t.hide(e)}o.goto.type&&"outbound"===o.goto.type.toLowerCase()&&"outbounddial"===o.goto.appType.toLowerCase()&&(o.goto.prefix=o.goto.phone?o.goto.phone.split("$")[0]:void 0,o.goto.callerId=o.goto.callerID?"CALLERID(all)="+o.goto.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.goto.type&&"outbound"===o.goto.type.toLowerCase()&&"outboundDial"===o.goto.appType&&(o.goto.phone=a.cutdigits?(o.goto.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.goto.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.goto.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.goto.options+="U(xcally-mixmonitor-context)"):o.goto.options=o.goto.options.replace("U(xcally-mixmonitor-context)",""));if(o.goto.appType&&"custom"===o.goto.appType);else switch((o.goto.app||o.goto.appType).toLowerCase()){case"set":o.goto.appdata=o.goto.name+"="+o.goto.value;break;case"custom":break;default:e[0]=o.goto.context,e[1]=o.goto.extension,e[2]=o.goto.priority,o.goto.appdata=e.join(",")}l(o.goto)},o.closeDialog=l,i.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){o.contexts=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppgotoDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(n.appType||n.app).toUpperCase(),o.hangup=angular.copy(n),o.hangup.appdata)switch(o.hangup.appType?o.hangup.appType.toLowerCase():o.hangup.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.hangup.appdata.split(",");o.hangup.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.hangup.text=s.slice(1,s.length).join(",");break;case"message":o.hangup.text=o.hangup.appdata;break;case"set":o.hangup.name=o.hangup.appdata.split("=")[0],o.hangup.value=o.hangup.appdata.split("=")[1];break;case"agi":o.hangup.project=o.hangup.appdata;break;default:var r=o.hangup.appdata.split(",");o.hangup.appdata=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10)}function l(e){t.hide(e)}o.hangup.type&&"outbound"===o.hangup.type.toLowerCase()&&"outbounddial"===o.hangup.appType.toLowerCase()&&(o.hangup.prefix=o.hangup.phone?o.hangup.phone.split("$")[0]:void 0,o.hangup.callerId=o.hangup.callerID?"CALLERID(all)="+o.hangup.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.hangup.type&&"outbound"===o.hangup.type.toLowerCase()&&"outboundDial"===o.hangup.appType&&(o.hangup.phone=a.cutdigits?(o.hangup.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.hangup.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.hangup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.hangup.options+="U(xcally-mixmonitor-context)"):o.hangup.options=o.hangup.options.replace("U(xcally-mixmonitor-context)",""));if(o.hangup.appType&&"custom"===o.hangup.appType);else switch((o.hangup.app||o.hangup.appType).toLowerCase()){case"set":o.hangup.appdata=o.hangup.name+"="+o.hangup.value;break;case"custom":break;default:e[0]=o.hangup.appdata,o.hangup.appdata=e.join(",")}l(o.hangup)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalApphangupDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.internaldial=angular.copy(e),o.internaldial.appdata)switch(o.internaldial.appType?o.internaldial.appType.toLowerCase():o.internaldial.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.internaldial.appdata.split(",");o.internaldial.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.internaldial.text=s.slice(1,s.length).join(",");break;case"message":o.internaldial.text=o.internaldial.appdata;break;case"set":o.internaldial.name=o.internaldial.appdata.split("=")[0],o.internaldial.value=o.internaldial.appdata.split("=")[1];break;case"agi":o.internaldial.project=o.internaldial.appdata;break;default:var r=o.internaldial.appdata.split(",");o.internaldial.user=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.internaldial.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.internaldial.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.internaldial.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.internaldial.type&&"outbound"===o.internaldial.type.toLowerCase()&&"outbounddial"===o.internaldial.appType.toLowerCase()&&(o.internaldial.prefix=o.internaldial.phone?o.internaldial.phone.split("$")[0]:void 0,o.internaldial.callerId=o.internaldial.callerID?"CALLERID(all)="+o.internaldial.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.internaldial.type&&"outbound"===o.internaldial.type.toLowerCase()&&"outboundDial"===o.internaldial.appType&&(o.internaldial.phone=a.cutdigits?(o.internaldial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.internaldial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.internaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.internaldial.options+="U(xcally-mixmonitor-context)"):o.internaldial.options=o.internaldial.options.replace("U(xcally-mixmonitor-context)",""));if(o.internaldial.appType&&"custom"===o.internaldial.appType);else switch((o.internaldial.app||o.internaldial.appType).toLowerCase()){case"set":o.internaldial.appdata=o.internaldial.name+"="+o.internaldial.value;break;case"custom":break;default:e[0]=o.internaldial.user,e[1]=o.internaldial.timeout,e[2]=o.internaldial.options,e[3]=o.internaldial.url,o.internaldial.appdata=e.join(",")}l(o.internaldial)},o.closeDialog=l,i.user.get({fields:"name",sort:"name"}).$promise.then(function(e){o.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppinternaldialDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditInternalAppintervalDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.playback=angular.copy(e),o.playback.appdata)switch(o.playback.appType?o.playback.appType.toLowerCase():o.playback.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.playback.appdata.split(",");o.playback.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.playback.text=s.slice(1,s.length).join(",");break;case"message":o.playback.text=o.playback.appdata;break;case"set":o.playback.name=o.playback.appdata.split("=")[0],o.playback.value=o.playback.appdata.split("=")[1];break;case"agi":o.playback.project=o.playback.appdata;break;default:var r=o.playback.appdata.split(",");o.playback.appdata=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.playback.options=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.playback.type&&"outbound"===o.playback.type.toLowerCase()&&"outbounddial"===o.playback.appType.toLowerCase()&&(o.playback.prefix=o.playback.phone?o.playback.phone.split("$")[0]:void 0,o.playback.callerId=o.playback.callerID?"CALLERID(all)="+o.playback.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.playback.type&&"outbound"===o.playback.type.toLowerCase()&&"outboundDial"===o.playback.appType&&(o.playback.phone=a.cutdigits?(o.playback.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.playback.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.playback.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.playback.options+="U(xcally-mixmonitor-context)"):o.playback.options=o.playback.options.replace("U(xcally-mixmonitor-context)",""));if(o.playback.appType&&"custom"===o.playback.appType);else switch((o.playback.app||o.playback.appType).toLowerCase()){case"set":o.playback.appdata=o.playback.name+"="+o.playback.value;break;case"custom":break;default:e[0]=o.playback.appdata,e[1]=o.playback.options,o.playback.appdata=e.join(",")}l(o.playback)},o.closeDialog=l,i.sound.get({fields:"name,save_name",sort:"name"}).$promise.then(function(e){o.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppplaybackDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.queue=angular.copy(e),o.queue.appdata)switch(o.queue.appType?o.queue.appType.toLowerCase():o.queue.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.queue.appdata.split(",");o.queue.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.queue.text=s.slice(1,s.length).join(",");break;case"message":o.queue.text=o.queue.appdata;break;case"set":o.queue.name=o.queue.appdata.split("=")[0],o.queue.value=o.queue.appdata.split("=")[1];break;case"agi":o.queue.project=o.queue.appdata;break;default:var r=o.queue.appdata.split(",");o.queue.queue=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.queue.options=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.queue.URL=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.queue.sound=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10),o.queue.timeout=_.isEmpty(r[4])?r[4]:isNaN(r[4])?r[4]:parseInt(r[4],10),o.queue.agi=_.isEmpty(r[5])?r[5]:isNaN(r[5])?r[5]:parseInt(r[5],10),o.queue.macro=_.isEmpty(r[6])?r[6]:isNaN(r[6])?r[6]:parseInt(r[6],10),o.queue.gosub=_.isEmpty(r[7])?r[7]:isNaN(r[7])?r[7]:parseInt(r[7],10),o.queue.rule=_.isEmpty(r[8])?r[8]:isNaN(r[8])?r[8]:parseInt(r[8],10),o.queue.position=_.isEmpty(r[9])?r[9]:isNaN(r[9])?r[9]:parseInt(r[9],10)}function l(e){t.hide(e)}o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outbounddial"===o.queue.appType.toLowerCase()&&(o.queue.prefix=o.queue.phone?o.queue.phone.split("$")[0]:void 0,o.queue.callerId=o.queue.callerID?"CALLERID(all)="+o.queue.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.queue.type&&"outbound"===o.queue.type.toLowerCase()&&"outboundDial"===o.queue.appType&&(o.queue.phone=a.cutdigits?(o.queue.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.queue.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.queue.options+="U(xcally-mixmonitor-context)"):o.queue.options=o.queue.options.replace("U(xcally-mixmonitor-context)",""));if(o.queue.appType&&"custom"===o.queue.appType);else switch((o.queue.app||o.queue.appType).toLowerCase()){case"set":o.queue.appdata=o.queue.name+"="+o.queue.value;break;case"custom":break;default:e[0]=o.queue.queue,e[1]=o.queue.options,e[2]=o.queue.URL,e[3]=o.queue.sound,e[4]=o.queue.timeout,e[5]=o.queue.agi,e[6]=o.queue.macro,e[7]=o.queue.gosub,e[8]=o.queue.rule,e[9]=o.queue.position,o.queue.appdata=e.join(",")}l(o.queue)},o.closeDialog=l,i.sound.get({fields:"name,save_name",sort:"name"}).$promise.then(function(e){o.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.voiceQueue.get({type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){o.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppqueueDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.ringgroup=angular.copy(e),o.ringgroup.appdata)switch(o.ringgroup.appType?o.ringgroup.appType.toLowerCase():o.ringgroup.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.ringgroup.appdata.split(",");o.ringgroup.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.ringgroup.text=s.slice(1,s.length).join(",");break;case"message":o.ringgroup.text=o.ringgroup.appdata;break;case"set":o.ringgroup.name=o.ringgroup.appdata.split("=")[0],o.ringgroup.value=o.ringgroup.appdata.split("=")[1];break;case"agi":o.ringgroup.project=o.ringgroup.appdata;break;default:var r=o.ringgroup.appdata.split(",");o.ringgroup.multipleUsers=r[0].split("&"),o.ringgroup.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.ringgroup.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.ringgroup.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.ringgroup.type&&"outbound"===o.ringgroup.type.toLowerCase()&&"outbounddial"===o.ringgroup.appType.toLowerCase()&&(o.ringgroup.prefix=o.ringgroup.phone?o.ringgroup.phone.split("$")[0]:void 0,o.ringgroup.callerId=o.ringgroup.callerID?"CALLERID(all)="+o.ringgroup.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.ringgroup.type&&"outbound"===o.ringgroup.type.toLowerCase()&&"outboundDial"===o.ringgroup.appType&&(o.ringgroup.phone=a.cutdigits?(o.ringgroup.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.ringgroup.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.ringgroup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.ringgroup.options+="U(xcally-mixmonitor-context)"):o.ringgroup.options=o.ringgroup.options.replace("U(xcally-mixmonitor-context)",""));if(o.ringgroup.appType&&"custom"===o.ringgroup.appType);else switch((o.ringgroup.app||o.ringgroup.appType).toLowerCase()){case"set":o.ringgroup.appdata=o.ringgroup.name+"="+o.ringgroup.value;break;case"custom":break;default:e[0]=o.ringgroup.multipleUsers.join("&"),e[1]=o.ringgroup.timeout,e[2]=o.ringgroup.options,e[3]=o.ringgroup.url,o.ringgroup.appdata=e.join(",")}l(o.ringgroup)},o.closeDialog=l,i.user.get({fields:"name",sort:"name"}).$promise.then(function(e){o.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppringgroupDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.set=angular.copy(e),o.set.appdata)switch(o.set.appType?o.set.appType.toLowerCase():o.set.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.set.appdata.split(",");o.set.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.set.text=s.slice(1,s.length).join(",");break;case"message":o.set.text=o.set.appdata;break;case"set":o.set.name=o.set.appdata.split("=")[0],o.set.value=o.set.appdata.split("=")[1];break;case"agi":o.set.project=o.set.appdata;break;default:var r=o.set.appdata.split("=");o.set.name=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.set.value=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.set.type&&"outbound"===o.set.type.toLowerCase()&&"outbounddial"===o.set.appType.toLowerCase()&&(o.set.prefix=o.set.phone?o.set.phone.split("$")[0]:void 0,o.set.callerId=o.set.callerID?"CALLERID(all)="+o.set.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.set.type&&"outbound"===o.set.type.toLowerCase()&&"outboundDial"===o.set.appType&&(o.set.phone=a.cutdigits?(o.set.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.set.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.set.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.set.options+="U(xcally-mixmonitor-context)"):o.set.options=o.set.options.replace("U(xcally-mixmonitor-context)",""));if(o.set.appType&&"custom"===o.set.appType);else switch((o.set.app||o.set.appType).toLowerCase()){case"set":o.set.appdata=o.set.name+"="+o.set.value;break;case"custom":break;default:e[0]=o.set.name,e[1]=o.set.value,o.set.appdata=e.join("=")}l(o.set)},o.closeDialog=l,i.variable.get({fields:"name",sort:"name"}).$promise.then(function(e){o.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppsetDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.voicemail=angular.copy(e),o.voicemail.appdata)switch(o.voicemail.appType?o.voicemail.appType.toLowerCase():o.voicemail.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.voicemail.appdata.split(",");o.voicemail.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.voicemail.text=s.slice(1,s.length).join(",");break;case"message":o.voicemail.text=o.voicemail.appdata;break;case"set":o.voicemail.name=o.voicemail.appdata.split("=")[0],o.voicemail.value=o.voicemail.appdata.split("=")[1];break;case"agi":o.voicemail.project=o.voicemail.appdata;break;default:var r=o.voicemail.appdata.split(",");o.voicemail.voiceMail=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.voicemail.options=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.voicemail.type&&"outbound"===o.voicemail.type.toLowerCase()&&"outbounddial"===o.voicemail.appType.toLowerCase()&&(o.voicemail.prefix=o.voicemail.phone?o.voicemail.phone.split("$")[0]:void 0,o.voicemail.callerId=o.voicemail.callerID?"CALLERID(all)="+o.voicemail.callerID:void 0),o.saveInternalRouteApp=function(){o.errors=[];var e=[];o.voicemail.type&&"outbound"===o.voicemail.type.toLowerCase()&&"outboundDial"===o.voicemail.appType&&(o.voicemail.phone=a.cutdigits?(o.voicemail.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.voicemail.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.voicemail.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.voicemail.options+="U(xcally-mixmonitor-context)"):o.voicemail.options=o.voicemail.options.replace("U(xcally-mixmonitor-context)",""));if(o.voicemail.appType&&"custom"===o.voicemail.appType);else switch((o.voicemail.app||o.voicemail.appType).toLowerCase()){case"set":o.voicemail.appdata=o.voicemail.name+"="+o.voicemail.value;break;case"custom":break;default:e[0]=o.voicemail.voiceMail,e[1]=o.voicemail.options,o.voicemail.appdata=e.join(",")}l(o.voicemail)},o.closeDialog=l,i.voiceMail.get({fields:"mailbox",sort:"mailbox"}).$promise.then(function(e){o.voiceMails=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMails",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","internalrouteApp","internalroute","api"],angular.module("app.voice").controller("EditInternalAppvoicemailDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.internalroute=d||e.params.internalroute||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoInternalRoutes=function(){e.go("app.voice.internalroutes")},c.saveInternalRoute=function(){s.voiceExtension.update({id:c.internalroute.id},c.internalroute).$promise.then(function(){r.success({title:"InternalRoute updated!",msg:c.internalroute.name?c.internalroute.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","internalroute"],angular.module("app.voice").controller("InternalRouteController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.internalroutes=r||{count:0,rows:[]},v.table="internalroutes",v.listOrder="",v.listOrderAsc=null,v.selectedInternalRoutes=[],v.query={fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},v.editstate=function(e,t){n.go("app.voice.internalroutes.edit",{id:e.id,internalroute:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the internalroute?").htmlContent("<b>"+(e.name||"internalroute")+"</b> will be deleted.").ariaLabel("delete internalroute").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getInternalRoutes=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceExtension.get(v.query,f).$promise},v.createOrEditInternalRoute=function(e,t){i.show({controller:"CreateOrEditInternalRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalroutes/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{internalroute:t,internalroutes:v.internalroutes.rows,license:v.license,setting:v.setting}})},v.deleteInternalRoute=A,v.exportSelectedInternalRoutes=function(){var e=angular.copy(v.selectedInternalRoutes);return v.selectedInternalRoutes=[],e},v.deleteSelectedInternalRoutes=function(e){var t=i.confirm().title("Are you sure want to delete the selected internalroutes?").htmlContent("<b>"+v.selectedInternalRoutes.length+" selected</b> will be deleted.").ariaLabel("delete InternalRoutes").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedInternalRoutes.forEach(function(e){A(e)}),v.selectedInternalRoutes=[]})},v.deselectInternalRoutes=function(){v.selectedInternalRoutes=[]},v.selectAllInternalRoutes=function(){v.selectedInternalRoutes=v.internalroutes.rows},l.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){v.contexts=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.internalroutes=e||{count:0,rows:[]}}function A(e){l.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(v.internalroutes.rows,{id:e.id}),v.internalroutes.count-=1,v.internalroutes.rows.length||v.getInternalRoutes(),c.success({title:"InternalRoute deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getInternalRoutes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","internalroutes","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("InternalRoutesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_MUSICONHOLD",m.musiconhold=angular.copy(s),m.musiconholds=o,m.newMusicOnHold=!1,m.musiconhold||(m.musiconhold={mode:"files"},m.title="VOICE.NEW_MUSICONHOLD",m.newMusicOnHold=!0),m.addNewMusicOnHold=function(){m.errors=[],r.voiceMusicOnHold.save(m.musiconhold).$promise.then(function(e){m.musiconholds.unshift(e.toJSON()),i.success({title:"MusicOnHold properly created",msg:m.musiconhold.name?m.musiconhold.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMusicOnHold=function(){m.errors=[],r.voiceMusicOnHold.update({id:m.musiconhold.id},m.musiconhold).$promise.then(function(e){var t=_.find(m.musiconholds,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"MusicOnHold properly saved!",msg:m.musiconhold.name?m.musiconhold.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMusicOnHold=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The musiconhold will be deleted.").ariaLabel("Delete MusicOnHold").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceMusicOnHold.delete({id:m.musiconhold.id}).$promise.then(function(){_.remove(m.musiconholds,{id:m.musiconhold.id}),i.success({title:"MusicOnHold properly deleted!",msg:(m.musiconhold.name||"musiconhold")+" has been deleted!"}),u(m.musiconhold)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","musiconholds","musiconhold","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditMusicOnHoldDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.musiconhold={},c.musiconholdMohSounds={count:0,rows:[]},c.selectedMusicOnHoldMohSounds=[],c.query={fields:"createdAt,updatedAt,id,save_name,converted_format,audio,id,createdAt",limit:10,page:1},c.init=function(e){c.musiconhold=e,c.query.id=c.musiconhold.id,c.query.VoiceMusicOnHoldId=c.musiconhold.id,c.getMusicOnHoldMohSounds()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the mohSound?").htmlContent("<b>"+(e.name||"mohSound")+"</b> will be deleted.").ariaLabel("delete mohSound").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.voiceMusicOnHoldDownload=function(o,e){return l.sound.download({id:o.id,exists:!0}).$promise.then(function(e){var t=[e.buffer],n="mohSound"+o.id,a=new Blob(t,{type:e.type});n=o.converted_format?o.save_name+"."+o.converted_format:o.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getMusicOnHoldMohSounds=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceMusicOnHold.getSounds(c.query,p).$promise},c.createOrEditMusicOnHoldMohSound=function(e,t){o.show({controller:"CreateOrEditMohSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:c.musiconhold,mohSound:t,mohSounds:c.musiconholdMohSounds.rows,license:null,setting:null}})},c.exportSelectedMusicOnHoldMohSounds=function(){var e=angular.copy(c.selectedMusicOnHoldMohSounds);return c.selectedMusicOnHoldMohSounds=[],e},c.deleteMusicOnHoldMohSound=g,c.deleteSelectedMusicOnHoldMohSounds=function(e){var t=o.confirm().title("Are you sure want to delete the selected mohSounds?").htmlContent("<b>"+c.selectedMusicOnHoldMohSounds.length+" selected</b> will be deleted.").ariaLabel("delete mohSounds").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedMusicOnHoldMohSounds.forEach(function(e){g(e)}),c.selectedMusicOnHoldMohSounds=[]})},l.sound.get({fields:"name,id",sort:"name"}).$promise.then(function(e){c.sounds=_.keyBy(e.rows||[],"id")}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.musiconholdMohSounds=e||{count:0,rows:[]}}function g(e){l.voiceMusicOnHold.removeSound({id:n.params.id,id2:e.id}).$promise.then(function(){_.remove(c.musiconholdMohSounds.rows,{id:e.id}),c.musiconholdMohSounds.count-=1,c.musiconholdMohSounds.rows.length||c.getMusicOnHoldMohSounds(),r.success({title:"MohSound deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMusicOnHold"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMusicOnHoldMohSounds())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("MusicOnHoldMohSoundsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_MOHSOUND",m.mohSound=angular.copy(s),m.mohSounds=o,m.newMohSound=!1,m.mohSound||(m.mohSound={},m.title="VOICE.NEW_MOHSOUND",m.newMohSound=!0),t.params.id&&(m.mohSound.VoiceMusicOnHoldId=t.params.id),m.addNewMohSound=function(){m.errors=[],r.voiceMusicOnHold.addSound({id:t.params.id},m.mohSound).$promise.then(function(e){m.mohSounds.unshift(e.toJSON()),i.success({title:"MohSound properly created",msg:m.mohSound.name?m.mohSound.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveMohSound=function(){m.errors=[],r.voiceMusicOnHold.update({id:m.mohSound.id},m.mohSound).$promise.then(function(e){var t=_.find(m.mohSounds,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"MohSound properly saved!",msg:m.mohSound.name?m.mohSound.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteMohSound=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The mohSound will be deleted.").ariaLabel("Delete MohSound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceMusicOnHold.delete({id:m.mohSound.id}).$promise.then(function(){_.remove(m.mohSounds,{id:m.mohSound.id}),i.success({title:"MohSound properly deleted!",msg:(m.mohSound.name||"mohSound")+" has been deleted!"}),u(m.mohSound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.sound.get({fields:"name,id",sort:"name"}).$promise.then(function(e){m.sounds=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","mohSounds","mohSound","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditMohSoundDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.musiconhold=d||e.params.musiconhold||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoMusicOnHolds=function(){e.go("app.voice.musiconholds")},c.saveMusicOnHold=function(){s.voiceMusicOnHold.update({id:c.musiconhold.id},c.musiconhold).$promise.then(function(){r.success({title:"MusicOnHold updated!",msg:c.musiconhold.name?c.musiconhold.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","musiconhold"],angular.module("app.voice").controller("MusicOnHoldController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.musiconholds=r||{count:0,rows:[]},v.table="musiconholds",v.listOrder="",v.listOrderAsc=null,v.selectedMusicOnHolds=[],v.query={fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,page:1},v.arraymode=_.keyBy([{option:"Files",value:"'files'"},{option:"Custom",value:"'custom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysort=_.keyBy([{option:"Random",value:"'random'"},{option:"Alphabetical",value:"'alpha'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.voice.musiconholds.edit",{id:e.id,musiconhold:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the musiconhold?").htmlContent("<b>"+(e.name||"musiconhold")+"</b> will be deleted.").ariaLabel("delete musiconhold").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getMusicOnHolds=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceMusicOnHold.get(v.query,f).$promise},v.createOrEditMusicOnHold=function(e,t){i.show({controller:"CreateOrEditMusicOnHoldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:t,musiconholds:v.musiconholds.rows,license:v.license,setting:v.setting}})},v.deleteMusicOnHold=A,v.exportSelectedMusicOnHolds=function(){var e=angular.copy(v.selectedMusicOnHolds);return v.selectedMusicOnHolds=[],e},v.deleteSelectedMusicOnHolds=function(e){var t=i.confirm().title("Are you sure want to delete the selected musiconholds?").htmlContent("<b>"+v.selectedMusicOnHolds.length+" selected</b> will be deleted.").ariaLabel("delete MusicOnHolds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedMusicOnHolds.forEach(function(e){A(e)}),v.selectedMusicOnHolds=[]})},v.deselectMusicOnHolds=function(){v.selectedMusicOnHolds=[]},v.selectAllMusicOnHolds=function(){v.selectedMusicOnHolds=v.musiconholds.rows};var h=!0,b=1;function f(e){v.musiconholds=e||{count:0,rows:[]}}function A(e){l.voiceMusicOnHold.delete({id:e.id}).$promise.then(function(){_.remove(v.musiconholds.rows,{id:e.id}),v.musiconholds.count-=1,v.musiconholds.rows.length||v.getMusicOnHolds(),c.success({title:"MusicOnHold deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMusicOnHold"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getMusicOnHolds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","musiconholds","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("MusicOnHoldsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_OUTBOUNDROUTE",m.outboundroute=angular.copy(s),m.outboundroutes=o,m.newOutboundRoute=!1,m.outboundroute||(m.outboundroute={appdata:"Outbound Call",type:"outbound",context:"from-sip",recordingFormat:"none"},m.title="VOICE.NEW_OUTBOUNDROUTE",m.newOutboundRoute=!0),m.addNewOutboundRoute=function(){m.errors=[],r.voiceExtension.save(m.outboundroute).$promise.then(function(e){m.outboundroutes.unshift(e.toJSON()),i.success({title:"OutboundRoute properly created",msg:m.outboundroute.name?m.outboundroute.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveOutboundRoute=function(){m.errors=[],r.voiceExtension.update({id:m.outboundroute.id},m.outboundroute).$promise.then(function(e){var t=_.find(m.outboundroutes,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"OutboundRoute properly saved!",msg:m.outboundroute.name?m.outboundroute.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteOutboundRoute=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The outboundroute will be deleted.").ariaLabel("Delete OutboundRoute").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceExtension.delete({id:m.outboundroute.id}).$promise.then(function(){_.remove(m.outboundroutes,{id:m.outboundroute.id}),i.success({title:"OutboundRoute properly deleted!",msg:(m.outboundroute.name||"outboundroute")+" has been deleted!"}),u(m.outboundroute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u,r.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","outboundroutes","outboundroute","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditOutboundRouteDialogController",e)}(),function(){"use strict";function e(b,i,a,o,t,e,n){var f=this;function s(e,t){if(f.outboundrouteApps.rows.length){var n=f.outboundrouteApps.rows[t]?f.outboundrouteApps.rows[t]:f.outboundrouteApps.rows[0];i.show({controller:"EditoutboundApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundroutes/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{outboundrouteApp:n,outboundroute:f.outboundroute}}).then(function(e){e&&(e.id?f.outboundrouteApps.rows[t]=e:f.outboundrouteApps.rows.splice(t,0,e),r())}).catch(function(e){e&&o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function r(e){var t=2,n=[];n.push({type:"outbound",app:"Set",appdata:"CDR(type)=outbound",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:t++,VoiceExtensionId:f.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"XCALLY-MOTION-ANSWER=0",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:t++,VoiceExtensionId:f.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"XCALLY-MOTION-PROGRESS=0",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:t++,VoiceExtensionId:f.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"MONITOR_OPTIONS=ab",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:t++,VoiceExtensionId:f.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"outboundrouteid="+f.outboundroute.id,context:f.outboundroute.context,exten:f.outboundroute.exten,priority:t++,VoiceExtensionId:f.outboundroute.id}),f.outboundroute.hasOwnProperty("recordingFormat")&&"none"!==f.outboundroute.recordingFormat&&(n.push({type:"outbound",app:"Set",appdata:"_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:t++,VoiceExtensionId:f.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"_XCALLY_MIXMONITOR_FORMAT="+f.outboundroute.recordingFormat||"wav",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:t++,VoiceExtensionId:f.outboundroute.id}));for(var a=0,i=0;a<f.outboundrouteApps.rows.length;a++,i=0){var o=f.outboundrouteApps.rows[a],s=[],r=[];o.intervals="*,*,*,*"!==o.interval?[o.interval]:o.IntervalId?_.map(_.filter(f.intervals.rows,{IntervalId:o.IntervalId}),"interval"):[],o.context=f.outboundroute.context,o.exten=f.outboundroute.exten,o.type&&(o.type=o.type.toLowerCase()),o.hasOwnProperty("tag")&&o.tag&&"--"!==o.tag&&s.push({type:o.type.toLowerCase(),app:"Set",appdata:"CDR(tag)="+o.tag,context:f.outboundroute.context,exten:f.outboundroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:f.outboundroute.id}),o.hasOwnProperty("callerID")&&o.callerID&&s.push({type:o.type.toLowerCase(),app:"Set",appdata:"CALLERID(all)="+o.callerID,context:f.outboundroute.context,exten:f.outboundroute.exten,priority:o.intervals.length+t+i++,VoiceExtensionId:f.outboundroute.id});for(var l=0;l<o.intervals.length;l++){var d=t+o.intervals.length,c=l===o.intervals.length-1?t+s.length+r.length+2:t+l+1;s.splice(l,0,{type:"outbound",app:"GotoIfTime",appdata:o.intervals[l]+"?"+f.outboundroute.context+",${EXTEN},"+d+":"+f.outboundroute.context+",${EXTEN},"+c,exten:f.outboundroute.exten,context:f.outboundroute.context,priority:t+l,VoiceExtensionId:f.outboundroute.id})}if(e&&"outboundDial"===o.appType){var m=_.find(f.apps,{appType:"outboundDial"});if(m&&m.fields){for(var u={},p=o.appdata.split(","),g=[],v=0,h=m.fields.length;v<h;v++)if(m.fields[v].hasOwnProperty("param"))switch(m.fields[v].name){case"trunk":u.trunk=p[m.fields[v].param].split("/")[1],u.phone=p[m.fields[v].param].split("/")[2],u.prefix=u.phone?u.phone.split("$")[0]:void 0,u.phone=f.outboundroute.cutdigits?(u.prefix||"")+"${EXTEN:"+f.outboundroute.cutdigits+"}":(u.prefix||"")+"${EXTEN}",g[m.fields[v].param]=["SIP",u.trunk,u.phone].join("/");break;case"options":u.options=p[m.fields[v].param],"none"!==f.outboundroute.recordingFormat?u.options.indexOf("U(xcally-mixmonitor-context)")<0&&(u.options+="U(xcally-mixmonitor-context)"):u.options=u.options.replace("U(xcally-mixmonitor-context)",""),g[m.fields[v].param]=u.options;break;default:g[m.fields[v].param]=p[m.fields[v].param]}o.appdata=g.join(",")}}o.priority=s.length?_.last(s).priority+1:t,t=(r.length?_.last(r).priority:o.priority)+1,n=_.concat(n,s,[o],r)}n.push({type:"outbound",app:"Hangup",exten:f.outboundroute.exten,context:f.outboundroute.context,priority:t,VoiceExtensionId:f.outboundroute.id}),b.voiceExtension.addApplications({id:f.outboundroute.id},_.sortBy(n,"priority")).$promise.then(function(e){f.outboundrouteApps.rows=e.rows}).catch(function(e){console.error(e)})}function l(e){f.outboundrouteApps=e||{count:0,rows:[]}}f.currentUser=n.getCurrentUser(),f.outboundroute={},f.outboundrouteApps={count:0,rows:[]},f.selectedOutboundRouteApps=[],f.query={sort:"priority"},f.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",type:"Outbound",types:["always","custom","list"],fields:[],isApp:!1},{app:"Dial",appType:"outboundDial",context:"from-sip",type:"Outbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"trunks",route:"trunk",filters:{fields:"name",sort:"name"}},{name:"tags",route:"tag",filters:{fields:"name",sort:"name"}}],fields:[{title:"Trunk",name:"trunk",type:"apiselect",values:"trunks",value:"trunk.name",option:"trunk.name",required:!0,param:0},{title:"Caller_ID",name:"callerID",type:"text"},{title:"Prefix",name:"prefix",type:"text"},{title:"Tags",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",defaultValues:[{value:"'--'",option:"None"}]},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:null,type:"Outbound",appType:"custom",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Application_Name",name:"app",type:"text",required:!0,param:0},{title:"Arguments",name:"appdata",type:"text",param:1}]}],["app"]),{isApp:!1}),f.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},f.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){s(e,e.newIndex)},onSort:function(e){r()}},f.init=function(e){f.outboundroute=e,t.on("voiceExtension:update",f.onVoiceExtensionUpdate),f.query.VoiceExtensionId=e.id,f.query.isApp=!0,f.query.nolimit=!0,f.getOutboundRouteApps(),f.getIntervals()},f.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){f.outboundrouteApps.rows.splice(t,1),r()},function(){console.log("CANCEL")})},f.getOutboundRouteApps=function(){f.promise=b.voiceExtension.get(f.query,l).$promise},f.editOutboundRouteApp=s,f.editInterval=function(e,t){if(f.outboundrouteApps.rows.length){var n=f.outboundrouteApps.rows[t]?f.outboundrouteApps.rows[t]:f.outboundrouteApps.rows[0];i.show({controller:"EditoutboundAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundroutes/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[]}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,r())})}},f.deleteOutboundRouteApp=function(e){_.remove(f.outboundrouteApps.rows,{id:e.id}),r(),o.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},f.deleteSelectedOutboundRouteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+f.selectedOutboundRouteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){f.selectedOutboundRouteApps.forEach(function(e){_.remove(f.outboundrouteApps.rows,{id:e.id})}),f.selectedOutboundRouteApps=[],r()})},f.rewriteRouting=r,f.getIntervals=function(){return b.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){f.intervals=e}).catch(function(e){console.error(e)})},f.onVoiceExtensionUpdate=function(e){e.VoiceExtensionId===f.outboundroute.id&&r(!0)},e.$on("$destroy",function(){t.removeAllListeners("voiceExtension:update")})}e.$inject=["api","$mdDialog","$document","toasty","socket","$scope","Auth"],angular.module("app.voice").controller("OutboundRouteActionsController",e)}(),function(){"use strict";function e(t,e,n,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(n.appType||n.app).toUpperCase(),o.custom=angular.copy(n),o.custom.appdata)switch(o.custom.appType?o.custom.appType.toLowerCase():o.custom.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.custom.appdata.split(",");o.custom.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.custom.text=s.slice(1,s.length).join(",");break;case"message":o.custom.text=o.custom.appdata;break;case"set":o.custom.name=o.custom.appdata.split("=")[0],o.custom.value=o.custom.appdata.split("=")[1];break;case"agi":o.custom.project=o.custom.appdata;break;default:var r=o.custom.appdata.split(",");o.custom.app=_.isEmpty(r[0])?r[0]:isNaN(r[0])?r[0]:parseInt(r[0],10),o.custom.appdata=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10)}function l(e){t.hide(e)}o.custom.type&&"outbound"===o.custom.type.toLowerCase()&&"outbounddial"===o.custom.appType.toLowerCase()&&(o.custom.prefix=o.custom.phone?o.custom.phone.split("$")[0]:void 0,o.custom.callerId=o.custom.callerID?"CALLERID(all)="+o.custom.callerID:void 0),o.saveOutboundRouteApp=function(){o.errors=[];var e=[];o.custom.type&&"outbound"===o.custom.type.toLowerCase()&&"outboundDial"===o.custom.appType&&(o.custom.phone=a.cutdigits?(o.custom.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.custom.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.custom.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.custom.options+="U(xcally-mixmonitor-context)"):o.custom.options=o.custom.options.replace("U(xcally-mixmonitor-context)",""));if(o.custom.appType&&"custom"===o.custom.appType);else switch((o.custom.app||o.custom.appType).toLowerCase()){case"set":o.custom.appdata=o.custom.name+"="+o.custom.value;break;case"custom":break;default:e[0]=o.custom.app,e[1]=o.custom.appdata,o.custom.appdata=e.join(",")}l(o.custom)},o.closeDialog=l}e.$inject=["$mdDialog","toasty","outboundrouteApp","outboundroute","api"],angular.module("app.voice").controller("EditoutboundAppcustomDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){var l=this;if(l.errors=[],l.title="TOOLS.EDIT_INTERVAL",l.interval=angular.copy(i),l.intervals=o,l.newInterval=!1,l.types=["always","custom","list"],l.daysOfWeek=a.getDaysOfWeek(),l.monthNumber=a.getMonthNumber(),l.monthName=a.getMonthName(),l.daysOfMonth=a.getDaysOfMonth(),l.interval)if("*,*,*,*"!==l.interval.interval){l.type="custom";var d=l.interval.interval.split(","),c=d[0],m=d[1],u=d[2],p=d[3];if("*"!==c){var g,v=c.split("-")[0],h=c.split("-")[1];(g=new Date).setHours(Number(v.split(":")[0])),g.setMinutes(Number(v.split(":")[1])),l.timeRangeFrom=g,(g=new Date).setHours(Number(h.split(":")[0])),g.setMinutes(Number(h.split(":")[1])),l.timeRangeTo=g}"*"!==m&&(l.dayOfWeekFrom=m.split("-")[0],l.dayOfWeekTo=m.split("-")[1]),"*"!==u&&(l.monthDayFrom=u.split("-")[0],l.monthDayTo=u.split("-")[1]),"*"!==p&&(l.monthFrom=p.split("-")[0],l.monthTo=p.split("-")[1])}else l.type="always";else l.interval={interval:"*,*,*,*"},l.type="always",l.title="TOOLS.NEW_INTERVAL",l.newInterval=!0;function b(){switch(l.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==l.timeRangeFrom&&l.timeRangeFrom&&l.timeRangeTo){var t=(l.timeRangeFrom.getHours()<10?"0":"")+l.timeRangeFrom.getHours()+":"+(l.timeRangeFrom.getMinutes()<10?"0":"")+l.timeRangeFrom.getMinutes(),n=(l.timeRangeTo.getHours()<10?"0":"")+l.timeRangeTo.getHours()+":"+(l.timeRangeTo.getMinutes()<10?"0":"")+l.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return l.dayOfWeekFrom?l.dayOfWeekTo?e.push(l.dayOfWeekFrom+"-"+l.dayOfWeekTo):e.push(l.dayOfWeekFrom):e.push("*"),l.monthDayFrom?l.monthDayTo?e.push(l.monthDayFrom+"-"+l.monthDayTo):e.push(l.monthDayFrom):e.push("*"),l.monthFrom?l.monthTo?e.push(l.monthFrom+"-"+l.monthTo):e.push(l.monthFrom):e.push("*"),e.join()}}function f(e){t.hide(e)}e.params.id&&!l.interval.application&&(l.interval.IntervalId=e.params.id),l.interval.IntervalId&&l.interval.application&&(l.type="list"),l.addNewInterval=function(){l.errors=[],l.interval.interval=b(),r.interval.save(l.interval).$promise.then(function(e){l.intervals.push(e),s.success({title:"Interval properly created",msg:l.interval.name?l.interval.name+" has been created!":""}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},l.saveInterval=function(){l.errors=[],l.interval.interval=b(),l.interval.application?("list"!==l.type&&(l.interval.IntervalId=null),f(l.interval)):r.interval.update({id:l.interval.id},l.interval).$promise.then(function(e){var t=_.find(l.intervals,{id:e.id});t&&_.merge(t,e),s.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),f()}).catch(function(e){console.error(e),l.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},l.closeDialog=f,l.interval.application&&r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){l.intervals=e}).catch(function(e){console.error(e)})}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api"],angular.module("app.voice").controller("EditoutboundAppintervalDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i){var o=this;if(o.errors=[],o.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),o.outbounddial=angular.copy(e),o.outbounddial.appdata)switch(o.outbounddial.appType?o.outbounddial.appType.toLowerCase():o.outbounddial.app.toLowerCase()){case"custom":break;case"autoreply":var s=o.outbounddial.appdata.split(",");o.outbounddial.times=isNaN(s[0])?s[0]:parseInt(s[0],10),o.outbounddial.text=s.slice(1,s.length).join(",");break;case"message":o.outbounddial.text=o.outbounddial.appdata;break;case"set":o.outbounddial.name=o.outbounddial.appdata.split("=")[0],o.outbounddial.value=o.outbounddial.appdata.split("=")[1];break;case"agi":o.outbounddial.project=o.outbounddial.appdata;break;default:var r=o.outbounddial.appdata.split(",");o.outbounddial.trunk=r[0].split("/")[1],o.outbounddial.phone=r[0].split("/")[2],o.outbounddial.timeout=_.isEmpty(r[1])?r[1]:isNaN(r[1])?r[1]:parseInt(r[1],10),o.outbounddial.options=_.isEmpty(r[2])?r[2]:isNaN(r[2])?r[2]:parseInt(r[2],10),o.outbounddial.url=_.isEmpty(r[3])?r[3]:isNaN(r[3])?r[3]:parseInt(r[3],10)}function l(e){t.hide(e)}o.outbounddial.type&&"outbound"===o.outbounddial.type.toLowerCase()&&"outbounddial"===o.outbounddial.appType.toLowerCase()&&(o.outbounddial.prefix=o.outbounddial.phone?o.outbounddial.phone.split("$")[0]:void 0,o.outbounddial.callerId=o.outbounddial.callerID?"CALLERID(all)="+o.outbounddial.callerID:void 0),o.saveOutboundRouteApp=function(){o.errors=[];var e=[];o.outbounddial.type&&"outbound"===o.outbounddial.type.toLowerCase()&&"outboundDial"===o.outbounddial.appType&&(o.outbounddial.phone=a.cutdigits?(o.outbounddial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(o.outbounddial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?o.outbounddial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(o.outbounddial.options+="U(xcally-mixmonitor-context)"):o.outbounddial.options=o.outbounddial.options.replace("U(xcally-mixmonitor-context)",""));if(o.outbounddial.appType&&"custom"===o.outbounddial.appType);else switch((o.outbounddial.app||o.outbounddial.appType).toLowerCase()){case"set":o.outbounddial.appdata=o.outbounddial.name+"="+o.outbounddial.value;break;case"custom":break;default:e[0]=["SIP",o.outbounddial.trunk,o.outbounddial.phone].join("/"),e[1]=o.outbounddial.timeout,e[2]=o.outbounddial.options,e[3]=o.outbounddial.url,o.outbounddial.appdata=e.join(",")}l(o.outbounddial)},o.closeDialog=l,i.trunk.get({fields:"name",sort:"name"}).$promise.then(function(e){o.trunks=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.tag.get({fields:"name",sort:"name"}).$promise.then(function(e){o.tags=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","outboundrouteApp","outboundroute","api"],angular.module("app.voice").controller("EditoutboundAppoutbounddialDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.outboundroute=d||e.params.outboundroute||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoOutboundRoutes=function(){e.go("app.voice.outboundroutes")},c.saveOutboundRoute=function(){s.voiceExtension.update({id:c.outboundroute.id},c.outboundroute).$promise.then(function(){r.success({title:"OutboundRoute updated!",msg:c.outboundroute.name?c.outboundroute.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","outboundroute"],angular.module("app.voice").controller("OutboundRouteController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.outboundroutes=r||{count:0,rows:[]},v.table="outboundroutes",v.listOrder="",v.listOrderAsc=null,v.selectedOutboundRoutes=[],v.query={fields:"createdAt,updatedAt,id,appdata,type,exten,context,recordingFormat,cutdigits,description",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},v.arrayrecordingFormat=_.keyBy([{option:"none",value:"'none'"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'WAV'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.voice.outboundroutes.edit",{id:e.id,outboundroute:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the outboundroute?").htmlContent("<b>"+(e.name||"outboundroute")+"</b> will be deleted.").ariaLabel("delete outboundroute").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getOutboundRoutes=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceExtension.get(v.query,f).$promise},v.createOrEditOutboundRoute=function(e,t){i.show({controller:"CreateOrEditOutboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundroutes/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{outboundroute:t,outboundroutes:v.outboundroutes.rows,license:v.license,setting:v.setting}})},v.deleteOutboundRoute=A,v.exportSelectedOutboundRoutes=function(){var e=angular.copy(v.selectedOutboundRoutes);return v.selectedOutboundRoutes=[],e},v.deleteSelectedOutboundRoutes=function(e){var t=i.confirm().title("Are you sure want to delete the selected outboundroutes?").htmlContent("<b>"+v.selectedOutboundRoutes.length+" selected</b> will be deleted.").ariaLabel("delete OutboundRoutes").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedOutboundRoutes.forEach(function(e){A(e)}),v.selectedOutboundRoutes=[]})},v.deselectOutboundRoutes=function(){v.selectedOutboundRoutes=[]},v.selectAllOutboundRoutes=function(){v.selectedOutboundRoutes=v.outboundroutes.rows},l.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){v.contexts=_.keyBy(e.rows||[],"id")}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=!0,b=1;function f(e){v.outboundroutes=e||{count:0,rows:[]}}function A(e){l.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(v.outboundroutes.rows,{id:e.id}),v.outboundroutes.count-=1,v.outboundroutes.rows.length||v.getOutboundRoutes(),c.success({title:"OutboundRoute deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getOutboundRoutes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","outboundroutes","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("OutboundRoutesController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l,d,c,m){var u=this,p=!0;function g(){var e=i.localStorage.getItem("motion2.realtime.abandoned.voice.contacts:"+u.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(u.query=_.merge(e.query,_.omit(u.query,["sort","limit","page"])),u.query=_.omit(u.query,"filter")),s.voiceDisposition.get().$promise.then(function(e){u.disposition=e?e.rows:[]}).catch(function(e){console.log(e)}),s.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise.then(function(e){u.queues=e||{count:0,rows:[]},u.queuesMap=_.mapValues(_.keyBy(u.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){u.getContacts()})}function v(e){u.contacts=e||{count:0,rows:[]},p=!1,u.refresh=!0}u.showTooltip=!1,u.refresh=!0,u.disable=[],u.agents=m||[],u.currentUser=r.getCurrentUser(),u.localizationMap=c,u.pickerModel={dateStart:null,dateEnd:null},u.queues={},u.contacts={count:0,rows:[]},u.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},u.clearAll=function(){u.query.dateStart=void 0,u.query.dateEnd=void 0,u.pickerModel={dateStart:null,dateEnd:null},u.getContacts()},u.getContacts=function(){u.refresh=!1,u.query.dateStart=void 0,u.query.dateEnd=void 0,u.pickerModel.dateStart&&!p&&(u.query.dateStart=u.pickerModel.dateStart,u.query.dateEnd=u.pickerModel.dateEnd);u.query.queue=u.query.queue,u.query.offset=(u.query.page-1)*u.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.voice.contacts:"+u.currentUser.id,JSON.stringify({query:_.omit(u.query,"queue")})),u.promise=s.voiceQueueReport.getVoiceQueuesReport(u.query,v).$promise},u.refreshContacts=function(){u.showTooltip=!1,u.getContacts()},u.onInit=g,u.assignedA=function(e,t){e&&(u.disable[e.id]=!0,s.voiceQueueReport.update({id:e.id,lastAssignedTo:t?t.name:null,assigned:!!t}).$promise.catch(function(e){console.log(e)}).finally(function(){u.disable[e.id]=!1}))},u.disposed=function(e,t){e&&s.voiceQueueReport.update({id:e.id,disposition:t||null}).$promise.catch(function(e){console.log(e)})},u.onSavevoiceQueueReport=function(e){e&&u.queuesMap&&"inbound"===e.type&&u.queuesMap[e.queue]&&(u.showTooltip=!0)},u.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(u.contacts.rows,["id",e.id]);0<=t&&_.merge(u.contacts.rows[t],e)}},l.onWithoutApply("voiceQueueReport:save",u.onSavevoiceQueueReport),l.on("voiceQueueReport:update",u.onUpdatevoiceQueueReport),g();var h=!0,b=1;e.$watch("vm.query.filter",function(e,t){h?n(function(){h=!1}):(t||(b=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=b),u.getContacts())}),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory","agents"],angular.module("app.voice").controller("AbandonedCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,s,t,n,a,i,o,r,l,d,c,m,u,p,g,v){var h=this,b=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum"],f=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var A in h.availableStates=["ringing","inuse","busy","onhold","not_inuse"],h.pauses=o||{count:0,rows:[]},h.license=g,h.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},h.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},h.paginatedAgents={},h.load=!1,h.order=[],h.agentInternal={},h.agents)h.agents.hasOwnProperty(A)&&(h.agents[A].init=!0);h.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},h.logout=function(e,t){return d.user.logout({id:e.id}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),h.agents[e.id]&&(h.agents[e.id].online=!1),h.rpcAgents[e.id]&&(h.rpcAgents[e.id].online=!1),y()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"voice",realtime:!0,direction:"inbound"}})},h.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){h.agents[t.id]&&_.merge(h.agents[t.id],_.pick(e,b)),h.rpcAgents[t.id]&&_.merge(h.rpcAgents[t.id],_.pick(e,b)),x(h.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},h.getAgentStatus=C,h.getAgentGlobalStatus=x,h.isPause=S,h.checkPause=function(e){return"pause"===e},h.isPartialPause=function(e){return"*pause"===e},h.onSave=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(_.omit(e,f),b)),_.merge(h.rpcAgents[e.id],_.pick(_.omit(e,f),b)),x(h.agents[e.id]))},h.onUpdate=function(e){h.agents[e.id]&&(_.merge(h.agents[e.id],_.pick(e,b)),_.merge(h.rpcAgents[e.id],_.pick(e,b)),x(h.agents[e.id]))},h.onInit=y,h.onConnect=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(_.merge(h.agents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(h.rpcAgents[h.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},h.onComplete=function(e){h.agents[h.agentInternal[e.destaccountcode]]&&(h.agents[h.agentInternal[e.destaccountcode]]=_.omit(h.agents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),h.rpcAgents[h.agentInternal[e.destaccountcode]]=_.omit(h.rpcAgents[h.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",h.onSave),c.on("user:update",h.onUpdate),c.on("user:agentconnect",h.onConnect),c.on("user:agentcomplete",h.onComplete),y();var E=v(function(){h.load&&(h.load=!1,y())},999);function y(e){h.load=!1;var t,n,a=s.defer();h.promise=a.promise,h.filteredAgents=[],h.order=[],_.forIn(h.agents,function(e,t){h.rpcAgents[t]&&_.merge(e,_.pick(_.omit(h.rpcAgents[t],f),b)),x(e),e.online?(h.filteredAgents.push(e),h.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),h.query.globalStatusFilter&&_.remove(h.filteredAgents,function(e){return e.globalStatus!==h.query.globalStatusFilter}),h.query.pauseTypeFilter&&_.remove(h.filteredAgents,function(e){return e.pauseType!==h.query.pauseTypeFilter}),h.query.filter&&_.remove(h.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(h.query.filter.toLowerCase())<0}),h.filteredAgents=(t=h.filteredAgents,n=_.startsWith(h.query.order,"-")?"desc":"asc",_.orderBy(t,[h.query.order.replace("-","")],[n]));var i=(h.query.page-1)*h.query.limit;h.paginatedAgents=_.drop(h.filteredAgents,i).slice(0,h.query.limit);for(var o=0;o<h.paginatedAgents.length;o+=1)h.order.push(h.paginatedAgents[o].id);a.resolve(),h.load=!0}function S(e){return"pause"===e||"*pause"===e}function T(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function C(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function x(e){var t="unknown";t=_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"pause":_.some([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],S)?"*pause":_.every([C(e,"voice"),C(e,"chat"),C(e,"mail"),C(e,"openchannel"),C(e,"sms"),C(e,"fax")],T)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=S(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),E&&(v.cancel(E),E=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","Auth","license","$interval"],angular.module("app.voice").controller("AgentsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,o){var s=this;s.calls=i||{rows:[],count:0},s.query={limit:10,page:1},s.channelStatus=o.channelStatusOut,s.onSave=function(e){var t=_.find(s.calls.rows,{channel:e.channel});e.channelstatedesc=e.dialstatus?"up":"ring",t?_.merge(t,e):e.channel&&s.calls.rows.push(e)},s.onRemove=function(e){var t=_.findIndex(s.calls.rows,{channel:e.channel});0<=t&&(s.calls.rows[t].status="hangup");n(function(){s.calls.rows.splice(t,1)},5e3)},a.on("voice_outbound_channel:save",s.onSave),a.on("voice_outbound_channel:remove",s.onRemove),e.$on("$destroy",function(){a.removeAllListeners("voice_outbound_channel:save"),a.removeAllListeners("voice_outbound_channel:remove")})}e.$inject=["$scope","$timeout","api","socket","rpcCalls","helperClasses"],angular.module("app.voice").controller("OutboundCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,o,s,r,l){var d=this;d.agents=n||{count:0,rows:[]},d.rpcVoiceQueuesChannels=i?_.keyBy(i.rows?_.filter(i.rows,{type:"inbound"}):[],"uniqueid"):{},d.queryChannels={limit:10,page:1},d.getSize=function(e){return _.size(e)},d.onSave=function(e){"inbound"===e.type&&(d.rpcVoiceQueuesChannels[e.uniqueid]=e)},d.onRemove=function(e){d.rpcVoiceQueuesChannels[e.uniqueid]&&delete d.rpcVoiceQueuesChannels[e.uniqueid]},d.hangup=function(t){return o.rpc.getVoiceQueuesChannelHangup({uniqueid:t}).$promise.then(function(e){l.success({title:"Channel "+t+" properly hangup!",msg:e.message||""})}).catch(function(e){l.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},d.redirectToAgent=function(t,e){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e}).$promise.then(function(e){l.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){l.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},d.redirectToNumber=function(e,t){var n=a.prompt().title("Which number do you want transfer the call to?").placeholder("Number").targetEvent(e).ok("Ok").cancel("Cancel");return a.show(n).then(function(e){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e}).$promise}).then(function(e){l.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){l.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},s.on("voice_queue_channel:save",d.onSave),s.on("voice_queue_channel:remove",d.onRemove),e.$on("$destroy",function(){s.removeAllListeners("voice_queue_channel:save"),s.removeAllListeners("voice_queue_channel:remove")})}e.$inject=["$scope","$timeout","$mdDialog","agents","rpcVoiceQueuesChannels","api","socket","helperClasses","toasty"],angular.module("app.voice").controller("QueueCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r){var l=this,d=["total","answered","unmanaged","sumHoldTime","sumDuration","sumBillable"];function c(){_.forIn(l.queues,function(e,t){l.rpcQueues[t]&&_.merge(e,_.pick(l.rpcQueues[t],d))})}l.count=a.count,l.queues=a?_.keyBy(a.rows?a.rows:[],"id"):{},l.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},r.hasRole("admin")?l.query={type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1}:l.query={id:r.getCurrentUser().id,channel:"voice",type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1},l.success=p,l.getQueues=function(){l.query.offset=(l.query.page-1)*l.query.limit,r.hasRole("admin")?l.promise=o.voiceQueue.get(l.query,p).$promise:l.promise=o.user.getQueues(l.query,p).$promise},l.onSave=function(e){l.queues[e.id]&&_.merge(l.queues[e.id],_.pick(e,d))},l.$onInit=c,s.onWithoutApply("voice_queue:save",l.onSave),l.interval=t(function(){},999);var m=!0,u=1;function p(e){l.count=e.count,l.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},c()}e.$watch("vm.query.filter",function(e,t){m?n(function(){m=!1}):(t||(u=l.query.page),e!==t&&(l.query.page=1),e||(l.query.page=u),l.getQueues())}),e.$on("$destroy",function(){s.removeAllListeners("voice_queue:save"),l.interval&&t.cancel(l.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","Auth"],angular.module("app.voice").controller("QueueParamsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r,l,d,c,m){var u=this,p=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function g(){var n=[];return _.forIn(u.queues,function(e,t){e.paused=0,e.loggedInDb=0,u.queues[t].agents={},n.push(l.voiceQueue.getMembers({id:t}).$promise),u.rpcQueues[t]&&_.merge(e,_.pick(u.rpcQueues[t],p))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&u.queues[e[t].rows[n].VoiceQueueId].paused++,u.queues[e[t].rows[n].VoiceQueueId].loggedInDb++,u.queues[e[t].rows[n].VoiceQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].VoiceQueueId}).catch(function(e){console.error(e)})}u.count=s.count?s.count:0,u.queues=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},m.hasRole("admin")?u.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:u.query={id:m.getCurrentUser().id,channel:"voice",type:"inbound",sort:"-updatedAt",limit:10,page:1},u.success=b,u.getQueues=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=l.voiceQueue.get(u.query,b).$promise:u.promise=l.user.getQueues(u.query,b).$promise},u.createOrEditVoiceQueue=function(e,t){a.show({controller:"CreateOrEditVoiceQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:t,voiceQueues:_.values(u.queues),license:null,setting:null}})},u.agentAdd=function(e,t){a.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:t,voiceQueues:u.queues?u.queues.rows:[],realtime:!0}})},u.updateQueue=function(e){return l.voiceQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},u.onSave=function(e){u.queues[e.id]&&_.merge(u.queues[e.id],_.pick(e,p))},u.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(u.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(u.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},u.onLogin=function(e){console.log("onLogged",e),u.queues[e.VoiceQueueId]&&(u.queues[e.VoiceQueueId].loggedInDb+=1,u.queues[e.VoiceQueueId].agents[e.UserId]=e.VoiceQueueId)},u.onLogout=function(e){console.log("onLogout",e),u.queues[e.VoiceQueueId]&&0<u.queues[e.VoiceQueueId].loggedInDb&&(u.queues[e.VoiceQueueId].loggedInDb-=1,delete u.queues[e.VoiceQueueId].agents[e.UserId])},u.$onInit=g,u.order=[],_.forIn(u.queues,function(e,t){u.order.push(e.id)}),d.onWithoutApply("voice_queue:save",u.onSave),u.interval=o(function(){},999),d.on("user:update",u.onPause),d.on("userVoiceQueue:remove",u.onLogout),d.on("userVoiceQueue:save",u.onLogin);var v=!0,h=1;function b(e){if(u.count=e.count,u.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){u.order=[];for(var t=0;t<e.rows.length;t++)u.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("voice_queue:save"),u.interval&&o.cancel(u.interval),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","Auth"],angular.module("app.voice").controller("QueuesVoiceRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){var a=this;switch(t.disconnect(),t.connect(),a.selectedTab=0,n.current.name){case"app.voice.realtime.agents":a.selectedTab=0;break;case"app.voice.realtime.telephones":a.selectedTab=1;break;case"app.voice.realtime.trunks":a.selectedTab=2;break;case"app.voice.realtime.queues":a.selectedTab=3;break;case"app.voice.realtime.queue_calls":a.selectedTab=4;break;case"app.voice.realtime.abandonedcalls":a.selectedTab=5;break;case"app.voice.realtime.queue_params":a.selectedTab=6;break;case"app.voice.realtime.outbound_calls":a.selectedTab=7;break;default:a.selectedTab=0,n.go("app.voice.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.voice.realtime.agents");break;case 1:n.go("app.voice.realtime.telephones");break;case 2:n.go("app.voice.realtime.trunks");break;case 3:n.go("app.voice.realtime.queues");break;case 4:n.go("app.voice.realtime.queue_calls");break;case 5:n.go("app.voice.realtime.abandonedcalls");break;case 6:n.go("app.voice.realtime.queue_params");break;case 7:n.go("app.voice.realtime.outbound_calls");break;default:n.go("app.voice.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.voice").controller("VoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r){var l=this,d=["fullname","internal","state","status"];function c(){_.forIn(l.telephones,function(e,t){l.rpcTelephones[t]&&_.merge(e,_.pick(l.rpcTelephones[t],d))})}l.count=a.count,l.attributes=["fullname","internal","state","status","address"],l.telephones=a?_.keyBy(a.rows?a.rows:[],"id"):{},l.rpcTelephones=i?_.keyBy(i.rows?i.rows:[],"id"):{},l.query={fields:"id,fullname,internal",role:"telephone",sort:"-updatedAt",limit:10,page:1},l.statusClass=r.status,l.stateClass=r.state,l.success=p,l.$onInit=c,l.showInfo=function(e){t.show(t.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},l.getTelephones=function(){l.query.offset=(l.query.page-1)*l.query.limit,l.promise=o.user.get(l.query,p).$promise},l.onSave=function(e){l.telephones[e.id]&&_.merge(l.telephones[e.id],_.pick(e,d))},s.on("telephone:save",l.onSave);var m=!0,u=1;function p(e){l.telephones=e?_.keyBy(e.rows?e.rows:[],"id"):{},c()}e.$watch("vm.query.filter",function(e,t){m?n(function(){m=!1}):(t||(u=l.query.page),e!==t&&(l.query.page=1),e||(l.query.page=u),l.getTelephones())}),e.$on("$destroy",function(){s.removeAllListeners("telephone:save")})}e.$inject=["$scope","$timeout","$mdDialog","telephones","rpcTelephones","api","socket","helperClasses"],angular.module("app.voice").controller("TelephonesVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,o,s,r,l){var d=this,c=["status","stateRegistry","registry","host","port","internal","state","status"];function m(){for(var e,t=0;t<d.trunks.length;t+=1)0<=(e=_.findIndex(d.rpcTrunks,["id",d.trunks[t].id]))&&_.merge(d.trunks[t],_.pick(d.rpcTrunks[e],c))}function u(e,t,n){0<=t&&_.merge(e[t],_.pick(n,c))}d.count=a.count,d.trunks=a?a.rows:[],d.rpcTrunks=i&&i.rows?i.rows:[],d.query={fields:"id,name",active:!0,sort:"-updatedAt",limit:10,page:1},d.statusClass=r.status,d.stateClass=r.state,d.success=v,d.$onInit=m,d.showInfo=function(e){t.show(t.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},d.getTrunks=function(){d.query.offset=(d.query.page-1)*d.query.limit,d.promise=o.trunk.get(d.query,v).$promise},d.goToTrunk=function(e,t){l.go("app.tools.trunks.edit",{id:t.id})},d.onSave=function(e){var t=_.findIndex(d.trunks,["id",e.id]),n=_.findIndex(d.rpcTrunks,["id",e.id]);u(d.trunks,t,e),u(d.rpcTrunks,n,e)},s.on("trunk:save",d.onSave);var p=!0,g=1;function v(e){d.count=e.count,d.trunks=e&&e.rows?e.rows:[],m()}e.$watch("vm.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=d.query.page),e!==t&&(d.query.page=1),e||(d.query.page=g),d.getTrunks())}),e.$on("$destroy",function(){s.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","helperClasses","$state"],angular.module("app.voice").controller("TrunksVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_VOICEMAIL",m.voicemail=angular.copy(s),m.voicemails=o,m.newVoicemail=!1,m.voicemail||(m.voicemail={attach:"no"},m.title="VOICE.NEW_VOICEMAIL",m.newVoicemail=!0),m.addNewVoicemail=function(){m.errors=[],r.voiceMail.save(m.voicemail).$promise.then(function(e){m.voicemails.unshift(e.toJSON()),i.success({title:"Voicemail properly created",msg:m.voicemail.name?m.voicemail.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveVoicemail=function(){m.errors=[],r.voiceMail.update({id:m.voicemail.id},m.voicemail).$promise.then(function(e){var t=_.find(m.voicemails,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"Voicemail properly saved!",msg:m.voicemail.name?m.voicemail.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteVoicemail=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The voicemail will be deleted.").ariaLabel("Delete Voicemail").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceMail.delete({id:m.voicemail.id}).$promise.then(function(){_.remove(m.voicemails,{id:m.voicemail.id}),i.success({title:"Voicemail properly deleted!",msg:(m.voicemail.name||"voicemail")+" has been deleted!"}),u(m.voicemail)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","voicemails","voicemail","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditVoicemailDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.voicemail={},c.voicemailMessages={count:0,rows:[]},c.selectedVoicemailMessages=[],c.query={fields:"createdAt,updatedAt,id,callerid,duration,audio,stamp,msg_id",sort:"-stamp",limit:10,page:1},c.init=function(e){c.voicemail=e,c.query.id=c.voicemail.id,c.getVoicemailMessages()},c.deleteConfirm=function(e,t){var n=o.confirm().title("Are you sure want to delete the message?").htmlContent("<b>"+(e.name||"message")+"</b> will be deleted.").ariaLabel("delete message").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.voiceMailMessageDownload=function(o,e){return l.voiceMailMessage.download({id:o.id,exists:!0}).$promise.then(function(e){var t=[e.buffer],n="message"+o.id,a=new Blob(t,{type:e.type});n=o.msg_id+".wav";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getVoicemailMessages=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceMail.getMessages(c.query,p).$promise},c.createOrEditVoicemailMessage=function(e,t){o.show({controller:"CreateOrEditMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/edit/messages/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:c.voicemail,message:t,messages:c.voicemailMessages.rows,license:null,setting:null}})},c.exportSelectedVoicemailMessages=function(){var e=angular.copy(c.selectedVoicemailMessages);return c.selectedVoicemailMessages=[],e},c.deleteVoicemailMessage=g,c.deleteSelectedVoicemailMessages=function(e){var t=o.confirm().title("Are you sure want to delete the selected messages?").htmlContent("<b>"+c.selectedVoicemailMessages.length+" selected</b> will be deleted.").ariaLabel("delete messages").targetEvent(e).ok("OK").cancel("CANCEL");o.show(t).then(function(){c.selectedVoicemailMessages.forEach(function(e){g(e)}),c.selectedVoicemailMessages=[]})};var m=!0,u=1;function p(e){c.voicemailMessages=e||{count:0,rows:[]}}function g(e){l.voiceMailMessage.delete({id:e.id}).$promise.then(function(){_.remove(c.voicemailMessages.rows,{id:e.id}),c.voicemailMessages.count-=1,c.voicemailMessages.rows.length||c.getVoicemailMessages(),r.success({title:"Message deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMail"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getVoicemailMessages())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("VoicemailMessagesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=i,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=t.protocol()+"://"+t.host(),c.voicemail=d||e.params.voicemail||{},c.selectedTab=e.params.tab||0,c.alert=r.info,c.gotoVoicemails=function(){e.go("app.voice.voicemails")},c.saveVoicemail=function(){s.voiceMail.update({id:c.voicemail.id},c.voicemail).$promise.then(function(){r.success({title:"Voicemail updated!",msg:c.voicemail.name?c.voicemail.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceContext.get({fields:"name",sort:"name"}).$promise.then(function(e){c.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","voicemail"],angular.module("app.voice").controller("VoicemailController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.voicemails=r||{count:0,rows:[]},v.table="voicemails",v.listOrder="",v.listOrderAsc=null,v.selectedVoicemails=[],v.query={fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,page:1},v.arrayattach=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayenvelope=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraydelete=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.voice.voicemails.edit",{id:e.id,voicemail:e})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the voicemail?").htmlContent("<b>"+(e.name||"voicemail")+"</b> will be deleted.").ariaLabel("delete voicemail").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getVoicemails=function(){v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceMail.get(v.query,f).$promise},v.createOrEditVoicemail=function(e,t){i.show({controller:"CreateOrEditVoicemailDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:t,voicemails:v.voicemails.rows,license:v.license,setting:v.setting}})},v.deleteVoicemail=A,v.exportSelectedVoicemails=function(){var e=angular.copy(v.selectedVoicemails);return v.selectedVoicemails=[],e},v.deleteSelectedVoicemails=function(e){var t=i.confirm().title("Are you sure want to delete the selected voicemails?").htmlContent("<b>"+v.selectedVoicemails.length+" selected</b> will be deleted.").ariaLabel("delete Voicemails").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedVoicemails.forEach(function(e){A(e)}),v.selectedVoicemails=[]})},v.deselectVoicemails=function(){v.selectedVoicemails=[]},v.selectAllVoicemails=function(){v.selectedVoicemails=v.voicemails.rows};var h=!0,b=1;function f(e){v.voicemails=e||{count:0,rows:[]}}function A(e){l.voiceMail.delete({id:e.id}).$promise.then(function(){_.remove(v.voicemails.rows,{id:e.id}),v.voicemails.count-=1,v.voicemails.rows.length||v.getVoicemails(),c.success({title:"Voicemail deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMail"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getVoicemails())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","voicemails","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("VoicemailsController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_VOICEQUEUE",m.voiceQueue=angular.copy(s),m.voiceQueues=o,m.newVoiceQueue=!1,m.voiceQueue||(m.voiceQueue={type:"inbound",strategy:"ringall",timeout:15,retry:2,random_periodic_announce:"no",announce_holdtime:"no",announce_position:"no",reportholdtime:"no",autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no"},m.title="VOICE.NEW_VOICEQUEUE",m.newVoiceQueue=!0),m.addNewVoiceQueue=function(){m.errors=[],r.voiceQueue.save(m.voiceQueue).$promise.then(function(e){m.voiceQueues.unshift(e.toJSON()),i.success({title:"VoiceQueue properly created",msg:m.voiceQueue.name?m.voiceQueue.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveVoiceQueue=function(){m.errors=[],r.voiceQueue.update({id:m.voiceQueue.id},m.voiceQueue).$promise.then(function(e){var t=_.find(m.voiceQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"VoiceQueue properly saved!",msg:m.voiceQueue.name?m.voiceQueue.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteVoiceQueue=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The voiceQueue will be deleted.").ariaLabel("Delete VoiceQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceQueue.delete({id:m.voiceQueue.id}).$promise.then(function(){_.remove(m.voiceQueues,{id:m.voiceQueue.id}),i.success({title:"VoiceQueue properly deleted!",msg:(m.voiceQueue.name||"voiceQueue")+" has been deleted!"}),u(m.voiceQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","voiceQueues","voiceQueue","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditVoiceQueueDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,o,s,r){var l=this;function d(){return a.voiceQueue[l.isVoiceRealtime()?"getMembers":"getAgents"]({id:l.voiceQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){return l.isVoiceRealtime()?l.selectedItems=e.rows?_.map(e.rows,function(e){return e.id=e.UserId,e.fullname=e.membername,e.penalty=e.hasOwnProperty("penalty")?"penalty "+e.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[]:l.selectedItems=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",e.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.selectedItems=l.selectedItems,r.hasRole("admin")?a.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise:a.user.getAgents({id:r.getCurrentUser().id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise}).then(function(e){l.items=e.rows?_.map(e.rows,function(e){return e.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",e.internal=e.internal?"<"+e.internal+">":"",e}):[],l.dualMultiselectOptions.items=_.differenceBy(l.items,l.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS.GETAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}l.voiceQueue=t,l.penalty=0,l.items=[],l.selectedItems=[],l.closeDialog=function(){e.hide()},l.isVoiceRealtime=function(){return o},l.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("VOICE.ALL_AGENTS"),labelSelected:s.instant("VOICE.SELECTED_AGENTS"),transferCallback:function(e,t){a.voiceQueue[t?"removeAgents":"addAgents"]({id:l.voiceQueue.id,ids:_.map(e,l.isVoiceRealtime()&&t?"UserId":"id"),penalty:l.penalty||0,realtime:o||!1}).$promise.then(function(){n.success({title:"VoiceQueue properly "+(t?"removed":"added"),msg:"VoiceQueue has been "+(t?"removed":"added")+"!"}),t||d()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:voiceQueue.ADDAGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},d()}e.$inject=["$mdDialog","toasty","api","voiceQueue","voiceQueues","realtime","$translate","Auth"],angular.module("app.voice").controller("VoiceQueueagentaddController",e)}(),function(){"use strict";function e(e,n,a,t,i){var o=this;o.voiceQueue=t,o.penalty=0,o.items=[],o.selectedItems=[],o.dualMultiselectOptions={items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:i.instant("VOICE.ALL_TEAMS"),labelSelected:i.instant("VOICE.SELECTED_TEAMS"),transferCallback:function(e,t){a.voiceQueue[t?"removeTeams":"addTeams"]({id:o.voiceQueue.id,ids:_.map(e,"id"),penalty:o.penalty||0}).$promise.then(function(){n.success({title:"Team properly "+(t?"removed":"added"),msg:"Team has been "+(t?"removed":"added")+"!"})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:voiceQueue.ADDTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},o.closeDialog=function(){e.hide()},a.voiceQueue.getTeams({id:o.voiceQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){return o.selectedItems=e.rows?e.rows:[],o.dualMultiselectOptions.selectedItems=o.selectedItems,a.team.get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){o.items=e.rows?e.rows:[],o.dualMultiselectOptions.items=_.differenceBy(o.items,o.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","toasty","api","voiceQueue","$translate"],angular.module("app.voice").controller("VoiceQueueteamaddController",e)}(),function(){"use strict";function e(n,e,a,i,t,o,s,r,l,d){var c=this;c.currentUser=l.getCurrentUser(),c.license=t,c.setting=o,c.passwordPattern=c.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",c.location=e.protocol()+"://"+e.host(),c.voiceQueue=d||n.params.voiceQueue||{},c.selectedTab=n.params.tab||0,c.teamadddialog=function(e,t){a.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:c.voiceQueues?c.voiceQueues.rows:[]}})},c.agentadddialog=function(e,t){a.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:c.voiceQueues?c.voiceQueues.rows:[],realtime:!1}})},c.gotogoto=function(e,t){n.go("app.voice.realtime.queues",{})},c.alert=r.info,c.gotoVoiceQueues=function(){n.go("app.voice.voiceQueues")},c.saveVoiceQueue=function(){s.voiceQueue.update({id:c.voiceQueue.id},c.voiceQueue).$promise.then(function(){r.success({title:"VoiceQueue updated!",msg:c.voiceQueue.name?c.voiceQueue.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.voiceMusicOnHold.get({fields:"name",nolimit:"true"}).$promise.then(function(e){c.musiconholds=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.sound.get({fields:"name,save_name",sort:"name",nolimit:"true"}).$promise.then(function(e){c.sounds=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","voiceQueue"],angular.module("app.voice").controller("VoiceQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.voiceQueues=r||{count:0,rows:[]},v.table="voiceQueues",v.listOrder="",v.listOrderAsc=null,v.selectedVoiceQueues=[],v.query={fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},v.arraystrategy=_.keyBy([{option:"Ringall",value:"'ringall'"},{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Least Recent",value:"'leastrecent'"},{option:"Fewest Calls",value:"'fewestcalls'"},{option:"Random",value:"'random'"},{option:"Linear",value:"'linear'"},{option:"Weight Random",value:"'wrandom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayjoinempty=_.keyBy([{option:"no",value:"'no'"},{option:"yes",value:"'yes'"},{option:"strict",value:"'strict'"},{option:"loose",value:"'loose'"},{option:"paused",value:"'paused'"},{option:"penalty",value:"'penalty'"},{option:"inuse",value:"'inuse'"},{option:"ringing",value:"'ringing'"},{option:"unavailable",value:"'unavailable'"},{option:"invalid",value:"'invalid'"},{option:"unknoww",value:"'unknown'"},{option:"wrapup",value:"'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayleavewhenempty=_.keyBy([{option:"no",value:"'no'"},{option:"yes",value:"'yes'"},{option:"strict",value:"'strict'"},{option:"loose",value:"'loose'"},{option:"paused",value:"'paused'"},{option:"penalty",value:"'penalty'"},{option:"inuse",value:"'inuse'"},{option:"ringing",value:"'ringing'"},{option:"unavailable",value:"'unavailable'"},{option:"invalid",value:"'invalid'"},{option:"unknoww",value:"'unknown'"},{option:"wrapup",value:"'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayrandom_periodic_announce=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayannounce_holdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Once",value:"'once'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayannounce_position=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Limit",value:"'limit'"},{option:"More",value:"'more'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayreportholdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editstate=function(e,t){n.go("app.voice.voiceQueues.edit",{id:e.id,voiceQueue:e})},v.teamadddialog=function(e,t){i.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:v.voiceQueues?v.voiceQueues.rows:[]}})},v.agentadddialog=function(e,t){i.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(o.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:v.voiceQueues?v.voiceQueues.rows:[],realtime:!1}})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the voiceQueue?").htmlContent("<b>"+(e.name||"voiceQueue")+"</b> will be deleted.").ariaLabel("delete voiceQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.gotorealtimegoto=function(e,t){n.go("app.voice.realtime.queues",{})},v.success=f,v.getVoiceQueues=function(){v.query.offset=(v.query.page-1)*v.query.limit,m.hasRole("admin")?v.promise=l.voiceQueue.get(v.query,f).$promise:(v.query.id=v.currentUser.id,v.promise=l.user.getQueues(v.query,f).$promise)},v.createOrEditVoiceQueue=function(e,t){i.show({controller:"CreateOrEditVoiceQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:t,voiceQueues:v.voiceQueues.rows,license:v.license,setting:v.setting}})},v.deleteVoiceQueue=A,v.exportSelectedVoiceQueues=function(){var e=angular.copy(v.selectedVoiceQueues);return v.selectedVoiceQueues=[],e},v.deleteSelectedVoiceQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected voiceQueues?").htmlContent("<b>"+v.selectedVoiceQueues.length+" selected</b> will be deleted.").ariaLabel("delete VoiceQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedVoiceQueues.forEach(function(e){A(e)}),v.selectedVoiceQueues=[]})},v.deselectVoiceQueues=function(){v.selectedVoiceQueues=[]},v.selectAllVoiceQueues=function(){v.selectedVoiceQueues=v.voiceQueues.rows};var h=!0,b=1;function f(e){v.voiceQueues=e||{count:0,rows:[]}}function A(e){l.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(v.voiceQueues.rows,{id:e.id}),v.voiceQueues.count-=1,v.voiceQueues.rows.length||v.getVoiceQueues(),c.success({title:"VoiceQueue deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getVoiceQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","voiceQueues","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("VoiceQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c){var m=this;function u(e){a.hide(e)}m.errors=[],m.setting=c,m.license=d,m.passwordPattern=m.setting&&m.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",m.title="VOICE.EDIT_VOICERECORDING",m.voiceRecording=angular.copy(s),m.voiceRecordings=o,m.newVoiceRecording=!1,m.voiceRecording||(m.voiceRecording={},m.title="VOICE.NEW_VOICERECORDING",m.newVoiceRecording=!0),m.addNewVoiceRecording=function(){m.errors=[],r.voiceRecording.save(m.voiceRecording).$promise.then(function(e){m.voiceRecordings.unshift(e.toJSON()),i.success({title:"VoiceRecording properly created",msg:m.voiceRecording.name?m.voiceRecording.name+" has been created!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.save"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveVoiceRecording=function(){m.errors=[],r.voiceRecording.update({id:m.voiceRecording.id},m.voiceRecording).$promise.then(function(e){var t=_.find(m.voiceRecordings,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),i.success({title:"VoiceRecording properly saved!",msg:m.voiceRecording.name?m.voiceRecording.name+" has been saved!":""}),u(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.update"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteVoiceRecording=function(e){m.errors=[];var t=a.confirm().title("Are you sure?").content("The voiceRecording will be deleted.").ariaLabel("Delete VoiceRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){r.voiceRecording.delete({id:m.voiceRecording.id}).$promise.then(function(){_.remove(m.voiceRecordings,{id:m.voiceRecording.id}),i.success({title:"VoiceRecording properly deleted!",msg:(m.voiceRecording.name||"voiceRecording")+" has been deleted!"}),u(m.voiceRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.delete"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return new Date(e)},m.closeDialog=u}e.$inject=["$scope","$state","$location","$mdDialog","toasty","voiceRecordings","voiceRecording","api","Auth","license","setting"],angular.module("app.voice").controller("CreateOrEditVoiceRecordingDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g){var v=this;v.license=u,v.setting=p,v.currentUser=m.getCurrentUser(),v.voiceRecordings=r||{count:0,rows:[]},v.table="voiceRecordings",v.listOrder="",v.listOrderAsc=null,v.selectedVoiceRecordings=[],v.query={fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,createdAt,userDisposition",sort:"-updatedAt",limit:10,page:1},v.localizationMap=g,v.pickerModel={dateStart:null},v.downloadfile2=function(o,e){return l.voiceRecording.download({id:o.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=o.uniqueid+o.format;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the voiceRecording?").htmlContent("<b>"+(e.name||"voiceRecording")+"</b> will be deleted.").ariaLabel("delete voiceRecording").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=f,v.getVoiceRecordings=function(){v.query.dateStart=void 0,v.query.dateEnd=void 0,v.pickerModel.dateStart&&(v.query.dateStart=v.pickerModel.dateStart,v.query.dateEnd=v.pickerModel.dateEnd);v.query.offset=(v.query.page-1)*v.query.limit,v.promise=l.voiceRecording.get(v.query,f).$promise},v.createOrEditVoiceRecording=function(e,t){i.show({controller:"CreateOrEditVoiceRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceRecordings/create/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceRecording:t,voiceRecordings:v.voiceRecordings.rows,license:v.license,setting:v.setting}})},v.deleteVoiceRecording=A,v.exportSelectedVoiceRecordings=function(){var e=angular.copy(v.selectedVoiceRecordings);return v.selectedVoiceRecordings=[],e},v.deleteSelectedVoiceRecordings=function(e){var t=i.confirm().title("Are you sure want to delete the selected voiceRecordings?").htmlContent("<b>"+v.selectedVoiceRecordings.length+" selected</b> will be deleted.").ariaLabel("delete VoiceRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){v.selectedVoiceRecordings.forEach(function(e){A(e)}),v.selectedVoiceRecordings=[]})},v.deselectVoiceRecordings=function(){v.selectedVoiceRecordings=[]},v.selectAllVoiceRecordings=function(){v.selectedVoiceRecordings=v.voiceRecordings.rows},v.clearDateFilter=function(){v.pickerModel={dateStart:null},v.getVoiceRecordings()};var h=!0,b=1;function f(e){v.voiceRecordings=e||{count:0,rows:[]}}function A(e){l.voiceRecording.delete({id:e.id}).$promise.then(function(){_.remove(v.voiceRecordings.rows,{id:e.id}),v.voiceRecordings.count-=1,v.voiceRecordings.rows.length||v.getVoiceRecordings(),c.success({title:"VoiceRecording deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceRecording"}];for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){h?s(function(){h=!1}):(t||(b=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=b),v.getVoiceRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","voiceRecordings","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("VoiceRecordingsController",e)}(),function(){"use strict";function e(t,n,a,e,i,o,s,r){var l=this;function d(e,t){return{id:e,title:t.name||"NONAME",state:"app.dashboards.custom",stateParams:t,weight:2,hidden:function(){return i.hasRole("agent")||!i.hasPermission(e)&&!i.hasRole("admin")}}}l.isAgent=function(){return i.getCurrentUser()&&i.hasRole("agent")},a.saveItem("apps",{title:"APPS",group:!0,weight:1,hidden:function(){return i.hasRole("agent")}}),s.version.get().$promise.then(function(e){l.version=e&&e.current?e.current:"UNKNOWN"}).catch(function(e){l.version="UNKNOWN"}).finally(function(){a.saveItem("version",{title:"VERSION "+l.version,group:!0,weight:2,hidden:function(){return i.hasRole("agent")}})}),i.isLoggedIn()&&s.dashboard.get().$promise.then(function(e){for(var t=0,n=0;n<e.rows.length;n+=1)t=99999+e.rows[n].id,a.saveItem("apps.dashboards.custom_"+t,d(t,e.rows[n]))}),o.custom&&!r.defaultPageTitle&&r.pageTitle&&angular.element("#pageTitle").html(r.pageTitle),a.saveItem("apps.dashboards",{id:100,title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",icon:"icon-tile-four",weight:2,hidden:function(){return i.hasRole("agent")||!i.hasPermission(100)&&!i.hasRole("admin")}}),a.saveItem("apps.dashboards.general",{id:101,title:"General",translate:"DASHBOARDS.GENERAL",state:"app.dashboards.general",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(101)&&!i.hasRole("admin")}}),a.saveItem("apps.staff",{id:200,title:"Staff",translate:"STAFF.STAFF",icon:"icon-account-multiple",weight:3,hidden:function(){return i.hasRole("agent")||!i.hasPermission(200)&&!i.hasRole("admin")}}),a.saveItem("apps.staff.users",{id:201,title:"Users",translate:"STAFF.USERS",state:"app.staff.users",weight:1,hidden:function(){return i.hasRole("agent")||i.hasRole("user")||!i.hasPermission(201)&&!i.hasRole("admin")}}),a.saveItem("apps.staff.agents",{id:202,title:"Agents",translate:"STAFF.AGENTS",state:"app.staff.agents",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(202)&&!i.hasRole("admin")}}),a.saveItem("apps.staff.telephones",{id:203,title:"Telephones",translate:"STAFF.TELEPHONES",state:"app.staff.telephones",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(203)&&!i.hasRole("admin")}}),a.saveItem("apps.staff.teams",{id:204,title:"Teams",translate:"STAFF.TEAMS",state:"app.staff.teams",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(204)&&!i.hasRole("admin")}}),a.saveItem("apps.contactmanager",{id:300,title:"ContactManager",translate:"CONTACTMANAGER.CONTACTMANAGER",icon:"icon-account-circle",weight:4,hidden:function(){return!o.cm||i.hasRole("agent")||!i.hasPermission(300)&&!i.hasRole("admin")}}),a.saveItem("apps.contactmanager.lists",{id:301,title:"Lists",translate:"CONTACTMANAGER.LISTS",state:"app.contactmanager.lists",weight:2,hidden:function(){return i.hasRole("agent")||!i.hasPermission(301)&&!i.hasRole("admin")}}),a.saveItem("apps.contactmanager.companies",{id:302,title:"Companies",translate:"CONTACTMANAGER.COMPANIES",state:"app.contactmanager.companies",weight:3,hidden:function(){return i.hasRole("agent")||!i.hasPermission(302)&&!i.hasRole("admin")}}),a.saveItem("apps.contactmanager.globalCustomFields",{id:304,title:"GlobalCustomFields",translate:"CONTACTMANAGER.GLOBALCUSTOMFIELDS",state:"app.contactmanager.globalCustomFields",weight:4,hidden:function(){return i.hasRole("agent")||!i.hasPermission(304)&&!i.hasRole("admin")}}),a.saveItem("apps.contactmanager.contacts",{id:303,title:"Contacts",translate:"CONTACTMANAGER.CONTACTS",state:"app.contactmanager.contacts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(303)&&!i.hasRole("admin")}}),a.saveItem("apps.voice",{id:400,title:"Voice",translate:"VOICE.VOICE",icon:"icon-phone",weight:5,hidden:function(){return i.hasRole("agent")||!i.hasPermission(400)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.voiceQueues",{id:401,title:"VoiceQueues",translate:"VOICE.VOICEQUEUES",state:"app.voice.voiceQueues",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(401)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.inboundroutes",{id:402,title:"InboundRoutes",translate:"VOICE.INBOUNDROUTES",state:"app.voice.inboundroutes",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(402)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.outboundroutes",{id:403,title:"OutboundRoutes",translate:"VOICE.OUTBOUNDROUTES",state:"app.voice.outboundroutes",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(403)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.internalroutes",{id:404,title:"InternalRoutes",translate:"VOICE.INTERNALROUTES",state:"app.voice.internalroutes",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(404)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.contexts",{id:405,title:"Contexts",translate:"VOICE.CONTEXTS",state:"app.voice.contexts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(405)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.voicemails",{id:406,title:"Voicemails",translate:"VOICE.VOICEMAILS",state:"app.voice.voicemails",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(406)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.musiconholds",{id:407,title:"MusicOnHolds",translate:"VOICE.MUSICONHOLDS",state:"app.voice.musiconholds",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(407)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.voiceRecordings",{id:408,title:"VoiceRecordings",translate:"VOICE.VOICERECORDINGS",state:"app.voice.voiceRecordings",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(408)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.chanSpies",{id:409,title:"ChanSpies",translate:"VOICE.CHANSPIES",state:"app.voice.chanSpies",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(409)&&!i.hasRole("admin")}}),a.saveItem("apps.voice.realtime",{id:410,title:"Realtime",translate:"VOICE.REALTIME",state:"app.voice.realtime",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(410)&&!i.hasRole("admin")}}),a.saveItem("apps.chat",{id:500,title:"Chat",translate:"CHAT.CHAT",icon:"icon-hangouts",weight:6,hidden:function(){return!o.chat||i.hasRole("agent")||!i.hasPermission(500)&&!i.hasRole("admin")}}),a.saveItem("apps.chat.chatQueues",{id:501,title:"ChatQueues",translate:"CHAT.CHATQUEUES",state:"app.chat.chatQueues",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(501)&&!i.hasRole("admin")}}),a.saveItem("apps.chat.chatWebsites",{id:502,title:"ChatWebsites",translate:"CHAT.CHATWEBSITES",state:"app.chat.chatWebsites",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(502)&&!i.hasRole("admin")}}),a.saveItem("apps.chat.realtime",{id:510,title:"Realtime",translate:"CHAT.REALTIME",state:"app.chat.realtime",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(510)&&!i.hasRole("admin")}}),a.saveItem("apps.mail",{id:600,title:"Mail",translate:"MAIL.MAIL",icon:"icon-email",weight:7,hidden:function(){return!o.mail||i.hasRole("agent")||!i.hasPermission(600)&&!i.hasRole("admin")}}),a.saveItem("apps.mail.mailQueues",{id:601,title:"MailQueues",translate:"MAIL.MAILQUEUES",state:"app.mail.mailQueues",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(601)&&!i.hasRole("admin")}}),a.saveItem("apps.mail.mailAccounts",{id:602,title:"MailAccounts",translate:"MAIL.MAILACCOUNTS",state:"app.mail.mailAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(602)&&!i.hasRole("admin")}}),a.saveItem("apps.mail.mailSubtatuses",{id:603,title:"MailSubstatuses",translate:"MAIL.MAILSUBSTATUSES",state:"app.mail.mailSubtatuses",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(603)&&!i.hasRole("admin")}}),a.saveItem("apps.mail.realtime",{id:610,title:"Realtime",translate:"MAIL.REALTIME",state:"app.mail.realtime",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(610)&&!i.hasRole("admin")}}),a.saveItem("apps.sms",{id:700,title:"Sms",translate:"SMS.SMS",icon:"icon-message-text",weight:8,hidden:function(){return!o.messaging||i.hasRole("agent")||!i.hasPermission(700)&&!i.hasRole("admin")}}),a.saveItem("apps.sms.smsQueues",{id:701,title:"SmsQueues",translate:"SMS.SMSQUEUES",state:"app.sms.smsQueues",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(701)&&!i.hasRole("admin")}}),a.saveItem("apps.sms.smsAccounts",{id:702,title:"SmsAccounts",translate:"SMS.SMSACCOUNTS",state:"app.sms.smsAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(702)&&!i.hasRole("admin")}}),a.saveItem("apps.sms.realtime",{id:710,title:"Realtime",translate:"SMS.REALTIME",state:"app.sms.realtime",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(710)&&!i.hasRole("admin")}}),a.saveItem("apps.openchannel",{id:800,title:"Openchannel",translate:"OPENCHANNEL.OPENCHANNEL",icon:"icon-google-earth",weight:9,hidden:function(){return!o.openchannel||i.hasRole("agent")||!i.hasPermission(800)&&!i.hasRole("admin")}}),a.saveItem("apps.openchannel.openchannelQueues",{id:801,title:"OpenchannelQueues",translate:"OPENCHANNEL.OPENCHANNELQUEUES",state:"app.openchannel.openchannelQueues",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(801)&&!i.hasRole("admin")}}),a.saveItem("apps.openchannel.openchannelAccounts",{id:802,title:"OpenchannelAccounts",translate:"OPENCHANNEL.OPENCHANNELACCOUNTS",state:"app.openchannel.openchannelAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(802)&&!i.hasRole("admin")}}),a.saveItem("apps.openchannel.realtime",{id:810,title:"Realtime",translate:"OPENCHANNEL.REALTIME",state:"app.openchannel.realtime",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(810)&&!i.hasRole("admin")}}),a.saveItem("apps.fax",{id:900,title:"Fax",translate:"FAX.FAX",icon:"icon-deskphone",weight:10,hidden:function(){return!o.fax||i.hasRole("agent")||!i.hasPermission(900)&&!i.hasRole("admin")}}),a.saveItem("apps.fax.faxQueues",{id:901,title:"FaxQueues",translate:"FAX.FAXQUEUES",state:"app.fax.faxQueues",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(901)&&!i.hasRole("admin")}}),a.saveItem("apps.fax.faxAccounts",{id:902,title:"FaxAccounts",translate:"FAX.FAXACCOUNTS",state:"app.fax.faxAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(902)&&!i.hasRole("admin")}}),a.saveItem("apps.fax.realtime",{id:910,title:"Realtime",translate:"FAX.REALTIME",state:"app.fax.realtime",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(910)&&!i.hasRole("admin")}}),a.saveItem("apps.tools",{id:1e3,title:"Tools",translate:"TOOLS.TOOLS",icon:"icon-auto-fix",weight:13,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1e3)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.cannedAnswers",{id:1002,title:"CannedAnswers",translate:"TOOLS.CANNEDANSWERS",state:"app.tools.cannedAnswers",weight:2,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1002)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.customDashboards",{id:1003,title:"CustomDashboards",translate:"TOOLS.CUSTOMDASHBOARDS",state:"app.tools.customDashboards",weight:3,badge:{content:"beta",color:"orange"},hidden:function(){return i.hasRole("agent")||!i.hasPermission(1003)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.intervals",{id:1004,title:"Intervals",translate:"TOOLS.INTERVALS",state:"app.tools.intervals",weight:4,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1004)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.pauses",{id:1005,title:"Pauses",translate:"TOOLS.PAUSES",state:"app.tools.pauses",weight:5,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1005)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.schedules",{id:42,title:"Scheduler",translate:"TOOLS.SCHEDULER",state:"app.tools.schedules",weight:6,hidden:function(){return i.hasRole("agent")||!i.hasPermission(42)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.sounds",{id:1006,title:"Sounds",translate:"TOOLS.SOUNDS",state:"app.tools.sounds",weight:7,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1006)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.tags",{id:1007,title:"Tags",translate:"TOOLS.TAGS",state:"app.tools.tags",weight:8,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1007)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.templates",{id:1008,title:"Templates",translate:"TOOLS.TEMPLATES",state:"app.tools.templates",weight:9,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1008)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.triggers",{id:1009,title:"Triggers",translate:"TOOLS.TRIGGERS",state:"app.tools.triggers",weight:10,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1009)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.trunks",{id:1010,title:"Trunks",translate:"TOOLS.TRUNKS",state:"app.tools.trunks",weight:11,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1010)&&!i.hasRole("admin")}}),a.saveItem("apps.tools.variables",{id:1011,title:"Variables",translate:"TOOLS.VARIABLES",state:"app.tools.variables",weight:12,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1011)&&!i.hasRole("admin")}}),a.saveItem("apps.callysquare",{id:1100,title:"CallySquare",translate:"CALLYSQUARE.CALLYSQUARE",icon:"icon-sitemap",weight:11,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1100)&&!i.hasRole("admin")}}),a.saveItem("apps.callysquare.odbcs",{id:1101,title:"ODBC",translate:"CALLYSQUARE.ODBC",state:"app.callysquare.odbcs",weight:2,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1101)&&!i.hasRole("admin")}}),a.saveItem("apps.callysquare.squareRecordings",{id:1102,title:"SquareRecordings",translate:"CALLYSQUARE.SQUARERECORDINGS",state:"app.callysquare.squareRecordings",weight:3,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1102)&&!i.hasRole("admin")}}),a.saveItem("apps.callysquare.projects",{id:1103,title:"Projects",translate:"CALLYSQUARE.PROJECTS",state:"app.callysquare.projects",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1103)&&!i.hasRole("admin")}}),a.saveItem("apps.analytics",{id:1200,title:"Analytics",translate:"ANALYTICS.ANALYTICS",icon:"icon-chart-line",weight:14,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1200)&&!i.hasRole("admin")}}),a.saveItem("apps.analytics.metrics",{id:1201,title:"Metrics",translate:"ANALYTICS.METRICS",state:"app.analytics.metrics",weight:3,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1201)&&!i.hasRole("admin")}}),a.saveItem("apps.analytics.extractedReports",{id:1202,title:"ExtractedReports",translate:"ANALYTICS.EXTRACTEDREPORTS",state:"app.analytics.extractedReports",weight:2,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1202)&&!i.hasRole("admin")}}),a.saveItem("apps.analytics.reports",{id:1203,title:"Reports",translate:"ANALYTICS.REPORTS",state:"app.analytics.reports",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1203)&&!i.hasRole("admin")}}),a.saveItem("apps.integrations",{id:1300,title:"Integrations",translate:"INTEGRATIONS.INTEGRATIONS",icon:"icon-heart",weight:15,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1300)&&!i.hasRole("admin")}}),a.saveItem("apps.integrations.zendeskAccounts",{id:1301,title:"ZendeskAccounts",translate:"INTEGRATIONS.ZENDESKACCOUNTS",state:"app.integrations.zendeskAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1301)&&!i.hasRole("admin")}}),a.saveItem("apps.integrations.salesforceAccounts",{id:1302,title:"SalesforceAccounts",translate:"INTEGRATIONS.SALESFORCEACCOUNTS",state:"app.integrations.salesforceAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1302)&&!i.hasRole("admin")}}),a.saveItem("apps.integrations.freshdeskAccounts",{id:1303,title:"FreshdeskAccounts",translate:"INTEGRATIONS.FRESHDESKACCOUNTS",state:"app.integrations.freshdeskAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1303)&&!i.hasRole("admin")}}),a.saveItem("apps.integrations.sugarcrmAccounts",{id:1304,title:"SugarcrmAccounts",translate:"INTEGRATIONS.SUGARCRMACCOUNTS",state:"app.integrations.sugarcrmAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1304)&&!i.hasRole("admin")}}),a.saveItem("apps.integrations.deskAccounts",{id:1302,title:"DeskAccounts",translate:"INTEGRATIONS.DESKACCOUNTS",state:"app.integrations.deskAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1302)&&!i.hasRole("admin")}}),a.saveItem("apps.integrations.zohoAccounts",{id:1302,title:"ZohoAccounts",translate:"INTEGRATIONS.ZOHOACCOUNTS",state:"app.integrations.zohoAccounts",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1302)&&!i.hasRole("admin")}}),a.saveItem("apps.settings",{id:1400,title:"Settings",translate:"SETTINGS.SETTINGS",icon:"icon-cog",weight:16,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1400)&&!i.hasRole("admin")}}),a.saveItem("apps.settings.generals",{id:1401,title:"General",translate:"SETTINGS.GENERAL",state:"app.settings.generals",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1401)&&!i.hasRole("admin")}}),a.saveItem("apps.settings.smtps",{id:1402,title:"Smtp",translate:"SETTINGS.SMTP",state:"app.settings.smtps",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1402)&&!i.hasRole("admin")}}),a.saveItem("apps.settings.networks",{id:1403,title:"Networks",translate:"SETTINGS.NETWORKS",state:"app.settings.networks",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1403)&&!i.hasRole("admin")}}),a.saveItem("apps.settings.customizations",{id:1407,title:"Customizations",translate:"SETTINGS.CUSTOMIZATIONS",state:"app.settings.customizations",weight:1,hidden:function(){return!o.custom||i.hasRole("agent")||!i.hasPermission(1407)&&!i.hasRole("admin")}}),a.saveItem("apps.settings.updates",{id:1404,title:"Updates",translate:"SETTINGS.UPDATES",state:"app.settings.updates",weight:1,hidden:function(){return!o.update||i.hasRole("agent")||!i.hasPermission(1404)&&!i.hasRole("admin")}}),a.saveItem("apps.settings.license",{id:1405,title:"License",translate:"SETTINGS.LICENSE",state:"app.settings.license",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1405)&&!i.hasRole("admin")}}),a.saveItem("apps.settings.system",{id:1406,title:"System",translate:"SETTINGS.SYSTEM",state:"app.settings.system",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1406)&&!i.hasRole("admin")}}),a.saveItem("apps.help",{id:1600,title:"Help",translate:"HELP.HELP",icon:"icon-help",weight:17,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1600)&&!i.hasRole("admin")}}),a.saveItem("apps.help.about",{id:1601,title:"About",translate:"HELP.ABOUT",state:"app.help.about",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1601)&&!i.hasRole("admin")}}),a.saveItem("apps.motiondialer",{id:1500,title:"MotionDialer",translate:"MOTIONDIALER.MOTIONDIALER",icon:"icon-fire",weight:5,hidden:function(){return!o.dialer||i.hasRole("agent")||!i.hasPermission(1500)&&!i.hasRole("admin")}}),a.saveItem("apps.motiondialer.queueCampaigns",{id:1501,title:"QueueCampaigns",translate:"MOTIONDIALER.QUEUECAMPAIGNS",state:"app.motiondialer.queueCampaigns",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1501)&&!i.hasRole("admin")}}),a.saveItem("apps.motiondialer.ivrCampaigns",{id:1502,title:"IvrCampaigns",translate:"MOTIONDIALER.IVRCAMPAIGNS",state:"app.motiondialer.ivrCampaigns",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1502)&&!i.hasRole("admin")}}),a.saveItem("apps.motiondialer.realtime",{id:1510,title:"Realtime",translate:"MOTIONDIALER.REALTIME",state:"app.motiondialer.realtime",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1510)&&!i.hasRole("admin")}}),a.saveItem("apps.jscripty",{id:1700,title:"jscripty",translate:"JSCRIPTY.JSCRIPTY",icon:"icon-script",weight:12,hidden:function(){return!o.jscripty||i.hasRole("agent")||!i.hasPermission(1700)&&!i.hasRole("admin")}}),a.saveItem("apps.jscripty.projects",{id:1701,title:"Projects",translate:"JSCRIPTY.PROJECTS",state:"app.jscripty.projects",weight:1,hidden:function(){return i.hasRole("agent")||!i.hasPermission(1701)&&!i.hasRole("admin")}}),e.saveItem("apps",{title:"APPS",group:!0,weight:1}),e.saveItem("apps.home",{id:100,title:"Home",translate:"DASHBOARDS.HOME",icon:"icon-home",weight:1}),e.saveItem("apps.home.dashboard",{id:101,title:"Dashboard",translate:"DASHBOARDS.DASHBOARD",state:"dashboard",icon:"icon-tile-four",iconClass:"cyan-500-fg",weight:1,hidden:function(){return!i.hasPermission(101)}}),e.saveItem("apps.home.contacts",{id:102,title:"Contacts",translate:"DASHBOARDS.CONTACTS",state:"contacts",icon:"icon-account-circle",iconClass:"red-fg",weight:2,hidden:function(){return!o.cm||!i.hasPermission(102)}}),e.saveItem("apps.home.mycontacts",{id:103,title:"Contacts",translate:"DASHBOARDS.MYCONTACTS",state:"mycontacts",icon:"icon-account-multiple",iconClass:"red-fg",weight:3,hidden:function(){return!o.cm||!i.hasPermission(103)}}),e.saveItem("apps.home.voice",{id:110,title:"Voice",translate:"DASHBOARDS.VOICE",state:"voice",icon:"icon-phone",iconClass:"blue-A700-fg",weight:4,hidden:function(){return!i.hasPermission(110)}}),e.saveItem("apps.home.abandoned",{id:111,title:"Abandoned",translate:"DASHBOARDS.ABANDONED",state:"abandoned",icon:"icon-phone-missed",iconClass:"blue-fg",weight:5,hidden:function(){return!i.hasPermission(111)}}),e.saveItem("apps.home.recordings",{id:104,title:"Recordings",translate:"DASHBOARDS.RECORDINGS",state:"recordings",icon:"icon-audiobook",iconClass:"indigo-A100-fg",weight:6,hidden:function(){return!i.hasPermission(104)}}),e.saveItem("apps.home.chat",{id:105,title:"Chat",translate:"DASHBOARDS.CHAT",state:"chat",icon:"icon-hangouts",iconClass:"green-A700-fg",weight:7,hidden:function(){return!o.chat||!i.hasPermission(105)}}),e.saveItem("apps.home.mail",{id:106,title:"Mail",translate:"DASHBOARDS.MAIL",state:"mail",icon:"icon-email",iconClass:"teal-fg",weight:8,hidden:function(){return!o.mail||!i.hasPermission(106)}}),e.saveItem("apps.home.sms",{id:107,title:"Sms",translate:"DASHBOARDS.SMS",state:"sms",icon:"icon-message-text",iconClass:"orange-fg",weight:9,hidden:function(){return!o.messaging||!i.hasPermission(107)}}),e.saveItem("apps.home.openchannel",{id:108,title:"Openchannel",translate:"DASHBOARDS.OPENCHANNEL",state:"openchannel",icon:"icon-google-earth",iconClass:"amber-A200-fg",weight:10,hidden:function(){return!o.openchannel||!i.hasPermission(108)}}),e.saveItem("apps.home.fax",{id:109,title:"Fax",translate:"DASHBOARDS.FAX",state:"fax",icon:"icon-deskphone",iconClass:"blue-grey-A200-fg",weight:11,hidden:function(){return!o.fax||!i.hasPermission(109)}}),t.$on("$viewContentAnimationEnded",function(e){e.targetScope.$id===t.$id&&n.$broadcast("msSplashScreen::remove")})}e.$inject=["$scope","$rootScope","msNavigationService","msNavigationAgentService","Auth","license","api","setting"],angular.module("motion").controller("MainController",e)}(),function(){"use strict";function e(e,t,n,a,i,o){var s=this;function r(e){if(e&&e.id){var t=99999+e.id;i.saveItem("apps.dashboards.custom_"+t,{id:t,title:e.name||"NONAME",badge:{content:"beta",color:"orange"},state:"app.dashboards.custom",stateParams:e,weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(t)&&!o.hasRole("admin")}})}}s.bodyEl=angular.element("body"),s.msScrollOptions={suppressScrollX:!0},s.setting=n,s.$onInit=function(){s.folded="true"===t.get("motion.folded")||!1},s.toggleMsNavigationFolded=function(){s.folded=!s.folded,t.put("motion.folded",s.folded)},s.getLogo=function(){return s.setting.defaultHeaderWhiteLabel?"xCALLY Motion":s.setting.headerWhiteLabel},a.on("dashboard:save",r),a.on("dashboard:update",r),a.on("dashboard:remove",function(e){if(e&&e.id){var t=99999+e.id;i.deleteItem("apps.dashboards.custom_"+t)}}),e.$on("$stateChangeSuccess",function(){s.bodyEl.removeClass("ms-navigation-horizontal-mobile-menu-active")})}e.$inject=["$scope","$cookies","setting","socket","msNavigationService","Auth"],angular.module("app.navigation").controller("NavigationController",e)}(),function(){"use strict";function e(e,a,i,t,n,o,s,r){var l=this;function d(n){s.isSupported()?s.requestPermission().then(function(){var e,t;t={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"api/users/"+(e=n).FromId+"/avatar",body:e.body||"",focusOnclick:!0,closeOnClick:!0},s.show(a.instant("QUICKPANEL.NEW_INTERNAL_MESSAGE"),t)},function(e){console.error("Please enable browser notifications!",e)}):console.error("Browser notifications are not supported by the browser. Normal notifications will be used.")}l.date=moment().format(),l.currentUser=t.getCurrentUser(),l.license=r,l.unreadTotalMessages=0,l.unreadTotalGroupMessages=0,l.userIsNotPhonebar=function(){return"admin"===l.currentUser.role||"user"===l.currentUser.role||"agent"===l.currentUser.role&&0!==l.currentUser.showWebBar},l.onMessageSave=function(e){e.ToId===l.currentUser.id&&e.FromId!==l.currentUser.id&&!e.read&&e.ChatGroupId&&(l.unreadTotalGroupMessages++,d(e));e.ToId!==l.currentUser.id||e.ChatGroupId||(l.unreadTotalMessages+=1,d(e))},l.onMessageUpdate=function(e){e.ToId===l.currentUser.id&&e.read&&0<l.unreadTotalMessages&&!e.ChatGroupId&&(l.unreadTotalMessages-=1);e.ToId==l.currentUser.id&&e.FromId!==l.currentUser.id&&e.ChatGroupId&&e.read&&0<l.unreadTotalGroupMessages&&l.unreadTotalGroupMessages--},n.on("chatInternalMessage:save",l.onMessageSave),n.on("chatInternalMessage:update",l.onMessageUpdate),o.chatInternalMessage.get({fields:"FromId",ToId:l.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){return e&&e.count&&(l.unreadTotalMessages=e.count),o.user.getGroups({id:l.currentUser.id}).$promise}).then(function(e){for(var t=[],n=e.rows,a=0;a<n.length;a++)t.push(o.chatGroup.getUnread({id:n[a].id}).$promise);return i.all(t)}).then(function(e){for(var t=0;t<e.length;t++)l.unreadTotalGroupMessages+=e[t].count}).catch(function(e){console.error(e)}),e.$on("$destroy",function(){n.removeAllListeners("chatInternalMessage:save"),n.removeAllListeners("chatInternalMessage:update")})}e.$inject=["$scope","$translate","$q","Auth","socket","api","desktopNotification","license"],angular.module("app.quick-panel").controller("QuickPanelController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l,d,c,m){var u=this;function p(e){var t=angular.element("#chat-dialog");a(function(){t.animate({scrollTop:t[0].scrollHeight},e)},0)}function g(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function v(e){return m.get(e).success(function(){t.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(e){t.error({title:"PhoneBar API Error",msg:d.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}u.currentUser=i.getCurrentUser(),u.user=void 0,u.users={count:0,rows:[]},u.standardDate=moment(0).format("YYYY-MM-DD HH:mm:ss"),u.unreadMessage={},u.replyMessage="",u.disabled=!1,u.init=function(e){u.license=e},u.toggleChat=function(e){if(e){if(!e.allowmessenger&&"agent"===e.role)return t.warning({title:d.instant("QUICKPANEL.WARNING"),msg:d.instant("QUICKPANEL.MESSENGER_DISABLED")}),void(u.user=void 0);u.user=e,u.replyMessage="",n.chatInternalMessage.get({sort:"createdAt",FromId:u.currentUser.id+","+e.id,ToId:u.currentUser.id+","+e.id,ChatGroupId:"null"}).$promise.then(function(e){if(e&&e.rows){u.user.messages=e;for(var t=0;t<u.user.messages.rows.length;t+=1)!1===u.user.messages.rows[t].read&&u.user.messages.rows[t].ToId===u.currentUser.id&&n.chatInternalMessage.update({id:u.user.messages.rows[t].id,read:!0})}}).finally(function(){p(0)})}else u.user=void 0},u.reply=function(){u.disabled=!0;Date.now();if(""===u.replyMessage)return void(u.disabled=!1);var e={FromId:u.currentUser.id,ToId:u.user.id,body:u.replyMessage,read:!1};u.replyMessage="",n.chatInternalMessage.save(e).$promise.then(function(e){u.user.messages.rows.push(e),u.user.lastMessageAt=e.createdAt,u.user.lastMessage=e,p(400)}).catch(function(e){}).finally(function(){u.disabled=!1})},u.onMessageSave=function(e){if(e.ToId===u.currentUser.id&&!e.ChatGroupId){u.user&&u.user.id===e.FromId?(u.user.messages.rows.push(e),p(0),n.chatInternalMessage.update({id:e.id,read:!0})):u.unreadMessage[e.FromId]=u.unreadMessage[e.FromId]?u.unreadMessage[e.FromId]+1:1;var t=_.find(u.users.rows,{id:e.FromId});t&&(t.lastMessageAt=e.createdAt,t.lastMessage=e)}},u.onMessageUpdate=function(e){if((e.FromId===u.currentUser.id||e.ToId===u.currentUser.id)&&!e.ChatGroupId){if(u.user){var t=_.find(u.user.messages.rows,{id:e.id});t&&_.merge(t,e)}var n=_.find(u.users.rows,{id:u.currentUser.id===e.FromId?e.ToId:e.FromId});n&&n.lastMessage&&_.merge(n.lastMessage,e),e.ToId===u.currentUser.id&&e.read&&0<u.unreadMessage[e.FromId]&&(u.unreadMessage[e.FromId]-=1)}},u.onUserUpdate=function(e){var t=_.find(u.users.rows,{id:e.id});t&&(_.isNil(e.online)||t.online===e.online||(t.online=e.online),_.isNil(e.allowmessenger)||t.allowmessenger===e.allowmessenger||(t.allowmessenger=e.allowmessenger))},u.webcall=function(e){c.$broadcast("webrtc::call",{target:g(e)})},u.call=function(e){return v("http://127.0.0.1:"+(u.user.phoneBarRemoteControlPort||"9888")+"/api/originate/"+g(e))},u.transfer=function(e){return v("http://127.0.0.1:"+(u.user.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+g(e))},o.on("chatInternalMessage:save",u.onMessageSave),o.on("chatInternalMessage:update",u.onMessageUpdate),o.on("user:update",u.onUserUpdate),s("quick-panel").onClose(function(){u.user=void 0}),n.chatInternalMessage.get({fields:"FromId",ToId:u.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){u.unreadMessage=_.countBy(e.rows,"FromId")}).catch(function(e){}),n.chatInternalMessage.getUsers().$promise.then(function(e){u.users=e}).catch(function(e){console.error(e)}),e.$on("$destroy",function(){o.removeAllListeners("chatInternalMessage:save"),o.removeAllListeners("chatInternalMessage:update"),o.removeAllListeners("user:update")})}e.$inject=["$scope","toasty","api","$timeout","Auth","socket","$mdSidenav","$q","$interval","$translate","$rootScope","$http"],angular.module("app.quick-panel").controller("ChatInternalController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r,l){var d=this;function c(e){a.hide(e)}d.errors=[],d.title="QUICKPANEL.EDIT_CHATGROUP",d.group=angular.copy(r),d.currentUser=s.getCurrentUser(),d.members=l,d.newChatGroup=!0,d.group||(d.group={write:!0,members:[]},d.title="QUICKPANEL.NEW_CHATGROUP"),d.saveChatGroup=function(){var n;return d.errors=[],o.chatGroup.save({name:d.group.name,write:d.group.write}).$promise.then(function(e){var t=_.map(d.group.members,"id");return t.unshift(d.currentUser.id),n=e,o.chatGroup.addMembers({id:n.id,ids:t}).$promise}).then(function(){i.success({title:"Group properly saved!",msg:n.name+" has been saved!"}),c(n)}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.closeDialog=c,d.querySearch=function(e){return e?d.members.rows.filter((t=e,n=angular.lowercase(t),function(e){var t=e.name.toLowerCase();return-1!=t.indexOf(n)})):[];var t,n}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","group","members"],angular.module("app.quick-panel").controller("CreateOrEditChatGroupDialogController",e)}(),function(){"use strict";function e(e,n,a,o,t,s,i,r,l,d){var c=this;function m(){delete c.group}function u(e){var t=angular.element("#chat-group-dialog");a(function(){t.animate({scrollTop:t[0].scrollHeight},e)},0)}c.currentUser=i.getCurrentUser(),c.unreadGroupMessages={},c.groups={},c.participants,c.group,c.init=function(e){return c.license=e,r.user.getGroups({id:c.currentUser.id}).$promise.then(function(e){for(var t=0,n=[];t<e.rows.length;t++)e.rows[t].unreadGroupMessages=0,c.groups[e.rows[t].id]=e.rows[t],n.push(r.chatGroup.getUnread({id:e.rows[t].id}).$promise);return s.all(n)}).then(function(e){for(var t=0;t<e.length;t++)c.groups[e[t].id].unreadGroupMessages+=e[t].count}).catch(function(e){console.error(e)})},c.back=m,c.addGroup=function(e,t){o.show({controller:"CreateOrEditChatGroupDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/create/dialog.html",parent:angular.element(n.body),targetEvent:t,clickOutsideToClose:!0,locals:{group:e,me:c.currentUser,license:null,setting:null},resolve:{members:function(){return r.user.get({role:"agent"}).$promise}}}).then(function(e){e&&(c.groups[e.id]=e)}).catch(function(e){e&&console.error(e.message)})},c.deleteGroup=function(e,t){var n=o.confirm().title("Are you sure want to delete the selected group?").htmlContent("Group <b>"+e.name+"</b> will be deleted.").ariaLabel("delete Group").targetEvent(t).ok("OK").cancel("CANCEL");o.show(n).then(function(){return r.chatGroup.delete({id:e.id}).$promise}).then(function(){delete c.groups[e.id],d.success({title:"Group properly deleted!",msg:e.name+" has been deleted!"})}).catch(function(e){e&&d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatGroup.delete",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.groupsToArray=function(){return _.values(c.groups)},c.showMessageInfo=function(e,i){o.show({controller:"ShowMessageInfoDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/info/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{message:i},resolve:{data:function(){var a={messages:[]};return r.chatInternalMessage.get({ChatInternalMessageId:i.id}).$promise.then(function(e){var t=[];a.messages=e.rows,a.messages.unshift(i);for(var n=0;n<a.messages.length;n++)t.push(r.user.get({id:a.messages[n].ToId,fields:"id,name,fullname,userpic"}).$promise);return s.all(t)}).then(function(e){return a.users=e,a}).catch(function(e){e&&console.error(e)})}}}).then(function(){}).catch(function(e){e&&console.error(e.message)})},c.toggleChat=function(t){c.group={id:t.id,write:t.write,messages:{}},r.chatGroup.getMembers({id:t.id,fields:"id,name,fullname"}).$promise.then(function(e){return c.group.membersByKeys=_.keyBy(e.rows,"id"),c.group.members=_.differenceBy(e.rows,[{id:c.currentUser.id}],"id"),c.participants=_.map(c.group.members,"fullname").join(", "),r.chatGroup.getMessages({id:t.id}).$promise}).then(function(e){for(var t,n=0,a=[];n<e.count;n++)e.rows[n].ToId===c.currentUser.id&&(t=e.rows[n],c.group.messages[t.id]=t,e.rows[n].ToId!=c.currentUser.id||e.rows[n].FromId===c.currentUser.id||t.read||a.push(r.chatInternalMessage.update({id:t.id,read:!0})));return s.all(a)}).then(function(){u(400)}).catch(function(e){console.error(e.message)})},c.reply=function(){if(!c.replyMessage)return;var n={id:c.group.id,FromId:c.currentUser.id,ToId:c.currentUser.id,body:c.replyMessage,read:!0},a=[];c.replyMessage="",r.chatGroup.addMessage(n).$promise.then(function(e){n.read=!1,n.ChatInternalMessageId=e.id;for(var t=0;t<c.group.members.length;t++)c.group.members[t].id!==c.currentUser.id&&(n.ToId=c.group.members[t].id,a.push(r.chatGroup.addMessage(angular.copy(n)).$promise));return s.all(a)}).catch(function(e){console.log(e)})},l.on("chatInternalMessage:save",function(t){if(!c.group&&t.ToId===c.currentUser.id&&t.FromId!==c.currentUser.id&&!t.read&&t.ChatGroupId){var e=c.groups[t.ChatGroupId];if(!e)return r.chatGroup.get({id:t.ChatGroupId}).$promise.then(function(e){e.unreadGroupMessages=1,c.groups[e.id]=e});e.unreadGroupMessages||(e.unreadGroupMessages=0),e.unreadGroupMessages++}c.group&&t.ChatGroupId===c.group.id&&t.ToId===c.currentUser.id&&r.chatInternalMessage.update({id:t.id,read:!0}).$promise.then(function(){var e;e=t,c.group.messages[e.id]=e,u(400)})}),l.on("chatInternalMessage:update",function(e){e.ToId==c.currentUser.id&&e.FromId!==c.currentUser.id&&e.ChatGroupId&&e.read&&(0<c.groups[e.ChatGroupId].unreadGroupMessages&&c.groups[e.ChatGroupId].unreadGroupMessages--,c.group.messages[e.id]&&(c.group.messages[e.id].read=!0))}),l.on("chatGroup:remove",function(e){c.groups[e.id]&&delete c.groups[e.id]}),t("quick-panel").onClose(m),e.$on("$destroy",function(){l.removeAllListeners("chatInternalMessage:save"),l.removeAllListeners("chatInternalMessage:update"),l.removeAllListeners("chatGroup:remove")})}e.$inject=["$scope","$document","$timeout","$mdDialog","$mdSidenav","$q","Auth","api","socket","toasty"],angular.module("app.quick-panel").controller("ChatGroupController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s,r){this.data=r,this.title="QUICKPANEL.INFO",this.closeDialog=function(){a.hide()}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","data"],angular.module("app.quick-panel").controller("ShowMessageInfoDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,o){var s=this;s.form={token:o.token},s.setting={},s.resetPassword=function(){return i.auth.reset(s.form).$promise.then(function(){t.success({title:n.instant("RESETPASSWORD.PASSWORD_RESET"),msg:n.instant("RESETPASSWORD.PASSWORD_RESET_MESSAGE")}),a.go("app.login")}).catch(function(e){e&&t.error({title:n.instant("RESETPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},s.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general");return i.setting.gdpr({id:1}).$promise.then(function(e){s.setting=e,s.passwordPattern=s.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:""}).catch(function(e){e&&t.error({title:"Error",msg:e.data?e.data.message||e.message||e:e.message||e})})}}e.$inject=["Auth","toasty","$translate","$state","api","$stateParams"],angular.module("app.reset").controller("ResetPasswordController",e)}(),function(){"use strict";function e(e,t,n,a,i,o){var s=this;function r(){e.hide()}s.errors=[],s.user=a,s.setting=i,s.reset=o,s.passwordPattern=s.setting.securePassword?/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/:"",s.savePassword=function(){s.errors=[],n.user.changePassword({id:s.user.id},{oldPassword:s.oldPassword,newPassword:s.password}).$promise.then(function(){t.show(t.simple().textContent("Your password properly updated").position("top right").hideDelay(5e3)),r()}).catch(function(e){console.error(e),s.errors=e.data.errors&&e.data.errors.length?e.data.errors:[{message:e.data.message||"Authorization error",type:"api.user.changePassword"}]})},s.closeDialog=r}e.$inject=["$mdDialog","$mdToast","api","user","setting","reset"],angular.module("app.toolbar").controller("ChangePasswordController",e)}(),function(){"use strict";function e(e,t,n,a,i,o,s){var r=this,l=[];function d(e){_.isNil(e)&&o.cmHopper.update({id:r.preview.id,UserId:null}),a.hide()}r.errors=[],r.preview=s,r.originated=!1,r.disable=!1,r.disableGetContact=!1,l.push(r.preview.id),r.originatePreview=function(){r.originated=!0,r.disable=!0,_.isEmpty(r.preview)?(i.error({title:"Message",msg:"Contact not available"}),r.disable=!1,l=[],d(!0)):o.rpc.getVoiceQueuesPreview({id:r.preview.id}).$promise.then(function(e){d(!0)}).catch(function(e){i.error({title:"Message",msg:e.data}),d(!0)}).finally(function(){r.disable=!1,l=[]})},r.closeDialog=d,r.nextContact=function(){r.disableGetContact=!0,r.originated||o.cmHopper.update({id:r.preview.id,UserId:null});return o.cmHopper.getPreview({hopperIds:l}).$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?i.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"}):(r.preview=e,l.push(r.preview.id))}).catch(function(e){if(l=[],a.hide(),404===e.status)i.info({title:"PREVIEW",msg:"CONTACT NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api preview"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){r.disableGetContact=!1})},e.$on("$destroy",function(){r.originated||o.cmHopper.update({id:r.preview.id,UserId:null})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","preview"],angular.module("app.toolbar").controller("PreviewDialogController",e)}(),function(){"use strict";function e(e,t,o,n,s,a,i,r,l,d,c,m,u,p,g,v,h,b,f,A,E){var y,S=this;function T(e){S.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}function C(){S.promise=b.user.getQueues(S.query,T).$promise}function x(e){return v.logout(e).then(function(){return h.disconnect(),t.$broadcast("webrtc::logout"),n.go("app.login")}).catch(function(e){console.error(e)})}function O(e,t){c.show({controller:"ChangePasswordController",controllerAs:"vm",templateUrl:"app/toolbar/changepassword/changepassword.html",parent:angular.element(m.body),targetEvent:e,clickOutsideToClose:!t,locals:{user:S.user,setting:A,reset:t}})}S.voiceQueues={},S.polling=!0,t.global={search:""},S.pauses=[],S.license=f,S.currentUser=v.getCurrentUser(),S.unreadTotalMessages=0,S.unreadTotalGroupMessages=0,S.contcts=0,"agent"===S.currentUser.role&&(y=E(function(){_.some(S.voiceQueues,{dialMethod:"preview",dialActive:!0})&&S.license.dialer&&S.polling?(S.polling=!1,b.cmHopper.getOpenContacts().$promise.then(function(e){e&&_.isNumber(e.contacts)&&(S.contacts=e.contacts)}).finally(function(){S.polling=!0})):S.contacts=0},14999)),S.setting=A,S.bodyEl=angular.element("body"),S.conf={realm:"asterisk",host:a.host(),protocol:a.protocol(),remotePlayerId:"remote-audio",ua:"Motion WebRTC Bar 0.2.0",license:S.license.webrtc,phoneBarExpires:S.currentUser.phoneBarExpires},S.query={id:v.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",nolimit:!0},S.userStatusOptions=[{title:"Online",icon:"icon-checkbox-marked-circle",color:"#4CAF50"},{title:"Away",icon:"icon-clock",color:"#FFC107"},{title:"Do not Disturb",icon:"icon-minus-circle",color:"#F44336"},{title:"Invisible",icon:"icon-checkbox-blank-circle-outline",color:"#BDBDBD"},{title:"Offline",icon:"icon-checkbox-blank-circle-outline",color:"#616161"}],S.languages={en:{title:"English",translation:"TOOLBAR.ENGLISH",code:"en",flag:"us"},it:{title:"Italian",translation:"TOOLBAR.ITALIAN",code:"it",flag:"it"},fr:{title:"French",translation:"TOOLBAR.FRENCH",code:"fr",flag:"fr"},ko:{title:"Korean",translation:"TOOLBAR.KOREAN",code:"ko",flag:"ko"},es:{title:"Spanish",translation:"TOOLBAR.SPANISH",code:"es",flag:"es"},sv:{title:"Swedish",translation:"TOOLBAR.SWEDISH",code:"sv",flag:"sv"},ru:{title:"Russian",translation:"TOOLBAR.RUSSIAN",code:"ru",flag:"ru"},de:{title:"German",translation:"TOOLBAR.GERMAN",code:"de",flag:"de"},ja:{title:"Japanese",translation:"TOOLBAR.JAPANESE",code:"ja",flag:"ja"},"zh-CN":{title:"ChineseSimplified",translation:"TOOLBAR.CHINESESIMPLIFIED",code:"zh-CN",flag:"zh-CN"},"zh-TW":{title:"ChineseTraditional",translation:"TOOLBAR.CHINESETRADITIONAL",code:"zh-TW",flag:"zh-TW"},nl:{title:"Dutch",translation:"TOOLBAR.DUTCH",code:"nl",flag:"nl"},fi:{title:"Finnish",translation:"TOOLBAR.FINNISH",code:"fi",flag:"fi"},da:{title:"Danish",translation:"TOOLBAR.DANISH",code:"da",flag:"da"},"pt-PT":{title:"Portuguese",translation:"TOOLBAR.PORTUGUESE",code:"pt-PT",flag:"pt-PT"},no:{title:"Norwegian",translation:"TOOLBAR.NORWEGIAN",code:"no",flag:"no"},hi:{title:"Hindi",translation:"TOOLBAR.HINDI",code:"hi",flag:"hi"},tr:{title:"Turkish",translation:"TOOLBAR.TURKISH",code:"tr",flag:"tr"},fa:{title:"Persian",translation:"TOOLBAR.PERSIAN",code:"fa",flag:"fa"},pl:{title:"Polish",translation:"TOOLBAR.POLISH",code:"pl",flag:"pl"},lv:{title:"Latvian",translation:"TOOLBAR.LATVIAN",code:"lv",flag:"lv"}},S.toggleSidenav=function(e){i(e).toggle()},S.logout=x,S.changeLanguage=function(e){if(!S.languages.hasOwnProperty(e.code)){return void l.show({template:'<md-toast id="language-message" layout="column" layout-align="center start"><div class="md-toast-content">Motion supports multiple translations through angular-translate module, but currently we do not support the selected language. If you want to help us, send us a message.</div></md-toast>',hideDelay:7e3,position:"top right",parent:"#content"})}S.selectedLanguage=e,u.put("motion.language",e.code),r.use(e.code),"app.callysquare.projects.edit"===n.current.name&&d.location.reload()},S.setUserStatus=function(e){S.userStatus=e},S.toggleHorizontalMobileMenu=function(){S.bodyEl.toggleClass("ms-navigation-horizontal-mobile-menu-active")},S.toggleMsNavigationFolded=function(){g.toggleFolded()},S.search=function(t){for(var e=[],n=g.getFlatNavigation(),a=o.defer(),i=0;i<n.length;i++)n[i].uisref&&e.push(n[i]);t&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(t)))return!0}));return s(function(){a.resolve(e)},1e3),a.promise},S.searchResultClick=function(e){e.uisref&&(e.stateParams?n.go(e.state,e.stateParams):n.go(e.state))},S.openSettings=function(e){t.$broadcast("webrtc::settings")},S.changePassword=O,S.isAgent=function(){return v.getCurrentUser()&&v.hasRole("agent")},S.onUserUpdate=function(e){if(e.id===S.user.id)if("agent"===e.role&&_.isBoolean(e.online)&&!e.online)if(0!==S.user.showWebBar){var t=c.confirm().title(r.instant("TOOLBAR.WARNING")+"!").textContent(r.instant("TOOLBAR.SOMEONE_LOGGED_YOU_OUT")).ariaLabel(r.instant("TOOLBAR.WARNING")+"!").ok(r.instant("TOOLBAR.STAY_LOGGED")).cancel("Logout");c.show(t).then(function(){v.queueLogin()}).catch(function(e){x(!0)}).finally(function(){_.merge(S.user,e),v.updateCurrentUser(S.user)})}else x(!0),_.merge(S.user,e),v.updateCurrentUser(S.user);else _.merge(S.user,e),v.updateCurrentUser(S.user)},S.onUserCalled=function(e){2===S.currentUser.showWebBar&&"agent"===S.currentUser.role&&S.currentUser.name===e.membername&&p.info({title:"WebRTC Popup",msg:"<div> <span>Call from: "+e.calleridnum+"</span><br> <span>Queue: "+e.queue+"</span><br> <span>Extra: "+(e.extravar||"Not defined")+"</span><br> </div>",showClose:!0,timeout:1e4,html:!0})},S.pause=function(e){return b.user.pause({id:S.user.id,type:e||"DEFAULT PAUSE"}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:PAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},S.unpause=function(){return b.user.unpause({id:S.user.id}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UNPAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},S.preview=function(t){return S.disable=!0,b.cmHopper.getPreview().$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?p.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"}):c.show({controller:"PreviewDialogController",controllerAs:"vm",templateUrl:"app/toolbar/preview/dialog.html",parent:angular.element(m.body),targetEvent:t,clickOutsideToClose:!0,locals:{preview:e}})}).catch(function(e){if(404===e.status)p.info({title:"PREVIEW",msg:"CONTACT NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){S.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var t=0;t<e.data.errors.length;t+=1)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){S.disable=!1})},S.getLogo=function(){return S.setting.defaultHeaderWhiteLabel?"xCALLY Motion":S.setting.headerWhiteLabel},S.userIsNotPhonebar=function(){return"admin"===S.currentUser.role||"user"===S.currentUser.role||"agent"===S.currentUser.role&&0!==S.currentUser.showWebBar},S.onInternalMessageSave=function(e){e.ToId!==S.currentUser.id||e.ChatGroupId||(S.unreadTotalMessages+=1);e.ToId===S.currentUser.id&&e.FromId!==S.currentUser.id&&!e.read&&e.ChatGroupId&&S.unreadTotalGroupMessages++},S.onInternalMessageUpdate=function(e){e.ToId===S.currentUser.id&&e.read&&0<S.unreadTotalMessages&&!e.ChatGroupId&&(S.unreadTotalMessages-=1);e.ToId===S.currentUser.id&&e.read&&e.ChatGroupId&&0<S.unreadTotalGroupMessages&&S.unreadTotalGroupMessages--},S.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===v.getCurrentUser().id&&C()},S.onVoiceQueue=function(e){C()},h.connect(),h.on("user:update",S.onUserUpdate),h.on("user:called",S.onUserCalled),h.on("chatInternalMessage:save",S.onInternalMessageSave),h.on("chatInternalMessage:update",S.onInternalMessageUpdate),h.on("userVoiceQueue:save",S.onUserVoiceQueue),h.on("voiceQueue:save",S.onVoiceQueue),h.on("userVoiceQueue:remove",S.onUserVoiceQueue),h.on("voiceQueue:remove",S.onVoiceQueue),h.on("voiceQueue:update",S.onVoiceQueue),function(){S.user=v.getCurrentUser(),S.conf.ha1=S.user.md5secret,S.conf.id=S.user.id,S.conf.name=S.user.name,S.conf.fullname=S.user.fullname,S.conf.internal=S.user.internal,S.conf.recording=S.user.phoneBarEnableRecording,S.conf.autoAnswer=S.user.phoneBarAutoAnswer,S.conf.enableSettings=S.user.phoneBarEnableSettings,S.conf.enableDtmfTone=S.user.phoneBarEnableDtmfTone,S.conf.autoAnswerDelay=S.user.phoneBarAutoAnswerDelay,S.userStatus=S.userStatusOptions[0];var e=u.get("motion.language");e&&S.languages.hasOwnProperty(e)?S.selectedLanguage=S.languages[e]:S.selectedLanguage=S.languages[r.preferredLanguage()];if(b.pause.get({fields:"name",nolimit:!0}).$promise.then(function(e){S.pauses=e.rows?e.rows:[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETPAUSES",msg:e.status?JSON.stringify(e.data):e.toString()})}),S.setting.securePassword)if(S.user.passwordResetAt){var t=moment(S.user.passwordResetAt).add(S.setting.passwordExpiresDays||90,"day");moment().isAfter(t)?O(null,!0):moment().add(15,"day").isAfter(t)&&p.warning({title:r.instant("TOOLBAR.WARNING")+"!",msg:r.instant("TOOLBAR.PASSWORD_EXPIRE_REMAINING_DAYS")+": "+Math.ceil(t.diff(moment(),"days",!0)),timeout:2e4})}else O(null,!0)}(),C(),b.chatInternalMessage.get({fields:"FromId",ToId:S.currentUser.id,read:!1,nolimit:!0}).$promise.then(function(e){S.unreadTotalMessages=e.rows.length}),e.$on("$destroy",function(){h.removeAllListeners("user:called"),h.removeAllListeners("user:update"),h.removeAllListeners("chatInternalMessage:save"),h.removeAllListeners("chatInternalMessage:update"),h.removeAllListeners("userVoiceQueue:save"),h.removeAllListeners("voiceQueue:save"),h.removeAllListeners("userVoiceQueue:remove"),h.removeAllListeners("voiceQueue:remove"),h.removeAllListeners("voiceQueue:update"),y&&(E.cancel(y),y=null)})}e.$inject=["$scope","$rootScope","$q","$state","$timeout","$location","$mdSidenav","$translate","$mdToast","$window","$mdDialog","$document","$cookies","toasty","msNavigationService","Auth","socket","api","license","setting","$interval"],angular.module("app.toolbar").controller("ToolbarController",e)}();var urlParams=function(e){var t=new Object,n=e.lastIndexOf("?");if(0<n)for(var a=e.substring(n+1).split("&"),i=0;i<a.length;i++)0<(n=a[i].indexOf("="))&&(t[a[i].substring(0,n)]=a[i].substring(n+1));return t}(window.location.href),t0=new Date,MAX_REQUEST_SIZE=10485760,MAX_WIDTH=12e3,MAX_HEIGHT=12e3,EXPORT_URL="http://exp.draw.io/ImageExport2/export",SHARE_HOST="http://localhost:3000",SAVE_URL="api/square/projects/",VARIABLE_URL="/api/variables",STENCIL_PATH="/assets/plugins/square/stencils",SHAPES_PATH="/assets/plugins/square/shapes",IMAGE_PATH="/assets/plugins/square/images",STYLE_PATH="/assets/plugins/square/styles",CSS_PATH="/assets/plugins/square/styles",OPEN_FORM="api/square/projects/open",TEMPLATE_PATH="/assets/plugins/square/templates",RESOURCES_PATH="/assets/plugins/square/resources",RESOURCE_BASE=RESOURCES_PATH+"/grapheditor",tapAndHoldStartsConnection=!0,showConnectorImg=!0,mxLoadResources=!1,mxLanguages=["it","fr","ko","es","sv","ru","de","ja","zh-CN","zh-TW","nl","fi","da","pt-PT","no","hi","tr","fa"],mxLanguage="en",match=document.cookie.match(new RegExp("(^| )motion.language=([^;]+)"));match&&mxLanguages.includes(match[2])&&(mxLanguage=match[2]);var mxBasePath="assets/plugins/mxgraph",mxClient={VERSION:"2.0.0.0",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&navigator.userAgent.indexOf("MSIE")<0,IS_OP:0<=navigator.userAgent.indexOf("Opera/"),IS_OT:navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&navigator.userAgent.indexOf("Chrome/")<0,IS_GC:0<=navigator.userAgent.indexOf("Chrome/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||0<=navigator.userAgent.indexOf("Iceweasel/")&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||0<=navigator.userAgent.indexOf("SeaMonkey/")&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||0<=navigator.userAgent.indexOf("Iceape/")&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||0<=navigator.userAgent.indexOf("Epiphany/")||0<=navigator.userAgent.indexOf("AppleWebKit/")||0<=navigator.userAgent.indexOf("Gecko/")||0<=navigator.userAgent.indexOf("Opera/"),NO_FO:0<=navigator.userAgent.indexOf("Firefox/1.")||0<=navigator.userAgent.indexOf("Iceweasel/1.")||0<=navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/1.")||0<=navigator.userAgent.indexOf("Camino/1.")||0<=navigator.userAgent.indexOf("Epiphany/2.")||0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("MSIE")||0<=navigator.userAgent.indexOf("Mozilla/2."),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_MAC:0<navigator.userAgent.toUpperCase().indexOf("MACINTOSH"),IS_TOUCH:0<navigator.userAgent.toUpperCase().indexOf("IPAD")||0<navigator.userAgent.toUpperCase().indexOf("IPOD")||0<navigator.userAgent.toUpperCase().indexOf("IPHONE")||0<navigator.userAgent.toUpperCase().indexOf("ANDROID"),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(e,t,n){if(n=n||document,mxClient.IS_IE6)n.write('<link rel="'+e+'" href="'+t+'" charset="ISO-8859-1" type="text/css"/>');else{var a=n.createElement("link");a.setAttribute("rel",e),a.setAttribute("href",t),a.setAttribute("charset","ISO-8859-1"),a.setAttribute("type","text/css"),n.getElementsByTagName("head")[0].appendChild(a)}},include:function(e){document.write('<script src="'+e+'"><\/script>')},dispose:function(){for(var e=0;e<mxEvent.objects.length;e++)null!=mxEvent.objects[e].mxListenerList&&mxEvent.removeAllListeners(mxEvent.objects[e])}};if(mxClient.IS_OP&&mxClient.IS_OT?mxClient.CSS_PREFIX="O":mxClient.IS_SF||mxClient.IS_GC?mxClient.CSS_PREFIX="Webkit":mxClient.IS_MT?mxClient.CSS_PREFIX="Moz":mxClient.IS_IE&&9<=document.documentMode&&(mxClient.CSS_PREFIX="ms"),void 0===mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),void 0!==mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images",mxClient.language=void 0!==mxLanguage?mxLanguage:mxClient.IS_IE?navigator.userLanguage:navigator.language,mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage?mxDefaultLanguage:"en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),void 0!==mxLanguages&&(mxClient.languages=mxLanguages),mxClient.IS_IE){if(9<=document.documentMode)mxClient.IS_VML=!1,mxClient.IS_SVG=!0;else{8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"));var ss=document.createStyleSheet();ss.cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css")}window.attachEvent("onunload",mxClient.dispose)}var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var e=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,t=document.createElement("table");t.setAttribute("width","100%"),t.setAttribute("height","100%");var n=document.createElement("tbody"),a=document.createElement("tr"),i=document.createElement("td");if(i.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxLog.textarea.style.width=mxClient.IS_NS&&"BackCompat"!=document.compatMode?"99%":"100%",i.appendChild(mxLog.textarea),a.appendChild(i),n.appendChild(a),a=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),a.appendChild(mxLog.td),n.appendChild(a),t.appendChild(n),mxLog.addButton("Info",function(e){mxLog.info()}),mxLog.addButton("DOM",function(e){e=mxUtils.getInnerHtml(document.body),mxLog.debug(e)}),mxLog.addButton("Trace",function(e){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")}),mxLog.addButton("Copy",function(e){try{mxUtils.copy(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Show",function(e){try{mxUtils.popup(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Clear",function(e){mxLog.textarea.value=""}),a=n=0,"number"==typeof window.innerWidth?(n=window.innerHeight,a=window.innerWidth):(n=document.documentElement.clientHeight||document.body.clientHeight,a=document.body.clientWidth),mxLog.window=new mxWindow(e,t,Math.max(0,a-320),Math.max(0,n-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode){var o=mxLog.window.getElement();e=function(e,t){mxLog.textarea.style.height=Math.max(0,o.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,e),mxLog.window.addListener(mxEvent.MAXIMIZE,e),mxLog.window.addListener(mxEvent.NORMALIZE,e),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(e,t){var n=document.createElement("button");mxUtils.write(n,e),mxEvent.addListener(n,"click",t),mxLog.td.appendChild(n)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(e){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(e)},enter:function(e){if(mxLog.TRACE)return mxLog.writeln("Entering "+e),(new Date).getTime()},leave:function(e,t){if(mxLog.TRACE){var n=0!=t?" ("+((new Date).getTime()-t)+" ms)":"";mxLog.writeln("Leaving "+e+n)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var e="",t=0;t<arguments.length;t++)e+=arguments[t],t<arguments.length-1&&(e+=" ");null!=mxLog.textarea?(mxLog.textarea.value+=e,0<=navigator.userAgent.indexOf("Presto/2.5")&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=e},writeln:function(){for(var e="",t=0;t<arguments.length;t++)e+=arguments[t],t<arguments.length-1&&(e+=" ");mxLog.write(e+"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(e){if("object"==typeof e&&null==e[mxObjectIdentity.FIELD_NAME]){var t=mxUtils.getFunctionName(e.constructor);e[mxObjectIdentity.FIELD_NAME]=t+"#"+mxObjectIdentity.counter++}return e[mxObjectIdentity.FIELD_NAME]},clear:function(e){"object"==typeof e&&delete e[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}mxDictionary.prototype.map=null,mxDictionary.prototype.clear=function(){this.map={}},mxDictionary.prototype.get=function(e){return e=mxObjectIdentity.get(e),this.map[e]},mxDictionary.prototype.put=function(e,t){var n=mxObjectIdentity.get(e),a=this.map[n];return this.map[n]=t,a},mxDictionary.prototype.remove=function(e){e=mxObjectIdentity.get(e);var t=this.map[e];return delete this.map[e],t},mxDictionary.prototype.getKeys=function(){var e,t=[];for(e in this.map)t.push(e);return t},mxDictionary.prototype.getValues=function(){var e,t=[];for(e in this.map)t.push(this.map[e]);return t},mxDictionary.prototype.visit=function(e){for(var t in this.map)e(t,this.map[t])};var mxResources={resources:[],extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(e){return null==mxClient.languages||0<=mxUtils.indexOf(mxClient.languages,e)},getDefaultBundle:function(e,t){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(t)?e+mxResources.extension:null},getSpecialBundle:function(e,t){if(null==mxClient.languages||!this.isLanguageSupported(t)){var n=t.indexOf("-");0<n&&(t=t.substring(0,n))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(t)&&t!=mxClient.defaultLanguage?e+"_"+t+mxResources.extension:null},add:function(e,t){if((t=null!=t?t:mxClient.language.toLowerCase())!=mxConstants.NONE){var n=mxResources.getDefaultBundle(e,t);if(null!=n)try{var a=mxUtils.load(n);a.isReady()&&mxResources.parse(a.getText())}catch(e){}if(null!=(n=mxResources.getSpecialBundle(e,t)))try{(a=mxUtils.load(n)).isReady()&&mxResources.parse(a.getText())}catch(e){}}},parse:function(e){if(null!=e){e=e.split("\n");for(var t=0;t<e.length;t++)if("#"!=e[t].charAt(0)){var n=e[t].indexOf("=");if(0<n){var a=e[t].substring(0,n),i=e[t].length;13==e[t].charCodeAt(i-1)&&i--,n=e[t].substring(n+1,i),this.resourcesEncoded?(n=n.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[a]=unescape(n)):mxResources.resources[a]=n}}}},get:function(e,t,n){if(null==(e=mxResources.resources[e])&&(e=n),null!=e&&null!=t){n=[];for(var a=null,i=0;i<e.length;i++){var o=e.charAt(i);"{"==o?a="":null!=a&&"}"==o?(0<=(a=parseInt(a)-1)&&a<t.length&&n.push(t[a]),a=null):null!=a?a+=o:n.push(o)}e=n.join("")}return e}};function mxPoint(e,t){this.x=null!=e?e:0,this.y=null!=t?t:0}function mxRectangle(e,t,n,a){mxPoint.call(this,e,t),this.width=null!=n?n:0,this.height=null!=a?a:0}mxPoint.prototype.x=null,mxPoint.prototype.y=null,mxPoint.prototype.equals=function(e){return e.x==this.x&&e.y==this.y},mxPoint.prototype.clone=function(){return mxUtils.clone(this)},mxRectangle.prototype=new mxPoint,mxRectangle.prototype.constructor=mxRectangle,mxRectangle.prototype.width=null,mxRectangle.prototype.height=null,mxRectangle.prototype.setRect=function(e,t,n,a){this.x=e,this.y=t,this.width=n,this.height=a},mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2},mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2},mxRectangle.prototype.add=function(e){if(null!=e){var t=Math.min(this.x,e.x),n=Math.min(this.y,e.y),a=Math.max(this.x+this.width,e.x+e.width);e=Math.max(this.y+this.height,e.y+e.height),this.x=t,this.y=n,this.width=a-t,this.height=e-n}},mxRectangle.prototype.grow=function(e){this.x-=e,this.y-=e,this.width+=2*e,this.height+=2*e},mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)},mxRectangle.prototype.equals=function(e){return e.x==this.x&&e.y==this.y&&e.width==this.width&&e.height==this.height};var mxEffects={animateChanges:function(l,d,c){var m=0,u=function(){for(var e=!1,t=0;t<d.length;t++){var n=d[t];if(n instanceof mxGeometryChange||n instanceof mxTerminalChange||n instanceof mxValueChange||n instanceof mxChildChange||n instanceof mxStyleChange){var a=l.getView().getState(n.cell||n.child,!1);if(null!=a)if(e=!0,n.constructor!=mxGeometryChange||l.model.isEdge(n.cell))mxUtils.setOpacity(a.shape.node,100*m/10);else{var i=l.getView().scale,o=(n.geometry.x-n.previous.x)*i,s=(n.geometry.y-n.previous.y)*i,r=(n.geometry.width-n.previous.width)*i;i=(n.geometry.height-n.previous.height)*i;0==m?(a.x-=o,a.y-=s,a.width-=r,a.height-=i):(a.x+=o/10,a.y+=s/10,a.width+=r/10,a.height+=i/10),l.cellRenderer.redraw(a),mxEffects.cascadeOpacity(l,n.cell,100*m/10)}}}m<10&&e?(m++,window.setTimeout(u,p)):null!=c&&c()},p=30;u()},cascadeOpacity:function(e,t,n){for(var a=e.model.getChildCount(t),i=0;i<a;i++){var o=e.model.getChildAt(t,i),s=e.getView().getState(o);null!=s&&(mxUtils.setOpacity(s.shape.node,n),mxEffects.cascadeOpacity(e,o,n))}if(null!=(t=e.model.getEdges(t)))for(i=0;i<t.length;i++)null!=(a=e.getView().getState(t[i]))&&mxUtils.setOpacity(a.shape.node,n)},fadeOut:function(e,t,n,a,i,o){a=a||40,i=i||30;var s=t||100;if(mxUtils.setOpacity(e,s),o||null==o){var r=function(){s=Math.max(s-a,0),mxUtils.setOpacity(e,s),0<s?window.setTimeout(r,i):(e.style.visibility="hidden",n&&e.parentNode&&e.parentNode.removeChild(e))};window.setTimeout(r,i)}else e.style.visibility="hidden",n&&e.parentNode&&e.parentNode.removeChild(e)}},mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(e){if(null!=e.style&&(e.style.cursor=""),null!=(e=e.childNodes))for(var t=e.length,n=0;n<t;n+=1)mxUtils.removeCursors(e[n])},getCurrentStyle:mxClient.IS_IE?function(e){return null!=e?e.currentStyle:null}:function(e){return null!=e?window.getComputedStyle(e,""):null},hasScrollbars:function(e){return null!=(e=mxUtils.getCurrentStyle(e))&&("scroll"==e.overflow||"auto"==e.overflow)},bind:function(e,t){return function(){return t.apply(e,arguments)}},eval:function(a){var b=null;if(0<=a.indexOf("function"))try{eval("var _mxJavaScriptExpression="+a),b=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(e){mxLog.warn(e.message+" while evaluating "+a)}else try{b=eval(a)}catch(e){mxLog.warn(e.message+" while evaluating "+a)}return b},findNode:function(e,t,n){var a=e.getAttribute(t);if(null!=a&&a==n)return e;for(e=e.firstChild;null!=e;){if(null!=(a=mxUtils.findNode(e,t,n)))return a;e=e.nextSibling}return null},findNodeByAttribute:9<=document.documentMode?function(e,t,n){var a=null;if(null!=e)if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.getAttribute(t)==n)a=e;else for(e=e.firstChild;null!=e&&null==a;)a=mxUtils.findNodeByAttribute(e,t,n),e=e.nextSibling;return a}:mxClient.IS_IE?function(e,t,n){return null==e?null:e.ownerDocument.selectSingleNode("//*[@"+t+"='"+n+"']")}:function(e,t,n){return null==e?null:e.ownerDocument.evaluate("//*[@"+t+"='"+n+"']",e.ownerDocument,null,XPathResult.ANY_TYPE,null).iterateNext()},getFunctionName:function(e){var t=null;if(null!=e)if(null!=e.name)t=e.name;else{for(e=e.toString(),t=9;" "==e.charAt(t);)t++;var n=e.indexOf("(",t);t=e.substring(t,n)}return t},indexOf:function(e,t){if(null!=e&&null!=t)for(var n=0;n<e.length;n++)if(e[n]==t)return n;return-1},remove:function(e,t){var n=null;if("object"==typeof t)for(var a=mxUtils.indexOf(t,e);0<=a;)t.splice(a,1),n=e,a=mxUtils.indexOf(t,e);for(var i in t)t[i]==e&&(delete t[i],n=e);return n},isNode:function(e,t,n,a){return!(null==e||isNaN(e.nodeType)||null!=t&&e.nodeName.toLowerCase()!=t.toLowerCase())&&(null==n||e.getAttribute(n)==a)},getChildNodes:function(e,t){t=t||mxConstants.NODETYPE_ELEMENT;for(var n=[],a=e.firstChild;null!=a;)a.nodeType==t&&n.push(a),a=a.nextSibling;return n},createXmlDocument:function(){var e=null;return document.implementation&&document.implementation.createDocument?e=document.implementation.createDocument("","",null):window.ActiveXObject&&(e=new ActiveXObject("Microsoft.XMLDOM")),e},parseXml:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){var t=mxUtils.createXmlDocument();return t.async="false",t.loadXML(e),t}:function(e){return(new DOMParser).parseFromString(e,"text/xml")},clearSelection:document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().removeAllRanges()}:void 0,getPrettyXml:function(e,t,n){var a=[];if(null!=e)if(t=t||" ",n=n||"",e.nodeType==mxConstants.NODETYPE_TEXT)a.push(e.nodeValue);else{a.push(n+"<"+e.nodeName);var i=e.attributes;if(null!=i)for(var o=0;o<i.length;o++){var s=mxUtils.htmlEntities(i[o].nodeValue);a.push(" "+i[o].nodeName+'="'+s+'"')}if(null!=(i=e.firstChild)){for(a.push(">\n");null!=i;)a.push(mxUtils.getPrettyXml(i,t,n+t)),i=i.nextSibling;a.push(n+"</"+e.nodeName+">\n")}else a.push("/>\n")}return a.join("")},removeWhitespace:function(e,t){for(var n=t?e.previousSibling:e.nextSibling;null!=n&&n.nodeType==mxConstants.NODETYPE_TEXT;){var a=t?n.previousSibling:n.nextSibling,i=mxUtils.getTextContent(n);0==mxUtils.trim(i).length&&n.parentNode.removeChild(n),n=a}},htmlEntities:function(e,t){return e=(e=(e=(e=(e=(e||"").replace(/&/g,"&")).replace(/"/g,""")).replace(/\'/g,"'")).replace(/</g,"<")).replace(/>/g,">"),(null==t||t)&&(e=e.replace(/\n/g,"
")),e},isVml:function(e){return null!=e&&"urn:schemas-microsoft-com:vml"==e.tagUrn},getXml:function(e,t){var n="";return null!=e&&(n=null==(n=e.xml)?e.innerHTML?e.innerHTML:(new XMLSerializer).serializeToString(e):n.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n")),n.replace(/\n/g,t||"
")},getTextContent:function(e){var t="";return null!=e&&(null!=e.firstChild&&(e=e.firstChild),t=e.nodeValue||""),t},getInnerHtml:mxClient.IS_IE?function(e){return null!=e?e.innerHTML:""}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},getOuterHtml:mxClient.IS_IE?function(e){if(null!=e){if(null!=e.outerHTML)return e.outerHTML;var t=[];t.push("<"+e.nodeName);var n=e.attributes;if(null!=n)for(var a=0;a<n.length;a++){var i=n[a].nodeValue;null!=i&&0<i.length&&(t.push(" "),t.push(n[a].nodeName),t.push('="'),t.push(i),t.push('"'))}return 0==e.innerHTML.length?t.push("/>"):(t.push(">"),t.push(e.innerHTML),t.push("</"+e.nodeName+">")),t.join("")}return""}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},write:function(e,t){var n=e.ownerDocument.createTextNode(t);return null!=e&&e.appendChild(n),n},writeln:function(e,t){var n=e.ownerDocument.createTextNode(t);return null!=e&&(e.appendChild(n),e.appendChild(document.createElement("br"))),n},br:function(e,t){t=t||1;for(var n=null,a=0;a<t;a++)null!=e&&(n=e.ownerDocument.createElement("br"),e.appendChild(n));return n},button:function(e,t,n){return n=(n=null!=n?n:document).createElement("button"),mxUtils.write(n,e),mxEvent.addListener(n,"click",function(e){t(e)}),n},para:function(e,t){var n=document.createElement("p");return mxUtils.write(n,t),null!=e&&e.appendChild(n),n},addTransparentBackgroundFilter:function(e){e.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(e,t,n,a,i){return mxUtils.link(e,t,function(){n.execute(a)},i)},linkInvoke:function(e,t,n,a,i,o){return mxUtils.link(e,t,function(){n[a](i)},o)},link:function(e,t,n,a){var i=document.createElement("span");return i.style.color="blue",i.style.textDecoration="underline",i.style.cursor="pointer",null!=a&&(i.style.paddingLeft=a+"px"),mxEvent.addListener(i,"click",n),mxUtils.write(i,t),null!=e&&e.appendChild(i),i},fit:function(e){var t=parseInt(e.offsetLeft),n=parseInt(e.offsetWidth),a=document.body,i=document.documentElement,o=(a.scrollLeft||i.scrollLeft)+(a.clientWidth||i.clientWidth);o<t+n&&(e.style.left=Math.max(a.scrollLeft||i.scrollLeft,o-n)+"px"),t=parseInt(e.offsetTop),n=parseInt(e.offsetHeight),(o=(a.scrollTop||i.scrollTop)+Math.max(a.clientHeight||0,i.clientHeight))<t+n&&(e.style.top=Math.max(a.scrollTop||i.scrollTop,o-n)+"px")},open:function(e){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return mxUtils.alert("Permission to read file denied."),""}var t=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);return t.initWithPath(e),t.exists()?((e=Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream)).init(t,1,4,null),(t=Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream)).init(e),t.read(t.available())):(mxUtils.alert("File not found."),"")}return e=(t=new ActiveXObject("Scripting.FileSystemObject").OpenTextFile(e,1)).readAll(),t.close(),e},save:function(e,t){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return void mxUtils.alert("Permission to write file denied.")}var n=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);n.initWithPath(e),n.exists()||n.create(0,420);var a=Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);a.init(n,34,4,null),a.write(t,t.length),a.flush(),a.close()}else(n=new ActiveXObject("Scripting.FileSystemObject").CreateTextFile(e,!0)).Write(t),n.Close()},saveAs:function(e){var t=document.createElement("iframe");t.setAttribute("src",""),t.style.visibility="hidden",document.body.appendChild(t);try{if(mxClient.IS_NS){var n=t.contentDocument;n.open(),n.write(e),n.close();try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"),t.focus(),saveDocument(n)}catch(e){mxUtils.alert("Permission to save document denied.")}}else(n=t.contentWindow.document).write(e),n.execCommand("SaveAs",!1,document.location)}finally{document.body.removeChild(t)}},copy:function(e){if(window.clipboardData)window.clipboardData.setData("Text",e);else{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");var t=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(t){var n=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(n){n.addDataFlavor("text/unicode");var a=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);a.data=e,n.setTransferData("text/unicode",a,2*e.length),t.setData(n,null,Components.interfaces.nsIClipboard.kGlobalClipboard)}}}},load:function(e){return(e=new mxXmlRequest(e,null,"GET",!1)).send(),e},get:function(e,t,n){return new mxXmlRequest(e,null,"GET").send(t,n)},post:function(e,t,n,a){return new mxXmlRequest(e,t).send(n,a)},submit:function(e,t,n,a){return new mxXmlRequest(e,t).simulate(n,a)},loadInto:function(e,t,n){mxClient.IS_IE?t.onreadystatechange=function(){4==t.readyState&&n()}:t.addEventListener("load",n,!1),t.load(e)},getValue:function(e,t,n){return null==(e=null!=e?e[t]:null)&&(e=n),e},getNumber:function(e,t,n){return null==(e=null!=e?e[t]:null)&&(e=n||0),Number(e)},getColor:function(e,t,n){return null==(e=null!=e?e[t]:null)?e=n:e==mxConstants.NONE&&(e=null),e},clone:function(e,t,n){n=null!=n&&n;var a=null;if(null!=e&&"function"==typeof e.constructor){var i;a=new e.constructor;for(i in e)i!=mxObjectIdentity.FIELD_NAME&&(null==t||mxUtils.indexOf(t,i)<0)&&(a[i]=n||"object"!=typeof e[i]?e[i]:mxUtils.clone(e[i]))}return a},equalPoints:function(e,t){if(null==e&&null!=t||null!=e&&null==t||null!=e&&null!=t&&e.length!=t.length)return!1;if(null!=e&&null!=t)for(var n=0;n<e.length;n++)if(e[n]==t[n]||null!=e[n]&&!e[n].equals(t[n]))return!1;return!0},equalEntries:function(e,t){if(null==e&&null!=t||null!=e&&null==t||null!=e&&null!=t&&e.length!=t.length)return!1;if(null!=e&&null!=t)for(var n in e)if(e[n]!=t[n])return!1;return!0},extend:function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},toString:function(e){var t,n="";for(t in e)try{if(null==e[t])n+=t+" = [null]\n";else if("function"==typeof e[t])n+=t+" => [Function]\n";else if("object"==typeof e[t])n=n+(t+" => [")+mxUtils.getFunctionName(e[t].constructor)+"]\n";else n+=t+" = "+e[t]+"\n"}catch(e){n+=t+"="+e.message}return n},toRadians:function(e){return Math.PI*e/180},arcToCurves:function(e,t,n,a,i,o,s,r,l){if(r-=e,l-=t,0===n||0===a)return h;n=Math.abs(n),a=Math.abs(a);var d=-r/2,c=-l/2,m=Math.cos(i*Math.PI/180);i=m*d+(h=Math.sin(i*Math.PI/180))*c;d=-1*h*d+m*c;1<(v=(c=i*i)/(g=n*n)+(p=d*d)/(A=a*a))?(n*=Math.sqrt(v),a*=Math.sqrt(v),o=0):(v=1,o===s&&(v=-1),o=v*Math.sqrt((g*A-g*p-A*c)/(g*p+A*c))),r=m*(c=o*n*d/a)-h*(p=-1*o*a*i/n)+r/2,l=h*c+m*p+l/2,o=0<=(g=Math.atan2((d-p)/a,(i-c)/n)-Math.atan2(0,1))?g:2*Math.PI+g,i=0<=(g=Math.atan2((-d-p)/a,(-i-c)/n)-Math.atan2((d-p)/a,(i-c)/n))?g:2*Math.PI+g,0==s&&0<i?i-=2*Math.PI:0!=s&&i<0&&(i+=2*Math.PI),s=2*i/Math.PI,i/=s=Math.ceil(s<0?-1*s:s),d=8/3*Math.sin(i/4)*Math.sin(i/4)/Math.sin(i/2),c=m*n,m*=a,n*=h,a*=h;for(var u=Math.cos(o),p=-d*(c*(f=Math.sin(o))+a*u),g=-d*(n*f-m*u),v=A=0,h=[],b=0;b<s;++b){o+=i;var f,A=c*(u=Math.cos(o))-a*(f=Math.sin(o))+r,E=(v=n*u+m*f+l,-d*(c*f+a*u));u=-d*(n*f-m*u);h[f=6*b]=Number(p+e),h[f+1]=Number(g+t),h[f+2]=Number(A-E+e),h[f+3]=Number(v-u+t),h[f+4]=Number(A+e),h[f+5]=Number(v+t),p=A+E,g=v+u}return h},getBoundingBox:function(e,t){var n=null;if(null!=e&&null!=t&&0!=t){var a=mxUtils.toRadians(t),i=(n=Math.cos(a),Math.sin(a)),o=new mxPoint(e.x+e.width/2,e.y+e.height/2),s=new mxPoint(e.x,e.y),r=new mxPoint((a=new mxPoint(e.x+e.width,e.y)).x,e.y+e.height),l=new mxPoint(e.x,r.y);s=mxUtils.getRotatedPoint(s,n,i,o),a=mxUtils.getRotatedPoint(a,n,i,o),r=mxUtils.getRotatedPoint(r,n,i,o),l=mxUtils.getRotatedPoint(l,n,i,o);(n=new mxRectangle(s.x,s.y,0,0)).add(new mxRectangle(a.x,a.y,0,0)),n.add(new mxRectangle(r.x,r.y,0,0)),n.add(new mxRectangle(l.x,l.y,0,0))}return n},getRotatedPoint:function(e,t,n,a){a=null!=a?a:new mxPoint;var i=e.x-a.x;return new mxPoint(i*t-(e=e.y-a.y)*n+a.x,e*t+i*n+a.y)},getPortConstraints:function(e,t,n,a){return null==(e=mxUtils.getValue(e.style,mxConstants.STYLE_PORT_CONSTRAINT,null))?a:(a=e.toString(),e=mxConstants.DIRECTION_MASK_NONE,0<=a.indexOf(mxConstants.DIRECTION_NORTH)&&(e|=mxConstants.DIRECTION_MASK_NORTH),0<=a.indexOf(mxConstants.DIRECTION_WEST)&&(e|=mxConstants.DIRECTION_MASK_WEST),0<=a.indexOf(mxConstants.DIRECTION_SOUTH)&&(e|=mxConstants.DIRECTION_MASK_SOUTH),0<=a.indexOf(mxConstants.DIRECTION_EAST)&&(e|=mxConstants.DIRECTION_MASK_EAST),e)},reversePortConstraints:function(e){return(e&mxConstants.DIRECTION_MASK_WEST)<<3|(e&mxConstants.DIRECTION_MASK_NORTH)<<1|(e&mxConstants.DIRECTION_MASK_SOUTH)>>1|(e&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(e,t,n){var a=-1;if(0<e.absolutePoints.length)for(var i=e.absolutePoints[0],o=null,s=1;s<e.absolutePoints.length;s++){var r=e.absolutePoints[s];i=mxUtils.ptSegDistSq(i.x,i.y,r.x,r.y,t,n);(null==o||i<o)&&(o=i,a=s-1),i=r}return a},rectangleIntersectsSegment:function(e,t,n){var a=e.y,i=e.x,o=a+e.height,s=i+e.width;e=t.x;var r=n.x;if(t.x>n.x&&(e=n.x,r=t.x),s<r&&(r=s),e<i&&(e=i),r<e)return!1;i=t.y,s=n.y;var l=n.x-t.x;return 1e-7<Math.abs(l)&&(i=(n=(n.y-t.y)/l)*e+(t=t.y-n*t.x),s=n*r+t),s<i&&(t=s,s=i,i=t),o<s&&(s=o),i<a&&(i=a),!(s<i)},contains:function(e,t,n){return e.x<=t&&e.x+e.width>=t&&e.y<=n&&e.y+e.height>=n},intersects:function(e,t){var n=e.width,a=e.height,i=t.width,o=t.height;if(i<=0||o<=0||n<=0||a<=0)return!1;var s=e.x,r=e.y,l=t.x,d=t.y;o+=d,n+=s,a+=r;return((i=i+l)<l||s<i)&&(o<d||r<o)&&(n<s||l<n)&&(a<r||d<a)},intersectsHotspot:function(e,t,n,a,i,o){if(i=null!=i?i:0,o=null!=o?o:0,0<(a=null!=a?a:1)){var s=e.getCenterX(),r=e.getCenterY(),l=e.width,d=e.height,c=mxUtils.getValue(e.style,mxConstants.STYLE_STARTSIZE)*e.view.scale;return 0<c&&(mxUtils.getValue(e.style,mxConstants.STYLE_HORIZONTAL,!0)?(r=e.y+c/2,d=c):(s=e.x+c/2,l=c)),l=Math.max(i,l*a),d=Math.max(i,d*a),0<o&&(l=Math.min(l,o),d=Math.min(d,o)),a=new mxRectangle(s-l/2,r-d/2,l,d),0!=(s=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(i=Math.cos(-s),o=Math.sin(-s),s=new mxPoint(e.getCenterX(),e.getCenterY()),t=(e=mxUtils.getRotatedPoint(new mxPoint(t,n),i,o,s)).x,n=e.y),mxUtils.contains(a,t,n)}return!0},getOffset:function(e,t){var n=0,a=0;if(null!=t&&t){var i=document.body,o=document.documentElement;n=n+(i.scrollLeft||o.scrollLeft),a=a+(i.scrollTop||o.scrollTop)}for(;e.offsetParent;)n+=e.offsetLeft,a+=e.offsetTop,e=e.offsetParent;return new mxPoint(n,a)},getScrollOrigin:function(e){for(var t=document.body,n=document.documentElement,a=new mxPoint(t.scrollLeft||n.scrollLeft,t.scrollTop||n.scrollTop);null!=e&&e!=t&&e!=n;)!isNaN(e.scrollLeft)&&!isNaN(e.scrollTop)&&(a.x+=e.scrollLeft,a.y+=e.scrollTop),e=e.parentNode;return a},convertPoint:function(e,t,n){var a=mxUtils.getScrollOrigin(e);return(e=mxUtils.getOffset(e)).x-=a.x,e.y-=a.y,new mxPoint(t-e.x,n-e.y)},ltrim:function(e,t){return e.replace(RegExp("^["+(t||"\\s")+"]+","g"),"")},rtrim:function(e,t){return e.replace(RegExp("["+(t||"\\s")+"]+$","g"),"")},trim:function(e,t){return mxUtils.ltrim(mxUtils.rtrim(e,t),t)},isNumeric:function(e){return null!=e&&(null==e.length||0<e.length&&e.indexOf("0x")<0&&e.indexOf("0X")<0)&&!isNaN(e)},mod:function(e,t){return(e%t+t)%t},intersection:function(e,t,n,a,i,o,s,r){var l=(r-o)*(n-e)-(s-i)*(a-t);return s=((s-i)*(t-o)-(r-o)*(e-i))/l,i=((n-e)*(t-o)-(a-t)*(e-i))/l,0<=s&&s<=1&&0<=i&&i<=1?new mxPoint(e+s*(n-e),t+s*(a-t)):null},ptSegDistSq:function(e,t,n,a,i,o){return(i-=e)*(n-=e)+(o-=t)*(a-=t)<=0?n=0:n=(e=(i=n-i)*n+(o=a-o)*a)<=0?0:e*e/(n*n+a*a),(i=i*i+o*o-n)<0&&(i=0),i},relativeCcw:function(e,t,n,a,i,o){return 0==(e=(i-=e)*(a-=t)-(o-=t)*(n-=e))&&(0<(e=i*n+o*a)&&((e=(i-n)*n+(o-a)*a)<0&&(e=0))),e<0?-1:0<e?1:0},animateChanges:function(e,t){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(e,t,n){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(e,t,n,a,i,o){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(e,t){mxUtils.isVml(e)?e.style.filter=100<=t?null:"alpha(opacity="+t/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?e.style.filter=100<=t?null:"alpha(opacity="+t+")":e.style.opacity=t/100},createImage:function(e){var t=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((t=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",e),t.style.borderStyle="none"):((t=document.createElement("img")).setAttribute("src",e),t.setAttribute("border","0")),t},sortCells:function(e,i){i=null==i||i;var o=new mxDictionary;return e.sort(function(e,t){var n=o.get(e);null==n&&(n=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),o.put(e,n));var a=o.get(t);return null==a&&(a=mxCellPath.create(t).split(mxCellPath.PATH_SEPARATOR),o.put(t,a)),0==(n=mxCellPath.compare(n,a))?0:0<n==i?1:-1}),e},getStylename:function(e){return null!=e&&(e=e.split(";")[0]).indexOf("=")<0?e:""},getStylenames:function(e){var t=[];if(null!=e){e=e.split(";");for(var n=0;n<e.length;n++)e[n].indexOf("=")<0&&t.push(e[n])}return t},indexOfStylename:function(e,t){if(null!=e&&null!=t)for(var n=e.split(";"),a=0,i=0;i<n.length;i++){if(n[i]==t)return a;a+=n[i].length+1}return-1},addStylename:function(e,t){return mxUtils.indexOfStylename(e,t)<0&&(null==e?e="":0<e.length&&";"!=e.charAt(e.length-1)&&(e+=";"),e+=t),e},removeStylename:function(e,t){var n=[];if(null!=e)for(var a=e.split(";"),i=0;i<a.length;i++)a[i]!=t&&n.push(a[i]);return n.join(";")},removeAllStylenames:function(e){var t=[];if(null!=e){e=e.split(";");for(var n=0;n<e.length;n++)0<=e[n].indexOf("=")&&t.push(e[n])}return t.join(";")},setCellStyles:function(e,t,n,a){if(null!=t&&0<t.length){e.beginUpdate();try{for(var i=0;i<t.length;i++)if(null!=t[i]){var o=mxUtils.setStyle(e.getStyle(t[i]),n,a);e.setStyle(t[i],o)}}finally{e.endUpdate()}}},setStyle:function(e,t,n){var a=null!=n&&(void 0===n.length||0<n.length);if(null==e||0==e.length)a&&(e=t+"="+n);else{var i=e.indexOf(t+"=");i<0?a&&(a=";"==e.charAt(e.length-1)?"":";",e=e+a+t+"="+n):(t=a?t+"="+n:"",n=e.indexOf(";",i),a||n++,e=e.substring(0,i)+t+(i<n?e.substring(n):""))}return e},setCellStyleFlags:function(e,t,n,a,i){if(null!=t&&0<t.length){e.beginUpdate();try{for(var o=0;o<t.length;o++)if(null!=t[o]){var s=mxUtils.setStyleFlag(e.getStyle(t[o]),n,a,i);e.setStyle(t[o],s)}}finally{e.endUpdate()}}},setStyleFlag:function(e,t,n,a){if(null==e||0==e.length)e=a||null==a?t+"="+n:t+"=0";else{var i=e.indexOf(t+"=");if(i<0)i=";"==e.charAt(e.length-1)?"":";",e=a||null==a?e+i+t+"="+n:e+i+t+"=0";else{var o=e.indexOf(";",i),s="";s=o<0?e.substring(i+t.length+1):e.substring(i+t.length+1,o),s=null==a?parseInt(s)^n:a?parseInt(s)|n:parseInt(s)&~n;e=e.substring(0,i)+t+"="+s+(0<=o?e.substring(o):"")}}return e},getAlignmentAsPoint:function(e,t){var n=0,a=0;return e==mxConstants.ALIGN_CENTER?n=-.5:e==mxConstants.ALIGN_RIGHT&&(n=-1),t==mxConstants.ALIGN_MIDDLE?a=-.5:t==mxConstants.ALIGN_BOTTOM&&(a=-1),new mxPoint(n,a)},getSizeForString:function(e,t,n){t=null!=t?t:mxConstants.DEFAULT_FONTSIZE,n=null!=n?n:mxConstants.DEFAULT_FONTFAMILY;var a=document.createElement("div");return a.style.fontFamily=n,a.style.fontSize=Math.round(t)+"px",a.style.lineHeight=Math.round(t*mxConstants.LINE_HEIGHT)+"px",a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,document.body.appendChild(a),e=new mxRectangle(0,0,a.offsetWidth,a.offsetHeight),document.body.removeChild(a),e},getViewXml:function(e,t,n,a,i){a=null!=a?a:0,i=null!=i?i:0,t=null!=t?t:1,null==n&&(n=[e.getModel().getRoot()]);var o=e.getView(),s=null,r=o.isEventsEnabled();o.setEventsEnabled(!1);var l=o.drawPane,d=o.overlayPane;e.dialect==mxConstants.DIALECT_SVG?(o.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),o.canvas.appendChild(o.drawPane),o.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(o.drawPane=o.drawPane.cloneNode(!1),o.canvas.appendChild(o.drawPane),o.overlayPane=o.overlayPane.cloneNode(!1)),o.canvas.appendChild(o.overlayPane);var c=o.getTranslate();o.translate=new mxPoint(a,i),t=new mxTemporaryCellStates(e.getView(),t,n);try{s=(new mxCodec).encode(e.getView())}finally{t.destroy(),o.translate=c,o.canvas.removeChild(o.drawPane),o.canvas.removeChild(o.overlayPane),o.drawPane=l,o.overlayPane=d,o.setEventsEnabled(r)}return s},getScaleForPageCount:function(e,t,n,a){if(e<1)return 1;a=null!=a?a:0;var i=(n=null!=n?n:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*a;n=n.height-2*a,a=t.getGraphBounds().clone(),t=t.getView().getScale(),a.width/=t,a.height/=t,n=(t=a.width)/a.height/(i/n),a=Math.sqrt(e);var o=Math.sqrt(n);if(n=a*o,a/=o,n<1&&e<a){var s=a/e;a=e,n/=s}for(a<1&&e<n&&(s=n/e,n=e,a/=s),s=Math.ceil(n)*Math.ceil(a),o=0;e<s;){s=Math.floor(n)/n;var r=Math.floor(a)/a;if(1==s&&(s=Math.floor(n-1)/n),1==r&&(r=Math.floor(a-1)/a),n*=s=r<s?s:r,a*=s,s=Math.ceil(n)*Math.ceil(a),10<++o)break}return i*n/t*.99999},show:function(e,t,n,a){if(n=null!=n?n:0,a=null!=a?a:0,null==t?t=window.open().document:t.open(),n=-(i=e.getGraphBounds()).x+n,a=-i.y+a,mxClient.IS_IE){for(var i="<html><head>",o=document.getElementsByTagName("base"),s=0;s<o.length;s++)i+=o[s].outerHTML;for(i+="<style>",s=0;s<document.styleSheets.length;s++)try{i+=document.styleSheets(s).cssText}catch(e){}i+="</style></head>",i+="<body>",i+=e.container.innerHTML,i+="</body>",i+="<html>",t.writeln(i),t.close(),null!=(e=t.body.getElementsByTagName("DIV")[0])&&(e.style.position="absolute",e.style.left=n+"px",e.style.top=a+"px")}else{for(t.writeln("<html"),t.writeln("<head>"),o=document.getElementsByTagName("base"),s=0;s<o.length;s++)t.writeln(mxUtils.getOuterHtml(o[s]));for(o=document.getElementsByTagName("link"),s=0;s<o.length;s++)t.writeln(mxUtils.getOuterHtml(o[s]));for(o=document.getElementsByTagName("style"),s=0;s<o.length;s++)t.writeln(mxUtils.getOuterHtml(o[s]));for(t.writeln("</head>"),t.writeln("</html>"),t.close(),null==t.body&&t.documentElement.appendChild(t.createElement("body")),t.body.style.overflow="auto",e=e.container.firstChild;null!=e;)s=e.cloneNode(!0),t.body.appendChild(s),e=e.nextSibling;null!=(e=t.getElementsByTagName("g")[0])&&(e.setAttribute("transform","translate("+n+","+a+")"),(n=e.ownerSVGElement).setAttribute("width",i.width+Math.max(i.x,0)+3),n.setAttribute("height",i.height+Math.max(i.y,0)+3))}return mxUtils.removeCursors(t.body),t},printScreen:function(e){var t=window.open();mxUtils.show(e,t.document),e=function(){t.focus(),t.print(),t.close()},mxClient.IS_GC?t.setTimeout(e,500):e()},popup:function(e,t){if(t){var n=document.createElement("div");n.style.overflow="scroll",n.style.width="636px",n.style.height="460px";var a=document.createElement("pre");a.innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g," "),n.appendChild(a),(n=new mxWindow("Popup Window",n,document.body.clientWidth/2-320,(document.body.clientHeight||document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),n.setVisible(!0)}else mxClient.IS_NS?((n=window.open()).document.writeln("<pre>"+mxUtils.htmlEntities(e)+"</pre"),n.document.close()):((a=(n=window.open()).document.createElement("pre")).innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g," "),n.document.body.appendChild(a))},alert:function(e){alert(e)},prompt:function(e,t){return prompt(e,t)},confirm:function(e){return confirm(e)},error:function(e,t,n,a){var i=document.createElement("div");i.style.padding="20px";var o=document.createElement("img");o.setAttribute("src",a||mxUtils.errorImage),o.setAttribute("valign","bottom"),o.style.verticalAlign="middle",i.appendChild(o),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),mxUtils.write(i,e),e=document.body.clientWidth,a=document.body.clientHeight||document.documentElement.clientHeight;var s=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,i,(e-t)/2,a/4,t,null,!1,!0);return n&&(mxUtils.br(i),t=document.createElement("p"),n=document.createElement("button"),mxClient.IS_IE?n.style.cssText="float:right":n.setAttribute("style","float:right"),mxEvent.addListener(n,"click",function(e){s.destroy()}),mxUtils.write(n,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),t.appendChild(n),i.appendChild(t),mxUtils.br(i),s.setClosable(!0)),s.setVisible(!0),s},makeDraggable:function(e,t,n,i,a,o,s,r,l,d){return(e=new mxDragSource(e,n)).dragOffset=new mxPoint(null!=a?a:0,null!=o?o:mxConstants.TOOLTIP_VERTICAL_OFFSET),e.autoscroll=s,e.setGuidesEnabled(!1),null!=l&&(e.highlightDropTargets=l),null!=d&&(e.getDropTarget=d),e.getGraphForEvent=function(e){return"function"==typeof t?t(e):t},null!=i&&(e.createDragElement=function(){return i.cloneNode(!0)},r&&(e.createPreviewElement=function(e){var t=i.cloneNode(!0),n=parseInt(t.style.width),a=parseInt(t.style.height);return t.style.width=Math.round(n*e.view.scale)+"px",t.style.height=Math.round(a*e.view.scale)+"px",t})),e}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",HIGHLIGHT_STROKEWIDTH:3,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_BEND_HANDLE:"pointer",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:7,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,LINE_HEIGHT:1.2,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:10,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,826,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,826),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_OPACITY:"opacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_SMOOTH:"smooth",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_LOOP:"loopStyle",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_SHADOW:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_BLOCK:"block",ARROW_OPEN:"open",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(e){this.name=e,this.properties=[];for(var t=1;t<arguments.length;t+=2)null!=arguments[t+1]&&(this.properties[arguments[t]]=arguments[t+1])}function mxMouseEvent(e,t){this.evt=e,this.state=t}function mxEventSource(e){this.setEventSource(e)}mxEventObject.prototype.name=null,mxEventObject.prototype.properties=null,mxEventObject.prototype.consumed=!1,mxEventObject.prototype.getName=function(){return this.name},mxEventObject.prototype.getProperties=function(){return this.properties},mxEventObject.prototype.getProperty=function(e){return this.properties[e]},mxEventObject.prototype.isConsumed=function(){return this.consumed},mxEventObject.prototype.consume=function(){this.consumed=!0},mxMouseEvent.prototype.consumed=!1,mxMouseEvent.prototype.evt=null,mxMouseEvent.prototype.graphX=null,mxMouseEvent.prototype.graphY=null,mxMouseEvent.prototype.state=null,mxMouseEvent.prototype.getEvent=function(){return this.evt},mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)},mxMouseEvent.prototype.isSource=function(e){if(null!=e)for(var t=this.getSource();null!=t;){if(t==e.node)return!0;t=t.parentNode}return!1},mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())},mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())},mxMouseEvent.prototype.getGraphX=function(){return this.graphX},mxMouseEvent.prototype.getGraphY=function(){return this.graphY},mxMouseEvent.prototype.getState=function(){return this.state},mxMouseEvent.prototype.getCell=function(){var e=this.getState();return null!=e?e.cell:null},mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())},mxMouseEvent.prototype.isConsumed=function(){return this.consumed},mxMouseEvent.prototype.consume=function(e){(null==e||e)&&this.evt.preventDefault&&this.evt.preventDefault(),this.evt.returnValue=!1,this.consumed=!0},mxEventSource.prototype.eventListeners=null,mxEventSource.prototype.eventsEnabled=!0,mxEventSource.prototype.eventSource=null,mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled},mxEventSource.prototype.setEventsEnabled=function(e){this.eventsEnabled=e},mxEventSource.prototype.getEventSource=function(){return this.eventSource},mxEventSource.prototype.setEventSource=function(e){this.eventSource=e},mxEventSource.prototype.addListener=function(e,t){null==this.eventListeners&&(this.eventListeners=[]),this.eventListeners.push(e),this.eventListeners.push(t)},mxEventSource.prototype.removeListener=function(e){if(null!=this.eventListeners)for(var t=0;t<this.eventListeners.length;)this.eventListeners[t+1]==e?this.eventListeners.splice(t,2):t+=2},mxEventSource.prototype.fireEvent=function(e,t){if(null!=this.eventListeners&&this.isEventsEnabled()){null==e&&(e=new mxEventObject),null==t&&(t=this.getEventSource()),null==t&&(t=this);for(var n=[t,e],a=0;a<this.eventListeners.length;a+=2){var i=this.eventListeners[a];(null==i||i==e.getName())&&this.eventListeners[a+1].apply(this,n)}}};var mxEvent={objects:[],addListener:function(){var a=function(e,t,n){null==e.mxListenerList&&(e.mxListenerList=[],mxEvent.objects.push(e)),e.mxListenerList.push({name:t,f:n})};return window.addEventListener?function(e,t,n){e.addEventListener(t,n,!1),a(e,t,n)}:function(e,t,n){e.attachEvent("on"+t,n),a(e,t,n)}}(),removeListener:function(){var a=function(e,t,n){if(null!=e.mxListenerList){t=e.mxListenerList.length;for(var a=0;a<t;a++)if(e.mxListenerList[a].f==n){e.mxListenerList.splice(a,1);break}0==e.mxListenerList.length&&(e.mxListenerList=null)}};return window.removeEventListener?function(e,t,n){e.removeEventListener(t,n,!1),a(e,t,n)}:function(e,t,n){e.detachEvent("on"+t,n),a(e,t,n)}}(),removeAllListeners:function(e){var t=e.mxListenerList;if(null!=t)for(;0<t.length;){var n=t[0];mxEvent.removeListener(e,n.name,n.f)}},addGestureListeners:function(e,t,n,a){null!=t&&mxEvent.addListener(e,"mousedown",t),null!=n&&mxEvent.addListener(e,"mousemove",n),null!=a&&mxEvent.addListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=t&&mxEvent.addListener(e,"touchstart",t),null!=n&&mxEvent.addListener(e,"touchmove",n),null!=a&&mxEvent.addListener(e,"touchend",a))},removeGestureListeners:function(e,t,n,a){null!=t&&mxEvent.removeListener(e,"mousedown",t),null!=n&&mxEvent.removeListener(e,"mousemove",n),null!=a&&mxEvent.removeListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=t&&mxEvent.removeListener(e,"touchstart",t),null!=n&&mxEvent.removeListener(e,"touchmove",n),null!=a&&mxEvent.removeListener(e,"touchend",a))},redirectMouseEvents:function(e,n,t,a,i,o,s){var r=function(e){return"function"==typeof t?t(e):t};mxEvent.addGestureListeners(e,function(e){null!=a?a(e):mxEvent.isConsumed(e)||n.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,r(e)))},function(e){null!=i?i(e):mxEvent.isConsumed(e)||n.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,r(e)))},function(e){null!=o?o(e):mxEvent.isConsumed(e)||n.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,r(e)))}),mxEvent.addListener(e,"dblclick",function(e){if(null!=s)s(e);else if(!mxEvent.isConsumed(e)){var t=r(e);n.dblClick(e,null!=t?t.cell:null)}})},release:function(e){if(null!=e&&(mxEvent.removeAllListeners(e),null!=(e=e.childNodes)))for(var t=e.length,n=0;n<t;n+=1)mxEvent.release(e[n])},addMouseWheelListener:function(n){if(null!=n){var e=function(e){null==e&&(e=window.event);var t=0;0!=(t=!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC?e.wheelDelta/120:-e.detail/2)&&n(e,0<t)};mxClient.IS_NS?mxEvent.addListener(window,mxClient.IS_SF||mxClient.IS_GC?"mousewheel":"DOMMouseScroll",e):mxEvent.addListener(document,"mousewheel",e)}},disableContextMenu:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){mxEvent.addListener(e,"contextmenu",function(){return!1})}:function(e){e.setAttribute("oncontextmenu","return false;")},getSource:function(e){return null!=e.srcElement?e.srcElement:e.target},isConsumed:function(e){return null!=e.isConsumed&&e.isConsumed},isLeftMouseButton:function(e){return e.button==(mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?1:0)},isRightMouseButton:function(e){return 2==e.button},isPopupTrigger:function(e){return mxEvent.isRightMouseButton(e)||mxEvent.isShiftDown(e)&&!mxEvent.isControlDown(e)},isShiftDown:function(e){return null!=e&&e.shiftKey},isAltDown:function(e){return null!=e&&e.altKey},isControlDown:function(e){return null!=e&&e.ctrlKey},isMetaDown:function(e){return null!=e&&e.metaKey},getMainEvent:function(e){return"touchstart"!=e.type&&"touchmove"!=e.type||null==e.touches||null==e.touches[0]?"touchend"==e.type&&null!=e.changedTouches&&null!=e.changedTouches[0]&&(e=e.changedTouches[0]):e=e.touches[0],e},getClientX:function(e){return mxEvent.getMainEvent(e).clientX},getClientY:function(e){return mxEvent.getMainEvent(e).clientY},consume:function(e,t,n){n=null==n||n,(null==t||t)&&(e.preventDefault?(n&&e.stopPropagation(),e.preventDefault()):n&&(e.cancelBubble=!0)),e.isConsumed=!0,e.returnValue=!1},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",SESSION:"session",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",CLICK:"click",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset"};function mxXmlRequest(e,t,n,a,i,o){this.url=e,this.params=t,this.method=n||"POST",this.async=null==a||a,this.username=i,this.password=o}mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(e){this.binary=e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var e=this.getXml();return null!=e?e.documentElement:null},mxXmlRequest.prototype.getXml=function(){var e=this.request.responseXML;return(9<=document.documentMode||null==e||null==e.documentElement)&&(e=mxUtils.parseXml(this.request.responseText)),e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.getStatus=function(){return this.request.status},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var e=new XMLHttpRequest;return this.isBinary()&&e.overrideMimeType&&e.overrideMimeType("text/plain; charset=x-user-defined"),e}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(e,t){this.request=this.create(),null!=this.request&&(null!=e&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&(e(this),this.onreadystatechaange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(e,t){null!=t&&e.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(e,t){var n=null;(e=e||document)==document&&(n=window.onbeforeunload,window.onbeforeunload=null);var a=e.createElement("form");a.setAttribute("method",this.method),a.setAttribute("action",this.url),null!=t&&a.setAttribute("target",t),a.style.display="none",a.style.visibility="hidden";for(var i=0<this.params.indexOf("&")?this.params.split("&"):this.params.split(),o=0;o<i.length;o++){if(0<(s=i[o].indexOf("="))){var s,r=i[o].substring(0,s),l=i[o].substring(s+1);(s=e.createElement("textarea")).setAttribute("name",r),l=l.replace(/\n/g,"
"),r=e.createTextNode(l),s.appendChild(r),a.appendChild(s)}}e.body.appendChild(a),a.submit(),e.body.removeChild(a),null!=n&&(window.onbeforeunload=n)};var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,isEmpty:function(){return null==mxClipboard.cells},cut:function(e,t){return t=mxClipboard.copy(e,t),mxClipboard.insertCount=0,mxClipboard.removeCells(e,t),t},removeCells:function(e,t){e.removeCells(t)},copy:function(e,t){t=t||e.getSelectionCells();var n=e.getExportableCells(t);return mxClipboard.insertCount=1,mxClipboard.cells=e.cloneCells(n),n},paste:function(e){if(null!=mxClipboard.cells){var t=e.getImportableCells(mxClipboard.cells),n=mxClipboard.insertCount*mxClipboard.STEPSIZE,a=e.getDefaultParent();t=e.importCells(t,n,n,a);mxClipboard.insertCount++,e.setSelectionCells(t)}}};function mxWindow(e,t,n,a,i,o,s,r,l,d){null!=t&&(s=null==s||s,this.content=t,this.init(n,a,i,o,d),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(s),this.setTitle(e),(null==r||r)&&this.installMoveHandler(),null!=l&&null!=l.parentNode?l.parentNode.replaceChild(this.div,l):document.body.appendChild(this.div))}function mxForm(e){this.table=document.createElement("table"),this.table.className=e,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(e,t,n){this.src=e,this.width=t,this.height=n}function mxDivResizer(e,t){if("div"==e.nodeName.toLowerCase()){null==t&&(t=window),this.div=e;var n=mxUtils.getCurrentStyle(e);null!=n&&(this.resizeWidth="auto"==n.width,this.resizeHeight="auto"==n.height),mxEvent.addListener(t,"resize",mxUtils.bind(this,function(e){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize()}}function mxDragSource(e,t){this.element=e,this.dropHandler=t,mxEvent.addGestureListeners(e,mxUtils.bind(this,this.mouseDown))}function mxToolbar(e){this.container=e}function mxSession(t,e,n,a){this.model=t,this.urlInit=e,this.urlPoll=n,this.urlNotify=a,null!=t&&(this.codec=new mxCodec,this.codec.lookup=function(e){return t.getCell(e)}),t.addListener(mxEvent.NOTIFY,mxUtils.bind(this,function(e,t){var n=t.getProperty("edit");(null!=n&&this.debug||this.connected&&!this.suspended)&&this.notify("<edit>"+this.encodeChanges(n.changes,n.undone)+"</edit>")}))}function mxUndoableEdit(e,t){this.source=e,this.changes=[],this.significant=null==t||t}function mxUndoManager(e){this.size=null!=e?e:100,this.clear()}mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.content=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.title=!1,mxWindow.prototype.content=!1,mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.init=function(e,t,n,a,i){i=null!=i?i:"mxWindow",this.div=document.createElement("div"),this.div.className=i,this.div.style.left=e+"px",this.div.style.top=t+"px",this.table=document.createElement("table"),this.table.className=i,null!=n&&(mxClient.IS_IE||(this.div.style.width=n+"px"),this.table.style.width=n+"px"),null!=a&&(mxClient.IS_IE||(this.div.style.height=a+"px"),this.table.style.height=a+"px"),e=document.createElement("tbody"),t=document.createElement("tr"),this.title=document.createElement("td"),this.title.className=i+"Title",t.appendChild(this.title),e.appendChild(t),t=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=i+"Pane",this.contentWrapper=document.createElement("div"),this.contentWrapper.className=i+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_IE||"DIV"!=this.content.nodeName.toUpperCase())&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),t.appendChild(this.td),e.appendChild(t),this.table.appendChild(e),this.div.appendChild(this.table),i=mxUtils.bind(this,function(e){this.activate()}),mxEvent.addListener(this.title,"mousedown",i),mxEvent.addListener(this.table,"mousedown",i),mxClient.IS_TOUCH&&(mxEvent.addListener(this.title,"touchstart",i),mxEvent.addListener(this.table,"touchstart",i)),this.hide()},mxWindow.prototype.setTitle=function(e){for(var t=this.title.firstChild;null!=t;){var n=t.nextSibling;t.nodeType==mxConstants.NODETYPE_TEXT&&t.parentNode.removeChild(t),t=n}mxUtils.write(this.title,e||"")},mxWindow.prototype.setScrollable=function(e){navigator.userAgent.indexOf("Presto/2.5")<0&&(this.contentWrapper.style.overflow=e?"auto":"hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var e=null!=(e=mxUtils.getCurrentStyle(this.getElement()))?e.zIndex:3;if(mxWindow.activeWindow){var t=mxWindow.activeWindow.getElement();null!=t&&null!=t.style&&(t.style.zIndex=e)}t=mxWindow.activeWindow,this.getElement().style.zIndex=parseInt(e)+1,(mxWindow.activeWindow=this).fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",t))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(e){e?null==this.resize?(this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",mxClient.imageBasePath+"/resize.gif"),this.resize.style.cursor="nw-resize",mxEvent.addGestureListeners(this.resize,mxUtils.bind(this,function(e){this.activate();var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),o=this.div.offsetWidth,s=this.div.offsetHeight,t=mxUtils.bind(this,function(e){var t=mxEvent.getClientX(e)-a,n=mxEvent.getClientY(e)-i;this.setSize(o+t,s+n),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",e)),mxEvent.consume(e)}),n=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",e)),mxEvent.consume(e)}),null,null),this.div.appendChild(this.resize)):this.resize.style.display="inline":null!=this.resize&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(e,t){e=Math.max(this.minimumSize.width,e),t=Math.max(this.minimumSize.height,t),mxClient.IS_IE||(this.div.style.width=e+"px",this.div.style.height=t+"px"),this.table.style.width=e+"px",this.table.style.height=t+"px",mxClient.IS_IE||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")},mxWindow.prototype.setMinimizable=function(e){this.minimize.style.display=e?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("align","right"),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginRight="1px",this.minimize.style.display="none",this.title.appendChild(this.minimize);var n=!1,a=null,i=null,e=mxUtils.bind(this,function(e){if(this.activate(),n)n=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=a,mxClient.IS_IE||(this.div.style.height=i),this.table.style.height=i,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{n=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",a=this.maximize.style.display,this.maximize.style.display="none",i=this.table.style.height;var t=this.getMinimumSize();0<t.height&&(mxClient.IS_IE||(this.div.style.height=t.height+"px"),this.table.style.height=t.height+"px"),0<t.width&&(mxClient.IS_IE||(this.div.style.width=t.width+"px"),this.table.style.width=t.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",e))}mxEvent.consume(e)});mxEvent.addListener(this.minimize,"mousedown",e),mxClient.IS_TOUCH&&mxEvent.addListener(this.minimize,"touchstart",e)},mxWindow.prototype.setMaximizable=function(e){this.maximize.style.display=e?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("align","right"),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="1px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.title.appendChild(this.maximize);var n=!1,a=null,i=null,o=null,s=null,e=mxUtils.bind(this,function(e){if(this.activate(),"none"!=this.maximize.style.display){if(n)n=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.visibility="",this.div.style.left=a+"px",this.div.style.top=i+"px",mxClient.IS_IE||(this.div.style.height=o,this.div.style.width=s,"auto"!=(t=mxUtils.getCurrentStyle(this.contentWrapper)).overflow&&null==this.resize)||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.table.style.height=o,this.table.style.width=s,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{if(n=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",this.minimize.style.visibility="hidden",a=parseInt(this.div.style.left),i=parseInt(this.div.style.top),o=this.table.style.height,s=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px",mxClient.IS_IE||(this.div.style.height=document.body.clientHeight-2+"px",this.div.style.width=document.body.clientWidth-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=document.body.clientHeight-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),!mxClient.IS_IE){var t=mxUtils.getCurrentStyle(this.contentWrapper);"auto"!=t.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")}this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",e))}mxEvent.consume(e)}});mxEvent.addGestureListeners(this.maximize,e),mxEvent.addListener(this.title,"dblclick",e)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(e){var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),o=this.getX(),s=this.getY(),t=mxUtils.bind(this,function(e){var t=mxEvent.getClientX(e)-a,n=mxEvent.getClientY(e)-i;this.setLocation(o+t,s+n),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",e)),mxEvent.consume(e)}),n=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",e)),mxEvent.consume(e)}))},mxWindow.prototype.setLocation=function(e,t){this.div.style.left=e+"px",this.div.style.top=t+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("align","right"),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.title.insertBefore(this.closeImg,this.title.firstChild),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",e)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(e)}))},mxWindow.prototype.setImage=function(e){this.image=document.createElement("img"),this.image.setAttribute("src",e),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(e){this.closeImg.style.display=e?"":"none"},mxWindow.prototype.isVisible=function(){return null!=this.div&&"hidden"!=this.div.style.visibility},mxWindow.prototype.setVisible=function(e){null!=this.div&&this.isVisible()!=e&&(e?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.visibility="",this.activate();var e=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_IE||"auto"!=e.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.visibility="hidden",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.contentWrapper=this.content=this.title=null},mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(e,t){var n=document.createElement("tr"),a=document.createElement("td");n.appendChild(a);a=document.createElement("td");var i=document.createElement("button");mxUtils.write(i,mxResources.get("ok")||"OK"),a.appendChild(i),mxEvent.addListener(i,"click",function(){e()}),i=document.createElement("button"),mxUtils.write(i,mxResources.get("cancel")||"Cancel"),a.appendChild(i),mxEvent.addListener(i,"click",function(){t()}),n.appendChild(a),this.body.appendChild(n)},mxForm.prototype.addText=function(e,t){var n=document.createElement("input");return n.setAttribute("type","text"),n.value=t,this.addField(e,n)},mxForm.prototype.addCheckbox=function(e,t){var n=document.createElement("input");return n.setAttribute("type","checkbox"),this.addField(e,n),t&&(n.checked=!0),n},mxForm.prototype.addTextarea=function(e,t,n){var a=document.createElement("textarea");return mxClient.IS_NS&&n--,a.setAttribute("rows",n||2),a.value=t,this.addField(e,a)},mxForm.prototype.addCombo=function(e,t,n){var a=document.createElement("select");return null!=n&&a.setAttribute("size",n),t&&a.setAttribute("multiple","true"),this.addField(e,a)},mxForm.prototype.addOption=function(e,t,n,a){var i=document.createElement("option");mxUtils.writeln(i,t),i.setAttribute("value",n),a&&i.setAttribute("selected",a),e.appendChild(i)},mxForm.prototype.addField=function(e,t){var n=document.createElement("tr"),a=document.createElement("td");return mxUtils.write(a,e),n.appendChild(a),(a=document.createElement("td")).appendChild(t),n.appendChild(a),this.body.appendChild(n),t},mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var e=this.getDocumentWidth(),t=this.getDocumentHeight(),n=parseInt(this.div.style.left),a=parseInt(this.div.style.right),i=parseInt(this.div.style.top),o=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(n)&&!isNaN(a)&&0<=n&&0<=a&&0<e-a-n&&(this.div.style.width=e-a-n+"px"),this.resizeHeight&&!isNaN(i)&&!isNaN(o)&&0<=i&&0<=o&&0<t-i-o&&(this.div.style.height=t-i-o+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(e){this.enabled=e},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(e){this.guidesEnabled=e},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxDragSource.prototype.getGraphForEvent=function(e){return null},mxDragSource.prototype.getDropTarget=function(e,t,n){return e.getCellAt(t,n)},mxDragSource.prototype.createDragElement=function(e){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(e){return null},mxDragSource.prototype.mouseDown=function(e){this.enabled&&!mxEvent.isConsumed(e)&&null==this.mouseMoveHandler&&(this.startDrag(e),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxEvent.consume(e,!0,!1))},mxDragSource.prototype.startDrag=function(e){this.dragElement=this.createDragElement(e),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity)},mxDragSource.prototype.stopDrag=function(e){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.graphContainsEvent=function(e,t){var n=mxEvent.getClientX(t),a=mxEvent.getClientY(t),i=mxUtils.getOffset(e.container),o=mxUtils.getScrollOrigin();return n>=i.x-o.x&&a>=i.y-o.y&&n<=i.x-o.x+e.container.offsetWidth&&a<=i.y-o.y+e.container.offsetHeight},mxDragSource.prototype.mouseMove=function(e){if(null!=(t=this.getGraphForEvent(e))&&!this.graphContainsEvent(t,e)&&(t=null),t!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph),this.currentGraph=t,null!=this.currentGraph&&this.dragEnter(this.currentGraph)),null!=this.currentGraph&&this.dragOver(this.currentGraph,e),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility="hidden");else{var t=mxEvent.getClientX(e),n=mxEvent.getClientY(e);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(t+=this.dragOffset.x,n+=this.dragOffset.y),t+=document.body.scrollLeft||document.documentElement.scrollLeft,n+=document.body.scrollTop||document.documentElement.scrollTop,this.dragElement.style.left=t+"px",this.dragElement.style.top=n+"px"}mxEvent.consume(e)},mxDragSource.prototype.mouseUp=function(e){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var t=this.currentGraph.view.scale,n=this.currentGraph.view.translate;this.drop(this.currentGraph,e,this.currentDropTarget,this.currentPoint.x/t-n.x,this.currentPoint.y/t-n.y)}this.dragExit(this.currentGraph)}this.stopDrag(e),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.currentGraph=this.mouseUpHandler=this.mouseMoveHandler=null,mxEvent.consume(e)},mxDragSource.prototype.dragEnter=function(e){e.isMouseDown=!0,this.previewElement=this.createPreviewElement(e),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(e,e.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(e,mxConstants.DROP_TARGET_COLOR))},mxDragSource.prototype.dragExit=function(e){this.currentPoint=this.currentDropTarget=null,e.isMouseDown=!1,null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(e,t){var n=mxUtils.getOffset(e.container),a=mxUtils.getScrollOrigin(e.container),i=mxEvent.getClientX(t)-n.x+a.x;n=mxEvent.getClientY(t)-n.y+a.y;if(e.autoScroll&&(null==this.autoscroll||this.autoscroll)&&e.scrollPointToVisible(i,n,e.autoExtend),null!=this.currentHighlight&&e.isDropEnabled()&&(this.currentDropTarget=this.getDropTarget(e,i,n),a=e.getView().getState(this.currentDropTarget),this.currentHighlight.highlight(a)),null!=this.previewElement){null==this.previewElement.parentNode&&(e.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");a=this.isGridEnabled()&&e.isGridEnabledEvent(t);var o=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(t))o=new mxRectangle(0,0,o=parseInt(this.previewElement.style.width),s=parseInt(this.previewElement.style.height)),n=new mxPoint(i,n),n=this.currentGuide.move(o,n,a),o=!1,i=n.x,n=n.y;else if(a){a=e.view.scale;var s=e.view.translate,r=e.gridSize/2;i=(e.snap(i/a-s.x-r)+s.x)*a,n=(e.snap(n/a-s.y-r)+s.y)*a}null!=this.currentGuide&&o&&this.currentGuide.hide(),null!=this.previewOffset&&(i+=this.previewOffset.x,n+=this.previewOffset.y),this.previewElement.style.left=Math.round(i)+"px",this.previewElement.style.top=Math.round(n)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(i,n)},mxDragSource.prototype.drop=function(e,t,n,a,i){this.dropHandler(e,t,n,a,i),e.container.focus()},mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(e,t,n,a,i,o){var s=document.createElement(null!=t?"img":"button"),r=i||(null!=o?"mxToolbarMode":"mxToolbarItem");return s.className=r,s.setAttribute("src",t),null!=e&&(null!=t?s.setAttribute("title",e):mxUtils.write(s,e)),this.container.appendChild(s),null!=n&&(mxEvent.addListener(s,"click",n),mxClient.IS_TOUCH&&mxEvent.addListener(s,"touchend",n)),e=mxUtils.bind(this,function(e){null!=a?s.setAttribute("src",t):s.style.backgroundColor=""}),mxEvent.addGestureListeners(s,mxUtils.bind(this,function(e){if(null!=a?s.setAttribute("src",a):s.style.backgroundColor="gray",null!=o){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var t=this.currentImg;this.menu.isMenuShowing()&&this.menu.hideMenu(),t!=s&&(this.currentImg=s,this.menu.factoryMethod=o,t=new mxPoint(s.offsetLeft,s.offsetTop+s.offsetHeight),this.menu.popup(t.x,t.y,null,e),this.menu.isMenuShowing()&&(s.className=r+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),s.className=r,this.currentImg=null}))}}),null,e),mxEvent.addListener(s,"mouseout",e),s},mxToolbar.prototype.addCombo=function(e){var t=document.createElement("div");t.style.display="inline",t.className="mxToolbarComboContainer";var n=document.createElement("select");return n.className=e||"mxToolbarCombo",t.appendChild(n),this.container.appendChild(t),n},mxToolbar.prototype.addActionCombo=function(e,t){var n=document.createElement("select");return n.className=t||"mxToolbarCombo",this.addOption(n,e,null),mxEvent.addListener(n,"change",function(e){var t=n.options[n.selectedIndex];n.selectedIndex=0,null!=t.funct&&t.funct(e)}),this.container.appendChild(n),n},mxToolbar.prototype.addOption=function(e,t,n){var a=document.createElement("option");return mxUtils.writeln(a,t),"function"==typeof n?a.funct=n:a.setAttribute("value",n),e.appendChild(a),a},mxToolbar.prototype.addSwitchMode=function(e,t,n,a,i){var o=document.createElement("img");return o.initialClassName=i||"mxToolbarMode",o.className=o.initialClassName,o.setAttribute("src",t),o.altIcon=a,null!=e&&o.setAttribute("title",e),mxEvent.addListener(o,"click",mxUtils.bind(this,function(e){null!=(e=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=o),null!=(e=(this.selectedMode=o).altIcon)?(o.altIcon=o.getAttribute("src"),o.setAttribute("src",e)):o.className=o.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),n()})),this.container.appendChild(o),null==this.defaultMode&&(this.defaultMode=o,this.selectMode(o),n()),o},mxToolbar.prototype.addMode=function(e,t,n,a,i,o){o=null==o||o;var s=document.createElement(null!=t?"img":"button");return s.initialClassName=i||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",t),s.altIcon=a,null!=e&&s.setAttribute("title",e),this.enabled&&o&&(mxEvent.addListener(s,"click",mxUtils.bind(this,function(e){this.selectMode(s,n),this.noReset=!1})),mxEvent.addListener(s,"dblclick",mxUtils.bind(this,function(e){this.selectMode(s,n),this.noReset=!0})),null==this.defaultMode&&(this.defaultMode=s,this.defaultFunction=n,this.selectMode(s,n))),this.container.appendChild(s),s},mxToolbar.prototype.selectMode=function(e,t){if(this.selectedMode!=e){if(null!=this.selectedMode){var n=this.selectedMode.altIcon;null!=n?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=e,null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",t))}},mxToolbar.prototype.resetMode=function(e){(e||!this.noReset)&&this.selectedMode!=this.defaultMode&&this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(e){return this.addItem(null,e,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var e=document.createElement("hr");e.style.marginRight="6px",e.setAttribute("size","1"),this.container.appendChild(e)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.selectedMode=this.defaultFunction=this.defaultMode=this.container=null,null!=this.menu&&this.menu.destroy()},mxSession.prototype=new mxEventSource,mxSession.prototype.constructor=mxSession,mxSession.prototype.model=null,mxSession.prototype.urlInit=null,mxSession.prototype.urlPoll=null,mxSession.prototype.urlNotify=null,mxSession.prototype.codec=null,mxSession.prototype.linefeed="
",mxSession.prototype.escapePostData=!0,mxSession.prototype.significantRemoteChanges=!0,mxSession.prototype.sent=0,mxSession.prototype.received=0,mxSession.prototype.debug=!1,mxSession.prototype.connected=!1,mxSession.prototype.suspended=!1,mxSession.prototype.polling=!1,mxSession.prototype.start=function(){this.debug?(this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT))):this.connected||this.get(this.urlInit,mxUtils.bind(this,function(e){this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT)),this.poll()}))},mxSession.prototype.suspend=function(){this.connected&&!this.suspended&&(this.suspended=!0,this.fireEvent(new mxEventObject(mxEvent.SUSPEND)))},mxSession.prototype.resume=function(e,t,n){this.connected&&this.suspended&&(this.suspended=!1,this.fireEvent(new mxEventObject(mxEvent.RESUME)),this.polling||this.poll())},mxSession.prototype.stop=function(e){this.connected&&(this.connected=!1),this.fireEvent(new mxEventObject(mxEvent.DISCONNECT,"reason",e))},mxSession.prototype.poll=function(){this.connected&&!this.suspended&&null!=this.urlPoll?(this.polling=!0,this.get(this.urlPoll,mxUtils.bind(this,function(){this.poll()}))):this.polling=!1},mxSession.prototype.notify=function(e,t,n){null!=e&&0<e.length&&(null!=this.urlNotify&&(this.debug?(mxLog.show(),mxLog.debug("mxSession.notify: "+this.urlNotify+" xml="+e)):(e="<message><delta>"+e+"</delta></message>",this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(this.urlNotify,"xml="+e,t,n))),this.sent+=e.length,this.fireEvent(new mxEventObject(mxEvent.NOTIFY,"url",this.urlNotify,"xml",e)))},mxSession.prototype.get=function(n,a,t){if(void 0!==mxUtils){var i=mxUtils.bind(this,function(e){null!=t?t(e):this.stop(e)});mxUtils.get(n,mxUtils.bind(this,function(e){if(void 0!==mxUtils)if(e.isReady()&&404!=e.getStatus()){if(this.received+=e.getText().length,this.fireEvent(new mxEventObject(mxEvent.GET,"url",n,"request",e)),this.isValidResponse(e)){if(0<e.getText().length){var t=e.getDocumentElement();null==t?i("Invalid response: "+e.getText()):this.receive(t)}null!=a&&a(e)}}else i("Response not ready")}),function(e){i("Transmission error")})}},mxSession.prototype.isValidResponse=function(e){return e.getText().indexOf("<?php")<0},mxSession.prototype.encodeChanges=function(e,t){for(var n="",a=t?-1:1,i=t?e.length-1:0;0<=i&&i<e.length;i+=a){var o=this.codec.encode(e[i]);n=n+mxUtils.getXml(o,this.linefeed)}return n},mxSession.prototype.receive=function(e){if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){var t=e.getAttribute("namespace");for(null!=t&&(this.model.prefix=t+"-"),t=e.firstChild;null!=t;){var n=t.nodeName.toLowerCase();"state"==n?this.processState(t):"delta"==n&&this.processDelta(t),t=t.nextSibling}this.fireEvent(new mxEventObject(mxEvent.RECEIVE,"node",e))}},mxSession.prototype.processState=function(e){new mxCodec(e.ownerDocument).decode(e.firstChild,this.model)},mxSession.prototype.processDelta=function(e){for(e=e.firstChild;null!=e;)"edit"==e.nodeName&&this.processEdit(e),e=e.nextSibling},mxSession.prototype.processEdit=function(e){if(0<(e=this.decodeChanges(e)).length){var t=this.createUndoableEdit(e);this.model.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",t,"changes",e)),this.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t)),this.fireEvent(new mxEventObject(mxEvent.FIRED,"edit",t))}},mxSession.prototype.createUndoableEdit=function(e){var t=new mxUndoableEdit(this.model,this.significantRemoteChanges);return t.changes=e,t.notify=function(){t.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",t,"changes",t.changes)),t.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",t,"changes",t.changes))},t},mxSession.prototype.decodeChanges=function(e){this.codec.document=e.ownerDocument;var t=[];for(e=e.firstChild;null!=e;){var n=this.decodeChange(e);null!=n&&t.push(n),e=e.nextSibling}return t},mxSession.prototype.decodeChange=function(e){var t=null;return e.nodeType==mxConstants.NODETYPE_ELEMENT&&(null!=(t="mxRootChange"==e.nodeName?new mxCodec(e.ownerDocument).decode(e):this.codec.decode(e))&&(t.model=this.model,t.execute(),"mxChildChange"==e.nodeName&&null==t.parent&&this.cellRemoved(t.child))),t},mxSession.prototype.cellRemoved=function(e,t){this.codec.putObject(e.getId(),e);for(var n=this.model.getChildCount(e),a=0;a<n;a++)this.cellRemoved(this.model.getChildAt(e,a))},mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(e){this.changes.push(e)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length-1;0<=e;e--){var t=this.changes[e];null!=t.execute?t.execute():null!=t.undo&&t.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",t))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length,t=0;t<e;t++){var n=this.changes[t];null!=n.execute?n.execute():null!=n.redo&&n.redo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",n))}this.undone=!1,this.redone=!0,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoManager.prototype=new mxEventSource,mxUndoManager.prototype.constructor=mxUndoManager,mxUndoManager.prototype.size=null,mxUndoManager.prototype.history=null,mxUndoManager.prototype.indexOfNextAdd=0,mxUndoManager.prototype.isEmpty=function(){return 0==this.history.length},mxUndoManager.prototype.clear=function(){this.history=[],this.indexOfNextAdd=0,this.fireEvent(new mxEventObject(mxEvent.CLEAR))},mxUndoManager.prototype.canUndo=function(){return 0<this.indexOfNextAdd},mxUndoManager.prototype.undo=function(){for(;0<this.indexOfNextAdd;){var e=this.history[--this.indexOfNextAdd];if(e.undo(),e.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length},mxUndoManager.prototype.redo=function(){for(var e=this.history.length;this.indexOfNextAdd<e;){var t=this.history[this.indexOfNextAdd++];if(t.redo(),t.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",t));break}}},mxUndoManager.prototype.undoableEditHappened=function(e){this.trim(),0<this.size&&this.size==this.history.length&&this.history.shift(),this.history.push(e),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",e))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var e=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),t=0;t<e.length;t++)e[t].die()};var mxUrlConverter=function(e){var n=!0,a=null,i=null;return{isEnabled:function(){return n},setEnabled:function(e){n=e},getBaseUrl:function(){return a},setBaseUrl:function(e){a=e},getBaseDomain:function(){return a},setBaseDomain:function(e){a=e},isRelativeUrl:function(e){return"http://"!=e.substring(0,7)&&"https://"!=e.substring(0,8)&&"data:image"!=e.substring(0,10)},convert:function(e){if(n&&this.isRelativeUrl(e)){if(null==a){i=location.protocol+"//"+location.host;var t=(a=i+location.pathname).lastIndexOf("/");0<t&&(a=a.substring(0,t+1))}e="/"==e.charAt(0)?i+e:a+e}return e}}};function mxPanningManager(o){this.thread=null,this.active=!1,this.dy=this.dx=this.t0y=this.t0x=this.tdy=this.tdx=0,this.scrollbars=!1,this.scrollTop=this.scrollLeft=0,this.mouseListener={mouseDown:function(e,t){},mouseMove:function(e,t){},mouseUp:mxUtils.bind(this,function(e,t){this.active&&this.stop()})},o.addMouseListener(this.mouseListener),mxEvent.addListener(document,"mouseup",mxUtils.bind(this,function(){this.active&&this.stop()}));var s=mxUtils.bind(this,function(){return this.scrollbars=mxUtils.hasScrollbars(o.container),this.scrollLeft=o.container.scrollLeft,this.scrollTop=o.container.scrollTop,window.setInterval(mxUtils.bind(this,function(){if(this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars){var e=-o.container.scrollLeft-Math.ceil(this.dx),t=-o.container.scrollTop-Math.ceil(this.dy);o.panGraph(e,t),o.panDx=this.scrollLeft-o.container.scrollLeft,o.panDy=this.scrollTop-o.container.scrollTop,o.fireEvent(new mxEventObject(mxEvent.PAN))}else o.panGraph(this.getDx(),this.getDy())}),this.delay)});this.isActive=function(){return active},this.getDx=function(){return Math.round(this.tdx)},this.getDy=function(){return Math.round(this.tdy)},this.start=function(){this.t0x=o.view.translate.x,this.t0y=o.view.translate.y,this.active=!0},this.panTo=function(e,t,n,a){this.active||this.start(),this.scrollLeft=o.container.scrollLeft,this.scrollTop=o.container.scrollTop,a=null!=a?a:0;var i=o.container;this.dx=e+(null!=n?n:0)-i.scrollLeft-i.clientWidth,this.dx<0&&Math.abs(this.dx)<this.border?this.dx=this.border+this.dx:this.dx=this.handleMouseOut?Math.max(this.dx,0):0,0==this.dx&&(this.dx=e-i.scrollLeft,this.dx=0<this.dx&&this.dx<this.border?this.dx-this.border:this.handleMouseOut?Math.min(0,this.dx):0),this.dy=t+a-i.scrollTop-i.clientHeight,this.dy<0&&Math.abs(this.dy)<this.border?this.dy=this.border+this.dy:this.dy=this.handleMouseOut?Math.max(this.dy,0):0,0==this.dy&&(this.dy=t-i.scrollTop,this.dy=0<this.dy&&this.dy<this.border?this.dy-this.border:this.handleMouseOut?Math.min(0,this.dy):0),0!=this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=s())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)},this.stop=function(){if(this.active)if(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdy=this.tdx=0,this.scrollbars)o.panDx=0,o.panDy=0,o.fireEvent(new mxEventObject(mxEvent.PAN));else{var e=o.panDx,t=o.panDy;0==e&&0==t||(o.panGraph(0,0),o.view.setTranslate(this.t0x+e/o.view.scale,this.t0y+t/o.view.scale))}},this.destroy=function(){o.removeMouseListener(this.mouseListener)}}function mxPopupMenu(e){null!=(this.factoryMethod=e)&&this.init()}function mxAutoSaveManager(e){this.changeHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.graphModelChanged(t.getProperty("edit").changes)}),this.setGraph(e)}function mxAnimation(e){this.delay=null!=e?e:20}function mxMorphing(e,t,n,a){mxAnimation.call(this,a),this.graph=e,this.steps=null!=t?t:6,this.ease=null!=n?n:1.5}function mxImageBundle(e){this.images=[],this.alt=null!=e&&e}function mxImageExport(){}function mxAbstractCanvas2D(){this.converter=this.createUrlConverter(),this.reset()}function mxXmlCanvas2D(e){mxAbstractCanvas2D.call(this),this.root=e,this.writeDefaults()}function mxSvgCanvas2D(e,t){mxAbstractCanvas2D.call(this),this.root=e,this.gradients=[],this.defs=null,this.styleEnabled=null!=t&&t;var n=null;if(e.ownerDocument!=document)for(n=e;null!=n&&"svg"!=n.nodeName;)n=n.parentNode;null!=n&&(0<n.getElementsByTagName("defs").length&&(this.defs=n.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=n.firstChild?n.insertBefore(this.defs,n.firstChild):n.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,mxPopupMenu.prototype=new mxEventSource,mxPopupMenu.prototype.constructor=mxPopupMenu,mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif",mxPopupMenu.prototype.zIndex=10006,mxPopupMenu.prototype.factoryMethod=null,mxPopupMenu.prototype.useLeftButtonForPopup=!1,mxPopupMenu.prototype.enabled=!0,mxPopupMenu.prototype.itemCount=0,mxPopupMenu.prototype.autoExpand=!1,mxPopupMenu.prototype.smartSeparators=!1,mxPopupMenu.prototype.labels=!0,mxPopupMenu.prototype.init=function(){this.table=document.createElement("table"),this.table.className="mxPopupMenu",this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.div=document.createElement("div"),this.div.className="mxPopupMenu",this.div.style.display="inline",this.div.style.zIndex=this.zIndex,this.div.appendChild(this.table),mxEvent.disableContextMenu(this.div)},mxPopupMenu.prototype.isEnabled=function(){return this.enabled},mxPopupMenu.prototype.setEnabled=function(e){this.enabled=e},mxPopupMenu.prototype.isPopupTrigger=function(e){return e.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(e.getEvent())},mxPopupMenu.prototype.addItem=function(e,t,n,a,i,o){a=a||this,this.itemCount++,a.willAddSeparator&&(a.containsItems&&this.addSeparator(a,!0),a.willAddSeparator=!1),a.containsItems=!0;var s=document.createElement("tr");s.className="mxPopupMenuItem";var r=document.createElement("td");return r.className="mxPopupMenuIcon",null!=t?((i=document.createElement("img")).src=t,r.appendChild(i)):null!=i&&((t=document.createElement("div")).className=i,r.appendChild(t)),s.appendChild(r),this.labels&&((r=document.createElement("td")).className="mxPopupMenuItem"+(null==o||o?"":" disabled"),mxUtils.write(r,e),r.align="left",s.appendChild(r),(e=document.createElement("td")).className="mxPopupMenuItem"+(null==o||o?"":" disabled"),e.style.paddingRight="6px",e.style.textAlign="right",s.appendChild(e),null==a.div&&this.createSubmenu(a)),a.tbody.appendChild(s),(null==o||o)&&(mxEvent.addGestureListeners(s,mxUtils.bind(this,function(e){this.eventReceiver=s,a.activeRow!=s&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),null!=s.div&&(this.showSubmenu(a,s),a.activeRow=s)),mxEvent.consume(e)}),mxUtils.bind(this,function(e){a.activeRow!=s&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),this.autoExpand&&null!=s.div&&(this.showSubmenu(a,s),a.activeRow=s)),s.className="mxPopupMenuItemHover"}),mxUtils.bind(this,function(e){this.eventReceiver==s&&(a.activeRow!=s&&this.hideMenu(),null!=n&&n(e)),this.eventReceiver=null,mxEvent.consume(e)})),mxEvent.addListener(s,"mouseout",mxUtils.bind(this,function(e){s.className="mxPopupMenuItem"}))),s},mxPopupMenu.prototype.createSubmenu=function(e){e.table=document.createElement("table"),e.table.className="mxPopupMenu",e.tbody=document.createElement("tbody"),e.table.appendChild(e.tbody),e.div=document.createElement("div"),e.div.className="mxPopupMenu",e.div.style.position="absolute",e.div.style.display="inline",e.div.style.zIndex=this.zIndex,e.div.appendChild(e.table);var t=document.createElement("img");t.setAttribute("src",this.submenuImage),td=e.firstChild.nextSibling.nextSibling,td.appendChild(t)},mxPopupMenu.prototype.showSubmenu=function(e,t){if(null!=t.div){t.div.style.left=e.div.offsetLeft+t.offsetLeft+t.offsetWidth-1+"px",t.div.style.top=e.div.offsetTop+t.offsetTop+"px",document.body.appendChild(t.div);var n=parseInt(t.div.offsetLeft),a=parseInt(t.div.offsetWidth),i=document.body,o=document.documentElement;n+a>(i.scrollLeft||o.scrollLeft)+(i.clientWidth||o.clientWidth)&&(t.div.style.left=e.div.offsetLeft-a+(mxClient.IS_IE?6:-6)+"px"),mxUtils.fit(t.div)}},mxPopupMenu.prototype.addSeparator=function(e,t){if(e=e||this,this.smartSeparators&&!t)e.willAddSeparator=!0;else if(null!=e.tbody){e.willAddSeparator=!1;var n=document.createElement("tr"),a=document.createElement("td");a.className="mxPopupMenuIcon",a.style.padding="0 0 0 0px",n.appendChild(a),(a=document.createElement("td")).style.padding="0 0 0 0px",a.setAttribute("colSpan","2");var i=document.createElement("hr");i.setAttribute("size","1"),a.appendChild(i),n.appendChild(a),e.tbody.appendChild(n)}},mxPopupMenu.prototype.popup=function(e,t,n,a){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=e+"px",this.div.style.top=t+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,n,a),0<this.itemCount&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){9<=document.documentMode&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1)},mxPopupMenu.prototype.hideSubmenu=function(e){null!=e.activeRow&&(this.hideSubmenu(e.activeRow),null!=e.activeRow.div.parentNode&&e.activeRow.div.parentNode.removeChild(e.activeRow.div),e.activeRow=null)},mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)},mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(e){this.enabled=e},mxAutoSaveManager.prototype.setGraph=function(e){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=e,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(e){(e=((new Date).getTime()-this.lastSnapshot)/1e3)>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){var e=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var t=0;t<this.cells.length;t++)this.animateCell(cells[t],e,!1);else this.animateCell(this.graph.getModel().getRoot(),e,!0);this.show(e),(e.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(e){e.show()},mxMorphing.prototype.animateCell=function(e,t,n){var a=this.graph.getView().getState(e),i=null;if(null!=a&&(i=this.getDelta(a),this.graph.getModel().isVertex(e)&&(0!=i.x||0!=i.y))){var o=this.graph.view.getTranslate(),s=this.graph.view.getScale();i.x+=o.x*s,i.y+=o.y*s,t.moveState(a,-i.x/this.ease,-i.y/this.ease)}if(n&&!this.stopRecursion(a,i))for(a=this.graph.getModel().getChildCount(e),i=0;i<a;i++)this.animateCell(this.graph.getModel().getChildAt(e,i),t,n)},mxMorphing.prototype.stopRecursion=function(e,t){return null!=t&&(0!=t.x||0!=t.y)},mxMorphing.prototype.getDelta=function(e){var t=this.getOriginForCell(e.cell),n=this.graph.getView().getTranslate(),a=this.graph.getView().getScale();return e=new mxPoint(e.x/a-n.x,e.y/a-n.y),new mxPoint((t.x-e.x)*a,(t.y-e.y)*a)},mxMorphing.prototype.getOriginForCell=function(e){var t=null;return null!=e&&(t=this.getOriginForCell(this.graph.getModel().getParent(e)),null!=(e=this.graph.getCellGeometry(e))&&(t.x+=e.x,t.y+=e.y)),null==t&&(t=new mxPoint(-(t=this.graph.view.getTranslate()).x,-t.y)),t},mxImageBundle.prototype.images=null,mxImageBundle.prototype.images=null,mxImageBundle.prototype.putImage=function(e,t,n){this.images[e]={value:t,fallback:n}},mxImageBundle.prototype.getImage=function(e){var t=null;return null!=e&&(null!=(e=this.images[e])&&(t=this.alt?e.fallback:e.value)),t},mxImageExport.prototype.includeOverlays=!1,mxImageExport.prototype.drawState=function(e,t){null!=e&&(this.visitStatesRecursive(e,t,this.drawCellState),this.includeOverlays&&this.visitStatesRecursive(e,t,this.drawOverlays))},mxImageExport.prototype.visitStatesRecursive=function(e,t,n){if(null!=e){n(e,t);for(var a=e.view.graph,i=a.model.getChildCount(e.cell),o=0;o<i;o++){var s=a.view.getState(a.model.getChildAt(e.cell,o));this.visitStatesRecursive(s,t,n)}}},mxImageExport.prototype.drawCellState=function(e,t){e.shape instanceof mxShape&&(t.save(),e.shape.paint(t),t.restore()),null!=e.text&&(t.save(),e.text.paint(t),t.restore())},mxImageExport.prototype.drawOverlays=function(e,n){null!=e.overlays&&e.overlays.visit(function(e,t){t instanceof mxShape&&t.paint(n)})},mxAbstractCanvas2D.prototype.state=null,mxAbstractCanvas2D.prototype.states=null,mxAbstractCanvas2D.prototype.path=null,mxAbstractCanvas2D.prototype.rotateHtml=!0,mxAbstractCanvas2D.prototype.lastX=0,mxAbstractCanvas2D.prototype.lastY=0,mxAbstractCanvas2D.prototype.moveOp="M",mxAbstractCanvas2D.prototype.lineOp="L",mxAbstractCanvas2D.prototype.quadOp="Q",mxAbstractCanvas2D.prototype.curveOp="C",mxAbstractCanvas2D.prototype.closeOp="Z",mxAbstractCanvas2D.prototype.pointerEvents=!1,mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter},mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState(),this.states=[]},mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillColor:null,fillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:!1,dashPattern:"3 3",lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1,shadowColor:mxConstants.SHADOWCOLOR,shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}},mxAbstractCanvas2D.prototype.format=function(e){return Math.round(parseFloat(e))},mxAbstractCanvas2D.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var e=this.state,t=2;t<arguments.length;t+=2)this.lastX=arguments[t-1],this.lastY=arguments[t],this.path.push(this.format((this.lastX+e.dx)*e.scale)),this.path.push(this.format((this.lastY+e.dy)*e.scale))},mxAbstractCanvas2D.prototype.rotatePoint=function(e,t,n,a,i){return n*=Math.PI/180,mxUtils.getRotatedPoint(new mxPoint(e,t),Math.cos(n),Math.sin(n),new mxPoint(a,i))},mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state),this.state=mxUtils.clone(this.state)},mxAbstractCanvas2D.prototype.restore=function(){this.state=this.states.pop()},mxAbstractCanvas2D.prototype.scale=function(e){this.state.scale*=e,this.state.strokeWidth*=e},mxAbstractCanvas2D.prototype.translate=function(e,t){this.state.dx+=e,this.state.dy+=t},mxAbstractCanvas2D.prototype.setAlpha=function(e){this.state.alpha=e},mxAbstractCanvas2D.prototype.setFillColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fillColor=e,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(e,t,n,a,i,o,s,r,l){(n=this.state).fillColor=e,n.fillAlpha=null!=r?r:1,n.gradientColor=t,n.gradientAlpha=null!=l?l:1,n.gradientDirection=s},mxAbstractCanvas2D.prototype.setStrokeColor=function(e){e==mxConstants.NONE&&(e=null),this.state.strokeColor=e},mxAbstractCanvas2D.prototype.setStrokeWidth=function(e){this.state.strokeWidth=e},mxAbstractCanvas2D.prototype.setDashed=function(e){this.state.dashed=e},mxAbstractCanvas2D.prototype.setDashPattern=function(e){this.state.dashPattern=e},mxAbstractCanvas2D.prototype.setLineCap=function(e){this.state.lineCap=e},mxAbstractCanvas2D.prototype.setLineJoin=function(e){this.state.lineJoin=e},mxAbstractCanvas2D.prototype.setMiterLimit=function(e){this.state.miterLimit=e},mxAbstractCanvas2D.prototype.setFontColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontColor=e},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBackgroundColor=e},mxAbstractCanvas2D.prototype.setFontBorderColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBorderColor=e},mxAbstractCanvas2D.prototype.setFontSize=function(e){this.state.fontSize=e},mxAbstractCanvas2D.prototype.setFontFamily=function(e){this.state.fontFamily=e},mxAbstractCanvas2D.prototype.setFontStyle=function(e){null==e&&(e=0),this.state.fontStyle=e},mxAbstractCanvas2D.prototype.setShadow=function(e){this.state.shadow=e},mxAbstractCanvas2D.prototype.setShadowColor=function(e){e==mxConstants.NONE&&(e=null),this.state.shadowColor=e},mxAbstractCanvas2D.prototype.setShadowAlpha=function(e){this.state.shadowAlpha=e},mxAbstractCanvas2D.prototype.setShadowOffset=function(e,t){this.state.shadowDx=e,this.state.shadowDy=t},mxAbstractCanvas2D.prototype.begin=function(){this.lastY=this.lastX=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(e,t){this.addOp(this.moveOp,e,t)},mxAbstractCanvas2D.prototype.lineTo=function(e,t){this.addOp(this.lineOp,e,t)},mxAbstractCanvas2D.prototype.quadTo=function(e,t,n,a){this.addOp(this.quadOp,e,t,n,a)},mxAbstractCanvas2D.prototype.curveTo=function(e,t,n,a,i,o){this.addOp(this.curveOp,e,t,n,a,i,o)},mxAbstractCanvas2D.prototype.arcTo=function(e,t,n,a,i,o,s){for(e=mxUtils.arcToCurves(this.lastX,this.lastY,e,t,n,a,i,o,s),t=0;t<e.length;t+=6)this.curveTo(e[t],e[t+1],e[t+2],e[t+3],e[t+4],e[t+5])},mxAbstractCanvas2D.prototype.close=function(e,t,n,a,i,o){this.addOp(this.closeOp)},mxAbstractCanvas2D.prototype.end=function(){},mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D),mxXmlCanvas2D.prototype.textEnabled=!0,mxXmlCanvas2D.prototype.compressed=!0,mxXmlCanvas2D.prototype.writeDefaults=function(){var e;(e=this.createElement("fontfamily")).setAttribute("family",mxConstants.DEFAULT_FONTFAMILY),this.root.appendChild(e),(e=this.createElement("fontsize")).setAttribute("size",mxConstants.DEFAULT_FONTSIZE),this.root.appendChild(e),(e=this.createElement("shadowcolor")).setAttribute("color",mxConstants.SHADOWCOLOR),this.root.appendChild(e),(e=this.createElement("shadowalpha")).setAttribute("alpha",mxConstants.SHADOW_OPACITY),this.root.appendChild(e),(e=this.createElement("shadowoffset")).setAttribute("dx",mxConstants.SHADOW_OFFSET_X),e.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y),this.root.appendChild(e)},mxXmlCanvas2D.prototype.format=function(e){return parseFloat(parseFloat(e).toFixed(2))},mxXmlCanvas2D.prototype.createElement=function(e){return this.root.ownerDocument.createElement(e)},mxXmlCanvas2D.prototype.save=function(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments),this.root.appendChild(this.createElement("save"))},mxXmlCanvas2D.prototype.restore=function(){this.compressed&&mxAbstractCanvas2D.prototype.restore.apply(this,arguments),this.root.appendChild(this.createElement("restore"))},mxXmlCanvas2D.prototype.scale=function(e){if(this.compressed){if(this.state.scale==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var t=this.createElement("scale");t.setAttribute("scale",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.translate=function(e,t){var n=this.createElement("translate");n.setAttribute("dx",this.format(e)),n.setAttribute("dy",this.format(t)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rotate=function(e,t,n,a,i){var o=this.createElement("rotate");(0!=e||t||n)&&(o.setAttribute("theta",this.format(e)),o.setAttribute("flipH",t?"1":"0"),o.setAttribute("flipV",n?"1":"0"),o.setAttribute("cx",this.format(a)),o.setAttribute("cy",this.format(i)),this.root.appendChild(o))},mxXmlCanvas2D.prototype.setAlpha=function(e){if(this.compressed){if(this.state.alpha==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var t=this.createElement("alpha");t.setAttribute("alpha",this.format(e)),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setFillColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fillColor==e)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var t=this.createElement("fillcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setGradient=function(e,t,n,a,i,o,s,r,l){if(null!=e&&null!=t){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var d=this.createElement("gradient");d.setAttribute("c1",e),d.setAttribute("c2",t),d.setAttribute("x",this.format(n)),d.setAttribute("y",this.format(a)),d.setAttribute("w",this.format(i)),d.setAttribute("h",this.format(o)),null!=s&&d.setAttribute("direction",s),null!=r&&d.setAttribute("alpha1",r),null!=l&&d.setAttribute("alpha2",l),this.root.appendChild(d)}},mxXmlCanvas2D.prototype.setStrokeColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.strokeColor==e)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var t=this.createElement("strokecolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setStrokeWidth=function(e){if(this.compressed){if(this.state.strokeWidth==e)return;mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var t=this.createElement("strokewidth");t.setAttribute("width",this.format(e)),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setDashed=function(e){if(this.compressed){if(this.state.dashed==e)return;mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var t=this.createElement("dashed");t.setAttribute("dashed",e?"1":"0"),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setDashPattern=function(e){if(this.compressed){if(this.state.dashPattern==e)return;mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var t=this.createElement("dashpattern");t.setAttribute("pattern",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setLineCap=function(e){if(this.compressed){if(this.state.lineCap==e)return;mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var t=this.createElement("linecap");t.setAttribute("cap",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setLineJoin=function(e){if(this.compressed){if(this.state.lineJoin==e)return;mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var t=this.createElement("linejoin");t.setAttribute("join",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setMiterLimit=function(e){if(this.compressed){if(this.state.miterLimit==e)return;mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var t=this.createElement("miterlimit");t.setAttribute("limit",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setFontColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontColor==e)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var t=this.createElement("fontcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontBackgroundColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBackgroundColor==e)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var t=this.createElement("fontbackgroundcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontBorderColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBorderColor==e)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var t=this.createElement("fontbordercolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontSize=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==e)return;mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var t=this.createElement("fontsize");t.setAttribute("size",e),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontFamily=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==e)return;mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var t=this.createElement("fontfamily");t.setAttribute("family",e),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontStyle=function(e){if(this.textEnabled){if(null==e&&(e=0),this.compressed){if(this.state.fontStyle==e)return;mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var t=this.createElement("fontstyle");t.setAttribute("style",e),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setShadow=function(e){if(this.compressed){if(this.state.shadow==e)return;mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var t=this.createElement("shadow");t.setAttribute("enabled",e?"1":"0"),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setShadowColor=function(e){if(this.compressed){if(e==mxConstants.NONE&&(e=null),this.state.shadowColor==e)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var t=this.createElement("shadowcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setShadowAlpha=function(e){if(this.compressed){if(this.state.shadowAlpha==e)return;mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var t=this.createElement("shadowalpha");t.setAttribute("alpha",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setShadowOffset=function(e,t){if(this.compressed){if(this.state.shadowDx==e&&this.state.shadowDy==t)return;mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var n=this.createElement("shadowoffset");n.setAttribute("dx",e),n.setAttribute("dy",t),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rect=function(e,t,n,a){var i=this.createElement("rect");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(t)),i.setAttribute("w",this.format(n)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.roundrect=function(e,t,n,a,i,o){var s=this.createElement("roundrect");s.setAttribute("x",this.format(e)),s.setAttribute("y",this.format(t)),s.setAttribute("w",this.format(n)),s.setAttribute("h",this.format(a)),s.setAttribute("dx",this.format(i)),s.setAttribute("dy",this.format(o)),this.root.appendChild(s)},mxXmlCanvas2D.prototype.ellipse=function(e,t,n,a){var i=this.createElement("ellipse");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(t)),i.setAttribute("w",this.format(n)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.image=function(e,t,n,a,i,o,s,r){i=this.converter.convert(i);var l=this.createElement("image");l.setAttribute("x",this.format(e)),l.setAttribute("y",this.format(t)),l.setAttribute("w",this.format(n)),l.setAttribute("h",this.format(a)),l.setAttribute("src",i),l.setAttribute("aspect",o?"1":"0"),l.setAttribute("flipH",s?"1":"0"),l.setAttribute("flipV",r?"1":"0"),this.root.appendChild(l)},mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin")),this.lastY=this.lastX=0},mxXmlCanvas2D.prototype.moveTo=function(e,t){var n=this.createElement("move");n.setAttribute("x",this.format(e)),n.setAttribute("y",this.format(t)),this.root.appendChild(n),this.lastX=e,this.lastY=t},mxXmlCanvas2D.prototype.lineTo=function(e,t){var n=this.createElement("line");n.setAttribute("x",this.format(e)),n.setAttribute("y",this.format(t)),this.root.appendChild(n),this.lastX=e,this.lastY=t},mxXmlCanvas2D.prototype.quadTo=function(e,t,n,a){var i=this.createElement("quad");i.setAttribute("x1",this.format(e)),i.setAttribute("y1",this.format(t)),i.setAttribute("x2",this.format(n)),i.setAttribute("y2",this.format(a)),this.root.appendChild(i),this.lastX=n,this.lastY=a},mxXmlCanvas2D.prototype.curveTo=function(e,t,n,a,i,o){var s=this.createElement("curve");s.setAttribute("x1",this.format(e)),s.setAttribute("y1",this.format(t)),s.setAttribute("x2",this.format(n)),s.setAttribute("y2",this.format(a)),s.setAttribute("x3",this.format(i)),s.setAttribute("y3",this.format(o)),this.root.appendChild(s),this.lastX=i,this.lastY=o},mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))},mxXmlCanvas2D.prototype.text=function(e,t,n,a,i,o,s,r,l,d,c,m){if(this.textEnabled&&null!=i){mxUtils.isNode(i)&&(i=mxUtils.getOuterHtml(i));var u=this.createElement("text");u.setAttribute("x",this.format(e)),u.setAttribute("y",this.format(t)),u.setAttribute("w",this.format(n)),u.setAttribute("h",this.format(a)),u.setAttribute("str",i),null!=o&&u.setAttribute("align",o),null!=s&&u.setAttribute("valign",s),u.setAttribute("wrap",r?"1":"0"),null==l&&(l=""),u.setAttribute("format",l),null!=d&&u.setAttribute("fill",d?"1":"0"),null!=c&&u.setAttribute("clip",c?"1":"0"),null!=m&&u.setAttribute("rotation",m),this.root.appendChild(u)}},mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))},mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))},mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))},mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),mxSvgCanvas2D.prototype.node=null,mxSvgCanvas2D.prototype.matchHtmlAlignment=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,mxSvgCanvas2D.prototype.strokeTolerance=0,mxSvgCanvas2D.prototype.refCount=0,mxSvgCanvas2D.prototype.blockImagePointerEvents=!1,mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(e){return(e=this.createElement("style")).setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(e,t){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(t||mxConstants.NS_SVG,e);var n=this.root.ownerDocument.createElement(e);return null!=t&&n.setAttribute("xmlns",t),n},mxSvgCanvas2D.prototype.createGradientId=function(e,t,n,a,i){return"#"==e.charAt(0)&&(e=e.substring(1)),"#"==t.charAt(0)&&(t=t.substring(1)),e=e.toLowerCase()+"-"+n,t=t.toLowerCase()+"-"+a,(n=null)==i||i==mxConstants.DIRECTION_SOUTH?n="s":i==mxConstants.DIRECTION_EAST?n="e":(a=e,e=t,t=a,i==mxConstants.DIRECTION_NORTH?n="s":i==mxConstants.DIRECTION_WEST&&(n="e")),"mx-gradient-"+e+"-"+t+"-"+n},mxSvgCanvas2D.prototype.getSvgGradient=function(e,t,n,a,i){var o=this.createGradientId(e,t,n,a,i),s=this.gradients[o];if(null==s){var r=this.root.ownerSVGElement,l=0,d=o+"-"+l;if(null!=r)for(s=r.ownerDocument.getElementById(d);null!=s&&s.ownerSVGElement!=r;)d=o+"-"+l++,s=r.ownerDocument.getElementById(d);else d="id"+ ++this.refCount;null==s&&((s=this.createSvgGradient(e,t,n,a,i)).setAttribute("id",d),null!=this.defs?this.defs.appendChild(s):r.appendChild(s)),this.gradients[o]=s}return s.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(e,t,n,a,i){var o=this.createElement("linearGradient");return o.setAttribute("x1","0%"),o.setAttribute("y1","0%"),o.setAttribute("x2","0%"),o.setAttribute("y2","0%"),null==i||i==mxConstants.DIRECTION_SOUTH?o.setAttribute("y2","100%"):i==mxConstants.DIRECTION_EAST?o.setAttribute("x2","100%"):i==mxConstants.DIRECTION_NORTH?o.setAttribute("y1","100%"):i==mxConstants.DIRECTION_WEST&&o.setAttribute("x1","100%"),n=n<1?";stop-opacity:"+n:"",(i=this.createElement("stop")).setAttribute("offset","0%"),i.setAttribute("style","stop-color:"+e+n),o.appendChild(i),n=a<1?";stop-opacity:"+a:"",(i=this.createElement("stop")).setAttribute("offset","100%"),i.setAttribute("style","stop-color:"+t+n),o.appendChild(i),o},mxSvgCanvas2D.prototype.addNode=function(e,t){var n=this.node,a=this.state;if(null!=n){if("path"==n.nodeName){if(!(null!=this.path&&0<this.path.length))return;n.setAttribute("d",this.path.join(" "))}e&&null!=a.fillColor?this.updateFill():this.styleEnabled||("ellipse"!=n.nodeName||!mxClient.IS_NS||mxClient.IS_GC||mxClient.IS_SF?n.setAttribute("fill","none"):n.setAttribute("fill","transparent"),e=!1),t&&null!=a.strokeColor?this.updateStroke():this.styleEnabled||n.setAttribute("stroke","none"),null!=a.transform&&0<a.transform.length&&n.setAttribute("transform",a.transform),a.shadow&&this.root.appendChild(this.createShadow(n)),0<this.strokeTolerance&&!e&&this.root.appendChild(this.createTolerance(n)),this.pointerEvents&&("path"!=n.nodeName||this.path[this.path.length-1]==this.closeOp)&&n.setAttribute("pointer-events","all"),this.root.appendChild(n)}},mxSvgCanvas2D.prototype.updateFill=function(){var e=this.state;e.alpha<1&&this.node.setAttribute("fill-opacity",e.alpha),null!=e.fillColor&&(null!=e.gradientColor?(e=this.getSvgGradient(e.fillColor,e.gradientColor,e.fillAlpha,e.gradientAlpha,e.gradientDirection),this.node.setAttribute("fill","url(#"+e+")")):this.node.setAttribute("fill",e.fillColor.toLowerCase()))},mxSvgCanvas2D.prototype.updateStroke=function(){var e=this.state;this.node.setAttribute("stroke",e.strokeColor.toLowerCase()),e.alpha<1&&this.node.setAttribute("stroke-opacity",e.alpha);var t=Math.max(1,this.format(e.strokeWidth*e.scale));1!=t&&this.node.setAttribute("stroke-width",t),"path"==this.node.nodeName&&this.updateStrokeAttributes(),e.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern(t))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var e=this.state;if(null!=e.lineJoin&&"miter"!=e.lineJoin&&this.node.setAttribute("stroke-linejoin",e.lineJoin),null!=e.lineCap){var t=e.lineCap;"flat"==t&&(t="butt"),"butt"!=t&&this.node.setAttribute("stroke-linecap",t)}null!=e.miterLimit&&(!this.styleEnabled||10!=e.miterLimit)&&this.node.setAttribute("stroke-miterlimit",e.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(e){var t=this.state.dashPattern.split(" "),n=[];if(0<t.length)for(var a=0;a<t.length;a++)n[a]=Number(t[a])*e;return n.join(" ")},mxSvgCanvas2D.prototype.createTolerance=function(e){e=e.cloneNode(!0);var t=parseFloat(e.getAttribute("stroke-width")||1)+this.strokeTolerance;return e.setAttribute("pointer-events","stroke"),e.setAttribute("visibility","hidden"),e.removeAttribute("stroke-dasharray"),e.setAttribute("stroke-width",t),e.setAttribute("fill","none"),e.setAttribute("stroke",mxClient.IS_OP?"none":"white"),e},mxSvgCanvas2D.prototype.createShadow=function(e){e=e.cloneNode(!0);var t=this.state;return"none"!=e.getAttribute("fill")&&e.setAttribute("fill",t.shadowColor),"none"!=e.getAttribute("stroke")&&e.setAttribute("stroke",t.shadowColor),e.setAttribute("transform","translate("+this.format(t.shadowDx*t.scale)+","+this.format(t.shadowDy*t.scale)+")"+(t.transform||"")),e.setAttribute("opacity",t.shadowAlpha),e},mxSvgCanvas2D.prototype.rotate=function(e,t,n,a,i){if(0!=e||t||n){var o=this.state;if(a+=o.dx,i+=o.dy,a*=o.scale,i*=o.scale,o.transform=o.transform||"",t&&n)e+=180;else if(t^n){var s=t?a:0,r=t?-1:1,l=n?i:0,d=n?-1:1;o.transform+="translate("+this.format(s)+","+this.format(l)+")scale("+this.format(r)+","+this.format(d)+")translate("+this.format(-s)+","+this.format(-l)+")"}(t?!n:n)&&(e*=-1),0!=e&&(o.transform+="rotate("+this.format(e)+","+this.format(a)+","+this.format(i)+")"),o.rotation+=e,o.rotationCx=a,o.rotationCy=i}},mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createElement("path")},mxSvgCanvas2D.prototype.rect=function(e,t,n,a){var i=this.state,o=this.createElement("rect");o.setAttribute("x",this.format((e+i.dx)*i.scale)),o.setAttribute("y",this.format((t+i.dy)*i.scale)),o.setAttribute("width",this.format(n*i.scale)),o.setAttribute("height",this.format(a*i.scale)),this.node=o},mxSvgCanvas2D.prototype.roundrect=function(e,t,n,a,i,o){this.rect(e,t,n,a),0<i&&this.node.setAttribute("rx",this.format(i*this.state.scale)),0<o&&this.node.setAttribute("ry",this.format(o*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(e,t,n,a){var i=this.state,o=this.createElement("ellipse");o.setAttribute("cx",Math.round((e+n/2+i.dx)*i.scale)),o.setAttribute("cy",Math.round((t+a/2+i.dy)*i.scale)),o.setAttribute("rx",n/2*i.scale),o.setAttribute("ry",a/2*i.scale),this.node=o},mxSvgCanvas2D.prototype.image=function(e,t,n,a,i,o,s,r){i=this.converter.convert(i),o=null==o||o,s=null!=s&&s,r=null!=r&&r;var l=this.state;e+=l.dx,t+=l.dy;var d=this.createElement("image");if(d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(t*l.scale)),d.setAttribute("width",this.format(n*l.scale)),d.setAttribute("height",this.format(a*l.scale)),null==d.setAttributeNS?d.setAttribute("xlink:href",i):d.setAttributeNS(mxConstants.NS_XLINK,"href",i),o||d.setAttribute("preserveAspectRatio","none"),l.alpha<1&&d.setAttribute("opacity",l.alpha),i=this.state.transform||"",s||r){var c=o=1,m=0,u=0;s&&(o=-1,m=-n-2*e),r&&(c=-1,u=-a-2*t),i+="scale("+o+","+c+")translate("+m+","+u+")"}0<i.length&&d.setAttribute("transform",i),this.root.appendChild(d),this.blockImagePointerEvents&&(d.setAttribute("style","pointer-events:none"),(d=this.createElement("rect")).setAttribute("visibility","hidden"),d.setAttribute("pointer-events","fill"),d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(t*l.scale)),d.setAttribute("width",this.format(n*l.scale)),d.setAttribute("height",this.format(a*l.scale)),this.root.appendChild(d))},mxSvgCanvas2D.prototype.createDiv=function(e,t,n,a,i){return n=this.state,a="display:inline-block;font-size:"+Math.round(n.fontSize)+"px;font-family:"+n.fontFamily+";color:"+n.fontColor+";line-height:"+Math.round(n.fontSize*mxConstants.LINE_HEIGHT)+"px;"+a,(n.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="font-weight:bold;"),(n.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="font-style:italic;"),(n.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(a+="font-decoration:underline;"),t==mxConstants.ALIGN_CENTER?a+="text-align:center;":t==mxConstants.ALIGN_RIGHT&&(a+="text-align:right;"),t="",null!=n.fontBackgroundColor&&(t+="background-color:"+n.fontBackgroundColor+";"),null!=n.fontBorderColor&&(t+="border:1px solid "+n.fontBorderColor+";"),mxUtils.isNode(e)||((n=document.createElement("textarea")).innerHTML=e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"<").replace(/>/g,">"),e=n.value,i?a+=t:0<t.length&&(e='<div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;'+t+'">'+e+"</div>")),!mxClient.IS_IE&&document.createElementNS?((i=document.createElementNS("http://www.w3.org/1999/xhtml","div")).setAttribute("style",a),mxUtils.isNode(e)?this.root.ownerDocument!=document?i.appendChild(e.cloneNode(!0)):i.appendChild(e):i.innerHTML=e,i):(mxUtils.isNode(e)&&this.root.ownerDocument!=document&&(e=e.outerHTML),e=e.replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />"),mxUtils.parseXml('<div xmlns="http://www.w3.org/1999/xhtml" style="'+a+'">'+e+"</div>").documentElement)},mxSvgCanvas2D.prototype.text=function(e,t,n,a,i,o,s,r,l,d,c,m){if(this.textEnabled&&null!=i){m=null!=m?m:0;var u=this.state;if(e+=u.dx,t+=u.dy,this.foEnabled&&"html"==l){var p="vertical-align:top;";if(c?(p+="overflow:hidden;",0<a&&(p+="max-height:"+Math.round(a)+"px;"),0<n&&(p+="width:"+Math.round(n)+"px;")):d&&(p+="width:"+Math.round(n)+"px;",0<a&&(p+="max-height:"+Math.round(a)+"px;")),r?(!c&&0<n&&(p+="width:"+Math.round(n)+"px;"),p+="white-space:normal;"):p+="white-space:nowrap;",r=this.createElement("g"),u.alpha<1&&r.setAttribute("opacity",u.alpha),(l=this.createElement("foreignObject")).setAttribute("pointer-events","all"),null!=(p=this.createDiv(i,o,s,p,d))){r.appendChild(l),this.root.appendChild(r);var g=0;if(mxClient.IS_IE&&!mxClient.IS_SVG){var v=document.createElement("div");v.style.cssText=p.getAttribute("style"),v.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",v.style.visibility="hidden",v.innerHTML=mxUtils.isNode(i)?i.outerHTML:i,document.body.appendChild(v),g=v.offsetWidth,a=mxClient.IS_QUIRKS&&0<a&&c?Math.min(a,v.offsetHeight+2):v.offsetHeight,v.parentNode.removeChild(v),l.appendChild(p)}else this.root.ownerDocument!=document?(p.style.visibility="hidden",document.body.appendChild(p),g=p.offsetWidth,a=p.offsetHeight,l.appendChild(p),p.style.visibility=""):(l.appendChild(p),g=p.offsetWidth,a=p.offsetHeight);n=d?Math.max(n,g):g,u.alpha<1&&r.setAttribute("opacity",u.alpha),d=i=0,o==mxConstants.ALIGN_CENTER?i-=n/2:o==mxConstants.ALIGN_RIGHT&&(i-=n),e+=i,s==mxConstants.ALIGN_MIDDLE?d-=a/2:s==mxConstants.ALIGN_BOTTOM&&(d-=a),t+=d,o=1!=u.scale?"scale("+u.scale+")":"",0!=u.rotation&&this.rotateHtml?(o+="rotate("+u.rotation+","+n/2+","+a/2+")",e=(t=this.rotatePoint((e+n/2)*u.scale,(t+a/2)*u.scale,u.rotation,u.rotationCx,u.rotationCy)).x-n*u.scale/2,t=t.y-a*u.scale/2):(e*=u.scale,t*=u.scale),0!=m&&(o+="rotate("+m+","+-i+","+-d+")"),r.setAttribute("transform","translate("+Math.round(e)+","+Math.round(t)+")"+o),l.setAttribute("width",Math.round(Math.max(1,n))),l.setAttribute("height",Math.round(Math.max(1,a)))}}else this.plainText(e,t,n,a,i,o,s,r,d,c,m)}},mxSvgCanvas2D.prototype.createClip=function(e,t,n,a){for(var i="mx-clip-"+(e=Math.round(e))+"-"+(t=Math.round(t))+"-"+(n=Math.round(n))+"-"+(a=Math.round(a)),o=0,s=i+"-"+o;null!=document.getElementById(s);)s=i+"-"+ ++o;return clip=this.createElement("clipPath"),clip.setAttribute("id",s),(i=this.createElement("rect")).setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("width",n),i.setAttribute("height",a),clip.appendChild(i),clip},mxSvgCanvas2D.prototype.plainText=function(e,t,n,a,i,o,s,r,l,d,c){c=null!=c?c:0,r=this.state;var m=Math.round(r.fontSize),u=this.createElement("g"),p=r.transform||"";if(0!=c&&(p+="rotate("+c+","+this.format(e*r.scale)+","+this.format(t*r.scale)+")"),d&&0<n&&0<a){var g=e;c=t,o==mxConstants.ALIGN_CENTER?g-=n/2:o==mxConstants.ALIGN_RIGHT&&(g-=n),s==mxConstants.ALIGN_MIDDLE?c-=a/2:s==mxConstants.ALIGN_BOTTOM&&(c-=a),c=this.createClip(g*r.scale-2,c*r.scale-2,n*r.scale+4,a*r.scale+4),null!=this.defs?this.defs.appendChild(c):this.root.appendChild(c),u.setAttribute("clip-path","url(#"+c.getAttribute("id")+")")}this.updateFont(u,o),"start"!=(c=o==mxConstants.ALIGN_RIGHT?"end":o==mxConstants.ALIGN_CENTER?"middle":"start")&&u.setAttribute("text-anchor",c),(!this.styleEnabled||m!=mxConstants.DEFAULT_FONTSIZE)&&u.setAttribute("font-size",Math.round(m*r.scale)+"px"),0<p.length&&u.setAttribute("transform",p),r.alpha<1&&u.setAttribute("opacity",r.alpha);p=i.split("\n"),g=Math.round(m*mxConstants.LINE_HEIGHT);var v=m+(p.length-1)*g;for(c=t+m-1,s==mxConstants.ALIGN_MIDDLE?c-=(a=(this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)/2)+1:s==mxConstants.ALIGN_BOTTOM&&(c-=(a=this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)+2),a=0;a<p.length;a++)0<p[a].length&&0<mxUtils.trim(p[a]).length&&((d=this.createElement("text")).setAttribute("x",this.format(e*r.scale)),d.setAttribute("y",this.format(c*r.scale)),mxUtils.write(d,p[a]),u.appendChild(d)),c+=g;this.root.appendChild(u),this.addTextBackground(u,i,e,t,n,v,o,s,l)},mxSvgCanvas2D.prototype.updateFont=function(e){var t=this.state;e.setAttribute("fill",t.fontColor),(!this.styleEnabled||t.fontFamily!=mxConstants.DEFAULT_FONTFAMILY)&&e.setAttribute("font-family",t.fontFamily),(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&e.setAttribute("font-weight","bold"),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&e.setAttribute("font-style","italic"),(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&e.setAttribute("text-decoration","underline")},mxSvgCanvas2D.prototype.addTextBackground=function(e,t,n,a,i,o,s,r,l){var d=this.state;if(null!=d.fontBackgroundColor||null!=d.fontBorderColor){var c=null;l?(s==mxConstants.ALIGN_CENTER?n-=i/2:s==mxConstants.ALIGN_RIGHT&&(n-=i),r==mxConstants.ALIGN_MIDDLE?a-=o/2:r==mxConstants.ALIGN_BOTTOM&&(a-=o),c=new mxRectangle((n+1)*d.scale,a*d.scale,(i-2)*d.scale,(o+2)*d.scale)):null!=e.getBBox&&this.root.ownerDocument==document?(c=e.getBBox(),t=mxClient.IS_IE&&mxClient.IS_SVG,c=new mxRectangle(c.x,c.y+(t?0:1),c.width,c.height+(t?1:0))):((c=document.createElement("div")).style.lineHeight=Math.round(d.fontSize*mxConstants.LINE_HEIGHT)+"px",c.style.fontSize=Math.round(d.fontSize)+"px",c.style.fontFamily=d.fontFamily,c.style.whiteSpace="nowrap",c.style.position="absolute",c.style.visibility="hidden",c.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",c.style.zoom="1",(d.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(c.style.fontWeight="bold"),(d.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(c.style.fontStyle="italic"),t=mxUtils.htmlEntities(t,!1),c.innerHTML=t.replace(/\n/g,"<br/>"),document.body.appendChild(c),i=c.offsetWidth,o=c.offsetHeight,c.parentNode.removeChild(c),s==mxConstants.ALIGN_CENTER?n-=i/2:s==mxConstants.ALIGN_RIGHT&&(n-=i),r==mxConstants.ALIGN_MIDDLE?a-=o/2:r==mxConstants.ALIGN_BOTTOM&&(a-=o),c=new mxRectangle((n+1)*d.scale,(a+2)*d.scale,i*d.scale,(o+1)*d.scale)),null!=c&&((t=this.createElement("rect")).setAttribute("fill",d.fontBackgroundColor||"none"),t.setAttribute("stroke",d.fontBorderColor||"none"),t.setAttribute("x",Math.floor(c.x-1)),t.setAttribute("y",Math.floor(c.y-1)),t.setAttribute("width",Math.ceil(c.width+2)),t.setAttribute("height",Math.ceil(c.height)),d=null!=d.fontBorderColor?Math.max(1,this.format(d.scale)):0,t.setAttribute("stroke-width",d),this.root.ownerDocument==document&&1==mxUtils.mod(d,2)&&t.setAttribute("transform","translate(0.5, 0.5)"),e.insertBefore(t,e.firstChild))}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)};var mxVmlCanvas2D=function(e){mxAbstractCanvas2D.call(this),this.root=e};function mxGuide(e,t){this.graph=e,this.setStates(t)}function mxStencil(e){this.desc=e,this.parseDescription(),this.parseConstraints()}function mxShape(e){this.stencil=e,this.strokewidth=1,this.rotation=0,this.opacity=100,this.flipV=this.flipH=!1}mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.addNode=function(e,t){var n=this.node,a=this.state;if(null!=n){if("shape"==n.nodeName){if(!(null!=this.path&&0<this.path.length))return;n.path=this.path.join(" ")+" e",n.style.width=this.root.style.width,n.style.height=this.root.style.height,n.coordsize=parseInt(n.style.width)+" "+parseInt(n.style.height)}n.strokeweight=this.format(Math.max(1,a.strokeWidth*a.scale/this.vmlScale))+"px",a.shadow&&this.root.appendChild(this.createShadow(n,e&&null!=a.fillColor,t&&null!=a.strokeColor)),t&&null!=a.strokeColor?(n.stroked="true",n.strokecolor=a.strokeColor):n.stroked="false",n.appendChild(this.createStroke()),e&&null!=a.fillColor?n.appendChild(this.createFill()):!this.pointerEvents||"shape"==n.nodeName&&this.path[this.path.length-1]!=this.closeOp?n.filled="false":n.appendChild(this.createTransparentFill()),this.root.appendChild(n)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.src=mxClient.imageBasePath+"/transparent.gif",e.type="tile",e},mxVmlCanvas2D.prototype.createFill=function(){var e=this.state,t=document.createElement(mxClient.VML_PREFIX+":fill");if(t.color=e.fillColor,null!=e.gradientColor){t.type="gradient",t.method="none",t.color2=e.gradientColor;var n=180-e.rotation;n=e.gradientDirection==mxConstants.DIRECTION_WEST?n-(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_EAST?n+(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_NORTH?n-(180+("y"==this.root.style.flip?-180:0)):n+("y"==this.root.style.flip?-180:0);"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(n*=-1),t.angle=mxUtils.mod(n,360),t.opacity=100*e.alpha*e.fillAlpha+"%",t.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",100*e.alpha*e.gradientAlpha+"%")}else e.alpha<1&&(t.opacity=100*e.alpha+"%");return t},mxVmlCanvas2D.prototype.createStroke=function(){var e=this.state,t=document.createElement(mxClient.VML_PREFIX+":stroke");return t.endcap=e.lineCap||"flat",t.joinstyle=e.lineJoin||"miter",t.miterlimit=e.miterLimit||"10",e.alpha<1&&(t.opacity=100*e.alpha+"%"),e.dashed&&(t.dashstyle=this.getVmlDashStyle()),t},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var e="dash";if(null!=this.state.dashPattern){var t=this.state.dashPattern.split(" ");0<t.length&&1==t[0]&&(e="0 2")}return e},mxVmlCanvas2D.prototype.createShadow=function(e,t,n){var a=this.state,i=-a.rotation*(Math.PI/180),o=Math.cos(i),s=(i=Math.sin(i),a.shadowDx*a.scale),r=a.shadowDy*a.scale;"x"==this.root.style.flip?s*=-1:"y"==this.root.style.flip&&(r*=-1);var l=e.cloneNode(!0);return l.style.marginLeft=Math.round(s*o-r*i)+"px",l.style.marginTop=Math.round(s*i+r*o)+"px",8==document.documentMode&&(l.strokeweight=e.strokeweight,"shape"==e.nodeName&&(l.path=this.path.join(" ")+" e",l.style.width=this.root.style.width,l.style.height=this.root.style.height,l.coordsize=parseInt(e.style.width)+" "+parseInt(e.style.height))),n?(l.strokecolor=a.shadowColor,l.appendChild(this.createShadowStroke())):l.stroked="false",t?l.appendChild(this.createShadowFill()):l.filled="false",l},mxVmlCanvas2D.prototype.createShadowFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.color=this.state.shadowColor,e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.createShadowStroke=function(){var e=this.createStroke();return e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.rotate=function(e,t,n,a,i){t&&n?e+=180:t?this.root.style.flip="x":n&&(this.root.style.flip="y"),(t?!n:n)&&(e*=-1),this.root.style.rotation=e,this.state.rotation+=e,this.state.rotationCx=a,this.state.rotationCy=i},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=document.createElement(mxClient.VML_PREFIX+":shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(e,t,n,a){var i=this.state,o=(this.lastX+i.dx)*i.scale,s=(this.lastY+i.dy)*i.scale;e=(e+i.dx)*i.scale;s+=2/3*((t=(t+i.dy)*i.scale)-s);var r=(n=(n+i.dx)*i.scale)+2/3*(e-n);t=(a=(a+i.dy)*i.scale)+2/3*(t-a),this.path.push("c "+this.format(o+2/3*(e-o))+" "+this.format(s)+" "+this.format(r)+" "+this.format(t)+" "+this.format(n)+" "+this.format(a)),this.lastX=n/i.scale-i.dx,this.lastY=a/i.scale-i.dy},mxVmlCanvas2D.prototype.createRect=function(e,t,n,a,i){var o=this.state;return(e=document.createElement(e)).style.position="absolute",e.style.left=this.format((t+o.dx)*o.scale)+"px",e.style.top=this.format((n+o.dy)*o.scale)+"px",e.style.width=this.format(a*o.scale)+"px",e.style.height=this.format(i*o.scale)+"px",e},mxVmlCanvas2D.prototype.rect=function(e,t,n,a){this.node=this.createRect(mxClient.VML_PREFIX+":rect",e,t,n,a)},mxVmlCanvas2D.prototype.roundrect=function(e,t,n,a,i,o){this.node=this.createRect(mxClient.VML_PREFIX+":roundrect",e,t,n,a),this.node.setAttribute("arcsize",Math.max(100*i/n,100*o/a)+"%")},mxVmlCanvas2D.prototype.ellipse=function(e,t,n,a){this.node=this.createRect(mxClient.VML_PREFIX+":oval",e,t,n,a)},mxVmlCanvas2D.prototype.image=function(e,t,n,a,i,o,s,r){var l=null;o?((l=this.createRect(mxClient.VML_PREFIX+":rect",e,t,n,a)).stroked="false",(e=document.createElement(mxClient.VML_PREFIX+":fill")).aspect=o?"atmost":"ignore",e.rotate="true",e.type="frame",e.src=i,l.appendChild(e)):(l=this.createRect(mxClient.VML_PREFIX+":image",e,t,n,a)).src=i,s&&r?l.style.rotation="180":s?l.style.flip="x":r&&(l.style.flip="y"),this.state.alpha<1&&(l.style.filter+="alpha(opacity="+100*this.state.alpha+")"),this.root.appendChild(l)},mxVmlCanvas2D.prototype.createDiv=function(e,t,n,a){n=document.createElement("div");var i=this.state,o="";return null!=i.fontBackgroundColor&&(o+="background-color:"+i.fontBackgroundColor+";"),null!=i.fontBorderColor&&(o+="border:1px solid "+i.fontBorderColor+";"),mxUtils.isNode(e)?n.appendChild(e):0<o.length&&!a?((a=document.createElement("div")).style.cssText=o,a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,n.appendChild(a)):(n.style.cssText=o,n.innerHTML=e),(e=n.style).fontSize=Math.round(i.fontSize/this.vmlScale)+"px",e.fontFamily=i.fontFamily,e.color=i.fontColor,e.verticalAlign="top",e.textAlign=t||"left",e.lineHeight=Math.round(i.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale)+"px",(i.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e.fontWeight="bold"),(i.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e.fontStyle="italic"),(i.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(e.fontDecoration="underline"),n},mxVmlCanvas2D.prototype.text=function(e,t,n,a,i,o,s,r,l,d,c,m){if(this.textEnabled&&null!=i){var u=this.state;if("html"==l){null!=u.rotation&&(e=(t=this.rotatePoint(e,t,u.rotation,u.rotationCx,u.rotationCy)).x,t=t.y),8==document.documentMode?(e+=u.dx,t+=u.dy):(e*=u.scale,t*=u.scale),(l=8==document.documentMode?document.createElement(mxClient.VML_PREFIX+":group"):document.createElement("div")).style.position="absolute",l.style.display="inline",l.style.left=this.format(e)+"px",l.style.top=this.format(t)+"px",l.style.zoom=u.scale;var p=document.createElement("div");p.style.position="relative",p.style.display="inline";var g=(v=mxUtils.getAlignmentAsPoint(o,s)).x,v=v.y;if(i=this.createDiv(i,o,s,d),o=document.createElement("div"),r?(!c&&0<n&&(i.style.width=Math.round(n)+"px"),i.style.whiteSpace="normal"):i.style.whiteSpace="nowrap",r=u.rotation+(m||0),this.rotateHtml&&0!=r?(o.style.display="inline",o.style.zoom="1",o.appendChild(i),8==document.documentMode&&"DIV"!=this.root.nodeName?(p.appendChild(o),l.appendChild(p)):l.appendChild(o)):8==document.documentMode?(p.appendChild(i),l.appendChild(p)):(i.style.display="inline",l.appendChild(i)),"DIV"!=this.root.nodeName?((m=document.createElement(mxClient.VML_PREFIX+":rect")).stroked="false",m.filled="false",m.appendChild(l),this.root.appendChild(m)):this.root.appendChild(l),c?(i.style.overflow="hidden",0<n&&(i.style.width=Math.round(n)+"px"),0<a&&8==document.documentMode&&(i.style.maxHeight=Math.round(a)+"px")):d&&(i.style.width=n+"px",0<a&&(i.style.maxHeight=Math.round(a)+"px")),this.rotateHtml&&0!=r){n=r*(Math.PI/180),r=parseFloat(parseFloat(Math.cos(n)).toFixed(8)),m=parseFloat(parseFloat(Math.sin(-n)).toFixed(8)),(n%=2*Math.PI)<0&&(n+=2*Math.PI),(n%=Math.PI)>Math.PI/2&&(n=Math.PI-n),s=Math.cos(n);var h=Math.sin(n);8==document.documentMode&&(i.style.display="inline-block",o.style.display="inline-block",p.style.display="inline-block"),i.style.visibility="hidden",document.body.appendChild(i),n=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&(c||d)&&a<p&&(p=a,i.style.height=p+"px"),c=((a=p)-a*s+n*-h)/2-m*n*(g+.5)+r*a*(v+.5),d=(n-n*s+a*-h)/2+r*n*(g+.5)+m*a*(v+.5),"group"==l.nodeName&&"DIV"==this.root.nodeName?((g=document.createElement("div")).style.display="inline-block",g.style.position="absolute",g.style.left=this.format(e+(d-n/2)*u.scale)+"px",g.style.top=this.format(t+(c-a/2)*u.scale)+"px",l.parentNode.appendChild(g),g.appendChild(l)):(u=8==document.documentMode?1:u.scale,l.style.left=this.format(e+(d-n/2)*u)+"px",l.style.top=this.format(t+(c-a/2)*u)+"px"),o.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+r+", M12="+m+", M21="+-m+", M22="+r+", sizingMethod='auto expand')",o.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(o.style.filter+="alpha(opacity="+100*this.state.alpha+")"),i.style.visibility="",o.appendChild(i)}else 8!=document.documentMode?(i.style.verticalAlign="top",this.state.alpha<1&&(l.style.filter="alpha(opacity="+100*this.state.alpha+")"),u=i.parentNode,i.style.visibility="hidden",document.body.appendChild(i),n=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&c&&a<p&&(p=a,i.style.height=p+"px"),a=p,i.style.visibility="",u.appendChild(i),l.style.left=this.format(e+n*g*this.state.scale)+"px",l.style.top=this.format(t+a*v*this.state.scale)+"px"):(this.state.alpha<1&&(i.style.filter="alpha(opacity="+100*this.state.alpha+")"),p.style.left=100*g+"%",p.style.top=100*v+"%")}else this.plainText(e,t,n,a,mxUtils.htmlEntities(i,!1),o,s,r,l,d,c,m)}},mxVmlCanvas2D.prototype.plainText=function(e,t,n,a,i,o,s,r,l,d,c,m){e=(e+(a=this.state).dx)*a.scale,t=(t+a.dy)*a.scale,(n=document.createElement(mxClient.VML_PREFIX+":shape")).style.width="1px",n.style.height="1px",n.stroked="false",(d=document.createElement(mxClient.VML_PREFIX+":fill")).color=a.fontColor,d.opacity=100*a.alpha+"%",n.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":path")).textpathok="true",d.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),n.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":textpath")).style.cssText="v-text-align:"+o,d.style.align=o,d.style.fontFamily=a.fontFamily,d.string=i,d.on="true",o=Math.round(a.fontSize*a.scale/this.vmlScale),d.style.fontSize=o+"px",(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold"),(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic"),(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(d.style.textDecoration="underline"),a=o+((i=i.split("\n")).length-1)*o*mxConstants.LINE_HEIGHT,o=i=0,s==mxConstants.ALIGN_BOTTOM?o=-a/2:s!=mxConstants.ALIGN_MIDDLE&&(o=a/2),null!=m&&(s=(n.style.rotation=m)*(Math.PI/180),i=Math.sin(s)*o,o*=Math.cos(s)),n.appendChild(d),n.style.left=this.format(e-i)+"px",n.style.top=this.format(t+o)+"px",this.root.appendChild(n)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.setStates=function(e){this.states=e},mxGuide.prototype.isEnabledForEvent=function(e){return!0},mxGuide.prototype.getGuideTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxGuide.prototype.createGuideShape=function(e){return(e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)).isDashed=!0,e},mxGuide.prototype.move=function(a,e,t){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=e){var n=this.graph.getView().translate,i=this.graph.getView().scale,o=e.x,s=e.y,r=!1,l=!1,d=b=this.getGuideTolerance(),c=b;(b=a.clone()).x+=e.x,b.y+=e.y;var m=b.x,u=b.x+b.width,p=b.getCenterX(),g=b.y,v=b.y+b.height,h=b.getCenterY();e=function(e){e+=this.graph.panDx;var t=!1;if(Math.abs(e-p)<d?(o=e-a.getCenterX(),d=Math.abs(e-p),t=!0):Math.abs(e-m)<d?(o=e-a.x,d=Math.abs(e-m),t=!0):Math.abs(e-u)<d&&(o=e-a.x-a.width,d=Math.abs(e-u),t=!0),t){null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane()));var n=this.graph.container;e-=this.graph.panDx,this.guideX.points=[new mxPoint(e,-this.graph.panDy),new mxPoint(e,n.scrollHeight-3-this.graph.panDy)]}r=r||t};for(var b=function(e){e+=this.graph.panDy;var t=!1;if(Math.abs(e-h)<c?(s=e-a.getCenterY(),c=Math.abs(e-h),t=!0):Math.abs(e-g)<c?(s=e-a.y,c=Math.abs(e-g),t=!0):Math.abs(e-v)<c&&(s=e-a.y-a.height,c=Math.abs(e-v),t=!0),t){null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()));var n=this.graph.container;e-=this.graph.panDy,this.guideY.points=[new mxPoint(-this.graph.panDx,e),new mxPoint(n.scrollWidth-3-this.graph.panDx,e)]}l=l||t},f=0;f<this.states.length;f++){var A=this.states[f];null!=A&&(this.horizontal&&(e.call(this,A.getCenterX()),e.call(this,A.x),e.call(this,A.x+A.width)),this.vertical&&(b.call(this,A.getCenterY()),b.call(this,A.y),b.call(this,A.y+A.height)))}r||null==this.guideX?null!=this.guideX&&(this.guideX.node.style.visibility="visible",this.guideX.redraw()):this.guideX.node.style.visibility="hidden",l||null==this.guideY?null!=this.guideY&&(this.guideY.node.style.visibility="visible",this.guideY.redraw()):this.guideY.node.style.visibility="hidden",t&&(r||(t=a.x-(this.graph.snap(a.x/i-n.x)+n.x)*i,o=this.graph.snap(o/i)*i-t),l||(n=a.y-(this.graph.snap(a.y/i-n.y)+n.y)*i,s=this.graph.snap(s/i)*i-n)),e=new mxPoint(o,s)}return e},mxGuide.prototype.hide=function(){null!=this.guideX&&(this.guideX.node.style.visibility="hidden"),null!=this.guideY&&(this.guideY.node.style.visibility="hidden")},mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null),null!=this.guideY&&(this.guideY.destroy(),this.guideY=null)},mxStencil.defaultLocalized=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var e=this.desc.getAttribute("aspect");this.aspect=null!=e?e:"variable",e=this.desc.getAttribute("strokewidth"),this.strokewidth=null!=e?e:"1"},mxStencil.prototype.parseConstraints=function(){var e=this.desc.getElementsByTagName("connections")[0];if(null!=e&&(null!=(e=mxUtils.getChildNodes(e))&&0<e.length)){this.constraints=[];for(var t=0;t<e.length;t++)this.constraints.push(this.parseConstraint(e[t]))}},mxStencil.prototype.parseConstraint=function(e){var t=Number(e.getAttribute("x")),n=Number(e.getAttribute("y"));return e="1"==e.getAttribute("perimeter"),new mxConnectionConstraint(new mxPoint(t,n),e)},mxStencil.prototype.evaluateTextAttribute=function(e,t,n){return t=this.evaluateAttribute(e,t,n),e=e.getAttribute("localized"),(mxStencil.defaultLocalized&&null==e||"1"==e)&&(t=mxResources.get(t)),t},mxStencil.prototype.evaluateAttribute=function(e,t,n){return null==(t=e.getAttribute(t))&&(null!=(e=mxUtils.getTextContent(e))&&("function"==typeof(e=mxUtils.eval(e))&&(t=e(n)))),t},mxStencil.prototype.drawShape=function(e,t,n,a,i,o){this.drawChildren(e,t,n,a,i,o,this.bgNode,!1),this.drawChildren(e,t,n,a,i,o,this.fgNode,!0)},mxStencil.prototype.drawChildren=function(e,t,n,a,i,o,s,r){if(null!=s){var l=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,null);for(n=this.computeAspect(t.style,n,a,i,o,l),a=Math.min(n.width,n.height),a="inherit"==this.strokewidth?Number(mxUtils.getNumber(t.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*a,e.setStrokeWidth(a),s=s.firstChild;null!=s;)s.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,t,s,n,r),s=s.nextSibling}},mxStencil.prototype.computeAspect=function(e,t,n,a,i,o){e=t,t=a/this.w0;var s=i/this.h0;if(o="north"==o||"south"==o){s=a/this.h0,t=i/this.w0;var r=(a-i)/2;e+=r,n-=r}return"fixed"==this.aspect&&(t=s=Math.min(t,s),o?(e+=(i-this.w0*t)/2,n+=(a-this.h0*s)/2):(e+=(a-this.w0*t)/2,n+=(i-this.h0*s)/2)),new mxRectangle(e,n,t,s)},mxStencil.prototype.drawNode=function(e,t,n,a,i){var o=n.nodeName,s=a.x,r=a.y,l=a.width,d=a.height,c=Math.min(l,d);if("save"==o)e.save();else if("restore"==o)e.restore();else if("path"==o)for(e.begin(),n=n.firstChild;null!=n;)n.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,t,n,a,i),n=n.nextSibling;else if("close"==o)e.close();else if("move"==o)e.moveTo(s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d);else if("line"==o)e.lineTo(s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d);else if("quad"==o)e.quadTo(s+Number(n.getAttribute("x1"))*l,r+Number(n.getAttribute("y1"))*d,s+Number(n.getAttribute("x2"))*l,r+Number(n.getAttribute("y2"))*d);else if("curve"==o)e.curveTo(s+Number(n.getAttribute("x1"))*l,r+Number(n.getAttribute("y1"))*d,s+Number(n.getAttribute("x2"))*l,r+Number(n.getAttribute("y2"))*d,s+Number(n.getAttribute("x3"))*l,r+Number(n.getAttribute("y3"))*d);else if("arc"==o)e.arcTo(Number(n.getAttribute("rx"))*l,Number(n.getAttribute("ry"))*d,Number(n.getAttribute("x-axis-rotation")),Number(n.getAttribute("large-arc-flag")),Number(n.getAttribute("sweep-flag")),s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d);else if("rect"==o)e.rect(s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,Number(n.getAttribute("w"))*l,Number(n.getAttribute("h"))*d);else if("roundrect"==o)0==(t=n.getAttribute("arcsize"))&&(t=100*mxConstants.RECTANGLE_ROUNDING_FACTOR),c=Number(n.getAttribute("w"))*l,a=Number(n.getAttribute("h"))*d,t=Number(t)/100,t=Math.min(c*t,a*t),e.roundrect(s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,c,a,t,t);else if("ellipse"==o)e.ellipse(s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,Number(n.getAttribute("w"))*l,Number(n.getAttribute("h"))*d);else if("image"==o)t=this.evaluateAttribute(n,"src",t),e.image(s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,Number(n.getAttribute("w"))*l,Number(n.getAttribute("h"))*d,t,!1,"1"==n.getAttribute("flipH"),"1"==n.getAttribute("flipV"));else if("text"==o){if(c=this.evaluateTextAttribute(n,"str",t),a="1"==n.getAttribute("vertical")?-90:0,"0"==n.getAttribute("align-shape")){var m=t.rotation,u=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0);t=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0),a=u&&t?a-m:u||t?a+m:a-m}a-=n.getAttribute("rotation"),e.text(s+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,0,0,c,n.getAttribute("align")||"left",n.getAttribute("valign")||"top",!1,"",!1,!1,a)}else if("include-shape"==o)null!=(m=mxStencilRegistry.getStencil(n.getAttribute("name")))&&(s+=Number(n.getAttribute("x"))*l,r+=Number(n.getAttribute("y"))*d,c=Number(n.getAttribute("w"))*l,a=Number(n.getAttribute("h"))*d,m.drawShape(e,t,s,r,c,a));else if("fillstroke"==o)e.fillAndStroke();else if("fill"==o)e.fill();else if("stroke"==o)e.stroke();else if("strokewidth"==o)e.setStrokeWidth(Number(n.getAttribute("width"))*c);else if("dashed"==o)e.setDashed("1"==n.getAttribute("dashed"));else if("dashpattern"==o){if(null!=(n=n.getAttribute("pattern"))){for(n=n.split(" "),l=[],d=0;d<n.length;d++)0<n[d].length&&l.push(Number(n[d])*c);n=l.join(" "),e.setDashPattern(n)}}else"strokecolor"==o?e.setStrokeColor(n.getAttribute("color")):"linecap"==o?e.setLineCap(n.getAttribute("cap")):"linejoin"==o?e.setLineJoin(n.getAttribute("join")):"miterlimit"==o?e.setMiterLimit(Number(n.getAttribute("limit"))):"fillcolor"==o?e.setFillColor(n.getAttribute("color")):"alpha"==o?e.setAlpha(n.getAttribute("alpha")):"fontcolor"==o?e.setFontColor(n.getAttribute("color")):"fontstyle"==o?e.setFontStyle(n.getAttribute("style")):"fontfamily"==o?e.setFontFamily(n.getAttribute("family")):"fontsize"==o&&e.setFontSize(Number(n.getAttribute("size"))*c);i&&("fillstroke"==o||"fill"==o||"stroke"==o)&&e.setShadow(!1)},mxShape.prototype.dialect=null,mxShape.prototype.scale=1,mxShape.prototype.bounds=null,mxShape.prototype.points=null,mxShape.prototype.node=null,mxShape.prototype.style=null,mxShape.prototype.style=null,mxShape.prototype.boundingBox=null,mxShape.prototype.stencil=null,mxShape.prototype.svgStrokeTolerance=6,mxShape.prototype.pointerEvents=!0,mxShape.prototype.stencilPointerEvents=!1,mxShape.prototype.vmlScale=1,mxShape.prototype.init=function(e){null==this.node&&(this.node=this.create(e),null!=e&&e.appendChild(this.node))},mxShape.prototype.isParseVml=function(){return!0},mxShape.prototype.isHtmlAllowed=function(){return!1},mxShape.prototype.getSvgScreenOffset=function(){return 1==mxUtils.mod(Math.max(1,Math.round(this.strokewidth*this.scale)),2)?.5:0},mxShape.prototype.create=function(e){return null!=e.ownerSVGElement?this.createSvg(e):8==document.documentMode||this.dialect==mxConstants.DIALECT_SVG||this.dialect!=mxConstants.DIALECT_VML&&this.isHtmlAllowed()?this.createHtml(e):this.createVml(e)},mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")},mxShape.prototype.createVml=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e},mxShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxShape.prototype.reconfigure=function(){this.redraw()},mxShape.prototype.redraw=function(){this.updateBoundsFromPoints(),this.checkBounds()?(this.node.style.visibility="","DIV"==this.node.nodeName&&this.isHtmlAllowed()?this.redrawHtmlShape():this.redrawShape(),this.updateBoundingBox()):(this.node.style.visibility="hidden",this.boundingBox=null)},mxShape.prototype.updateBoundsFromPoints=function(){var e=this.points;if(null!=e&&0<e.length&&null!=e[0]){this.bounds=new mxRectangle(Number(e[0].x),Number(e[0].y),1,1);for(var t=1;t<this.points.length;t++)null!=e[t]&&this.bounds.add(new mxRectangle(Number(e[t].x),Number(e[t].y),1,1))}},mxShape.prototype.checkBounds=function(){return null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height},mxShape.prototype.createVmlGroup=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e.style.width=this.node.style.width,e.style.height=this.node.style.height,e},mxShape.prototype.redrawShape=function(){var e=this.createCanvas();for(e.pointerEvents=this.pointerEvents;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);this.paint(e),this.node!=e.root&&this.node.insertAdjacentHTML("beforeend",e.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",(null==this.stencil||!this.stencilPointerEvents)&&mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(e)},mxShape.prototype.createCanvas=function(){var e=null,t=null;if(null!=this.node.ownerSVGElement)(e=new mxSvgCanvas2D(this.node,!1)).strokeTolerance=this.svgStrokeTolerance,e.blockImagePointerEvents=mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC,0!=(t=this.getSvgScreenOffset())?this.node.setAttribute("transform","translate("+t+","+t+")"):this.node.removeAttribute("transform");else{this.updateVmlContainer();var n=Math.max(1,Math.round(this.bounds.width)),a=Math.max(1,Math.round(this.bounds.height));t=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t,!1);""!=t.tagUrn&&(t.coordsize=n*this.vmlScale+","+a*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale),t=this.scale,e.translate(-Math.round(this.bounds.x/t),-Math.round(this.bounds.y/t))}return e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var e=Math.max(1,Math.round(this.bounds.width)),t=Math.max(1,Math.round(this.bounds.height));this.node.style.width=e+"px",this.node.style.height=t+"px",this.node.style.overflow="visible"},mxShape.prototype.destroyCanvas=function(e){if(e instanceof mxSvgCanvas2D){for(var t in e.gradients){var n=e.gradients[t];n.mxRefCount=(n.mxRefCount||0)+1}this.releaseSvgGradients(this.oldGradients),this.oldGradients=e.gradients}},mxShape.prototype.paint=function(e){var t=this.scale,n=this.bounds.x/t,a=this.bounds.y/t,i=this.bounds.width/t,o=this.bounds.height/t;if(this.isPaintBoundsInverted()){n=n+(s=(i-o)/2),a=a-s;var s=i;i=o,o=s}if(this.updateTransform(e,n,a,i,o),this.configureCanvas(e,n,a,i,o),null!=this.stencil)this.paintStencilShape(e,n,a,i,o);else if(e.setStrokeWidth(this.strokewidth),null!=this.points){for(n=[],a=0;a<this.points.length;a++)n.push(new mxPoint(this.points[a].x/t,this.points[a].y/t));this.paintEdgeShape(e,n)}else this.paintVertexShape(e,n,a,i,o)},mxShape.prototype.configureCanvas=function(e,t,n,a,i){var o=null;null!=this.style&&(o=this.style.dashPattern),e.setAlpha(this.opacity/100),null!=this.isShadow&&e.setShadow(this.isShadow),null!=this.isDashed&&e.setDashed(this.isDashed),null!=o&&e.setDashPattern(o),null!=this.gradient?(t=this.getGradientBounds(e,t,n,a,i),e.setGradient(this.fill,this.gradient,t.x,t.y,t.width,t.height,this.gradientDirection)):e.setFillColor(this.fill),e.setStrokeColor(this.stroke)},mxShape.prototype.getGradientBounds=function(e,t,n,a,i){return new mxRectangle(t,n,a,i)},mxShape.prototype.updateTransform=function(e,t,n,a,i){e.scale(this.scale),e.rotate(this.getShapeRotation(),this.flipH,this.flipV,t+a/2,n+i/2)},mxShape.prototype.paintStencilShape=function(e,t,n,a,i){this.stencilPointerEvents&&(this.dialect==mxConstants.DIALECT_SVG?this.addTransparentBackgroundRectangle(this.node,t,n,a,i):8!=document.documentMode&&this.setTransparentBackgroundImage(this.node)),this.stencil.drawShape(e,this,t,n,a,i)},mxShape.prototype.paintVertexShape=function(e,t,n,a,i){this.paintBackground(e,t,n,a,i),e.setShadow(!1),this.paintForeground(e,t,n,a,i)},mxShape.prototype.paintBackground=function(e,t,n,a,i){},mxShape.prototype.paintForeground=function(e,t,n,a,i){},mxShape.prototype.paintEdgeShape=function(e,t){},mxShape.prototype.getArcSize=function(e,t){var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;return Math.min(e*n,t*n)},mxShape.prototype.paintGlassEffect=function(e,t,n,a,i,o){var s=Math.ceil(this.strokewidth/2);e.setGradient("#ffffff","#ffffff",t,n,a,.6*i,"south",.9,.1),e.begin(),o+=2*s,this.isRounded?(e.moveTo(t-s+o,n-s),e.quadTo(t-s,n-s,t-s,n-s+o),e.lineTo(t-s,n+.4*i),e.quadTo(t+.5*a,n+.7*i,t+a+s,n+.4*i),e.lineTo(t+a+s,n-s+o),e.quadTo(t+a+s,n-s,t+a+s-o,n-s)):(e.moveTo(t-s,n-s),e.lineTo(t-s,n+.4*i),e.quadTo(t+.5*a,n+.7*i,t+a+s,n+.4*i),e.lineTo(t+a+s,n-s)),e.close(),e.fill()},mxShape.prototype.apply=function(e){this.state=e,this.style=e.style,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill),this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient),this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke),this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth),this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing),this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,this.startSize),this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize),this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow),this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow),this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation),this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction),this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV),"north"!=this.direction&&"south"!=this.direction||(e=this.flipH,this.flipH=this.flipV,this.flipV=e),this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow),this.isDashed=1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed),this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded),this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass),"none"==this.fill&&(this.fill=null),"none"==this.gradient&&(this.gradient=null),"none"==this.stroke&&(this.stroke=null))},mxShape.prototype.setCursor=function(e){null==e&&(e=""),this.cursor=e,null!=this.node&&(this.node.style.cursor=e)},mxShape.prototype.getCursor=function(){return this.cursor},mxShape.prototype.updateBoundingBox=function(){if(null!=this.bounds){var e=this.createBoundingBox();if(null!=e){this.augmentBoundingBox(e);var t=this.getShapeRotation();0!=t&&(e=mxUtils.getBoundingBox(e,t)),e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.ceil(e.width),e.height=Math.ceil(e.height)}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var e=this.bounds.clone();if(this.isPaintBoundsInverted()){var t=(e.width-e.height)/2;e.x+=t,e.y-=t,t=e.width,e.width=e.height,e.height=t}return e},mxShape.prototype.augmentBoundingBox=function(e){this.isShadow&&(e.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),e.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale));var t=Math.ceil(this.strokewidth*this.scale);e.grow(Math.ceil(t/2))},mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&("north"==this.direction||"south"==this.direction)},mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0},mxShape.prototype.getTextRotation=function(){var e=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxShape.prototype.getShapeRotation=function(){var e=this.getRotation();return null!=this.direction&&("north"==this.direction?e+=270:"west"==this.direction?e+=180:"south"==this.direction&&(e+=90)),e},mxShape.prototype.addTransparentBackgroundRectangle=function(e,t,n,a,i){(e=document.createElementNS(mxConstants.NS_SVG,"rect")).setAttribute("x",t),e.setAttribute("y",n),e.setAttribute("width",a),e.setAttribute("height",i),e.setAttribute("fill","none"),e.setAttribute("stroke","none"),e.setAttribute("pointer-events","all"),this.node.appendChild(e)},mxShape.prototype.setTransparentBackgroundImage=function(e){e.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(e){if(null!=e)for(var t in e){var n=e[t];n.mxRefCount=(n.mxRefCount||0)-1,0==n.mxRefCount&&null!=n.parentNode&&n.parentNode.removeChild(n)}},mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null};var mxStencilRegistry={stencils:[],addStencil:function(e,t){mxStencilRegistry.stencils[e]=t},getStencil:function(e){return mxStencilRegistry.stencils[e]}},mxMarker={markers:[],addMarker:function(e,t){mxMarker.markers[e]=t},createMarker:function(e,t,n,a,i,o,s,r,l,d){var c=mxMarker.markers[n];return null!=c?c(e,t,n,a,i,o,s,r,l,d):null}};function mxActor(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxCloud(e,t,n,a){mxActor.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxRectangleShape(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxEllipse(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxDoubleEllipse(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxRhombus(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxPolyline(e,t,n){mxShape.call(this),this.points=e,this.stroke=t,this.strokewidth=null!=n?n:1}function mxArrow(e,t,n,a,i,o,s){mxShape.call(this),this.points=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1,this.arrowWidth=null!=i?i:mxConstants.ARROW_WIDTH,this.spacing=null!=o?o:mxConstants.ARROW_SPACING,this.endSize=null!=s?s:mxConstants.ARROW_SIZE}function mxText(e,t,n,a,i,o,s,r,l,d,c,m,u,p,g,v,h,b,f,A){mxShape.call(this),this.value=e,this.bounds=t,this.color=null!=i?i:"black",this.align=null!=n?n:"",this.valign=null!=a?a:"",this.family=null!=o?o:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=s?s:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=r?r:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(l||2),this.spacingTop=this.spacing+parseInt(d||0),this.spacingRight=this.spacing+parseInt(c||0),this.spacingBottom=this.spacing+parseInt(m||0),this.spacingLeft=this.spacing+parseInt(u||0),this.horizontal=null==p||p,this.background=g,this.border=v,this.wrap=null!=h&&h,this.clipped=null!=b&&b,this.overflow=null!=f?f:"visible",this.labelPadding=null!=A?A:0,this.rotation=0}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(e,t,n){mxShape.call(this),this.bounds=e,this.stroke=t,this.strokewidth=null!=n?n:1}function mxImageShape(e,t,n,a,i){mxShape.call(this),this.bounds=e,this.image=t,this.fill=n,this.stroke=a,this.strokewidth=null!=i?i:1,this.shadow=!1}function mxLabel(e,t,n,a){mxRectangleShape.call(this,e,t,n,a)}function mxCylinder(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxConnector(e,t,n){mxPolyline.call(this,e,t,n)}function mxSwimlane(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxGraphLayout(e){this.graph=e}function mxStackLayout(e,t,n,a,i,o){mxGraphLayout.call(this,e),this.horizontal=null==t||t,this.spacing=null!=n?n:0,this.x0=null!=a?a:0,this.y0=null!=i?i:0,this.border=null!=o?o:0}function mxPartitionLayout(e,t,n,a){mxGraphLayout.call(this,e),this.horizontal=null==t||t,this.spacing=n||0,this.border=a||0}function mxCompactTreeLayout(e,t,n){mxGraphLayout.call(this,e),this.horizontal=null==t||t,this.invert=null!=n&&n}function WeightedCellSorter(e,t){this.cell=e,this.weightedValue=t}function mxFastOrganicLayout(e){mxGraphLayout.call(this,e)}function mxCircleLayout(e,t){mxGraphLayout.call(this,e),this.radius=null!=t?t:100}function mxParallelEdgeLayout(e){mxGraphLayout.call(this,e)}function mxCompositeLayout(e,t,n){mxGraphLayout.call(this,e),this.layouts=t,this.master=n}function mxEdgeLabelLayout(e,t){mxGraphLayout.call(this,e)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=e}function mxGraphHierarchyEdge(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.edges=e}function mxGraphHierarchyModel(e,t,n,a,i){for(e.getGraph(),this.tightenToSource=i,this.roots=n,this.parent=a,this.vertexMapper={},this.edgeMapper={},this.maxRank=0,n=[],null==t&&(t=this.graph.getChildVertices(a)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(e,t,n),a=0;a<t.length;a++){i=n[a].connectsAsSource;for(var o=0;o<i.length;o++){var s=i[o];if(null!=(r=s.edges)&&0<r.length){var r=r[0],l=e.getVisibleTerminal(r,!1);l=mxCellPath.create(l),l=this.vertexMapper[l];n[a]==l&&(l=e.getVisibleTerminal(r,!0),l=mxCellPath.create(l),l=this.vertexMapper[l]),null!=l&&n[a]!=l&&(0==(s.target=l).connectsAsTarget.length&&(l.connectsAsTarget=[]),mxUtils.indexOf(l.connectsAsTarget,s)<0&&l.connectsAsTarget.push(s))}}n[a].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(e){this.layout=e}function MedianCellSorter(){}function mxMinimumCycleRemover(e){this.layout=e}function mxCoordinateAssignment(e,t,n,a,i,o){this.layout=e,this.intraCellSpacing=t,this.interRankCellSpacing=n,this.orientation=a,this.initialX=i,this.parallelEdgeSpacing=o}!function(){function e(e,t,n,a,i,o,s,r,l,d){t=1.118*i*l,r=1.118*o*l,i*=s+l,o*=s+l;var c=a.clone();return c.x-=t,c.y-=r,s=n!=mxConstants.ARROW_CLASSIC?1:.75,a.x+=-i*s-t,a.y+=-o*s-r,function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i-o/2,c.y-o+i/2),n==mxConstants.ARROW_CLASSIC&&e.lineTo(c.x-3*i/4,c.y-3*o/4),e.lineTo(c.x+o/2-i,c.y-o-i/2),e.close(),d?e.fillAndStroke():e.stroke()}}function t(e,t,n,a,i,o,s,r,l,d){r=n==mxConstants.ARROW_DIAMOND?.7071:.9862,t=i*l*r,r*=o*l,i*=s+l,o*=s+l;var c=a.clone();c.x-=t,c.y-=r,a.x+=-i-t,a.y+=-o-r;var m=n==mxConstants.ARROW_DIAMOND?2:3.4;return function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i/2-o/m,c.y+i/m-o/2),e.lineTo(c.x-i,c.y-o),e.lineTo(c.x-i/2+o/m,c.y-o/2-i/m),e.close(),d?e.fillAndStroke():e.stroke()}}mxMarker.addMarker("classic",e),mxMarker.addMarker("block",e),mxMarker.addMarker("open",function(e,t,n,a,i,o,s,r,l,d){t=1.118*i*l,n=1.118*o*l,i*=s+l,o*=s+l;var c=a.clone();return c.x-=t,c.y-=n,a.x+=2*-t,a.y+=2*-n,function(){e.begin(),e.moveTo(c.x-i-o/2,c.y-o+i/2),e.lineTo(c.x,c.y),e.lineTo(c.x+o/2-i,c.y-o-i/2),e.stroke()}}),mxMarker.addMarker("oval",function(e,t,n,a,i,o,s,r,l,d){var c=s/2,m=a.clone();return a.x-=i*c,a.y-=o*c,function(){e.ellipse(m.x-c,m.y-c,s,s),d?e.fillAndStroke():e.stroke()}}),mxMarker.addMarker("diamond",t),mxMarker.addMarker("diamondThin",t)}(),mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(e,t,n,a,i){e.translate(t,n),e.begin(),this.redrawPath(e,t,n,a,i),e.fillAndStroke()},mxActor.prototype.redrawPath=function(e,t,n,a,i){t=a/3,e.moveTo(0,i),e.curveTo(0,3*i/5,0,2*i/5,a/2,2*i/5),e.curveTo(a/2-t,2*i/5,a/2-t,0,a/2,0),e.curveTo(a/2+t,0,a/2+t,2*i/5,a/2,2*i/5),e.curveTo(a,2*i/5,a,3*i/5,a,i),e.close()},mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(e,t,n,a,i){e.moveTo(.25*a,.25*i),e.curveTo(.05*a,.25*i,0,.5*i,.16*a,.55*i),e.curveTo(0,.66*i,.18*a,.9*i,.31*a,.8*i),e.curveTo(.4*a,i,.7*a,i,.8*a,.8*i),e.curveTo(a,.8*i,a,.6*i,.875*a,.5*i),e.curveTo(a,.3*i,.8*a,.1*i,.625*a,.2*i),e.curveTo(.5*a,.05*i,.3*a,.05*i,.25*a,.25*i),e.close()},mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.isRounded&&!this.glass&&0==this.rotation},mxRectangleShape.prototype.paintBackground=function(e,t,n,a,i){if(this.isRounded){var o=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;o=Math.min(a*o,i*o);e.roundrect(t,n,a,i,o,o)}else e.rect(t,n,a,i);e.fillAndStroke()},mxRectangleShape.prototype.paintForeground=function(e,t,n,a,i){this.glass&&this.paintGlassEffect(e,t,n,a,i,this.getArcSize(a+this.strokewidth,i+this.strokewidth))},mxRectangleShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxRectangleShape.prototype.updateHtmlBounds=function(e){var t=9<=document.documentMode?0:Math.ceil(this.strokewidth*this.scale);e.style.borderWidth=Math.max(1,t)+"px",e.style.overflow="hidden",e.style.left=Math.round(this.bounds.x-t/2)+"px",e.style.top=Math.round(this.bounds.y-t/2)+"px","CSS1Compat"==document.compatMode&&(t=-t),e.style.width=Math.round(Math.max(0,this.bounds.width+t))+"px",e.style.height=Math.round(Math.max(0,this.bounds.height+t))+"px"},mxRectangleShape.prototype.updateHtmlColors=function(e){var t=this.stroke;null!=t&&t!=mxConstants.NONE?(e.style.borderColor=t,this.isDashed?e.style.borderStyle="dashed":0<this.strokewidth&&(e.style.borderStyle="solid"),e.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):e.style.borderWidth="0px",null!=(t=this.fill)&&t!=mxConstants.NONE?(e.style.backgroundColor=t,e.style.backgroundImage="none"):this.pointerEvents?e.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(e):this.setTransparentBackgroundImage(e)},mxRectangleShape.prototype.updateHtmlFilters=function(e){var t="";if(this.opacity<100&&(t+="alpha(opacity="+this.opacity+")"),this.isShadow&&(t+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.SHADOWCOLOR+"')"),this.gradient){var n=this.fill,a=this.gradient,i="0",o={east:0,south:1,west:2,north:3},s=null!=this.direction?o[this.direction]:0;null!=this.gradientDirection&&(s=mxUtils.mod(s+o[this.gradientDirection]-1,4)),1==s?(i="1",o=n,n=a,a=o):2==s?(o=n,n=a,a=o):3==s&&(i="1"),t+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+n+"', endColorStr='"+a+"', gradientType='"+i+"')"}e.style.filter=t},mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(e,t,n,a,i){e.ellipse(t,n,a,i),e.fillAndStroke()},mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(e,t,n,a,i){e.ellipse(t,n,a,i),e.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(e,t,n,a,i){var o=Math.min(4,Math.min(a/5,i/5));i-=2*o,0<(a-=2*o)&&0<i&&e.ellipse(t+o,n+o,a,i),e.stroke()},mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.paintVertexShape=function(e,t,n,a,i){var o=a/2,s=i/2;e.begin(),e.moveTo(t+o,n),e.lineTo(t+a,n+s),e.lineTo(t+o,n+i),e.lineTo(t,n+s),e.close(),e.fillAndStroke()},mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.paintEdgeShape=function(e,t){this.paintLine(e,t,this.isRounded)},mxPolyline.prototype.paintLine=function(e,t,n){var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,i=t[0],o=t[t.length-1];e.begin(),e.moveTo(i.x,i.y);for(var s=1;s<t.length-1;s++){var r=t[s],l=i.x-r.x;i=i.y-r.y;if(n&&s<t.length-1&&(0!=l||0!=i)){var d=Math.sqrt(l*l+i*i);l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d;e.lineTo(r.x+l,r.y+i),l=(i=t[s+1]).x-r.x,i=i.y-r.y,d=Math.max(1,Math.sqrt(l*l+i*i)),l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d,l=r.x+l,i=r.y+i,e.quadTo(r.x,r.y,l,i),r=new mxPoint(l,i)}else e.lineTo(r.x,r.y);i=r}e.lineTo(o.x,o.y),e.stroke()},mxUtils.extend(mxArrow,mxShape),mxArrow.prototype.paintEdgeShape=function(e,t){var n=mxConstants.ARROW_SPACING,a=mxConstants.ARROW_WIDTH,i=mxConstants.ARROW_SIZE,o=t[0],s=t[t.length-1],r=s.x-o.x,l=s.y-o.y,d=(c=Math.sqrt(r*r+l*l))-2*n-i,c=(r=r/c,a*(l=l/c)/3),m=(a=-a*r/3,(i=o.x-c/2+n*r)+c),u=(o=o.y-a/2+n*l)+a,p=m+d*r,g=p+c,v=(d=u+d*l)+a,h=g-3*c,b=v-3*a;e.begin(),e.moveTo(i,o),e.lineTo(m,u),e.lineTo(p,d),e.lineTo(g,v),e.lineTo(s.x-n*r,s.y-n*l),e.lineTo(h,b),e.lineTo(h+c,b+a),e.close(),e.fillAndStroke()},mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!(null==this.bounds||isNaN(this.bounds.x)||isNaN(this.bounds.y)||isNaN(this.bounds.width)||isNaN(this.bounds.height))},mxText.prototype.updateBoundingBox=function(){var e=this.node;8==document.documentMode&&null!=e.firstChild&&(null!=(e=e.firstChild).firstChild&&(e=e.firstChild)),this.boundingBox=this.bounds.clone();var t=this.getTextRotation();if(this.ignoreStringSize||null==e||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize)this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height;else{var n=null,a=null;if(null!=e.ownerSVGElement)if(null!=e.firstChild&&null!=e.firstChild.firstChild&&"foreignObject"==e.firstChild.firstChild.nodeName)e=e.firstChild.firstChild,n=this.wrap?this.bounds.width:parseInt(e.getAttribute("width"))*this.scale,a=parseInt(e.getAttribute("height"))*this.scale;else{if(0==(t=e.getBBox()).width&&0==t.height)return;this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),t=0}else a=this.state.view.textDiv,null!=this.offsetWidth&&null!=this.offsetHeight?(n=this.wrap?this.bounds.width:this.offsetWidth*this.scale,a=this.offsetHeight*this.scale):null!=a?(this.updateFont(a),this.updateSize(a),mxUtils.isNode(this.value)?a.innerHTML=this.value.outerHTML:(n=this.replaceLinefeeds?this.value.replace(/\n/g,"<br/>"):this.value,a.innerHTML=n),n=this.wrap?this.bounds.width:a.offsetWidth*this.scale,a=a.offsetHeight*this.scale):(n=this.wrap?this.bounds.width:e.offsetWidth*this.scale,a=e.offsetHeight*this.scale);null!=n&&null!=a&&(this.boundingBox=new mxRectangle(this.bounds.x+this.margin.x*n,this.bounds.y+this.margin.y*a,n,a))}null!=this.boundingBox&&(0!=t&&(t=mxUtils.getBoundingBox(this.boundingBox,t),this.boundingBox.x=t.x,this.boundingBox.y=t.y,mxClient.IS_QUIRKS||(this.boundingBox.width=t.width,this.boundingBox.height=t.height)),this.boundingBox.x=Math.floor(this.boundingBox.x),this.boundingBox.y=Math.floor(this.boundingBox.y),this.boundingBox.width=Math.ceil(this.boundingBox.width),this.boundingBox.height=Math.ceil(this.boundingBox.height))},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(e,t,n,a,i){mxShape.prototype.configureCanvas.apply(this,arguments),e.setFontColor(this.color),e.setFontBackgroundColor(this.background),e.setFontBorderColor(this.border),e.setFontFamily(this.family),e.setFontSize(this.size),e.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.paint=function(e){var t=this.scale,n=this.bounds.x/t,a=this.bounds.y/t,i=this.bounds.width/t;t=this.bounds.height/t;this.updateTransform(e,n,a,i,t),this.configureCanvas(e,n,a,i,t);var o=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,s=o||e instanceof mxVmlCanvas2D?"html":"",r=this.value;!o&&"html"==s&&(r=mxUtils.htmlEntities(r,!1)),r=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==s?r.replace(/\n/g,"<br/>"):r,e.text(n,a,i,t,r,this.align,this.valign,this.wrap,s,"fill"==this.overflow,this.clipped,this.getTextRotation())},mxText.prototype.redrawHtmlShape=function(){var e=this.node.style;e.opacity=this.opacity<1?this.opacity:"",e.overflow="",e.width="",e.height="",this.updateFont(this.node),this.updateSize(this.node),this.updateValue(),this.offsetHeight=this.offsetWidth=null,null!=mxClient.CSS_PREFIX?this.updateHtmlTransform():this.updateHtmlFilter()},mxText.prototype.updateHtmlTransform=function(){var e=this.getTextRotation(),t=this.node.style,n=this.margin.x,a=this.margin.y;0!=e?(t[mxClient.CSS_PREFIX+"TransformOrigin"]=100*-n+"% "+100*-a+"%",t[mxClient.CSS_PREFIX+"Transform"]="translate("+100*n+"%,"+100*a+"%)scale("+this.scale+") rotate("+e+"deg)"):(t[mxClient.CSS_PREFIX+"TransformOrigin"]="0% 0%",t[mxClient.CSS_PREFIX+"Transform"]="scale("+this.scale+")translate("+100*n+"%,"+100*a+"%)"),t.left=Math.round(this.bounds.x)+"px",t.top=Math.round(this.bounds.y)+"px"},mxText.prototype.updateHtmlFilter=function(){var e=this.node.style,t=this.margin.x,n=this.margin.y,a=this.scale;e.filter="";var i=0,o=0;if(null!=(r=null!=this.state?this.state.view.textDiv:null)){if(r.style.overflow="",r.style.height="",r.style.width="",this.updateFont(r),this.updateSize(r),mxUtils.isNode(this.value))r.innerHTML=this.value.outerHTML;else{var s=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(s=mxUtils.htmlEntities(s,!1)),s=this.replaceLinefeeds?s.replace(/\n/g,"<br/>"):s,r.innerHTML=s}i=r.offsetWidth+2,o=r.offsetHeight+2}else i=this.node.offsetWidth,o=this.node.offsetHeight+1;this.offsetWidth=i,this.offsetHeight=o,r=this.bounds.width/a,s=this.bounds.height/a,mxClient.IS_QUIRKS&&(this.clipped||"fill"==this.overflow)&&0<s?(s=Math.min(s,o),e.height=Math.round(s+1)+"px"):s=o,"fill"!=this.overflow&&(mxClient.IS_QUIRKS&&(this.clipped||this.wrap)&&0<r?(r=Math.min(r,i),e.width=Math.round(r)+"px"):r=i);s*=a;var r=r*a,l=(i=this.getTextRotation()*(Math.PI/180),o=parseFloat(parseFloat(Math.cos(i)).toFixed(8)),parseFloat(parseFloat(Math.sin(-i)).toFixed(8)));(i=i%(2*Math.PI))<0&&(i+=2*Math.PI),(i%=Math.PI)>Math.PI/2&&(i=Math.PI-i);var d=Math.cos(i),c=Math.sin(-i),m=(s-s*d+r*c)/2+l*(t=r*-(t+.5))-o*(n=s*-(n+.5));0!=i&&(e.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+o+", M12="+l+", M21="+-l+", M22="+o+", sizingMethod='auto expand')"),e.zoom=a,e.left=Math.round(this.bounds.x+((r-r*d+s*c)/2-o*t-l*n)-r/2)+"px",e.top=Math.round(this.bounds.y+m-s/2)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1));e=this.replaceLinefeeds?e.replace(/\n/g,"<br/>"):e;var t=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,n=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if(null!=t||null!=n)if("fill"==this.overflow)null!=t&&(this.node.style.backgroundColor=t),null!=n&&(this.node.style.border="1px solid "+n);else{var a="";null!=t&&(a+="background-color:"+t+";"),null!=n&&(a+="border:1px solid "+n+";"),e='<div style="zoom:1;'+a+"display:inline-block;_display:inline;padding-bottom:1px;padding-right:1px;line-height:"+this.node.style.lineHeight+'">'+e+"</div>",this.node.style.lineHeight=""}this.node.innerHTML=e}},mxText.prototype.updateFont=function(e){(e=e.style).lineHeight=Math.round(this.size*mxConstants.LINE_HEIGHT)+"px",e.fontSize=Math.round(this.size)+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,e.fontWeight=(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"",e.fontStyle=(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"",e.fontDecoration=(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE?"underline":"",e.textAlign=this.align==mxConstants.ALIGN_CENTER?"center":this.align==mxConstants.ALIGN_RIGHT?"right":"left"},mxText.prototype.updateSize=function(e){var t=Math.round(this.bounds.width/this.scale),n=Math.round(this.bounds.height/this.scale);e=e.style,this.clipped?(e.overflow="hidden",0<n&&(e.maxHeight=n+"px"),0<t&&(e.width=t+"px")):"fill"==this.overflow&&(e.width=t+"px",0<n&&(e.maxHeight=n+"px")),this.wrap?(!this.clipped&&0<t&&(e.width=t+"px"),e.whiteSpace="normal"):e.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.redrawPath=function(e,t,n,a,i){e.moveTo(0,0),e.lineTo(a,.5*i),e.lineTo(0,i),e.close()},mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(e,t,n,a,i){e.moveTo(.25*a,0),e.lineTo(.75*a,0),e.lineTo(a,.5*i),e.lineTo(.75*a,i),e.lineTo(.25*a,i),e.lineTo(0,.5*i),e.close()},mxUtils.extend(mxLine,mxShape),mxLine.prototype.paintVertexShape=function(e,t,n,a,i){n+=i/2,e.begin(),e.moveTo(t,n),e.lineTo(t+a,n),e.stroke()},mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return mxClient.IS_IE?0:.5},mxImageShape.prototype.apply=function(e){mxShape.prototype.apply.apply(this,arguments),this.gradient=this.stroke=this.fill=null,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER),this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxImageShape.prototype.paintVertexShape=function(e,t,n,a,i){if(null!=this.image){var o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null==o&&null==s||(e.setFillColor(o),e.setStrokeColor(s),e.rect(t,n,a,i),e.fillAndStroke()),e.image(t,n,a,i,this.image,this.preserveImageAspect,!1,!1)}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.style.backgroundColor=this.fill||"",this.node.style.borderColor=this.stroke||"",this.node.innerHTML="",null!=this.image){var e=document.createElement(mxClient.IS_IE6||null==mxClient.CSS_PREFIX&&0!=this.rotation?mxClient.VML_PREFIX+":image":"img");e.style.position="absolute",e.src=this.image;var t=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=t,this.flipH&&this.flipV?t+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?t+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(t+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),e.style.filter!=t&&(e.style.filter=t),"image"==e.nodeName?e.style.rotation=this.rotation:e.style[mxClient.CSS_PREFIX+"Transform"]="rotate("+this.rotation+"deg)",e.style.width=this.node.style.width,e.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(e)}else this.setTransparentBackgroundImage(this.node)},mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(e){mxShape.prototype.init.apply(this,arguments),null!=this.indicatorColor&&null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.bounds=this.bounds,this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape},mxLabel.prototype.paintForeground=function(e,t,n,a,i){this.paintImage(e,t,n,a,i),this.paintIndicator(e,t,n,a,i),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(e,t,n,a,i){null!=this.image&&(t=this.getImageBounds(t,n,a,i),e.image(t.x,t.y,t.width,t.height,this.image,!1,!1,!1))},mxLabel.prototype.getImageBounds=function(e,t,n,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),s=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),r=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return new mxRectangle(e=i==mxConstants.ALIGN_CENTER?e+(n-s)/2:i==mxConstants.ALIGN_RIGHT?e+(n-s-l):e+l,t=o==mxConstants.ALIGN_TOP?t+l:o==mxConstants.ALIGN_BOTTOM?t+(a-r-l):t+(a-r)/2,s,r)},mxLabel.prototype.paintIndicator=function(e,t,n,a,i){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(t,n,a,i),this.indicator.paint(e)):null!=this.indicatorImage&&(t=this.getIndicatorBounds(t,n,a,i),e.image(t.x,t.y,t.width,t.height,this.indicatorImage,!1,!1,!1))},mxLabel.prototype.getIndicatorBounds=function(e,t,n,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),s=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),r=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),l=this.spacing+5;return new mxRectangle(e=i==mxConstants.ALIGN_RIGHT?e+(n-s-l):i==mxConstants.ALIGN_CENTER?e+(n-s)/2:e+l,t=o==mxConstants.ALIGN_BOTTOM?t+(a-r-l):o==mxConstants.ALIGN_TOP?t+l:t+(a-r)/2,s,r)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var e=document.createElement("img");e.style.position="relative",e.setAttribute("border","0");var t=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);t.x-=this.bounds.x,t.y-=this.bounds.y,e.style.left=Math.round(t.x)+"px",e.style.top=Math.round(t.y)+"px",e.style.width=Math.round(t.width)+"px",e.style.height=Math.round(t.height)+"px",e.src=this.image,this.node.appendChild(e)}},mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(e,t,n,a,i){e.translate(t,n),e.begin(),this.redrawPath(e,t,n,a,i,!1),e.fillAndStroke(),e.setShadow(!1),e.begin(),this.redrawPath(e,t,n,a,i,!0),e.stroke()},mxCylinder.prototype.redrawPath=function(e,t,n,a,i,o){t=Math.min(this.maxHeight,Math.round(i/5)),(o&&null!=this.fill||!o&&null==this.fill)&&(e.moveTo(0,t),e.curveTo(0,2*t,a,2*t,a,t),o||(e.stroke(),e.begin())),o||(e.moveTo(0,t),e.curveTo(0,-t/3,a,-t/3,a,t),e.lineTo(a,i-t),e.curveTo(a,i+t/3,0,i+t/3,0,i-t),e.close())},mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.paintEdgeShape=function(e,t){var n=this.createMarker(e,t,!0),a=this.createMarker(e,t,!1);null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(e,t,this.isRounded):this.paintCurvedLine(e,t),e.setFillColor(this.stroke),e.setShadow(!1),e.setDashed(!1),null!=n&&n(),null!=a&&a()},mxConnector.prototype.paintCurvedLine=function(e,t){e.begin();var n=t[0],a=t.length;for(e.moveTo(n.x,n.y),n=1;n<a-2;n++){var i=t[n],o=t[n+1];e.quadTo(i.x,i.y,(i.x+o.x)/2,(i.y+o.y)/2)}i=t[a-2],o=t[a-1],e.quadTo(i.x,i.y,o.x,o.y),e.stroke()},mxConnector.prototype.createMarker=function(e,t,n){var a=t.length,i=n?t[1]:t[a-2],o=(a=(t=n?t[0]:t[a-1]).x-i.x,t.y-i.y),s=(i=a/(s=Math.max(1,Math.sqrt(a*a+o*o))),a=o/s,o=mxUtils.getNumber(this.style,n?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),mxUtils.getValue(this.style,n?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW));return mxMarker.createMarker(e,this,s,t,i,a,o,n,this.strokewidth,0!=this.style[n?mxConstants.STYLE_STARTFILL:mxConstants.STYLE_ENDFILL])},mxConnector.prototype.augmentBoundingBox=function(e){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var t=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(t=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1),mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(t=Math.max(t,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+1),e.grow(Math.ceil(t*this.scale))},mxUtils.extend(mxSwimlane,mxShape),mxSwimlane.prototype.imageSize=16,mxSwimlane.prototype.getGradientBounds=function(e,t,n,a,i){return new mxRectangle(t,n,a,Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)))},mxSwimlane.prototype.getRotation=function(){var e=mxShape.prototype.getRotation.apply(this,arguments);return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxSwimlane.prototype.getTextRotation=function(){return this.getRotation()},mxSwimlane.prototype.isPaintBoundsInverted=function(){return mxShape.prototype.isPaintBoundsInverted.apply(this,arguments)||1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)},mxSwimlane.prototype.getArcSize=function(e,t,n){return 3*n*(mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100)},mxSwimlane.prototype.paintVertexShape=function(e,t,n,a,i){var o=Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),s=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE),r=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),l=0;e.translate(t,n),this.isRounded?(l=this.getArcSize(a,i,o),this.paintRoundedSwimlane(e,t,n,a,i,o,l,s,r)):this.paintSwimlane(e,t,n,a,i,o,s,r),s=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE),this.paintSeparator(e,a,o,i,s),null!=this.image&&(i=this.getImageBounds(t,o,a,i),e.image(i.x-t,i.y-n,i.width,i.height,this.image,!1,!1,!1)),this.glass&&(e.setShadow(!1),this.paintGlassEffect(e,0,0,a,o,l))},mxSwimlane.prototype.paintSwimlane=function(e,t,n,a,i,o,s,r){s!=mxConstants.NONE&&(e.save(),e.setFillColor(s),e.rect(0,0,a,i),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(0,o),e.lineTo(0,0),e.lineTo(a,0),e.lineTo(a,o),r&&e.close(),e.fillAndStroke(),o<i&&s==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,o),e.lineTo(0,i),e.lineTo(a,i),e.lineTo(a,o),e.stroke())},mxSwimlane.prototype.paintRoundedSwimlane=function(e,t,n,a,i,o,s,r,l){r!=mxConstants.NONE&&(e.save(),e.setFillColor(r),e.roundrect(0,0,a,i,s,s),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(a,o),e.lineTo(a,s),e.quadTo(a,0,a-Math.min(a/2,s),0),e.lineTo(Math.min(a/2,s),0),e.quadTo(0,0,0,s),e.lineTo(0,o),l&&e.close(),e.fillAndStroke(),o<i&&r==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,o),e.lineTo(0,i-s),e.quadTo(0,i,Math.min(a/2,s),i),e.lineTo(a-Math.min(a/2,s),i),e.quadTo(a,i,a,i-s),e.lineTo(a,o),e.stroke())},mxSwimlane.prototype.paintSeparator=function(e,t,n,a,i){i!=mxConstants.NONE&&(e.setStrokeColor(i),e.setDashed(!0),e.begin(),e.moveTo(t,n),e.lineTo(t,a),e.stroke(),e.setDashed(!1))},mxSwimlane.prototype.getImageBounds=function(e,t,n,a){return new mxRectangle(e+n-this.imageSize,t,this.imageSize,this.imageSize)},mxGraphLayout.prototype.graph=null,mxGraphLayout.prototype.useBoundingBox=!0,mxGraphLayout.prototype.parent=null,mxGraphLayout.prototype.moveCell=function(e,t,n){},mxGraphLayout.prototype.execute=function(e){},mxGraphLayout.prototype.getGraph=function(){return this.graph},mxGraphLayout.prototype.getConstraint=function(e,t,n,a){return null!=(t=null!=(n=this.graph.view.getState(t))?n.style:this.graph.getCellStyle(t))?t[e]:null},mxGraphLayout.traverse=function(e,t,n,a,i){if(null!=n&&null!=e){t=null==t||t,i=i||[];var o=mxCellPath.create(e);if(null==i[o]&&(null==(a=n(i[o]=e,a))||a)&&0<(a=this.graph.model.getEdgeCount(e)))for(o=0;o<a;o++){var s=this.graph.model.getEdgeAt(e,o),r=this.graph.model.getTerminal(s,!0)==e;t&&!r||(r=this.graph.view.getVisibleTerminal(s,!r),this.traverse(r,t,n,s,i))}}},mxGraphLayout.prototype.isVertexMovable=function(e){return this.graph.isCellMovable(e)},mxGraphLayout.prototype.isVertexIgnored=function(e){return!this.graph.getModel().isVertex(e)||!this.graph.isCellVisible(e)},mxGraphLayout.prototype.isEdgeIgnored=function(e){var t=this.graph.getModel();return!t.isEdge(e)||!this.graph.isCellVisible(e)||null==t.getTerminal(e,!0)||null==t.getTerminal(e,!1)},mxGraphLayout.prototype.setEdgeStyleEnabled=function(e,t){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,t?"0":"1",[e])},mxGraphLayout.prototype.setOrthogonalEdge=function(e,t){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,t?"1":"0",[e])},mxGraphLayout.prototype.getParentOffset=function(e){var t=new mxPoint;if(null!=e&&e!=this.parent){var n=this.graph.getModel();if(n.isAncestor(this.parent,e))for(var a=n.getGeometry(e);e!=this.parent;)t.x+=a.x,t.y+=a.y,e=n.getParent(e),a=n.getGeometry(e)}return t},mxGraphLayout.prototype.setEdgePoints=function(e,t){if(null!=e){var n=this.graph.model,a=n.getGeometry(e);if(null==a?(a=new mxGeometry).setRelative(!0):a=a.clone(),null!=this.parent&&null!=t)for(var i=n.getParent(e),o=(i=this.getParentOffset(i),0);o<t.length;o++)t[o].x-=i.x,t[o].y-=i.y;a.points=t,n.setGeometry(e,a)}},mxGraphLayout.prototype.setVertexLocation=function(e,t,n){var a=this.graph.getModel(),i=a.getGeometry(e),o=null;if(null!=i){if(o=new mxRectangle(t,n,i.width,i.height),this.useBoundingBox){var s=this.graph.getView().getState(e);if(null!=s&&null!=s.text&&null!=s.text.boundingBox){var r=this.graph.getView().scale,l=s.text.boundingBox;s.text.boundingBox.x<s.x&&(t+=(s.x-l.x)/r,o.width=l.width),s.text.boundingBox.y<s.y&&(n+=(s.y-l.y)/r,o.height=l.height)}}null!=this.parent&&(null!=(s=a.getParent(e))&&s!=this.parent&&(t-=(s=this.getParentOffset(s)).x,n-=s.y)),i.x==t&&i.y==n||((i=i.clone()).x=t,i.y=n,a.setGeometry(e,i))}return o},mxGraphLayout.prototype.getVertexBounds=function(e){var t=this.graph.getModel().getGeometry(e);if(this.useBoundingBox&&(null!=(r=this.graph.getView().getState(e))&&null!=r.text&&null!=r.text.boundingBox)){var n=this.graph.getView().scale,a=r.text.boundingBox,i=Math.max(r.x-a.x,0)/n,o=Math.max(r.y-a.y,0)/n,s=Math.max(a.x+a.width-(r.x+r.width),0)/n,r=Math.max(a.y+a.height-(r.y+r.height),0)/n;t=new mxRectangle(t.x-i,t.y-o,t.width+i+s,t.height+o+r)}return null!=this.parent&&(e=this.graph.getModel().getParent(e),t=t.clone(),null!=e&&e!=this.parent&&(e=this.getParentOffset(e),t.x+=e.x,t.y+=e.y)),new mxRectangle(t.x,t.y,t.width,t.height)},mxGraphLayout.prototype.arrangeGroups=function(e,t){this.graph.getModel().beginUpdate();try{for(var n=e.length-1;0<=n;n--){var a=e[n],i=this.graph.getChildVertices(a),o=this.graph.getBoundingBoxFromGeometry(i),s=this.graph.getCellGeometry(a),r=0,l=0;if(this.graph.isSwimlane(a)){var d=this.graph.getStartSize(a);r=d.width,l=d.height}null!=o&&null!=s&&((s=s.clone()).x=s.x+o.x-t-r,s.y=s.y+o.y-t-l,s.width=o.width+2*t+r,s.height=o.height+2*t+l,this.graph.getModel().setGeometry(a,s),this.graph.moveCells(i,t+r-o.x,t+l-o.y))}}finally{this.graph.getModel().endUpdate()}},mxStackLayout.prototype=new mxGraphLayout,mxStackLayout.prototype.constructor=mxStackLayout,mxStackLayout.prototype.horizontal=null,mxStackLayout.prototype.spacing=null,mxStackLayout.prototype.x0=null,mxStackLayout.prototype.y0=null,mxStackLayout.prototype.border=0,mxStackLayout.prototype.keepFirstLocation=!1,mxStackLayout.prototype.fill=!1,mxStackLayout.prototype.resizeParent=!1,mxStackLayout.prototype.resizeLast=!1,mxStackLayout.prototype.wrap=null,mxStackLayout.prototype.isHorizontal=function(){return this.horizontal},mxStackLayout.prototype.moveCell=function(e,t,n){var a=this.graph.getModel(),i=a.getParent(e),o=this.isHorizontal();if(null!=e&&null!=i){var s=0,r=0,l=a.getChildCount(i);for(t=o?t:n,null!=(s=this.graph.getView().getState(i))&&(t-=o?s.x:s.y),s=0;s<l;s++)if((n=a.getChildAt(i,s))!=e&&null!=(n=a.getGeometry(n))){if(n=o?n.x+n.width/2:n.y+n.height/2,r<t&&t<n)break;r=n}o=i.getIndex(e),o=Math.max(0,s-(o<s?1:0)),a.add(i,e,o)}},mxStackLayout.prototype.getParentSize=function(e){var t=this.graph.getModel(),n=t.getGeometry(e);return null!=this.graph.container&&(null==n&&t.isLayer(e)||e==this.graph.getView().currentRoot)&&(n=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),n},mxStackLayout.prototype.execute=function(e){if(null!=e){var t=this.isHorizontal(),n=this.graph.getModel(),a=this.getParentSize(e),i=0;null!=a&&(i=t?a.height:a.width);i=i-(2*this.spacing+2*this.border);var o=this.x0+this.border,s=this.y0+this.border;if(this.graph.isSwimlane(e)){var r=this.graph.getCellStyle(e),l=mxUtils.getValue(r,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);t==(r=mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0))&&(i-=l),t?s+=l:o+=l}n.beginUpdate();try{l=0,r=null;for(var d=n.getChildCount(e),c=0;c<d;c++){var m=n.getChildAt(e,c);if(!this.isVertexIgnored(m)&&this.isVertexMovable(m)){var u=n.getGeometry(m);null!=u&&(u=u.clone(),null!=this.wrap&&null!=r&&(t&&r.x+r.width+u.width+2*this.spacing>this.wrap||!t&&r.y+r.height+u.height+2*this.spacing>this.wrap)&&(r=null,t?s+=l+this.spacing:o+=l+this.spacing,l=0),l=Math.max(l,t?u.height:u.width),null!=r?t?u.x=r.x+r.width+this.spacing:u.y=r.y+r.height+this.spacing:this.keepFirstLocation||(t?u.x=o:u.y=s),t?u.y=s:u.x=o,this.fill&&0<i&&(t?u.height=i:u.width=i),n.setGeometry(m,u),r=u)}}this.resizeParent&&null!=a&&null!=r&&!this.graph.isCellCollapsed(e)?(a=a.clone(),t?a.width=r.x+r.width+this.spacing:a.height=r.y+r.height+this.spacing,n.setGeometry(e,a)):this.resizeLast&&null!=a&&null!=r&&(t?r.width=a.width-r.x-this.spacing:r.height=a.height-r.y-this.spacing)}finally{n.endUpdate()}}},mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(e,t,n){var a=(n=this.graph.getModel()).getParent(e);if(null!=e&&null!=a){var i=0,o=0,s=n.getChildCount(a);for(i=0;i<s;i++){var r=n.getChildAt(a,i);if(null!=(r=this.getVertexBounds(r))){if(r=r.x+r.width/2,o<t&&t<r)break;o=r}}t=a.getIndex(e),t=Math.max(0,i-(t<i?1:0)),n.add(a,e,t)}},mxPartitionLayout.prototype.execute=function(e){var t=this.isHorizontal(),n=this.graph.getModel(),a=n.getGeometry(e);if(null!=this.graph.container&&(null==a&&n.isLayer(e)||e==this.graph.getView().currentRoot)&&(a=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),null!=a){for(var i=[],o=n.getChildCount(e),s=0;s<o;s++){var r=n.getChildAt(e,s);!this.isVertexIgnored(r)&&this.isVertexMovable(r)&&i.push(r)}if(0<(o=i.length)){var l=this.border,d=this.border,c=(c=t?a.height:a.width)-2*this.border;if(e=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle,c-=t?e.height:e.width,l+=e.width,d+=e.height,e=this.border+(o-1)*this.spacing,0<(a=t?(a.width-l-e)/o:(a.height-d-e)/o)){n.beginUpdate();try{for(s=0;s<o;s++){r=i[s];var m=n.getGeometry(r);null!=m&&((m=m.clone()).x=l,m.y=d,t?(this.resizeVertices&&(m.width=a,m.height=c),l+=a+this.spacing):(this.resizeVertices&&(m.height=a,m.width=c),d+=a+this.spacing),n.setGeometry(r,m))}}finally{n.endUpdate()}}}}},mxCompactTreeLayout.prototype=new mxGraphLayout,mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout,mxCompactTreeLayout.prototype.horizontal=null,mxCompactTreeLayout.prototype.invert=null,mxCompactTreeLayout.prototype.resizeParent=!0,mxCompactTreeLayout.prototype.groupPadding=10,mxCompactTreeLayout.prototype.parentsChanged=null,mxCompactTreeLayout.prototype.moveTree=!1,mxCompactTreeLayout.prototype.levelDistance=10,mxCompactTreeLayout.prototype.nodeDistance=20,mxCompactTreeLayout.prototype.resetEdges=!0,mxCompactTreeLayout.prototype.prefHozEdgeSep=5,mxCompactTreeLayout.prototype.prefVertEdgeOff=4,mxCompactTreeLayout.prototype.minEdgeJetty=8,mxCompactTreeLayout.prototype.channelBuffer=4,mxCompactTreeLayout.prototype.edgeRouting=!0,mxCompactTreeLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal},mxCompactTreeLayout.prototype.execute=function(e,t){this.parent=e;var n=this.graph.getModel();if(null==t)if(0<this.graph.getEdges(e,n.getParent(e),this.invert,!this.invert,!1).length)t=e;else{if(0<(s=this.graph.findTreeRoots(e,!0,this.invert)).length)for(var a=0;a<s.length;a++)if(!this.isVertexIgnored(s[a])&&0<this.graph.getEdges(s[a],null,this.invert,!this.invert,!1).length){t=s[a];break}}if(null!=t){this.parentsChanged=this.resizeParent?{}:null,n.beginUpdate();try{var i=this.dfs(t,e);if(null!=i){this.layout(i);var o=this.graph.gridSize,s=o;if(!this.moveTree){var r=this.getVertexBounds(t);null!=r&&(o=r.x,s=r.y)}if((r=null)!=(r=this.isHorizontal()?this.horizontalLayout(i,o,s):this.verticalLayout(i,null,o,s))){var l=a=0;r.x<0&&(a=Math.abs(o-r.x)),r.y<0&&(l=Math.abs(s-r.y)),(0!=a||0!=l)&&this.moveNode(i,a,l),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(i)}}}finally{n.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(e,t,n){for(e.x+=t,e.y+=n,this.apply(e),e=e.child;null!=e;)this.moveNode(e,t,n),e=e.next},mxCompactTreeLayout.prototype.dfs=function(e,t,n){n=null!=n?n:[];var a=mxCellPath.create(e),i=null;if(null!=e&&null==n[a]&&!this.isVertexIgnored(e)){n[a]=e;i=this.createNode(e),a=this.graph.getModel();var o=null;e=this.graph.getEdges(e,t,this.invert,!this.invert,!1,!0);for(var s=this.graph.getView(),r=0;r<e.length;r++){var l=e[r];if(!this.isEdgeIgnored(l)){this.resetEdges&&this.setEdgePoints(l,null),this.edgeRouting&&(this.setEdgeStyleEnabled(l,!1),this.setEdgePoints(l,null));var d;l=null!=(d=s.getState(l))?d.getVisibleTerminal(this.invert):s.getVisibleTerminal(l,this.invert);null!=(d=this.dfs(l,t,n))&&null!=a.getGeometry(l)&&(null==o?i.child=d:o.next=d,o=d)}}}return i},mxCompactTreeLayout.prototype.layout=function(e){if(null!=e){for(var t=e.child;null!=t;)this.layout(t),t=t.next;null!=e.child?this.attachParent(e,this.join(e)):this.layoutLeaf(e)}},mxCompactTreeLayout.prototype.horizontalLayout=function(e,t,n,a){if(e.x+=t+e.offsetX,e.y+=n+e.offsetY,a=this.apply(e,a),null!=(t=e.child)){a=this.horizontalLayout(t,e.x,e.y,a),n=e.y+t.offsetY;for(var i=t.next;null!=i;)a=this.horizontalLayout(i,e.x+t.offsetX,n,a),n+=i.offsetY,i=i.next}return a},mxCompactTreeLayout.prototype.verticalLayout=function(e,t,n,a,i){if(e.x+=n+e.offsetY,e.y+=a+e.offsetX,i=this.apply(e,i),null!=(t=e.child))for(i=this.verticalLayout(t,e,e.x,e.y,i),n=e.x+t.offsetY,a=t.next;null!=a;)i=this.verticalLayout(a,e,n,e.y+t.offsetX,i),n+=a.offsetY,a=a.next;return i},mxCompactTreeLayout.prototype.attachParent=function(e,t){var n=this.nodeDistance+this.levelDistance,a=(t-e.width)/2-this.nodeDistance,i=a+e.width+2*this.nodeDistance-t;e.child.offsetX=n+e.height,e.child.offsetY=i,e.contour.upperHead=this.createLine(e.height,0,this.createLine(n,i,e.contour.upperHead)),e.contour.lowerHead=this.createLine(e.height,0,this.createLine(n,a,e.contour.lowerHead))},mxCompactTreeLayout.prototype.layoutLeaf=function(e){var t=2*this.nodeDistance;e.contour.upperTail=this.createLine(e.height+t,0),e.contour.upperHead=e.contour.upperTail,e.contour.lowerTail=this.createLine(0,-e.width-t),e.contour.lowerHead=this.createLine(e.height+t,0,e.contour.lowerTail)},mxCompactTreeLayout.prototype.join=function(e){var t=2*this.nodeDistance,n=e.child;e.contour=n.contour;var a=n.width+t,i=a;for(n=n.next;null!=n;){var o=this.merge(e.contour,n.contour);n.offsetY=o+a,n.offsetX=0,i+=o+(a=n.width+t),n=n.next}return i},mxCompactTreeLayout.prototype.merge=function(e,t){for(var n=0,a=0,i=0,o=e.lowerHead,s=t.upperHead;null!=s&&null!=o;){var r=this.offset(n,a,s.dx,s.dy,o.dx,o.dy);a=a+r,i=i+r;n+s.dx<=o.dx?(n+=s.dx,a+=s.dy,s=s.next):(n-=o.dx,a-=o.dy,o=o.next)}return null!=s?(n=this.bridge(e.upperTail,0,0,s,n,a),e.upperTail=null!=n.next?t.upperTail:n,e.lowerTail=t.lowerTail):null==(n=this.bridge(t.lowerTail,n,a,o,0,0)).next&&(e.lowerTail=n),e.lowerHead=t.lowerHead,i},mxCompactTreeLayout.prototype.offset=function(e,t,n,a,i,o){var s;return i<=e||e+n<=0?0:0<(s=0<i*a-n*o?e<0?e*a/n-t:0<e?e*o/i-t:-t:i<e+n?o-(t+(i-e)*a/n):e+n<i?(n+e)*o/i-(t+a):o-(t+a))?s:0},mxCompactTreeLayout.prototype.bridge=function(e,t,n,a,i,o){return t=i+a.dx-t,i=i=0,0==a.dx?i=a.dy:(i=t*a.dy,i/=a.dx),t=this.createLine(t,i,a.next),e.next=this.createLine(0,o+a.dy-i-n,t),t},mxCompactTreeLayout.prototype.createNode=function(e){var t={};return t.cell=e,t.x=0,t.y=0,t.width=0,t.height=0,null!=(e=this.getVertexBounds(e))&&(this.isHorizontal()?(t.width=e.height,t.height=e.width):(t.width=e.width,t.height=e.height)),t.offsetX=0,t.offsetY=0,t.contour={},t},mxCompactTreeLayout.prototype.apply=function(e,t){var n=this.graph.getModel(),a=e.cell,i=n.getGeometry(a);return null!=a&&null!=i&&(this.isVertexMovable(a)&&(i=this.setVertexLocation(a,e.x,e.y),this.resizeParent&&(n=n.getParent(a),a=mxCellPath.create(n),null==this.parentsChanged[a]&&(this.parentsChanged[a]=n))),t=null==t?new mxRectangle(i.x,i.y,i.width,i.height):new mxRectangle(Math.min(t.x,i.x),Math.min(t.y,i.y),Math.max(t.x+t.width,i.x+i.width),Math.max(t.y+t.height,i.y+i.height))),t},mxCompactTreeLayout.prototype.createLine=function(e,t,n){var a={};return a.dx=e,a.dy=t,a.next=n,a},mxCompactTreeLayout.prototype.adjustParents=function(){var e,t=[];for(e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(e){for(this.processNodeOutgoing(e),e=e.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(e){for(var t=e.child,n=e.cell,a=0,i=[];null!=t;){a++;var o=t.x;this.horizontal&&(o=t.y),i.push(new WeightedCellSorter(t,o)),t=t.next}i.sort(WeightedCellSorter.prototype.compare),(o=e.width)>(s=(a+1)*this.prefHozEdgeSep)+2*this.prefHozEdgeSep&&(o-=2*this.prefHozEdgeSep),t=(e=o/a)/2,o>s+2*this.prefHozEdgeSep&&(t+=this.prefHozEdgeSep);o=this.minEdgeJetty-this.prefVertEdgeOff;for(var s=0,r=this.getVertexBounds(n),l=0;l<i.length;l++){for(var d=i[l].cell.cell,c=this.getVertexBounds(d),m=(d=this.graph.getEdgesBetween(n,d,!1),[]),u=0,p=0,g=0;g<d.length;g++)this.horizontal?(u=r.x+r.width,p=r.y+t,m.push(new mxPoint(u,p)),u=r.x+r.width+o,m.push(new mxPoint(u,p)),p=c.y+c.height/2):(u=r.x+t,p=r.y+r.height,m.push(new mxPoint(u,p)),p=r.y+r.height+o,m.push(new mxPoint(u,p)),u=c.x+c.width/2),m.push(new mxPoint(u,p)),this.setEdgePoints(d[g],m);l<a/2?o+=this.prefVertEdgeOff:a/2<l&&(o-=this.prefVertEdgeOff),t+=e,s=Math.max(s,o)}},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,t){return null!=e&&null!=t?t.weightedValue>e.weightedValue?1:t.weightedValue<e.weightedValue?-1:t.nudge?1:-1:0},mxFastOrganicLayout.prototype=new mxGraphLayout,mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout,mxFastOrganicLayout.prototype.useInputOrigin=!0,mxFastOrganicLayout.prototype.resetEdges=!0,mxFastOrganicLayout.prototype.disableEdgeStyle=!0,mxFastOrganicLayout.prototype.forceConstant=50,mxFastOrganicLayout.prototype.forceConstantSquared=0,mxFastOrganicLayout.prototype.minDistanceLimit=2,mxFastOrganicLayout.prototype.maxDistanceLimit=500,mxFastOrganicLayout.prototype.minDistanceLimitSquared=4,mxFastOrganicLayout.prototype.initialTemp=200,mxFastOrganicLayout.prototype.temperature=0,mxFastOrganicLayout.prototype.maxIterations=0,mxFastOrganicLayout.prototype.iteration=0,mxFastOrganicLayout.prototype.allowedToRun=!0,mxFastOrganicLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxFastOrganicLayout.prototype.execute=function(e){var t=this.graph.getModel();this.vertexArray=[];for(var n=this.graph.getChildVertices(e),a=0;a<n.length;a++)this.isVertexIgnored(n[a])||this.vertexArray.push(n[a]);var i=this.useInputOrigin?this.graph.view.getBounds(this.vertexArray):null,o=this.vertexArray.length;for(this.indices=[],this.dispX=[],this.dispY=[],this.cellLocation=[],this.isMoveable=[],this.neighbours=[],this.radius=[],this.radiusSquared=[],this.forceConstant<.001&&(this.forceConstant=.001),this.forceConstantSquared=this.forceConstant*this.forceConstant,a=0;a<this.vertexArray.length;a++){var s=this.vertexArray[a];this.cellLocation[a]=[];var r=mxCellPath.create(s);this.indices[r]=a;var l=this.getVertexBounds(s),d=l.width,c=l.height,m=l.x,u=l.y;this.cellLocation[a][0]=m+d/2,this.cellLocation[a][1]=u+c/2,this.radius[a]=Math.min(d,c),this.radiusSquared[a]=this.radius[a]*this.radius[a]}t.beginUpdate();try{for(a=0;a<o;a++){this.dispX[a]=0,this.dispY[a]=0,this.isMoveable[a]=this.isVertexMovable(this.vertexArray[a]);var p=this.graph.getConnections(this.vertexArray[a],e);n=this.graph.getOpposites(p,this.vertexArray[a]);for(this.neighbours[a]=[],d=0;d<n.length;d++){this.resetEdges&&this.graph.resetEdge(p[d]),this.disableEdgeStyle&&this.setEdgeStyleEnabled(p[d],!1);r=mxCellPath.create(n[d]);var g=this.indices[r];this.neighbours[a][d]=null!=g?g:a}}for(this.temperature=this.initialTemp,0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(o)),this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;this.calcRepulsion(),this.calcAttraction(),this.calcPositions(),this.reduceTemperature()}for(e=n=null,a=0;a<this.vertexArray.length;a++)s=this.vertexArray[a],this.isVertexMovable(s)&&(null!=(l=this.getVertexBounds(s))&&(this.cellLocation[a][0]-=l.width/2,this.cellLocation[a][1]-=l.height/2,m=this.graph.snap(this.cellLocation[a][0]),u=this.graph.snap(this.cellLocation[a][1]),this.setVertexLocation(s,m,u),n=null==n?m:Math.min(n,m),e=null==e?u:Math.min(e,u)));a=1-(n||0),s=1-(e||0),null!=i&&(a+=i.x,s+=i.y),this.graph.moveCells(this.vertexArray,a,s)}finally{t.endUpdate()}},mxFastOrganicLayout.prototype.calcPositions=function(){for(var e=0;e<this.vertexArray.length;e++)if(this.isMoveable[e]){(n=Math.sqrt(this.dispX[e]*this.dispX[e]+this.dispY[e]*this.dispY[e]))<.001&&(n=.001);var t=this.dispX[e]/n*Math.min(n,this.temperature),n=this.dispY[e]/n*Math.min(n,this.temperature);this.dispX[e]=0,this.dispY[e]=0,this.cellLocation[e][0]+=t,this.cellLocation[e][1]+=n}},mxFastOrganicLayout.prototype.calcAttraction=function(){for(var e=0;e<this.vertexArray.length;e++)for(var t=0;t<this.neighbours[e].length;t++){var n=this.neighbours[e][t];if(e!=n&&this.isMoveable[e]&&this.isMoveable[n]){(a=(o=this.cellLocation[e][0]-this.cellLocation[n][0])*o+(s=this.cellLocation[e][1]-this.cellLocation[n][1])*s-this.radiusSquared[e]-this.radiusSquared[n])<this.minDistanceLimitSquared&&(a=this.minDistanceLimitSquared);var a,i=Math.sqrt(a),o=o/i*(a=a/this.forceConstant),s=s/i*a;this.dispX[e]-=o,this.dispY[e]-=s,this.dispX[n]+=o,this.dispY[n]+=s}}},mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var e=this.vertexArray.length,t=0;t<e;t++)for(var n=t;n<e;n++){if(!this.allowedToRun)return;if(n!=t&&this.isMoveable[t]&&this.isMoveable[n]){var a=this.cellLocation[t][0]-this.cellLocation[n][0],i=this.cellLocation[t][1]-this.cellLocation[n][1];0==a&&(a=.01+Math.random()),0==i&&(i=.01+Math.random());var o=Math.sqrt(a*a+i*i),s=o-this.radius[t]-this.radius[n];s>this.maxDistanceLimit||(s<this.minDistanceLimit&&(s=this.minDistanceLimit),a=a/o*(s=this.forceConstantSquared/s),i=i/o*s,this.dispX[t]+=a,this.dispY[t]+=i,this.dispX[n]-=a,this.dispY[n]-=i)}}},mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)},mxCircleLayout.prototype=new mxGraphLayout,mxCircleLayout.prototype.constructor=mxCircleLayout,mxCircleLayout.prototype.radius=null,mxCircleLayout.prototype.moveCircle=!1,mxCircleLayout.prototype.x0=0,mxCircleLayout.prototype.y0=0,mxCircleLayout.prototype.resetEdges=!0,mxCircleLayout.prototype.disableEdgeStyle=!0,mxCircleLayout.prototype.execute=function(e){var t=this.graph.getModel();t.beginUpdate();try{for(var n=0,a=null,i=null,o=[],s=t.getChildCount(e),r=0;r<s;r++){var l=t.getChildAt(e,r);if(this.isVertexIgnored(l))this.isEdgeIgnored(l)||(this.resetEdges&&this.graph.resetEdge(l),this.disableEdgeStyle&&this.setEdgeStyleEnabled(l,!1));else{o.push(l);var d=this.getVertexBounds(l);a=null==a?d.y:Math.min(a,d.y),i=null==i?d.x:Math.min(i,d.x),n=Math.max(n,Math.max(d.width,d.height))}}var c=this.getRadius(o.length,n);this.moveCircle&&(i=this.x0,a=this.y0),this.circle(o,c,i,a)}finally{t.endUpdate()}},mxCircleLayout.prototype.getRadius=function(e,t){return Math.max(e*t/Math.PI,this.radius)},mxCircleLayout.prototype.circle=function(e,t,n,a){for(var i=e.length,o=2*Math.PI/i,s=0;s<i;s++)this.isVertexMovable(e[s])&&this.setVertexLocation(e[s],n+t+t*Math.sin(s*o),a+t+t*Math.cos(s*o))},mxParallelEdgeLayout.prototype=new mxGraphLayout,mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout,mxParallelEdgeLayout.prototype.spacing=20,mxParallelEdgeLayout.prototype.execute=function(e){e=this.findParallels(e),this.graph.model.beginUpdate();try{for(var t in e){var n=e[t];1<n.length&&this.layout(n)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(e){for(var t=this.graph.getModel(),n=[],a=t.getChildCount(e),i=0;i<a;i++){var o=t.getChildAt(e,i);if(!this.isEdgeIgnored(o)){var s=this.getEdgeId(o);null!=s&&(null==n[s]&&(n[s]=[]),n[s].push(o))}}return n},mxParallelEdgeLayout.prototype.getEdgeId=function(e){var t=this.graph.getView(),n=t.getState(e),a=null!=n?n.getVisibleTerminal(!0):t.getVisibleTerminal(e,!0);return e=null!=n?n.getVisibleTerminal(!1):t.getVisibleTerminal(e,!1),null!=a&&null!=e?(a=mxCellPath.create(a),(e=mxCellPath.create(e))<a?e+"-"+a:a+"-"+e):null},mxParallelEdgeLayout.prototype.layout=function(e){var t=e[0];if((s=(n=this.graph.getModel()).getGeometry(n.getTerminal(t,!0)))==(o=n.getGeometry(n.getTerminal(t,!1)))){t=s.x+s.width+this.spacing;for(var n=s.y+s.height/2,a=0;a<e.length;a++)this.route(e[a],t,n),t+=this.spacing}else if(null!=s&&null!=o){t=s.x+s.width/2,n=s.y+s.height/2,a=o.x+o.width/2-t;var i=o.y+o.height/2-n,o=Math.sqrt(a*a+i*i),s=i*this.spacing/o;for(o=a*this.spacing/o,t=t+a/2+s*(e.length-1)/2,n=n+i/2-o*(e.length-1)/2,a=0;a<e.length;a++)this.route(e[a],t,n),t-=s,n+=o}},mxParallelEdgeLayout.prototype.route=function(e,t,n){this.graph.isCellMovable(e)&&this.setEdgePoints(e,[new mxPoint(t,n)])},mxCompositeLayout.prototype=new mxGraphLayout,mxCompositeLayout.prototype.constructor=mxCompositeLayout,mxCompositeLayout.prototype.layouts=null,mxCompositeLayout.prototype.master=null,mxCompositeLayout.prototype.moveCell=function(e,t,n){null!=this.master?this.master.move.apply(this.master,arguments):this.layouts[0].move.apply(this.layouts[0],arguments)},mxCompositeLayout.prototype.execute=function(e){var t=this.graph.getModel();t.beginUpdate();try{for(var n=0;n<this.layouts.length;n++)this.layouts[n].execute.apply(this.layouts[n],arguments)}finally{t.endUpdate()}},mxEdgeLabelLayout.prototype=new mxGraphLayout,mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout,mxEdgeLabelLayout.prototype.execute=function(e){for(var t=this.graph.view,n=this.graph.getModel(),a=[],i=[],o=n.getChildCount(e),s=0;s<o;s++){var r=n.getChildAt(e,s),l=t.getState(r);null!=l&&(this.isVertexIgnored(r)?this.isEdgeIgnored(r)||a.push(l):i.push(l))}this.placeLabels(i,a)},mxEdgeLabelLayout.prototype.placeLabels=function(e,t){var n=this.graph.getModel();n.beginUpdate();try{for(var a=0;a<t.length;a++){var i=t[a];if(null!=i&&null!=i.text&&null!=i.text.boundingBox)for(var o=0;o<e.length;o++){var s=e[o];null!=s&&this.avoid(i,s)}}}finally{n.endUpdate()}},mxEdgeLabelLayout.prototype.avoid=function(e,t){var n=this.graph.getModel(),a=e.text.boundingBox;if(mxUtils.intersects(a,t)){var i=-a.y-a.height+t.y,o=-a.y+t.y+t.height;i=Math.abs(i)<Math.abs(o)?i:o,o=-a.x-a.width+t.x,a=-a.x+t.x+t.width,a=Math.abs(o)<Math.abs(a)?o:a;Math.abs(a)<Math.abs(i)?i=0:a=0,null!=(o=n.getGeometry(e.cell))&&(null!=(o=o.clone()).offset?(o.offset.x+=a,o.offset.y+=i):o.offset=new mxPoint(a,i),n.setGeometry(e.cell,o))}},mxGraphAbstractHierarchyCell.prototype.maxRank=-1,mxGraphAbstractHierarchyCell.prototype.minRank=-1,mxGraphAbstractHierarchyCell.prototype.x=null,mxGraphAbstractHierarchyCell.prototype.y=null,mxGraphAbstractHierarchyCell.prototype.width=0,mxGraphAbstractHierarchyCell.prototype.height=0,mxGraphAbstractHierarchyCell.prototype.nextLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.previousLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.temp=null,mxGraphAbstractHierarchyCell.prototype.getNextLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return!1},mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1},mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(e){return null},mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(e,t){return null},mxGraphAbstractHierarchyCell.prototype.setX=function(e,t){this.isVertex()?this.x[0]=t:this.isEdge()&&(this.x[e-this.minRank-1]=t)},mxGraphAbstractHierarchyCell.prototype.getX=function(e){return this.isVertex()?this.x[0]:this.isEdge()?this.x[e-this.minRank-1]:0},mxGraphAbstractHierarchyCell.prototype.setY=function(e,t){this.isVertex()?this.y[0]=t:this.isEdge()&&(this.y[e-this.minRank-1]=t)},mxGraphHierarchyNode.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyNode.prototype.constructor=mxGraphHierarchyNode,mxGraphHierarchyNode.prototype.cell=null,mxGraphHierarchyNode.prototype.connectsAsTarget=[],mxGraphHierarchyNode.prototype.connectsAsSource=[],mxGraphHierarchyNode.prototype.hashCode=!1,mxGraphHierarchyNode.prototype.getRankValue=function(e){return this.maxRank},mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[],this.nextLayerConnectedCells[0]=[];for(var t=0;t<this.connectsAsTarget.length;t++){var n=this.connectsAsTarget[t];-1==n.maxRank||n.maxRank==e+1?this.nextLayerConnectedCells[0].push(n.source):this.nextLayerConnectedCells[0].push(n)}}return this.nextLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[],this.previousLayerConnectedCells[0]=[];for(var t=0;t<this.connectsAsSource.length;t++){var n=this.connectsAsSource[t];-1==n.minRank||n.minRank==e-1?this.previousLayerConnectedCells[0].push(n.target):this.previousLayerConnectedCells[0].push(n)}}return this.previousLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.isVertex=function(){return!0},mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(e){return this.temp[0]},mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(e,t){this.temp[0]=t},mxGraphHierarchyNode.prototype.isAncestor=function(e){if(null!=e&&null!=this.hashCode&&null!=e.hashCode&&this.hashCode.length<e.hashCode.length){if(this.hashCode==e.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var t=0;t<this.hashCode.length;t++)if(this.hashCode[t]!=e.hashCode[t])return!1;return!0}return!1},mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell},mxGraphHierarchyEdge.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyEdge.prototype.constructor=mxGraphHierarchyEdge,mxGraphHierarchyEdge.prototype.edges=null,mxGraphHierarchyEdge.prototype.source=null,mxGraphHierarchyEdge.prototype.target=null,mxGraphHierarchyEdge.prototype.isReversed=!1,mxGraphHierarchyEdge.prototype.invert=function(e){e=this.source,this.source=this.target,this.target=e,this.isReversed=!this.isReversed},mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var t=0;t<this.temp.length;t++)this.nextLayerConnectedCells[t]=[],t==this.temp.length-1?this.nextLayerConnectedCells[t].push(this.source):this.nextLayerConnectedCells[t].push(this)}return this.nextLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var t=0;t<this.temp.length;t++)this.previousLayerConnectedCells[t]=[],0==t?this.previousLayerConnectedCells[t].push(this.target):this.previousLayerConnectedCells[t].push(this)}return this.previousLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.isEdge=function(){return!0},mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(e){return this.temp[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(e,t){this.temp[e-this.minRank-1]=t},mxGraphHierarchyEdge.prototype.getCoreCell=function(){return null!=this.edges&&0<this.edges.length?this.edges[0]:null},mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(e,t,n){for(var a=e.getGraph(),i=0;i<t.length;i++){n[i]=new mxGraphHierarchyNode(t[i]);var o=mxCellPath.create(t[i]);this.vertexMapper[o]=n[i],o=e.getEdges(t[i]),n[i].connectsAsSource=[];for(var s=0;s<o.length;s++){if((d=e.getVisibleTerminal(o[s],!1))!=t[i]&&d!=t[i]&&e.graph.model.isVertex(d)&&!e.isVertexIgnored(d)){var r=e.getEdgesBetween(t[i],d,!1),l=e.getEdgesBetween(t[i],d,!0),d=mxCellPath.create(r[0]);if(null!=r&&0<r.length&&null==this.edgeMapper[d]&&2*l.length>=r.length){l=new mxGraphHierarchyEdge(r);for(var c=0;c<r.length;c++){var m=r[c];d=mxCellPath.create(m);this.edgeMapper[d]=l,a.resetEdge(m),e.disableEdgeStyle&&(e.setEdgeStyleEnabled(m,!1),e.setOrthogonalEdge(m,!0))}l.source=n[i],mxUtils.indexOf(n[i].connectsAsSource,l)<0&&n[i].connectsAsSource.push(l)}}}n[i].temp[0]=0}},mxGraphHierarchyModel.prototype.initialRank=function(){var e=[];if(null!=this.roots)for(var t=0;t<this.roots.length;t++){var n=mxCellPath.create(this.roots[t]);null!=(n=this.vertexMapper[n])&&e.push(n)}for(var a in this.vertexMapper)(n=this.vertexMapper[a]).temp[0]=-1;for(var i=e.slice();0<e.length;){var o,s;o=(n=e[0]).connectsAsTarget,s=n.connectsAsSource;var r=!0,l=this.SOURCESCANSTARTRANK;for(t=0;t<o.length;t++){var d=o[t];if(5270620!=d.temp[0]){r=!1;break}d=d.source,l=Math.min(l,d.temp[0]-1)}if(r){if(n.temp[0]=l,this.maxRank=Math.min(this.maxRank,l),null!=s)for(t=0;t<s.length;t++)(d=s[t]).temp[0]=5270620,-1==(d=d.target).temp[0]&&(e.push(d),d.temp[0]=-2);e.shift()}else if(t=e.shift(),e.push(n),t==n&&1==e.length)break}for(a in this.vertexMapper)(n=this.vertexMapper[a]).temp[0]-=this.maxRank;for(t=0;t<i.length;t++)for(e=0,o=(n=i[t]).connectsAsSource,a=0;a<o.length;a++)d=(d=o[a]).target,n.temp[0]=Math.max(e,d.temp[0]+1),e=n.temp[0];this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank},mxGraphHierarchyModel.prototype.fixRanks=function(){var o=[];this.ranks=[];for(var e=0;e<this.maxRank+1;e++)o[e]=[],this.ranks[e]=o[e];var t=null;if(null!=this.roots){var n=this.roots;for(t=[],e=0;e<n.length;e++){var a=mxCellPath.create(n[e]);t[e]=this.vertexMapper[a]}}this.visit(function(e,t,n,a,i){if(0==i&&t.maxRank<0&&t.minRank<0&&(o[t.temp[0]].push(t),t.maxRank=t.temp[0],t.minRank=t.temp[0],t.temp[0]=o[t.maxRank].length-1),null!=e&&null!=n&&1<e.maxRank-t.maxRank)for(n.maxRank=e.maxRank,n.minRank=t.maxRank,n.temp=[],n.x=[],n.y=[],e=n.minRank+1;e<n.maxRank;e++)o[e].push(n),n.setGeneralPurposeVariable(e,o[e].length-1)},t,!1,null)},mxGraphHierarchyModel.prototype.visit=function(e,t,n,a){if(null!=t){for(var i=0;i<t.length;i++){var o=t[i];null!=o&&(null==a&&(a={}),n?(o.hashCode=[],o.hashCode[0]=this.dfsCount,o.hashCode[1]=i,this.extendedDfs(null,o,null,e,a,o.hashCode,i,0)):this.dfs(null,o,null,e,a,0))}this.dfsCount++}},mxGraphHierarchyModel.prototype.dfs=function(e,t,n,a,i,o){if(null!=t){var s=mxCellPath.create(t.cell);if(null==i[s])for(a(e,i[s]=t,n,o,0),e=t.connectsAsSource.slice(),n=0;n<e.length;n++)s=e[n],this.dfs(t,s.target,s,a,i,o+1);else a(e,t,n,o,1)}},mxGraphHierarchyModel.prototype.extendedDfs=function(e,t,n,a,i,o,s,r){if(null!=t)if(null==e||null!=t.hashCode&&t.hashCode[0]==e.hashCode[0]||(o=e.hashCode.length+1,t.hashCode=e.hashCode.slice(),t.hashCode[o-1]=s),null==i[s=mxCellPath.create(t.cell)])for(a(e,i[s]=t,n,r,0),e=t.connectsAsSource.slice(),n=0;n<e.length;n++)s=e[n],this.extendedDfs(t,s.target,s,a,i,t.hashCode,n,r+1);else a(e,t,n,r,1)},mxHierarchicalLayoutStage.prototype.execute=function(e){},mxMedianHybridCrossingReduction.prototype=new mxHierarchicalLayoutStage,mxMedianHybridCrossingReduction.prototype.constructor=mxMedianHybridCrossingReduction,mxMedianHybridCrossingReduction.prototype.layout=null,mxMedianHybridCrossingReduction.prototype.maxIterations=24,mxMedianHybridCrossingReduction.prototype.nestedBestRanks=null,mxMedianHybridCrossingReduction.prototype.currentBestCrossings=0,mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement=0,mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations=2,mxMedianHybridCrossingReduction.prototype.execute=function(e){e=this.layout.getModel(),this.nestedBestRanks=[];for(var t=0;t<e.ranks.length;t++)this.nestedBestRanks[t]=e.ranks[t].slice();var n=0,a=this.calculateCrossings(e);for(t=0;t<this.maxIterations&&n<this.maxNoImprovementIterations;t++){this.weightedMedian(t,e),this.transpose(t,e);var i=this.calculateCrossings(e);if(i<a)for(a=i,i=n=0;i<this.nestedBestRanks.length;i++)for(var o=e.ranks[i],s=0;s<o.length;s++){var r=o[s];this.nestedBestRanks[i][r.getGeneralPurposeVariable(i)]=r}else for(n++,i=0;i<this.nestedBestRanks.length;i++)for(o=e.ranks[i],s=0;s<o.length;s++)(r=o[s]).setGeneralPurposeVariable(i,s);if(0==a)break}for(n=[],a=[],t=0;t<e.maxRank+1;t++)a[t]=[],n[t]=a[t];for(t=0;t<this.nestedBestRanks.length;t++)for(i=0;i<this.nestedBestRanks[t].length;i++)a[t].push(this.nestedBestRanks[t][i]);e.ranks=n},mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(e){for(var t=e.ranks.length,n=0,a=1;a<t;a++)n+=this.calculateRankCrossing(a,e);return n},mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(e,t){for(var n=0,a=t.ranks[e],i=a.length,o=t.ranks[e-1].length,s=[],r=0;r<i;r++)s[r]=[];for(r=0;r<a.length;r++)for(var l=(c=a[r]).getGeneralPurposeVariable(e),d=c.getPreviousLayerConnectedCells(e),c=0;c<d.length;c++){var m=d[c].getGeneralPurposeVariable(e-1);s[l][m]=201207}for(r=0;r<i;r++)for(c=0;c<o;c++)if(201207==s[r][c]){for(a=r+1;a<i;a++)for(l=0;l<c;l++)201207==s[a][l]&&n++;for(a=0;a<r;a++)for(l=c+1;l<o;l++)201207==s[a][l]&&n++}return n/2},mxMedianHybridCrossingReduction.prototype.transpose=function(e,t){for(var n=!0,a=0;n&&a++<10;)for(var i=1==e%2&&1==a%2,o=(n=!1,0);o<t.ranks.length;o++){for(var s=t.ranks[o],r=[],l=0;l<s.length;l++){(f=(b=s[l]).getGeneralPurposeVariable(o))<0&&(f=l),r[f]=b}var d=f=b=null,c=null,m=null,u=null,p=null,g=null,v=null,h=null;for(l=0;l<s.length-1;l++){if(0==l){for(var b=(v=r[l]).getNextLayerConnectedCells(o),f=v.getPreviousLayerConnectedCells(o),A=(m=[],u=[],0);A<b.length;A++)m[A]=b[A].getGeneralPurposeVariable(o+1);for(A=0;A<f.length;A++)u[A]=f[A].getGeneralPurposeVariable(o-1)}else b=d,f=c,m=p,u=g,v=h;for(d=(h=r[l+1]).getNextLayerConnectedCells(o),c=h.getPreviousLayerConnectedCells(o),p=[],g=[],A=0;A<d.length;A++)p[A]=d[A].getGeneralPurposeVariable(o+1);for(A=0;A<c.length;A++)g[A]=c[A].getGeneralPurposeVariable(o-1);var E=0,y=0;for(A=0;A<m.length;A++)for(var S=0;S<p.length;S++)m[A]>p[S]&&E++,m[A]<p[S]&&y++;for(A=0;A<u.length;A++)for(S=0;S<g.length;S++)u[A]>g[S]&&E++,u[A]<g[S]&&y++;(y<E||y==E&&i)&&(d=v.getGeneralPurposeVariable(o),v.setGeneralPurposeVariable(o,h.getGeneralPurposeVariable(o)),h.setGeneralPurposeVariable(o,d),d=b,c=f,p=m,g=u,h=v,i||(n=!0))}}},mxMedianHybridCrossingReduction.prototype.weightedMedian=function(e,t){var n=0==e%2;if(n)for(var a=t.maxRank-1;0<=a;a--)this.medianRank(a,n);else for(a=1;a<t.maxRank;a++)this.medianRank(a,n)},mxMedianHybridCrossingReduction.prototype.medianRank=function(e,t){for(var n=this.nestedBestRanks[e].length,a=[],i=[],o=0;o<n;o++){var s,r,l=this.nestedBestRanks[e][o],d=new MedianCellSorter;d.cell=l,r=t?e+1:e-1,null!=(s=t?l.getNextLayerConnectedCells(e):l.getPreviousLayerConnectedCells(e))&&0!=s.length?(d.medianValue=this.medianValue(s,r),a.push(d)):i[l.getGeneralPurposeVariable(e)]=!0}for(a.sort(MedianCellSorter.prototype.compare),o=0;o<n;o++)null==i[o]&&(l=a.shift().cell).setGeneralPurposeVariable(e,o)},mxMedianHybridCrossingReduction.prototype.medianValue=function(e,t){for(var n=[],a=0,i=0;i<e.length;i++){var o=e[i];n[a++]=o.getGeneralPurposeVariable(t)}return n.sort(function(e,t){return e-t}),1==a%2?n[Math.floor(a/2)]:2==a?(n[0]+n[1])/2:(o=n[(i=a/2)-1]-n[0],a=n[a-1]-n[i],(n[i-1]*a+n[i]*o)/(o+a))},MedianCellSorter.prototype.medianValue=0,MedianCellSorter.prototype.cell=!1,MedianCellSorter.prototype.compare=function(e,t){return null!=e&&null!=t?t.medianValue>e.medianValue?-1:t.medianValue<e.medianValue?1:0:0},mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage,mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover,mxMinimumCycleRemover.prototype.layout=null,mxMinimumCycleRemover.prototype.execute=function(e){var t=this.layout.getModel(),o={},s=mxUtils.clone(t.vertexMapper,null,!0),n=null;if(null!=t.roots){var a=t.roots;n=[];for(e=0;e<a.length;e++){var i=mxCellPath.create(a[e]);n[e]=t.vertexMapper[i]}}if(t.visit(function(e,t,n,a,i){t.isAncestor(e)&&(n.invert(),mxUtils.remove(n,e.connectsAsSource),e.connectsAsTarget.push(n),mxUtils.remove(n,t.connectsAsTarget),t.connectsAsSource.push(n)),e=mxCellPath.create(t.cell),o[e]=t,delete s[e]},n,!0,null),n=null,0<s.lenth&&(n=mxUtils.clone(s,null,!0)),e=mxUtils.clone(o,null,!0),t.visit(function(e,t,n,a,i){t.isAncestor(e)&&(n.invert(),mxUtils.remove(n,e.connectsAsSource),t.connectsAsSource.push(n),e.connectsAsTarget.push(n),mxUtils.remove(n,t.connectsAsTarget)),e=mxCellPath.create(t.cell),o[e]=t,delete s[e]},s,!0,e),a=this.layout.getGraph(),null!=n&&0<n.length)for(t=t.roots,e=0;e<n.length;e++)i=n[e].cell,0==a.getIncomingEdges(i).length&&t.push(i)};var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};function WeightedCellSorter(e,t){this.cell=e,this.weightedValue=t}function mxHierarchicalLayout(e,t,n){mxGraphLayout.call(this,e),this.orientation=null!=t?t:mxConstants.DIRECTION_NORTH,this.deterministic=null==n||n}function mxGraphModel(e){this.currentEdit=this.createUndoableEdit(),null!=e?this.setRoot(e):this.clear()}function mxRootChange(e,t){this.model=e,this.previous=this.root=t}function mxChildChange(e,t,n,a){this.model=e,this.previous=this.parent=t,this.child=n,this.previousIndex=this.index=a}function mxTerminalChange(e,t,n,a){this.model=e,this.cell=t,this.previous=this.terminal=n,this.source=a}function mxValueChange(e,t,n){this.model=e,this.cell=t,this.previous=this.value=n}function mxStyleChange(e,t,n){this.model=e,this.cell=t,this.previous=this.style=n}function mxGeometryChange(e,t,n){this.model=e,this.cell=t,this.previous=this.geometry=n}function mxCollapseChange(e,t,n){this.model=e,this.cell=t,this.previous=this.collapsed=n}function mxVisibleChange(e,t,n){this.model=e,this.cell=t,this.previous=this.visible=n}function mxCellAttributeChange(e,t,n){this.cell=e,this.attribute=t,this.previous=this.value=n}function mxCell(e,t,n){this.value=e,this.setGeometry(t),this.setStyle(n),null!=this.onInit&&this.onInit()}function mxGeometry(e,t,n,a){mxRectangle.call(this,e,t,n,a)}mxCoordinateAssignment.prototype=new mxHierarchicalLayoutStage,mxCoordinateAssignment.prototype.constructor=mxCoordinateAssignment,mxCoordinateAssignment.prototype.layout=null,mxCoordinateAssignment.prototype.intraCellSpacing=30,mxCoordinateAssignment.prototype.interRankCellSpacing=100,mxCoordinateAssignment.prototype.parallelEdgeSpacing=10,mxCoordinateAssignment.prototype.maxIterations=8,mxCoordinateAssignment.prototype.prefHozEdgeSep=5,mxCoordinateAssignment.prototype.prefVertEdgeOff=2,mxCoordinateAssignment.prototype.minEdgeJetty=12,mxCoordinateAssignment.prototype.channelBuffer=4,mxCoordinateAssignment.prototype.jettyPositions=null,mxCoordinateAssignment.prototype.orientation=mxConstants.DIRECTION_NORTH,mxCoordinateAssignment.prototype.initialX=null,mxCoordinateAssignment.prototype.limitX=null,mxCoordinateAssignment.prototype.currentXDelta=null,mxCoordinateAssignment.prototype.widestRank=null,mxCoordinateAssignment.prototype.rankTopY=null,mxCoordinateAssignment.prototype.rankBottomY=null,mxCoordinateAssignment.prototype.widestRankValue=null,mxCoordinateAssignment.prototype.rankWidths=null,mxCoordinateAssignment.prototype.rankY=null,mxCoordinateAssignment.prototype.fineTuning=!0,mxCoordinateAssignment.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE,mxCoordinateAssignment.prototype.nextLayerConnectedCache=null,mxCoordinateAssignment.prototype.previousLayerConnectedCache=null,mxCoordinateAssignment.prototype.groupPadding=10,mxCoordinateAssignment.prototype.printStatus=function(){var e=this.layout.getModel();mxLog.show(),mxLog.writeln("======Coord assignment debug=======");for(var t=0;t<e.ranks.length;t++){mxLog.write("Rank ",t," : ");for(var n=e.ranks[t],a=0;a<n.length;a++)mxLog.write(n[a].getGeneralPurposeVariable(t)," ");mxLog.writeln()}mxLog.writeln("====================================")},mxCoordinateAssignment.prototype.execute=function(e){this.jettyPositions=[],e=this.layout.getModel(),this.currentXDelta=0,this.initialCoords(this.layout.getGraph(),e),this.fineTuning&&this.minNode(e);var t=1e8;if(this.fineTuning)for(var n=0;n<this.maxIterations;n++){if(0!=n&&(this.medianPos(n,e),this.minNode(e)),this.currentXDelta<t){for(var a=0;a<e.ranks.length;a++)for(var i=e.ranks[a],o=0;o<i.length;o++){var s=i[o];s.setX(a,s.getGeneralPurposeVariable(a))}t=this.currentXDelta}else for(a=0;a<e.ranks.length;a++)for(i=e.ranks[a],o=0;o<i.length;o++)(s=i[o]).setGeneralPurposeVariable(a,s.getX(a));this.minPath(this.layout.getGraph(),e),this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),e)},mxCoordinateAssignment.prototype.minNode=function(e){for(var t=[],n=[],a=[],i=0;i<=e.maxRank;i++){a[i]=e.ranks[i];for(var o=0;o<a[i].length;o++){var s=a[i][o];(r=new WeightedCellSorter(s,i)).rankIndex=o,r.visited=!0,t.push(r),n[s=mxCellPath.create(s.getCoreCell())]=r}}for(e=10*t.length,o=0;0<t.length&&o<=e;){i=(r=t.shift()).cell;var r,l=r.weightedValue,d=parseInt(r.rankIndex),c=(s=i.getNextLayerConnectedCells(l),i.getPreviousLayerConnectedCells(l)),m=s.length,u=c.length,p=this.medianXValue(s,l+1),g=this.medianXValue(c,l-1),v=m+u,h=i.getGeneralPurposeVariable(l),b=h;if(0<v&&(b=(p*m+g*u)/v),m=!1,b<h-1?0==d?(i.setGeneralPurposeVariable(l,b),m=!0):(h=(h=(d=a[l][d-1]).getGeneralPurposeVariable(l))+d.width/2+this.intraCellSpacing+i.width/2)<b?(i.setGeneralPurposeVariable(l,b),m=!0):h<i.getGeneralPurposeVariable(l)-1&&(i.setGeneralPurposeVariable(l,h),m=!0):h+1<b&&(d==a[l].length-1?(i.setGeneralPurposeVariable(l,b),m=!0):b<(h=(h=(d=a[l][d+1]).getGeneralPurposeVariable(l))-d.width/2-this.intraCellSpacing-i.width/2)?(i.setGeneralPurposeVariable(l,b),m=!0):h>i.getGeneralPurposeVariable(l)+1&&(i.setGeneralPurposeVariable(l,h),m=!0)),m){for(i=0;i<s.length;i++)l=s[i],null!=(l=n[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,t.push(l));for(i=0;i<c.length;i++)l=c[i],null!=(l=n[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,t.push(l))}r.visited=!1,o++}},mxCoordinateAssignment.prototype.medianPos=function(e,t){if(0==e%2)for(var n=t.maxRank;0<n;n--)this.rankMedianPosition(n-1,t,n);else for(n=0;n<t.maxRank-1;n++)this.rankMedianPosition(n+1,t,n)},mxCoordinateAssignment.prototype.rankMedianPosition=function(e,t,n){t=t.ranks[e];for(var a=[],i=[],o=0;o<t.length;o++){var s=t[o];a[o]=new WeightedCellSorter,a[o].cell=s,a[o].rankIndex=o;var r=mxCellPath.create(s.getCoreCell());i[r]=a[o];var l=null;l=n<e?s.getPreviousLayerConnectedCells(e):s.getNextLayerConnectedCells(e);a[o].weightedValue=this.calculatedWeightedValue(s,l)}for(a.sort(WeightedCellSorter.prototype.compare),o=0;o<a.length;o++){r=0,s=a[o].cell,r=0,null!=(l=n<e?s.getPreviousLayerConnectedCells(e).slice():s.getNextLayerConnectedCells(e).slice())&&(r=0<(r=l.length)?this.medianXValue(l,n):s.getGeneralPurposeVariable(e));for(var d=0,c=(l=-1e8,a[o].rankIndex-1);0<=c;){var m;if(null!=(m=i[m=mxCellPath.create(t[c].getCoreCell())])){var u=m.cell;m.visited?(l=u.getGeneralPurposeVariable(e)+u.width/2+this.intraCellSpacing+d+s.width/2,c=-1):(d+=u.width+this.intraCellSpacing,c--)}}for(d=0,u=1e8,c=a[o].rankIndex+1;c<a.length;)if(null!=(m=i[m=mxCellPath.create(t[c].getCoreCell())])){var p=m.cell;m.visited?(u=p.getGeneralPurposeVariable(e)-p.width/2-this.intraCellSpacing-d-s.width/2,c=a.length):(d+=p.width+this.intraCellSpacing,c++)}l<=r&&r<=u?s.setGeneralPurposeVariable(e,r):r<l?(s.setGeneralPurposeVariable(e,l),this.currentXDelta+=l-r):u<r&&(s.setGeneralPurposeVariable(e,u),this.currentXDelta+=r-u),a[o].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(e,t){for(var n=0,a=0;a<t.length;a++){var i=t[a];e.isVertex()&&i.isVertex()?n++:n=e.isEdge()&&i.isEdge()?n+8:n+2}return n},mxCoordinateAssignment.prototype.medianXValue=function(e,t){if(0==e.length)return 0;for(var n=[],a=0;a<e.length;a++)n[a]=e[a].getGeneralPurposeVariable(t);return n.sort(function(e,t){return e-t}),1==e.length%2?n[Math.floor(e.length/2)]:(n[(a=e.length/2)-1]+n[a])/2},mxCoordinateAssignment.prototype.initialCoords=function(e,t){this.calculateWidestRank(e,t);for(var n=this.widestRank;0<=n;n--)n<t.maxRank&&this.rankCoordinates(n,e,t);for(n=this.widestRank+1;n<=t.maxRank;n++)0<n&&this.rankCoordinates(n,e,t)},mxCoordinateAssignment.prototype.rankCoordinates=function(e,t,n){t=n.ranks[e],n=0;for(var a=this.initialX+(this.widestRankValue-this.rankWidths[e])/2,i=!1,o=0;o<t.length;o++){var s=t[o];if(s.isVertex()){var r=this.layout.getVertexBounds(s.cell);null!=r?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(s.width=r.width,s.height=r.height):(s.width=r.height,s.height=r.width):i=!0,n=Math.max(n,s.height)}else s.isEdge()&&(r=1,null!=s.edges?r=s.edges.length:mxLog.warn("edge.edges is null"),s.width=(r-1)*this.parallelEdgeSpacing);a+=s.width/2,s.setX(e,a),s.setGeneralPurposeVariable(e,a),a+=s.width/2,a+=this.intraCellSpacing}1==i&&mxLog.warn("At least one cell has no bounds")},mxCoordinateAssignment.prototype.calculateWidestRank=function(e,t){var n=-this.interRankCellSpacing,a=0;this.rankWidths=[],this.rankY=[];for(var i=t.maxRank;0<=i;i--){for(var o=0,s=t.ranks[i],r=this.initialX,l=!1,d=0;d<s.length;d++){var c=s[d];if(c.isVertex()){var m=this.layout.getVertexBounds(c.cell);null!=m?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(c.width=m.width,c.height=m.height):(c.width=m.height,c.height=m.width):l=!0,o=Math.max(o,c.height)}else c.isEdge()&&(m=1,null!=c.edges?m=c.edges.length:mxLog.warn("edge.edges is null"),c.width=(m-1)*this.parallelEdgeSpacing);r+=c.width/2,c.setX(i,r),c.setGeneralPurposeVariable(i,r),r+=c.width/2,(r+=this.intraCellSpacing)>this.widestRankValue&&(this.widestRankValue=r,this.widestRank=i),this.rankWidths[i]=r}for(1==l&&mxLog.warn("At least one cell has no bounds"),this.rankY[i]=n,r=o/2+a/2+this.interRankCellSpacing,a=o,n=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?n+r:n-r,d=0;d<s.length;d++)s[d].setY(i,n)}},mxCoordinateAssignment.prototype.minPath=function(e,t){var n,a=t.edgeMapper;for(n in a){var i=a[n];if(!(i.maxRank-i.minRank-1<1)){for(var o=i.getGeneralPurposeVariable(i.minRank+1),s=!0,r=0,l=i.minRank+2;l<i.maxRank;l++){o!=(d=i.getGeneralPurposeVariable(l))?(s=!1,o=d):r++}if(!s){s=o=0;var d=[],c=[],m=i.getGeneralPurposeVariable(i.minRank+1);for(l=i.minRank+1;l<i.maxRank-1;l++){var u=i.getX(l+1);m==u?(d[l-i.minRank-1]=m,o++):this.repositionValid(t,i,l+1,m)?(d[l-i.minRank-1]=m,o++):m=d[l-i.minRank-1]=u}for(m=i.getX(l),l=i.maxRank-1;l>i.minRank+1;l--)m==(u=i.getX(l-1))?(c[l-i.minRank-2]=m,s++):this.repositionValid(t,i,l-1,m)?(c[l-i.minRank-2]=m,s++):(c[l-i.minRank-2]=i.getX(l-1),m=u);if(r<s||r<o)if(o<=s)for(l=i.maxRank-2;l>i.minRank;l--)i.setX(l,c[l-i.minRank-1]);else if(s<o)for(l=i.minRank+2;l<i.maxRank;l++)i.setX(l,d[l-i.minRank-2])}}}},mxCoordinateAssignment.prototype.repositionValid=function(e,t,n,a){e=e.ranks[n];for(var i=-1,o=0;o<e.length;o++)if(t==e[o]){i=o;break}if(i<0)return!1;if(a<(o=t.getGeneralPurposeVariable(n))){if(0==i)return!0;if(!((n=(n=(e=e[i-1]).getGeneralPurposeVariable(n))+e.width/2+this.intraCellSpacing+t.width/2)<=a))return!1}else if(o<a){if(i==e.length-1)return!0;if(!(a<=(n=(n=(e=e[i+1]).getGeneralPurposeVariable(n))-e.width/2-this.intraCellSpacing-t.width/2)))return!1}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(e,t){this.rankTopY=[],this.rankBottomY=[];for(var n=0;n<t.ranks.length;n++)this.rankTopY[n]=Number.MAX_VALUE,this.rankBottomY[n]=0;n=null,this.layout.resizeParent&&(n={});var a,i=t.edgeMapper,o=t.vertexMapper;for(a in o){var s=o[a];if(this.setVertexLocation(s),this.layout.resizeParent){s=e.model.getParent(s.cell);var r=mxCellPath.create(s);null==n[r]&&(n[r]=s)}}for(a in this.layout.resizeParent&&null!=n&&this.adjustParents(n),(this.edgeStyle==mxHierarchicalEdgeStyle.ORTHOGONAL||this.edgeStyle==mxHierarchicalEdgeStyle.POLYLINE||this.edgeStyle==mxHierarchicalEdgeStyle.CURVE)&&this.localEdgeProcessing(t),i)this.setEdgePosition(i[a])},mxCoordinateAssignment.prototype.adjustParents=function(e){var t,n=[];for(t in e)n.push(e[t]);this.layout.arrangeGroups(mxUtils.sortCells(n,!0),this.groupPadding)},mxCoordinateAssignment.prototype.localEdgeProcessing=function(e){for(var t=0;t<e.ranks.length;t++)for(var n=e.ranks[t],a=0;a<n.length;a++){var i=n[a];if(i.isVertex())for(var o=i.getPreviousLayerConnectedCells(t),s=t-1,r=0;r<2;r++){if(-1<s&&s<e.ranks.length&&null!=o&&0<o.length){for(var l=[],d=0;d<o.length;d++){var c=new WeightedCellSorter(o[d],o[d].getX(s));l.push(c)}l.sort(WeightedCellSorter.prototype.compare);var m=(c=i.x[0]-i.width/2)+i.width,u=o=0;for(s=[],d=0;d<l.length;d++){var p,g=l[d].cell;if(g.isVertex()){p=0==r?i.connectsAsSource:i.connectsAsTarget;for(var v=0;v<p.length;v++)p[v].source!=g&&p[v].target!=g||(o+=p[v].edges.length,u++,s.push(p[v]))}else o+=g.edges.length,u++,s.push(g)}for(i.width>(o+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(c+=this.prefHozEdgeSep,m-=this.prefHozEdgeSep),c+=(l=(m-c)/o)/2,m=this.minEdgeJetty-this.prefVertEdgeOff,d=u=0;d<s.length;d++){for(g=s[d].edges.length,v=mxCellPath.create(s[d].edges[0]),null==(p=this.jettyPositions[v])&&(p=[],this.jettyPositions[v]=p),d<o/2?m+=this.prefVertEdgeOff:o/2<d&&(m-=this.prefVertEdgeOff),v=0;v<g;v++)p[4*v+2*r]=c,c+=l,p[4*v+2*r+1]=m;u=Math.max(u,m)}}o=i.getNextLayerConnectedCells(t),s=t+1}}},mxCoordinateAssignment.prototype.setEdgePosition=function(e){var t=0;if(101207!=e.temp[0]){var n=e.maxRank,a=e.minRank;n==a&&(n=e.source.maxRank,a=e.target.minRank);for(var i=0,o=mxCellPath.create(e.edges[0]),s=(o=this.jettyPositions[o],e.isReversed?e.target.cell:e.source.cell),r=this.layout.graph,l=0;l<e.edges.length;l++){var d=e.edges[l],c=this.layout.getVisibleTerminal(d,!0),m=r.model.getTerminal(d,!0),u=[],p=e.isReversed;if(c!=s&&(p=!p),null!=o){var g=p?2:0,v=p?this.rankTopY[a]:this.rankBottomY[n],h=o[4*i+1+g];p&&(h=-h),v+=h,g=o[4*i+g],m=r.model.getTerminal(d,!0),this.layout.isPort(m)&&r.model.getParent(m)==c&&(g=null!=(g=r.view.getState(m))?g.x:c.geometry.x+e.source.width*m.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(g,v)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v+h))):(u.push(new mxPoint(v,g)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v+h,g)))}for(g=e.x.length-1,v=h=-1,c=e.maxRank-1,p&&(g=0,h=e.x.length,v=1,c=e.minRank+1);e.maxRank!=e.minRank&&g!=h;g+=v){m=e.x[g]+t;var b=(this.rankTopY[c]+this.rankBottomY[c+1])/2,f=(this.rankTopY[c-1]+this.rankBottomY[c])/2;if(p){var A=b;b=f,f=A}this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(m,b)),u.push(new mxPoint(m,f))):(u.push(new mxPoint(b,m)),u.push(new mxPoint(f,m))),this.limitX=Math.max(this.limitX,m),c+=v}null!=o&&(g=p?2:0,v=p?this.rankBottomY[n]:this.rankTopY[a],h=o[4*i+3-g],p&&(h=-h),v-=h,g=o[4*i+2-g],p=r.model.getTerminal(d,!1),c=this.layout.getVisibleTerminal(d,!1),this.layout.isPort(p)&&r.model.getParent(p)==c&&(g=null!=(g=r.view.getState(p))?g.x:c.geometry.x+e.target.width*p.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v-h)),u.push(new mxPoint(g,v))):(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v-h,g)),u.push(new mxPoint(v,g)))),e.isReversed&&this.processReversedEdge(e,d),this.layout.setEdgePoints(d,u),t=0==t?this.parallelEdgeSpacing:0<t?-t:-t+this.parallelEdgeSpacing,i++}e.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(e){var t=e.cell,n=e.x[0]-e.width/2,a=e.y[0]-e.height/2;this.rankTopY[e.minRank]=Math.min(this.rankTopY[e.minRank],a),this.rankBottomY[e.minRank]=Math.max(this.rankBottomY[e.minRank],a+e.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(t,n,a):this.layout.setVertexLocation(t,a,n),this.limitX=Math.max(this.limitX,n+e.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(e,t){},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,t){return null!=e&&null!=t?t.weightedValue>e.weightedValue?-1:t.weightedValue<e.weightedValue?1:t.nudge?-1:1:0},mxHierarchicalLayout.prototype=new mxGraphLayout,mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout,mxHierarchicalLayout.prototype.roots=null,mxHierarchicalLayout.prototype.resizeParent=!1,mxHierarchicalLayout.prototype.moveParent=!1,mxHierarchicalLayout.prototype.parentBorder=0,mxHierarchicalLayout.prototype.intraCellSpacing=30,mxHierarchicalLayout.prototype.interRankCellSpacing=100,mxHierarchicalLayout.prototype.interHierarchySpacing=60,mxHierarchicalLayout.prototype.parallelEdgeSpacing=10,mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH,mxHierarchicalLayout.prototype.fineTuning=!0,mxHierarchicalLayout.prototype.tightenToSource=!0,mxHierarchicalLayout.prototype.disableEdgeStyle=!0,mxHierarchicalLayout.prototype.traverseAncestors=!0,mxHierarchicalLayout.prototype.model=null,mxHierarchicalLayout.prototype.edgesCache=null,mxHierarchicalLayout.prototype.getModel=function(){return this.model},mxHierarchicalLayout.prototype.execute=function(e,t){this.parent=e;var n=this.graph.model;if(this.edgesCache={},null!=t||null!=e){if(null!=t&&null!=e){for(var a=[],i=0;i<t.length;i++)n.isAncestor(e,t[i])&&a.push(t[i]);this.roots=a}else this.roots=t;n.beginUpdate();try{this.run(e),this.resizeParent&&!this.graph.isCellCollapsed(e)&&this.graph.updateGroupBounds([e],this.parentBorder,this.moveParent)}finally{n.endUpdate()}}},mxHierarchicalLayout.prototype.findRoots=function(e,t){var n=[];if(null!=e&&null!=t){var a,i=this.graph.model,o=null,s=-1e5;for(a in t){var r=t[a];if(i.isVertex(r)&&this.graph.isCellVisible(r)){for(var l=this.getEdges(r),d=0,c=0,m=0;m<l.length;m++)this.getVisibleTerminal(l[m],!0)==r?d++:c++;0==c&&0<d&&n.push(r),s<(l=d-c)&&(s=l,o=r)}}0==n.length&&null!=o&&n.push(o)}return n},mxHierarchicalLayout.prototype.getEdges=function(e){var t=mxCellPath.create(e);if(null!=this.edgesCache[t])return this.edgesCache[t];for(var n=this.graph.model,a=[],i=this.graph.isCellCollapsed(e),o=n.getChildCount(e),s=0;s<o;s++){var r=n.getChildAt(e,s);this.isPort(r)?a=a.concat(n.getEdges(r,!0,!0)):!i&&this.graph.isCellVisible(r)||(a=a.concat(n.getEdges(r,!0,!0)))}for(a=a.concat(n.getEdges(e,!0,!0)),n=[],s=0;s<a.length;s++)((i=this.getVisibleTerminal(a[s],!0))==(o=this.getVisibleTerminal(a[s],!1))||i!=o&&(o==e&&(null==this.parent||this.graph.isValidAncestor(i,this.parent,this.traverseAncestors))||i==e&&(null==this.parent||this.graph.isValidAncestor(o,this.parent,this.traverseAncestors))))&&n.push(a[s]);return this.edgesCache[t]=n},mxHierarchicalLayout.prototype.getVisibleTerminal=function(e,t){var n=null!=(n=this.graph.view.getState(e))?n.getVisibleTerminal(t):this.graph.view.getVisibleTerminal(e,t);return this.isPort(n)&&(n=this.graph.model.getParent(n)),n},mxHierarchicalLayout.prototype.run=function(e){var t=[],n=[];if(null==this.roots&&null!=e){var a={};this.filterDescendants(e,a),this.roots=[];var i,o=!0;for(i in a)if(null!=a[i]){o=!1;break}for(;!o;){var s=this.findRoots(e,a);for(o=0;o<s.length;o++){var r=[];t.push(r),this.traverse(s[o],!0,null,n,r,t,a)}for(o=0;o<s.length;o++)this.roots.push(s[o]);for(i in o=!0,a)if(null!=a[i]){o=!1;break}}}else for(o=0;o<roots.length;o++)r=[],t.push(r),traverse(roots.get(o),!0,null,n,r,t,null);for(o=n=0;o<t.length;o++){for(i in a=[],r=t[o])a.push(r[i]);this.model=new mxGraphHierarchyModel(this,a,this.roots,e,this.tightenToSource),this.cycleStage(e),this.layeringStage(),this.crossingStage(e),n=this.placementStage(n,e)}},mxHierarchicalLayout.prototype.filterDescendants=function(e,t){var n=this.graph.model;if(n.isVertex(e)&&e!=this.parent&&this.graph.isCellVisible(e)&&(t[mxCellPath.create(e)]=e),this.traverseAncestors||e==this.parent&&this.graph.isCellVisible(e))for(var a=n.getChildCount(e),i=0;i<a;i++){var o=n.getChildAt(e,i);this.isPort(o)||this.filterDescendants(o,t)}},mxHierarchicalLayout.prototype.isPort=function(e){return!!e.geometry.relative},mxHierarchicalLayout.prototype.getEdgesBetween=function(e,t,n){n=null!=n&&n;for(var a=this.getEdges(e),i=[],o=0;o<a.length;o++){var s=this.getVisibleTerminal(a[o],!0),r=this.getVisibleTerminal(a[o],!1);(s==e&&r==t||!n&&s==t&&r==e)&&i.push(a[o])}return i},mxHierarchicalLayout.prototype.traverse=function(e,t,n,a,i,o,s){if(null!=e&&null!=a){var r=mxCellPath.create(e);if(null!=a[r]||null!=s&&null==s[r]){if(null==i[r])for(n=0;n<o.length;n++)if(null!=(e=o[n])[r]){for(l in i)e[l]=i[l];return o.pop(),e}}else{null==i[r]&&(i[r]=e),null==a[r]&&(a[r]=e),delete s[r];var l=this.getEdges(e);for(n=0;n<l.length;n++)r=this.getVisibleTerminal(l[n],!0)==e,(!t||r)&&(r=this.getVisibleTerminal(l[n],!r),i=this.traverse(r,t,l[n],a,i,o,s))}}return i},mxHierarchicalLayout.prototype.cycleStage=function(e){new mxMinimumCycleRemover(this).execute(e)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(e){new mxMedianHybridCrossingReduction(this).execute(e)},mxHierarchicalLayout.prototype.placementStage=function(e,t){var n=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,e,this.parallelEdgeSpacing);return n.fineTuning=this.fineTuning,n.execute(t),n.limitX+this.interHierarchySpacing},mxGraphModel.prototype=new mxEventSource,mxGraphModel.prototype.constructor=mxGraphModel,mxGraphModel.prototype.root=null,mxGraphModel.prototype.cells=null,mxGraphModel.prototype.maintainEdgeParent=!0,mxGraphModel.prototype.createIds=!0,mxGraphModel.prototype.prefix="",mxGraphModel.prototype.postfix="",mxGraphModel.prototype.nextId=0,mxGraphModel.prototype.currentEdit=null,mxGraphModel.prototype.updateLevel=0,mxGraphModel.prototype.endingUpdate=!1,mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())},mxGraphModel.prototype.isCreateIds=function(){return this.createIds},mxGraphModel.prototype.setCreateIds=function(e){this.createIds=e},mxGraphModel.prototype.createRoot=function(){var e=new mxCell;return e.insert(new mxCell),e},mxGraphModel.prototype.getCell=function(e){return null!=this.cells?this.cells[e]:null},mxGraphModel.prototype.filterCells=function(e,t){var n=null;if(null!=e){n=[];for(var a=0;a<e.length;a++)t(e[a])&&n.push(e[a])}return n},mxGraphModel.prototype.getDescendants=function(e){return this.filterDescendants(null,e)},mxGraphModel.prototype.filterDescendants=function(e,t){var n=[];t=t||this.getRoot(),(null==e||e(t))&&n.push(t);for(var a=this.getChildCount(t),i=0;i<a;i++){var o=this.getChildAt(t,i);n=n.concat(this.filterDescendants(e,o))}return n},mxGraphModel.prototype.getRoot=function(e){var t=e||this.root;if(null!=e)for(;null!=e;)t=e,e=this.getParent(e);return t},mxGraphModel.prototype.setRoot=function(e){return this.execute(new mxRootChange(this,e)),e},mxGraphModel.prototype.rootChanged=function(e){var t=this.root;return this.root=e,this.nextId=0,this.cells=null,this.cellAdded(e),t},mxGraphModel.prototype.isRoot=function(e){return null!=e&&this.root==e},mxGraphModel.prototype.isLayer=function(e){return this.isRoot(this.getParent(e))},mxGraphModel.prototype.isAncestor=function(e,t){for(;null!=t&&t!=e;)t=this.getParent(t);return t==e},mxGraphModel.prototype.contains=function(e){return this.isAncestor(this.root,e)},mxGraphModel.prototype.getParent=function(e){return null!=e?e.getParent():null},mxGraphModel.prototype.add=function(e,t,n){if(t!=e&&null!=e&&null!=t){null==n&&(n=this.getChildCount(e));var a=e!=this.getParent(t);this.execute(new mxChildChange(this,e,t,n)),this.maintainEdgeParent&&a&&this.updateEdgeParents(t)}return t},mxGraphModel.prototype.cellAdded=function(e){if(null!=e){if(null==e.getId()&&this.createIds&&e.setId(this.createId(e)),null!=e.getId())if((t=this.getCell(e.getId()))!=e){for(;null!=t;)e.setId(this.createId(e)),t=this.getCell(e.getId());null==this.cells&&(this.cells={}),this.cells[e.getId()]=e}mxUtils.isNumeric(e.getId())&&(this.nextId=Math.max(this.nextId,e.getId()));for(var t=this.getChildCount(e),n=0;n<t;n++)this.cellAdded(this.getChildAt(e,n))}},mxGraphModel.prototype.createId=function(e){return e=this.nextId,this.nextId++,this.prefix+e+this.postfix},mxGraphModel.prototype.updateEdgeParents=function(e,t){t=t||this.getRoot(e);for(var n=this.getChildCount(e),a=0;a<n;a++){var i=this.getChildAt(e,a);this.updateEdgeParents(i,t)}for(i=this.getEdgeCount(e),n=[],a=0;a<i;a++)n.push(this.getEdgeAt(e,a));for(a=0;a<n.length;a++)i=n[a],this.isAncestor(t,i)&&this.updateEdgeParent(i,t)},mxGraphModel.prototype.updateEdgeParent=function(e,t){for(var n=this.getTerminal(e,!0),a=this.getTerminal(e,!1),i=null;null!=n&&!this.isEdge(n)&&null!=n.geometry&&n.geometry.relative;)n=this.getParent(n);for(;null!=a&&!this.isEdge(a)&&null!=a.geometry&&a.geometry.relative;)a=this.getParent(a);if(this.isAncestor(t,n)&&this.isAncestor(t,a)&&(null!=(i=n==a?this.getParent(n):this.getNearestCommonAncestor(n,a))&&(this.getParent(i)!=this.root||this.isAncestor(i,e))&&this.getParent(e)!=i)){if(null!=(n=this.getGeometry(e))){var o=this.getOrigin(this.getParent(e)),s=this.getOrigin(i);a=s.x-o.x,o=s.y-o.y;(n=n.clone()).translate(-a,-o),this.setGeometry(e,n)}this.add(i,e,this.getChildCount(i))}},mxGraphModel.prototype.getOrigin=function(e){var t=null;return null!=e?(t=this.getOrigin(this.getParent(e)),this.isEdge(e)||null!=(e=this.getGeometry(e))&&(t.x+=e.x,t.y+=e.y)):t=new mxPoint,t},mxGraphModel.prototype.getNearestCommonAncestor=function(e,t){if(null!=e&&null!=t&&(null!=(o=mxCellPath.create(t))&&0<o.length)){var n=e,a=mxCellPath.create(n);if(o.length<a.length){n=t;var i=a,o=(a=o,i)}for(;null!=n;){if(i=this.getParent(n),0==o.indexOf(a+mxCellPath.PATH_SEPARATOR)&&null!=i)return n;a=mxCellPath.getParentPath(a),n=i}}return null},mxGraphModel.prototype.remove=function(e){return e==this.root?this.setRoot(null):null!=this.getParent(e)&&this.execute(new mxChildChange(this,null,e)),e},mxGraphModel.prototype.cellRemoved=function(e){if(null!=e&&null!=this.cells){for(var t=this.getChildCount(e)-1;0<=t;t--)this.cellRemoved(this.getChildAt(e,t));null!=this.cells&&null!=e.getId()&&delete this.cells[e.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(e,t,n){var a=this.getParent(e);return null!=t?(t!=a||a.getIndex(e)!=n)&&t.insert(e,n):null!=a&&(n=a.getIndex(e),a.remove(n)),this.contains(a)||null==t?null==t&&this.cellRemoved(e):this.cellAdded(e),a},mxGraphModel.prototype.getChildCount=function(e){return null!=e?e.getChildCount():0},mxGraphModel.prototype.getChildAt=function(e,t){return null!=e?e.getChildAt(t):null},mxGraphModel.prototype.getChildren=function(e){return null!=e?e.children:null},mxGraphModel.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraphModel.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraphModel.prototype.getChildCells=function(e,t,n){t=null!=t&&t,n=null!=n&&n;for(var a=this.getChildCount(e),i=[],o=0;o<a;o++){var s=this.getChildAt(e,o);(!n&&!t||n&&this.isEdge(s)||t&&this.isVertex(s))&&i.push(s)}return i},mxGraphModel.prototype.getTerminal=function(e,t){return null!=e?e.getTerminal(t):null},mxGraphModel.prototype.setTerminal=function(e,t,n){var a=t!=this.getTerminal(e,n);return this.execute(new mxTerminalChange(this,e,t,n)),this.maintainEdgeParent&&a&&this.updateEdgeParent(e,this.getRoot()),t},mxGraphModel.prototype.setTerminals=function(e,t,n){this.beginUpdate();try{this.setTerminal(e,t,!0),this.setTerminal(e,n,!1)}finally{this.endUpdate()}},mxGraphModel.prototype.terminalForCellChanged=function(e,t,n){var a=this.getTerminal(e,n);return null!=t?t.insertEdge(e,n):null!=a&&a.removeEdge(e,n),a},mxGraphModel.prototype.getEdgeCount=function(e){return null!=e?e.getEdgeCount():0},mxGraphModel.prototype.getEdgeAt=function(e,t){return null!=e?e.getEdgeAt(t):null},mxGraphModel.prototype.getDirectedEdgeCount=function(e,t,n){for(var a=0,i=this.getEdgeCount(e),o=0;o<i;o++){var s=this.getEdgeAt(e,o);s!=n&&this.getTerminal(s,t)==e&&a++}return a},mxGraphModel.prototype.getConnections=function(e){return this.getEdges(e,!0,!0,!1)},mxGraphModel.prototype.getIncomingEdges=function(e){return this.getEdges(e,!0,!1,!1)},mxGraphModel.prototype.getOutgoingEdges=function(e){return this.getEdges(e,!1,!0,!1)},mxGraphModel.prototype.getEdges=function(e,t,n,a){t=null==t||t,n=null==n||n,a=null==a||a;for(var i=this.getEdgeCount(e),o=[],s=0;s<i;s++){var r=this.getEdgeAt(e,s),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(a&&l==d||l!=d&&(t&&d==e||n&&l==e))&&o.push(r)}return o},mxGraphModel.prototype.getEdgesBetween=function(e,t,n){n=null!=n&&n;var a=this.getEdgeCount(e),i=this.getEdgeCount(t),o=e,s=a;for(i<a&&(s=i,o=t),a=[],i=0;i<s;i++){var r=this.getEdgeAt(o,i),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(l==e&&d==t||!n&&(d==e&&l==t))&&a.push(r)}return a},mxGraphModel.prototype.getOpposites=function(e,t,n,a){n=null==n||n,a=null==a||a;var i=[];if(null!=e)for(var o=0;o<e.length;o++){var s=this.getTerminal(e[o],!0),r=this.getTerminal(e[o],!1);s==t&&null!=r&&r!=t&&a?i.push(r):r==t&&null!=s&&s!=t&&n&&i.push(s)}return i},mxGraphModel.prototype.getTopmostCells=function(e){for(var t=[],n=0;n<e.length;n++){for(var a=e[n],i=!0,o=this.getParent(a);null!=o;){if(0<=mxUtils.indexOf(e,o)){i=!1;break}o=this.getParent(o)}i&&t.push(a)}return t},mxGraphModel.prototype.isVertex=function(e){return null!=e&&e.isVertex()},mxGraphModel.prototype.isEdge=function(e){return null!=e&&e.isEdge()},mxGraphModel.prototype.isConnectable=function(e){return null!=e&&e.isConnectable()},mxGraphModel.prototype.getValue=function(e){return null!=e?e.getValue():null},mxGraphModel.prototype.setValue=function(e,t){return this.execute(new mxValueChange(this,e,t)),t},mxGraphModel.prototype.valueForCellChanged=function(e,t){return e.valueChanged(t)},mxGraphModel.prototype.getGeometry=function(e,t){return null!=e?e.getGeometry():null},mxGraphModel.prototype.setGeometry=function(e,t){return t!=this.getGeometry(e)&&this.execute(new mxGeometryChange(this,e,t)),t},mxGraphModel.prototype.geometryForCellChanged=function(e,t){var n=this.getGeometry(e);return e.setGeometry(t),n},mxGraphModel.prototype.getStyle=function(e){return null!=e?e.getStyle():null},mxGraphModel.prototype.setStyle=function(e,t){return t!=this.getStyle(e)&&this.execute(new mxStyleChange(this,e,t)),t},mxGraphModel.prototype.styleForCellChanged=function(e,t){var n=this.getStyle(e);return e.setStyle(t),n},mxGraphModel.prototype.isCollapsed=function(e){return null!=e&&e.isCollapsed()},mxGraphModel.prototype.setCollapsed=function(e,t){return t!=this.isCollapsed(e)&&this.execute(new mxCollapseChange(this,e,t)),t},mxGraphModel.prototype.collapsedStateForCellChanged=function(e,t){var n=this.isCollapsed(e);return e.setCollapsed(t),n},mxGraphModel.prototype.isVisible=function(e){return null!=e&&e.isVisible()},mxGraphModel.prototype.setVisible=function(e,t){return t!=this.isVisible(e)&&this.execute(new mxVisibleChange(this,e,t)),t},mxGraphModel.prototype.visibleStateForCellChanged=function(e,t){var n=this.isVisible(e);return e.setVisible(t),n},mxGraphModel.prototype.execute=function(e){e.execute(),this.beginUpdate(),this.currentEdit.add(e),this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",e)),this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e)),this.endUpdate()},mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++,this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE)),1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))},mxGraphModel.prototype.endUpdate=function(){if(this.updateLevel--,0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT)),!this.endingUpdate){this.endingUpdate=0==this.updateLevel,this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{if(this.endingUpdate&&!this.currentEdit.isEmpty()){this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit));var e=this.currentEdit;this.currentEdit=this.createUndoableEdit(),e.notify(),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e))}}finally{this.endingUpdate=!1}}},mxGraphModel.prototype.createUndoableEdit=function(){var e=new mxUndoableEdit(this,!0);return e.notify=function(){e.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",e,"changes",e.changes)),e.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",e,"changes",e.changes))},e},mxGraphModel.prototype.mergeChildren=function(e,t,n){n=null==n||n,this.beginUpdate();try{var a={};for(var i in this.mergeChildrenImpl(e,t,n,a),a){var o=a[i],s=this.getTerminal(o,!0);null!=s&&(s=a[mxCellPath.create(s)],this.setTerminal(o,s,!0)),null!=(s=this.getTerminal(o,!1))&&(s=a[mxCellPath.create(s)],this.setTerminal(o,s,!1))}}finally{this.endUpdate()}},mxGraphModel.prototype.mergeChildrenImpl=function(e,t,n,a){this.beginUpdate();try{for(var i=e.getChildCount(),o=0;o<i;o++){var s=e.getChildAt(o);if("function"==typeof s.getId){var r=s.getId(),l=null==r||this.isEdge(s)&&n?null:this.getCell(r);if(null==l){var d=s.clone();d.setId(r),d.setTerminal(s.getTerminal(!0),!0),d.setTerminal(s.getTerminal(!1),!1),l=t.insert(d),this.cellAdded(l)}a[mxCellPath.create(s)]=l,this.mergeChildrenImpl(s,l,n,a)}}}finally{this.endUpdate()}},mxGraphModel.prototype.getParents=function(e){var t=[];if(null!=e)for(var n={},a=0;a<e.length;a++){var i=this.getParent(e[a]);if(null!=i){var o=mxCellPath.create(i);null==n[o]&&(n[o]=i,t.push(i))}}return t},mxGraphModel.prototype.cloneCell=function(e){return null!=e?this.cloneCells([e],!0)[0]:null},mxGraphModel.prototype.cloneCells=function(e,t){for(var n={},a=[],i=0;i<e.length;i++)null!=e[i]?a.push(this.cloneCellImpl(e[i],n,t)):a.push(null);for(i=0;i<a.length;i++)null!=a[i]&&this.restoreClone(a[i],e[i],n);return a},mxGraphModel.prototype.cloneCellImpl=function(e,t,n){var a=this.cellCloned(e);if(t[mxObjectIdentity.get(e)]=a,n){n=this.getChildCount(e);for(var i=0;i<n;i++){var o=this.cloneCellImpl(this.getChildAt(e,i),t,!0);a.insert(o)}}return a},mxGraphModel.prototype.cellCloned=function(e){return e.clone()},mxGraphModel.prototype.restoreClone=function(e,t,n){null!=(a=this.getTerminal(t,!0))&&(null!=(a=n[mxObjectIdentity.get(a)])&&a.insertEdge(e,!0)),null!=(a=this.getTerminal(t,!1))&&(null!=(a=n[mxObjectIdentity.get(a)])&&a.insertEdge(e,!1));for(var a=this.getChildCount(e),i=0;i<a;i++)this.restoreClone(this.getChildAt(e,i),this.getChildAt(t,i),n)},mxRootChange.prototype.execute=function(){this.root=this.previous,this.previous=this.model.rootChanged(this.previous)},mxChildChange.prototype.execute=function(){var e=this.model.getParent(this.child),t=null!=e?e.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1),e=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex),null!=this.previous&&this.connect(this.child,!0),this.parent=this.previous,this.previous=e,this.index=this.previousIndex,this.previousIndex=t},mxChildChange.prototype.connect=function(e,t){t=null==t||t;var n=e.getTerminal(!0),a=e.getTerminal(!1);for(null!=n&&(t?this.model.terminalForCellChanged(e,n,!0):this.model.terminalForCellChanged(e,null,!0)),null!=a&&(t?this.model.terminalForCellChanged(e,a,!1):this.model.terminalForCellChanged(e,null,!1)),e.setTerminal(n,!0),e.setTerminal(a,!1),n=this.model.getChildCount(e),a=0;a<n;a++)this.connect(this.model.getChildAt(e,a),t)},mxTerminalChange.prototype.execute=function(){this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source)},mxValueChange.prototype.execute=function(){this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous)},mxStyleChange.prototype.execute=function(){this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous)},mxGeometryChange.prototype.execute=function(){this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous)},mxCollapseChange.prototype.execute=function(){this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous)},mxVisibleChange.prototype.execute=function(){this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous)},mxCellAttributeChange.prototype.execute=function(){var e=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous),this.previous=e},mxCell.prototype.id=null,mxCell.prototype.value=null,mxCell.prototype.geometry=null,mxCell.prototype.style=null,mxCell.prototype.vertex=!1,mxCell.prototype.edge=!1,mxCell.prototype.connectable=!0,mxCell.prototype.visible=!0,mxCell.prototype.collapsed=!1,mxCell.prototype.parent=null,mxCell.prototype.source=null,mxCell.prototype.target=null,mxCell.prototype.children=null,mxCell.prototype.edges=null,mxCell.prototype.mxTransient="id value parent source target children edges".split(" "),mxCell.prototype.getId=function(){return this.id},mxCell.prototype.setId=function(e){this.id=e},mxCell.prototype.getValue=function(){return this.value},mxCell.prototype.setValue=function(e){this.value=e},mxCell.prototype.valueChanged=function(e){var t=this.getValue();return this.setValue(e),t},mxCell.prototype.getGeometry=function(){return this.geometry},mxCell.prototype.setGeometry=function(e){this.geometry=e},mxCell.prototype.getStyle=function(){return this.style},mxCell.prototype.setStyle=function(e){this.style=e},mxCell.prototype.isVertex=function(){return this.vertex},mxCell.prototype.setVertex=function(e){this.vertex=e},mxCell.prototype.isEdge=function(){return this.edge},mxCell.prototype.setEdge=function(e){this.edge=e},mxCell.prototype.isConnectable=function(){return this.connectable},mxCell.prototype.setConnectable=function(e){this.connectable=e},mxCell.prototype.isVisible=function(){return this.visible},mxCell.prototype.setVisible=function(e){this.visible=e},mxCell.prototype.isCollapsed=function(){return this.collapsed},mxCell.prototype.setCollapsed=function(e){this.collapsed=e},mxCell.prototype.getParent=function(){return this.parent},mxCell.prototype.setParent=function(e){this.parent=e},mxCell.prototype.getTerminal=function(e){return e?this.source:this.target},mxCell.prototype.setTerminal=function(e,t){return t?this.source=e:this.target=e,e},mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length},mxCell.prototype.getIndex=function(e){return mxUtils.indexOf(this.children,e)},mxCell.prototype.getChildAt=function(e){return null==this.children?null:this.children[e]},mxCell.prototype.insert=function(e,t){return null!=e&&(null==t&&(t=this.getChildCount(),e.getParent()==this&&t--),e.removeFromParent(),e.setParent(this),null==this.children?(this.children=[],this.children.push(e)):this.children.splice(t,0,e)),e},mxCell.prototype.remove=function(e){var t=null;return null!=this.children&&0<=e&&(null!=(t=this.getChildAt(e))&&(this.children.splice(e,1),t.setParent(null))),t},mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var e=this.parent.getIndex(this);this.parent.remove(e)}},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(e){return mxUtils.indexOf(this.edges,e)},mxCell.prototype.getEdgeAt=function(e){return null==this.edges?null:this.edges[e]},mxCell.prototype.insertEdge=function(e,t){return null!=e&&(e.removeFromTerminal(t),e.setTerminal(this,t),null==this.edges||e.getTerminal(!t)!=this||mxUtils.indexOf(this.edges,e)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(e)),e},mxCell.prototype.removeEdge=function(e,t){if(null!=e){if(e.getTerminal(!t)!=this&&null!=this.edges){var n=this.getEdgeIndex(e);0<=n&&this.edges.splice(n,1)}e.setTerminal(null,t)}return e},mxCell.prototype.removeFromTerminal=function(e){var t=this.getTerminal(e);null!=t&&t.removeEdge(this,e)},mxCell.prototype.getAttribute=function(e,t){var n=this.getValue();return(null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT?n.getAttribute(e):null)||t},mxCell.prototype.setAttribute=function(e,t){var n=this.getValue();null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT&&n.setAttribute(e,t)},mxCell.prototype.clone=function(){var e=mxUtils.clone(this,this.mxTransient);return e.setValue(this.cloneValue()),e},mxCell.prototype.cloneValue=function(){var e=this.getValue();return null!=e&&("function"==typeof e.clone?e=e.clone():isNaN(e.nodeType)||(e=e.cloneNode(!0))),e},mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=e}},mxGeometry.prototype.getTerminalPoint=function(e){return e?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(e,t){return t?this.sourcePoint=e:this.targetPoint=e,e},mxGeometry.prototype.translate=function(e,t){if(this.clone(),this.relative||(this.x+=e,this.y+=t),null!=this.sourcePoint&&(this.sourcePoint.x+=e,this.sourcePoint.y+=t),null!=this.targetPoint&&(this.targetPoint.x+=e,this.targetPoint.y+=t),this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(var n=this.points.length,a=0;a<n;a++){var i=this.points[a];null!=i&&(i.x+=e,i.y+=t)}};var mxCellPath={PATH_SEPARATOR:".",create:function(e){var t="";if(null!=e)for(var n=e.getParent();null!=n;)t=n.getIndex(e)+mxCellPath.PATH_SEPARATOR+t,n=(e=n).getParent();return 1<(e=t.length)&&(t=t.substring(0,e-1)),t},getParentPath:function(e){if(null!=e){var t=e.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(0<=t)return e.substring(0,t);if(0<e.length)return""}return null},resolve:function(e,t){var n=e;if(null!=t)for(var a=t.split(mxCellPath.PATH_SEPARATOR),i=0;i<a.length;i++)n=n.getChildAt(parseInt(a[i]));return n},compare:function(e,t){for(var n=Math.min(e.length,t.length),a=0,i=0;i<n;i++)if(e[i]!=t[i]){0==e[i].length||0==t[i].length?a=e[i]==t[i]?0:e[i]>t[i]?1:-1:a=(n=parseInt(e[i]))==(i=parseInt(t[i]))?0:i<n?1:-1;break}return 0==a&&((n=e.length)!=(i=t.length)&&(a=i<n?1:-1)),a}},mxPerimeter={RectanglePerimeter:function(e,t,n,a){t=e.getCenterX();var i=e.getCenterY(),o=Math.atan2(n.y-i,n.x-t),s=new mxPoint(0,0),r=Math.PI,l=Math.PI/2-o,d=Math.atan2(e.height,e.width);return o<-r+d||r-d<o?(s.x=e.x,s.y=i-e.width*Math.tan(o)/2):o<-d?(s.y=e.y,s.x=t-e.height*Math.tan(l)/2):o<d?(s.x=e.x+e.width,s.y=i+e.width*Math.tan(o)/2):(s.y=e.y+e.height,s.x=t+e.height*Math.tan(l)/2),a&&(n.x>=e.x&&n.x<=e.x+e.width?s.x=n.x:n.y>=e.y&&n.y<=e.y+e.height&&(s.y=n.y),n.x<e.x?s.x=e.x:n.x>e.x+e.width&&(s.x=e.x+e.width),n.y<e.y?s.y=e.y:n.y>e.y+e.height&&(s.y=e.y+e.height)),s},EllipsePerimeter:function(e,t,n,a){var i=e.x,o=e.y,s=e.width/2,r=e.height/2,l=i+s,d=o+r;t=n.x,n=n.y;var c=parseInt(t-l),m=parseInt(n-d);if(0==c&&0!=m)return new mxPoint(l,d+r*m/Math.abs(m));if(0==c&&0==m)return new mxPoint(t,n);if(a){if(o<=n&&n<=o+e.height)return e=n-d,e=Math.sqrt(s*s*(1-e*e/(r*r)))||0,t<=i&&(e=-e),new mxPoint(l+e,n);if(i<=t&&t<=i+e.width)return e=t-l,e=Math.sqrt(r*r*(1-e*e/(s*s)))||0,n<=o&&(e=-e),new mxPoint(t,d+e)}return d-=(i=m/c)*l,l=i*(s=(-(e=-2*l*(o=s*s*i*i+r*r))+(r=Math.sqrt(e*e-4*o*(s*s*i*i*l*l+r*r*l*l-s*s*r*r))))/(2*o))+d,d=i*(r=(-e-r)/(2*o))+d,i=Math.sqrt(Math.pow(s-t,2)+Math.pow(l-n,2)),t=Math.sqrt(Math.pow(r-t,2)+Math.pow(d-n,2)),o=n=0,i<t?(n=s,o=l):(n=r,o=d),new mxPoint(n,o)},RhombusPerimeter:function(e,t,n,a){t=e.x;var i=e.y,o=e.width,s=t+o/2,r=i+(e=e.height)/2,l=n.x;if(n=n.y,s==l)return new mxPoint(s,n<r?i:i+e);if(r==n)return new mxPoint(l<s?t:t+o,r);var d=s,c=r;return a&&(t<=l&&l<=t+o?d=l:i<=n&&n<=i+e&&(c=n)),l<s?n<r?mxUtils.intersection(l,n,d,c,s,i,t,r):mxUtils.intersection(l,n,d,c,s,i+e,t,r):n<r?mxUtils.intersection(l,n,d,c,s,i,t+o,r):mxUtils.intersection(l,n,d,c,s,i+e,t+o,r)},TrianglePerimeter:function(e,t,n,a){var i=(t=null!=t?t.style[mxConstants.STYLE_DIRECTION]:null)==mxConstants.DIRECTION_NORTH||t==mxConstants.DIRECTION_SOUTH,o=e.x,s=e.y,r=e.width,l=o+r/2,d=s+(e=e.height)/2,c=new mxPoint(o,s),m=new mxPoint(o+r,d),u=new mxPoint(o,s+e);t==mxConstants.DIRECTION_NORTH?(c=u,m=new mxPoint(l,s),u=new mxPoint(o+r,s+e)):t==mxConstants.DIRECTION_SOUTH?(m=new mxPoint(l,s+e),u=new mxPoint(o+r,s)):t==mxConstants.DIRECTION_WEST&&(c=new mxPoint(o+r,s),m=new mxPoint(o,d),u=new mxPoint(o+r,s+e));var p=n.x-l,g=n.y-d,v=(p=i?Math.atan2(p,g):Math.atan2(g,p),i?Math.atan2(r,e):Math.atan2(e,r));g=!1,g=t==mxConstants.DIRECTION_NORTH||t==mxConstants.DIRECTION_WEST?-v<p&&p<v:p<-Math.PI+v||p>Math.PI-v,v=null;return g?v=a&&(i&&n.x>=c.x&&n.x<=u.x||!i&&n.y>=c.y&&n.y<=u.y)?i?new mxPoint(n.x,c.y):new mxPoint(c.x,n.y):t==mxConstants.DIRECTION_NORTH?new mxPoint(o+r/2+e*Math.tan(p)/2,s+e):t==mxConstants.DIRECTION_SOUTH?new mxPoint(o+r/2-e*Math.tan(p)/2,s):t==mxConstants.DIRECTION_WEST?new mxPoint(o+r,s+e/2+r*Math.tan(p)/2):new mxPoint(o,s+e/2-r*Math.tan(p)/2):(a&&(a=new mxPoint(l,d),n.y>=s&&n.y<=s+e?(a.x=i?l:t==mxConstants.DIRECTION_WEST?o+r:o,a.y=n.y):n.x>=o&&n.x<=o+r&&(a.x=n.x,a.y=i?t==mxConstants.DIRECTION_NORTH?s+e:s:d),l=a.x,d=a.y),v=i&&n.x<=o+r/2||!i&&n.y<=s+e/2?mxUtils.intersection(n.x,n.y,l,d,c.x,c.y,m.x,m.y):mxUtils.intersection(n.x,n.y,l,d,m.x,m.y,u.x,u.y)),null==v&&(v=new mxPoint(l,d)),v}};function mxPrintPreview(e,t,n,a,i,o,s,r,l){this.graph=e,this.scale=null!=t?t:1/e.pageScale,this.border=null!=a?a:0,this.pageFormat=null!=n?n:e.pageFormat,this.title=null!=r?r:"Printer-friendly version",this.x0=null!=i?i:0,this.y0=null!=o?o:0,this.borderColor=s,this.pageSelector=null==l||l}function mxStylesheet(){this.styles={},this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(e,t,n){this.view=e,this.cell=t,this.style=n,this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(e){this.graph=e,this.cells=[]}function mxSelectionChange(e,t,n){this.selectionModel=e,this.added=null!=t?t.slice():null,this.removed=null!=n?n.slice():null}function mxCellEditor(e){this.graph=e}function mxCellRenderer(){}mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var e="";return 8==document.documentMode&&(e='<meta http-equiv="X-UA-Compatible" content="IE=8">'),e},mxPrintPreview.prototype.open=function(e){var t=this.graph.cellRenderer.initializeOverlay,n=null;try{if(this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(e,t){t.init(e.view.getDrawPane())}),null==this.wnd){this.wnd=window.open();var a=this.wnd.document,i=this.getDoctype();null!=i&&0<i.length&&a.writeln(i),a.writeln("<html>"),a.writeln("<head>"),this.writeHead(a,e),a.writeln("</head>"),a.writeln('<body class="mxPage">'),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",a),mxClient.IS_VML&&(a.namespaces.add("v","urn:schemas-microsoft-com:vml"),a.namespaces.add("o","urn:schemas-microsoft-com:office:office"),a.createStyleSheet().cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css",a));var o=this.graph.getGraphBounds().clone(),s=this.graph.getView().getScale(),r=s/this.scale,l=this.graph.getView().getTranslate();this.autoOrigin||(this.x0=-l.x*this.scale,this.y0=-l.y*this.scale,o.width+=o.x,o.height+=o.y,o.x=0,this.border=o.y=0),o.width/=r,o.height/=r;var d=this.pageFormat.width-2*this.border,c=this.pageFormat.height-2*this.border,m=Math.max(1,Math.ceil((o.width+this.x0)/d)),u=Math.max(1,Math.ceil((o.height+this.y0)/c));this.pageCount=m*u;var p=mxUtils.bind(this,function(){if(this.pageSelector&&(1<u||1<m)){var e=this.createPageSelector(u,m);if(a.body.appendChild(e),mxClient.IS_IE){e.style.position="absolute";var t=function(){e.style.top=a.body.scrollTop+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(e){t()}),mxEvent.addListener(this.wnd,"resize",function(e){t()})}}});if(e=function(e,t){if(null!=this.borderColor&&(e.style.borderColor=this.borderColor,e.style.borderStyle="solid",e.style.borderWidth="1px"),e.style.background="white",t&&(e.style.pageBreakAfter="always"),mxClient.IS_IE?(a.writeln(e.outerHTML),e.parentNode.removeChild(e)):(e.parentNode.removeChild(e),a.body.appendChild(e)),t){var n=a.createElement("hr");n.className="mxPageBreak",a.body.appendChild(n)}},null!=(b=this.getCoverPages(this.pageFormat.width,this.pageFormat.height)))for(var g=0;g<b.length;g++)e(b[g],!0);var v=this.getAppendices(this.pageFormat.width,this.pageFormat.height);for(g=0;g<u;g++)for(var h=g*c/this.scale-this.y0/this.scale+(o.y-l.y*s)/s,b=0;b<m;b++){if(null==this.wnd)return null;var f=b*d/this.scale-this.x0/this.scale+(o.x-l.x*s)/s,A=g*m+b+1;(n=this.renderPage(this.pageFormat.width,this.pageFormat.height,mxUtils.bind(this,function(e){this.addGraphFragment(-f,-h,this.scale,A,e)}))).setAttribute("id","mxPage-"+A),e(n,null!=v||g<u-1||b<m-1)}if(null!=v)for(g=0;g<v.length;g++)e(v[g],g<v.length);a.writeln("</body>"),a.writeln("</html>"),a.close(),p(),mxEvent.release(a.body)}this.wnd.focus()}catch(e){null!=n&&null!=n.parentNode&&n.parentNode.removeChild(n)}finally{this.graph.cellRenderer.initializeOverlay=t}return this.wnd},mxPrintPreview.prototype.writeHead=function(e,t){null!=this.title&&e.writeln("<title>"+this.title+"</title>"),e.writeln('<style type="text/css">'),e.writeln("@media print {"),e.writeln(" table.mxPageSelector { display: none; }"),e.writeln(" hr.mxPageBreak { display: none; }"),e.writeln("}"),e.writeln("@media screen {"),e.writeln(" table.mxPageSelector { position: fixed; right: 10px; top: 10px;font-family: Arial; font-size:10pt; border: solid 1px darkgray;background: white; border-collapse:collapse; }"),e.writeln(" table.mxPageSelector td { border: solid 1px gray; padding:4px; }"),e.writeln(" body.mxPage { background: gray; }"),e.writeln("}"),null!=t&&e.writeln(t),e.writeln("</style>")},mxPrintPreview.prototype.createPageSelector=function(e,t){var n=this.wnd.document,a=n.createElement("table");a.className="mxPageSelector",a.setAttribute("border","0");for(var i=n.createElement("tbody"),o=0;o<e;o++){for(var s=n.createElement("tr"),r=0;r<t;r++){var l=o*t+r+1,d=n.createElement("td");if(!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC){var c=n.createElement("a");c.setAttribute("href","#mxPage-"+l),mxUtils.write(c,l,n),d.appendChild(c)}else mxUtils.write(d,l,n);s.appendChild(d)}i.appendChild(s)}return a.appendChild(i),a},mxPrintPreview.prototype.renderPage=function(e,t,n){var a=document.createElement("div");try{a.style.width=e+"px",a.style.height=t+"px",a.style.overflow="hidden",a.style.pageBreakInside="avoid",a.style.position="relative";var i=document.createElement("div");i.style.top=this.border+"px",i.style.left=this.border+"px",i.style.width=e-2*this.border+"px",i.style.height=t-2*this.border+"px",i.style.overflow="hidden",this.graph.dialect==mxConstants.DIALECT_VML&&(i.style.position="absolute"),a.appendChild(i),document.body.appendChild(a),n(i)}catch(e){throw a.parentNode.removeChild(a),e}return a},mxPrintPreview.prototype.addGraphFragment=function(e,t,n,a,i){a=this.graph.getView();var o=this.graph.container;this.graph.container=i;var s=a.getCanvas(),r=a.getBackgroundPane(),l=a.getDrawPane(),d=a.getOverlayPane();this.graph.dialect==mxConstants.DIALECT_SVG?a.createSvg():this.graph.dialect==mxConstants.DIALECT_VML?a.createVml():a.createHtml();var c=a.isEventsEnabled();a.setEventsEnabled(!1);var m=this.graph.isEnabled();this.graph.setEnabled(!1);var u=a.getTranslate();a.translate=new mxPoint(e,t),e=null;try{var p=[this.graph.getModel().getRoot()];e=new mxTemporaryCellStates(a,n,p)}finally{if(mxClient.IS_IE)a.overlayPane.innerHTML="";else for(n=i.firstChild;null!=n;)p=n.nextSibling,"svg"==(t=n.nodeName.toLowerCase())?(n.setAttribute("width",parseInt(i.style.width)),n.setAttribute("height",parseInt(i.style.height))):"default"!=n.style.cursor&&"table"!=t&&n.parentNode.removeChild(n),n=p;a.overlayPane.parentNode.removeChild(a.overlayPane),this.graph.setEnabled(m),this.graph.container=o,a.canvas=s,a.backgroundPane=r,a.drawPane=l,a.overlayPane=d,a.translate=u,e.destroy(),a.setEventsEnabled(c)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(){var e=this.open();null!=e&&e.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},mxStylesheet.prototype.createDefaultVertexStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,e[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#774400",e},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,e[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#446299",e},mxStylesheet.prototype.putDefaultVertexStyle=function(e){this.putCellStyle("defaultVertex",e)},mxStylesheet.prototype.putDefaultEdgeStyle=function(e){this.putCellStyle("defaultEdge",e)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(e,t){this.styles[e]=t},mxStylesheet.prototype.getCellStyle=function(e,t){var n=t;if(null!=e&&0<e.length)for(var a=e.split(";"),i=(n=null!=n&&";"!=e.charAt(0)?mxUtils.clone(n):{},0);i<a.length;i++){var o=(s=a[i]).indexOf("=");if(0<=o){var s,r=s.substring(0,o);(s=s.substring(o+1))==mxConstants.NONE?delete n[r]:mxUtils.isNumeric(s)?n[r]=parseFloat(s):n[r]=s}else if(null!=(s=this.styles[s]))for(r in s)n[r]=s[r]}return n},mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalid=!0,mxCellState.prototype.invalidOrder=!1,mxCellState.prototype.orderChanged=!1,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.getPerimeterBounds=function(e,t){if(e=e||0,t=null!=t?t:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil){var n=this.shape.stencil.computeAspect(this.style,t.x,t.y,t.width,t.height);t.x=n.x,t.y=n.y,t.width=this.shape.stencil.w0*n.width,t.height=this.shape.stencil.h0*n.height}return 0!=e&&t.grow(e),t},mxCellState.prototype.setAbsoluteTerminalPoint=function(e,t){t?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[0]=e):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(e)):1==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[this.absolutePoints.length-1]=e},mxCellState.prototype.setCursor=function(e){null!=this.shape&&this.shape.setCursor(e),null!=this.text&&this.text.setCursor(e)},mxCellState.prototype.getVisibleTerminal=function(e){return null!=(e=this.getVisibleTerminalState(e))?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(e){return e?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(e,t){t?this.visibleSourceState=e:this.visibleTargetState=e},mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)},mxCellState.prototype.clone=function(){var e=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){e.absolutePoints=[];for(var t=0;t<this.absolutePoints.length;t++)e.absolutePoints[t]=this.absolutePoints[t].clone()}return null!=this.origin&&(e.origin=this.origin.clone()),null!=this.absoluteOffset&&(e.absoluteOffset=this.absoluteOffset.clone()),null!=this.boundingBox&&(e.boundingBox=this.boundingBox.clone()),e.terminalDistance=this.terminalDistance,e.segments=this.segments,e.length=this.length,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e},mxGraphSelectionModel.prototype=new mxEventSource,mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel,mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"",mxGraphSelectionModel.prototype.graph=null,mxGraphSelectionModel.prototype.singleSelection=!1,mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection},mxGraphSelectionModel.prototype.setSingleSelection=function(e){this.singleSelection=e},mxGraphSelectionModel.prototype.isSelected=function(e){return null!=e&&0<=mxUtils.indexOf(this.cells,e)},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(e){null!=e&&this.setCells([e])},mxGraphSelectionModel.prototype.setCells=function(e){if(null!=e){this.singleSelection&&(e=[this.getFirstSelectableCell(e)]);for(var t=[],n=0;n<e.length;n++)this.graph.isCellSelectable(e[n])&&t.push(e[n]);this.changeSelection(t,this.cells)}},mxGraphSelectionModel.prototype.getFirstSelectableCell=function(e){if(null!=e)for(var t=0;t<e.length;t++)if(this.graph.isCellSelectable(e[t]))return e[t];return null},mxGraphSelectionModel.prototype.addCell=function(e){null!=e&&this.addCells([e])},mxGraphSelectionModel.prototype.addCells=function(e){if(null!=e){var t=null;this.singleSelection&&(t=this.cells,e=[this.getFirstSelectableCell(e)]);for(var n=[],a=0;a<e.length;a++)!this.isSelected(e[a])&&this.graph.isCellSelectable(e[a])&&n.push(e[a]);this.changeSelection(n,t)}},mxGraphSelectionModel.prototype.removeCell=function(e){null!=e&&this.removeCells([e])},mxGraphSelectionModel.prototype.removeCells=function(e){if(null!=e){for(var t=[],n=0;n<e.length;n++)this.isSelected(e[n])&&t.push(e[n]);this.changeSelection(null,t)}},mxGraphSelectionModel.prototype.changeSelection=function(e,t){if(null!=e&&0<e.length&&null!=e[0]||null!=t&&0<t.length&&null!=t[0]){var n=new mxSelectionChange(this,e,t);n.execute();var a=new mxUndoableEdit(this,!1);a.add(n),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",a))}},mxGraphSelectionModel.prototype.cellAdded=function(e){null!=e&&!this.isSelected(e)&&this.cells.push(e)},mxGraphSelectionModel.prototype.cellRemoved=function(e){null!=e&&(0<=(e=mxUtils.indexOf(this.cells,e))&&this.cells.splice(e,1))},mxSelectionChange.prototype.execute=function(){var e=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var t=0;t<this.removed.length;t++)this.selectionModel.cellRemoved(this.removed[t]);if(null!=this.added)for(t=0;t<this.added.length;t++)this.selectionModel.cellAdded(this.added[t]);t=this.added,this.added=this.removed,this.removed=t,window.status=mxResources.get(this.selectionModel.doneResource)||this.selectionModel.doneResource,mxLog.leave("mxSelectionChange.execute",e),this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))},mxCellEditor.prototype.graph=null,mxCellEditor.prototype.textarea=null,mxCellEditor.prototype.editingCell=null,mxCellEditor.prototype.trigger=null,mxCellEditor.prototype.modified=!1,mxCellEditor.prototype.autoSize=!0,mxCellEditor.prototype.emptyLabelText="",mxCellEditor.prototype.textNode="",mxCellEditor.prototype.init=function(){this.textarea=document.createElement("textarea"),this.textarea.className="mxCellEditor",this.textarea.style.position="absolute",this.textarea.style.overflow="visible",this.textarea.setAttribute("cols","20"),this.textarea.setAttribute("rows","4"),mxClient.IS_NS&&(this.textarea.style.resize="none"),mxEvent.addListener(this.textarea,"blur",mxUtils.bind(this,function(e){this.focusLost()})),mxEvent.addListener(this.textarea,"keydown",mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(113==e.keyCode||this.graph.isEnterStopsCellEditing()&&13==e.keyCode&&!mxEvent.isControlDown(e)&&!mxEvent.isShiftDown(e)?(this.graph.stopEditing(!1),mxEvent.consume(e)):27==e.keyCode?(this.graph.stopEditing(!0),mxEvent.consume(e)):(this.clearOnChange&&(this.clearOnChange=!1,this.textarea.value=""),this.setModified(!0)))})),mxEvent.addListener(this.textarea,"keypress",mxUtils.bind(this,function(e){this.autoSize&&!mxEvent.isConsumed(e)&&setTimeout(mxUtils.bind(this,function(){this.resize()}),0)}))},mxCellEditor.prototype.resize=function(){if(null!=this.textDiv){var e=this.graph.getView().getState(this.editingCell),t=this.graph.isLabelClipped(e.cell),n=this.graph.isWrapping(e.cell);if(this.graph.getModel().isEdge(e.cell))this.bounds.x=e.absoluteOffset.x,this.bounds.y=e.absoluteOffset.y,this.bounds.width=0,this.bounds.height=0;else if(null!=this.bounds){this.bounds.x=e.x,this.bounds.y=e.y,this.bounds.width=e.width,this.bounds.height=e.height,(a=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?this.bounds.x-=e.width:a==mxConstants.ALIGN_RIGHT&&(this.bounds.x+=e.width),(a=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?this.bounds.y-=e.height:a==mxConstants.ALIGN_BOTTOM&&(this.bounds.y+=e.height)}"\n"!=(a=this.textarea.value).charAt(a.length-1)&&""!=a||(a+=" "),a=mxUtils.htmlEntities(a,!1),n?(this.textDiv.style.whiteSpace="normal",this.textDiv.style.width=this.bounds.width+"px"):a=a.replace(/ /g," "),a=a.replace(/\n/g,"<br/>"),this.textDiv.innerHTML=a;var a=this.textDiv.offsetWidth+30,i=this.textDiv.offsetHeight+16;a=Math.max(a,40),i=Math.max(i,20);t&&(a=Math.min(this.bounds.width-4,a),i=Math.min(this.bounds.height,i));var o=null!=e.text?e.text.margin:null;null==o&&(o=mxUtils.getValue(e.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),e=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getAlignmentAsPoint(o,e)),null!=o&&(!t&&n||(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-o.x*this.bounds.width+o.x*a)-3)+"px"),this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-o.y*this.bounds.height+o.y*i)+4)+"px"),!t&&n||(this.textarea.style.width=a+"px"),this.textarea.style.height=i+"px"}},mxCellEditor.prototype.isModified=function(){return this.modified},mxCellEditor.prototype.setModified=function(e){this.modified=e},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.startEditing=function(e,t){null==this.textarea&&this.init(),this.stopEditing(!0);var n=this.graph.getView().getState(e);if(null!=n){this.editingCell=e,this.trigger=t,(this.textNode=null)!=n.text&&this.isHideLabel(n)&&(this.textNode=n.text.node,this.textNode.style.visibility="hidden");var a=this.graph.getView().scale,i=(a=mxUtils.getValue(n.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)*a,mxUtils.getValue(n.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)),o=mxUtils.getValue(n.style,mxConstants.STYLE_FONTCOLOR,"black"),s=mxUtils.getValue(n.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),r=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,l=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,d=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.fontSize=Math.round(a)+"px",this.textarea.style.lineHeight=Math.round(a*mxConstants.LINE_HEIGHT)+"px",this.textarea.style.fontFamily=i,this.textarea.style.textAlign=s,this.textarea.style.color=o,this.textarea.style.fontWeight=r?"bold":"normal",this.textarea.style.fontStyle=l?"italic":"",this.textarea.style.textDecoration=d?"underline":"",this.textarea.style.overflow="auto",this.textarea.style.outline="none",this.bounds=a=this.getEditorBounds(n),this.textarea.style.left=a.x+"px",this.textarea.style.top=a.y+"px",this.textarea.style.width=a.width+"px",this.textarea.style.height=a.height+"px",this.textarea.style.zIndex=5,null==(n=this.getInitialValue(n,t))||0==n.length?(n=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=!1,this.setModified(!1),this.textarea.value=n,this.graph.container.appendChild(this.textarea),"none"!=this.textarea.style.display&&(this.autoSize&&(this.textDiv=this.createTextDiv(),document.body.appendChild(this.textDiv),this.resize()),this.textarea.focus(),this.textarea.select())}},mxCellEditor.prototype.createTextDiv=function(){var e=document.createElement("div"),t=e.style;return t.position="absolute",t.whiteSpace="nowrap",t.visibility="hidden",t.display=mxClient.IS_QUIRKS?"inline":"inline-block",t.zoom="1",t.verticalAlign="top",t.lineHeight=this.textarea.style.lineHeight,t.fontSize=this.textarea.style.fontSize,t.fontFamily=this.textarea.style.fontFamily,t.fontWeight=this.textarea.style.fontWeight,t.textAlign=this.textarea.style.textAlign,t.fontStyle=this.textarea.style.fontStyle,t.textDecoration=this.textarea.style.textDecoration,e},mxCellEditor.prototype.stopEditing=function(e){null!=this.editingCell&&(null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null),!e&&this.isModified()&&this.graph.labelChanged(this.editingCell,this.getCurrentValue(),this.trigger),null!=this.textDiv&&(document.body.removeChild(this.textDiv),this.textDiv=null),this.bounds=this.trigger=this.editingCell=null,this.textarea.blur(),this.textarea.parentNode.removeChild(this.textarea))},mxCellEditor.prototype.getInitialValue=function(e,t){return this.graph.getEditingValue(e.cell,t)},mxCellEditor.prototype.getCurrentValue=function(){return this.textarea.value.replace(/\r/g,"")},mxCellEditor.prototype.isHideLabel=function(e){return!0},mxCellEditor.prototype.getMinimumSize=function(e){var t=this.graph.getView().scale;return new mxRectangle(0,0,null==e.text?30:e.text.size*t+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(e){var t=this.graph.getModel().isEdge(e.cell),n=this.graph.getView().scale,a=(i=this.getMinimumSize(e)).width,i=i.height,o=parseInt(e.style[mxConstants.STYLE_SPACING]||2)*n,s=parseInt(e.style[mxConstants.STYLE_SPACING_TOP]||0)*n+o,r=parseInt(e.style[mxConstants.STYLE_SPACING_RIGHT]||0)*n+o,l=parseInt(e.style[mxConstants.STYLE_SPACING_BOTTOM]||0)*n+o;n=parseInt(e.style[mxConstants.STYLE_SPACING_LEFT]||0)*n+o,r=new mxRectangle(e.x,e.y,Math.max(a,e.width-n-r),Math.max(i,e.height-s-l));return t?(r.x=e.absoluteOffset.x,r.y=e.absoluteOffset.y,null!=e.text&&null!=e.text.boundingBox&&(0<e.text.boundingBox.x&&(r.x=e.text.boundingBox.x),0<e.text.boundingBox.y&&(r.y=e.text.boundingBox.y))):null!=e.text&&null!=e.text.boundingBox&&(r.x=Math.min(r.x,e.text.boundingBox.x),r.y=Math.min(r.y,e.text.boundingBox.y)),r.x+=n,r.y+=s,null!=e.text&&null!=e.text.boundingBox&&(t?(r.width=Math.max(a,e.text.boundingBox.width),r.height=Math.max(i,e.text.boundingBox.height)):(r.width=Math.max(r.width,e.text.boundingBox.width),r.height=Math.max(r.height,e.text.boundingBox.height))),this.graph.getModel().isVertex(e.cell)&&((t=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?r.x-=e.width:t==mxConstants.ALIGN_RIGHT&&(r.x+=e.width),(t=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?r.y-=e.height:t==mxConstants.ALIGN_BOTTOM&&(r.y+=e.height)),r},mxCellEditor.prototype.getEmptyLabelText=function(e){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null)},mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.defaultShapes={},mxCellRenderer.registerShape=function(e,t){mxCellRenderer.prototype.defaultShapes[e]=t},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initialize=function(e,t){var n=e.view.graph.getModel();null!=e.view.graph.container&&null==e.shape&&e.cell!=e.view.currentRoot&&(n.isVertex(e.cell)||n.isEdge(e.cell))&&(this.createShape(e),null==e.shape||null!=t&&!t||(this.initializeShape(e),e.view.graph.ordered||n.isEdge(e.cell)?e.invalidOrder=!0:e.view.graph.keepEdgesInForeground&&null!=this.firstEdge&&(this.firstEdge.parentNode==e.shape.node.parentNode?this.insertState(e,this.firstEdge):this.firstEdge=null),e.shape.scale=e.view.scale,this.createCellOverlays(e),this.installListeners(e)))},mxCellRenderer.prototype.initializeShape=function(e){e.shape.init(e.view.getDrawPane())},mxCellRenderer.prototype.getPreviousStateInContainer=function(e,t){for(var n=null,a=e.view.graph,i=a.getModel(),o=e.cell,s=i.getParent(o);null!=s&&null==n;)n=this.findPreviousStateInContainer(a,s,o,t),o=s,s=i.getParent(o);return n},mxCellRenderer.prototype.findPreviousStateInContainer=function(e,t,n,a){var i=null,o=e.getModel();for(n=null!=n?t.getIndex(n)-1:o.getChildCount(t)-1;0<=n&&null==i;n--)i=this.findPreviousStateInContainer(e,o.getChildAt(t,n),null,a);return null!=i||(null==(i=e.view.getState(t))||null!=i.shape&&null!=i.shape.node&&i.shape.node.parentNode==a)||(i=null),i},mxCellRenderer.prototype.order=function(e){var t=e.shape.node.parentNode,n=this.getPreviousStateInContainer(e,t),a=t.firstChild;null!=n&&(a=n.shape.node,null!=n.text&&null!=n.text.node&&n.text.node.parentNode==t&&(a=n.text.node),a=a.nextSibling),this.insertState(e,a)},mxCellRenderer.prototype.orderEdge=function(e){var t=(n=e.view).graph.getModel();if(n.graph.keepEdgesInForeground)null!=this.firstEdge&&null!=this.firstEdge.parentNode&&this.firstEdge.parentNode==e.shape.node.parentNode||(this.firstEdge=e.shape.node);else if(n.graph.keepEdgesInBackground){var n,a=e.shape.node,i=a.parentNode;t=t.getParent(e.cell);null!=(i=null!=(n=n.getState(t))&&null!=n.shape&&null!=n.shape.node?n.shape.node.nextSibling:i.firstChild)&&i!=a&&this.insertState(e,i)}},mxCellRenderer.prototype.insertState=function(e,t){e.shape.node.parentNode.insertBefore(e.shape.node,t),null!=e.text&&null!=e.text.node&&e.text.node.parentNode==e.shape.node.parentNode&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling)},mxCellRenderer.prototype.createShape=function(e){if(null!=e.style){var t=mxStencilRegistry.getStencil(e.style[mxConstants.STYLE_SHAPE]);null!=t?e.shape=new mxShape(t):(t=this.getShapeConstructor(e),e.shape=new t),e.shape.points=e.absolutePoints,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.dialect=e.view.graph.dialect,this.configureShape(e)}},mxCellRenderer.prototype.getShape=function(e){return null!=e?mxCellRenderer.prototype.defaultShapes[e]:null},mxCellRenderer.prototype.getShapeConstructor=function(e){var t=this.getShape(e.style[mxConstants.STYLE_SHAPE]);return null==t&&(t=e.view.graph.getModel().isEdge(e.cell)?this.defaultEdgeShape:this.defaultVertexShape),t},mxCellRenderer.prototype.configureShape=function(e){e.shape.apply(e),e.shape.image=e.view.graph.getImage(e),e.shape.indicatorShape=this.getShape(e.view.graph.getIndicatorShape(e)),e.shape.indicatorColor=e.view.graph.getIndicatorColor(e),e.shape.indicatorGradientColor=e.view.graph.getIndicatorGradientColor(e),e.shape.indicatorDirection=e.style[mxConstants.STYLE_INDICATOR_DIRECTION],e.shape.indicatorImage=e.view.graph.getIndicatorImage(e),this.postConfigureShape(e)},mxCellRenderer.prototype.postConfigureShape=function(e){null!=e.shape&&(this.resolveColor(e,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(e,"fill",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(e,"gradient",mxConstants.STYLE_GRADIENTCOLOR))},mxCellRenderer.prototype.resolveColor=function(e,t,n){var a=e.shape[t],i=e.view.graph,o=null;"inherit"==a?o=i.model.getParent(e.cell):"swimlane"==a?(o=null!=i.model.getTerminal(e.cell,!1)?i.model.getTerminal(e.cell,!1):e.cell,o=i.getSwimlane(o),n=i.swimlaneIndicatorColorAttribute):"indicated"==a&&(e.shape[t]=e.shape.indicatorColor),null!=o&&(a=i.getView().getState(o),(e.shape[t]=null)!=a&&(e.shape[t]=null!=a.shape&&"indicatorColor"!=t?a.shape[t]:a.style[n]))},mxCellRenderer.prototype.getLabelValue=function(e){return e.view.graph.getLabel(e.cell)},mxCellRenderer.prototype.createLabel=function(n,e){var a=n.view.graph;if(a.getModel().isEdge(n.cell),0<n.style[mxConstants.STYLE_FONTSIZE]||null==n.style[mxConstants.STYLE_FONTSIZE]){var t=a.isHtmlLabel(n.cell)||null!=e&&mxUtils.isNode(e);n.text=new this.defaultTextShape(e,new mxRectangle,n.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,a.getVerticalAlign(n),n.style[mxConstants.STYLE_FONTCOLOR],n.style[mxConstants.STYLE_FONTFAMILY],n.style[mxConstants.STYLE_FONTSIZE],n.style[mxConstants.STYLE_FONTSTYLE],n.style[mxConstants.STYLE_SPACING],n.style[mxConstants.STYLE_SPACING_TOP],n.style[mxConstants.STYLE_SPACING_RIGHT],n.style[mxConstants.STYLE_SPACING_BOTTOM],n.style[mxConstants.STYLE_SPACING_LEFT],n.style[mxConstants.STYLE_HORIZONTAL],n.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],n.style[mxConstants.STYLE_LABEL_BORDERCOLOR],a.isWrapping(n.cell)&&a.isHtmlLabel(n.cell),a.isLabelClipped(n.cell),n.style[mxConstants.STYLE_OVERFLOW],n.style[mxConstants.STYLE_LABEL_PADDING]),n.text.opacity=mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_OPACITY,100),n.text.dialect=t?mxConstants.DIALECT_STRICTHTML:n.view.graph.dialect,n.text.state=n,this.initializeLabel(n);var i=!1,o=function(e){var t=n;return(mxClient.IS_TOUCH||i)&&(t=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,t,e),t=a.view.getState(a.getCellAt(e.x,e.y))),t};mxEvent.addGestureListeners(n.text.node,mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&(a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,n)),i=a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName)}),mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,o(e)))}),mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&(a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,o(e))),i=!1)})),mxEvent.addListener(n.text.node,"dblclick",mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&(a.dblClick(e,n.cell),mxEvent.consume(e))}))}},mxCellRenderer.prototype.initializeLabel=function(e){var t=e.view.graph;e.text.dialect!=mxConstants.DIALECT_SVG&&(mxClient.IS_SVG&&mxClient.NO_FO?e.text.init(t.container):mxUtils.isVml(e.view.getDrawPane())&&(null!=e.shape.label?e.text.init(e.shape.label):e.text.init(e.shape.node))),null==e.text.node&&(e.text.init(e.view.getDrawPane()),null!=e.shape&&null!=e.text&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling))},mxCellRenderer.prototype.createCellOverlays=function(e){var t=e.view.graph.getCellOverlays(e.cell),n=null;if(null!=t){n=new mxDictionary;for(var a=0;a<t.length;a++){var i=null!=e.overlays?e.overlays.remove(t[a]):null;null==i&&((i=new mxImageShape(new mxRectangle,t[a].image.src)).dialect=e.view.graph.dialect,i.preserveImageAspect=!1,i.overlay=t[a],this.initializeOverlay(e,i),this.installCellOverlayListeners(e,t[a],i),null!=t[a].cursor&&(i.node.style.cursor=t[a].cursor)),n.put(t[a],i)}}null!=e.overlays&&e.overlays.visit(function(e,t){t.destroy()}),e.overlays=n},mxCellRenderer.prototype.initializeOverlay=function(e,t){t.init(e.view.getOverlayPane())},mxCellRenderer.prototype.installCellOverlayListeners=function(t,n,e){var a=t.view.graph;mxEvent.addListener(e.node,"click",function(e){a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),n.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",t.cell))}),mxEvent.addGestureListeners(e.node,function(e){mxEvent.consume(e)},function(e){a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))}),mxClient.IS_TOUCH&&mxEvent.addListener(e.node,"touchend",function(e){n.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",t.cell))})},mxCellRenderer.prototype.createControl=function(n){var a=n.view.graph,e=a.getFoldingImage(n);if(a.foldingEnabled&&null!=e){if(null==n.control){var t=new mxRectangle(0,0,e.width,e.height);n.control=new mxImageShape(t,e.src),n.control.preserveImageAspect=!1,n.control.dialect=a.dialect,this.initControl(n,n.control,!0,function(e){if(a.isEnabled()){var t=!a.isCellCollapsed(n.cell);a.foldCells(t,!1,[n.cell]),mxEvent.consume(e)}})}}else null!=n.control&&(n.control.destroy(),n.control=null)},mxCellRenderer.prototype.initControl=function(t,e,n,a){var i=t.view.graph;return i.isHtmlLabel(t.cell)&&mxClient.NO_FO&&i.dialect==mxConstants.DIALECT_SVG?(e.dialect=mxConstants.DIALECT_PREFERHTML,e.init(i.container),e.node.style.zIndex=1):e.init(t.view.getOverlayPane()),e=e.innerNode||e.node,a&&(i.isEnabled()&&(e.style.cursor="pointer"),mxEvent.addListener(e,"click",a)),n&&mxEvent.addGestureListeners(e,function(e){i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),mxEvent.consume(e)},function(e){i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))}),e},mxCellRenderer.prototype.isShapeEvent=function(e,t){return!0},mxCellRenderer.prototype.isLabelEvent=function(e,t){return!0},mxCellRenderer.prototype.installListeners=function(n){var a=n.view.graph,t=function(e){var t=n;return(a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName||mxClient.IS_TOUCH)&&(t=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,t,e),t=a.view.getState(a.getCellAt(e.x,e.y))),t},i=!1;mxEvent.addListener(n.shape.node,"gesturestart",mxUtils.bind(this,function(e){a.lastTouchTime=0,i=!0,mxEvent.consume(e)})),mxEvent.addGestureListeners(n.shape.node,mxUtils.bind(this,function(e){this.isShapeEvent(n,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:n)):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(n,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:t(e))):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(n,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:t(e))):i&&mxEvent.consume(e)}));var o=mxClient.IS_TOUCH?"gestureend":"dblclick";mxEvent.addListener(n.shape.node,o,mxUtils.bind(this,function(e){i=!1,"gestureend"==o?(a.lastTouchTime=0,a.gestureEnabled&&(a.handleGesture(n,e),mxEvent.consume(e))):this.isShapeEvent(n,e)&&(a.dblClick(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:n.cell),mxEvent.consume(e))}))},mxCellRenderer.prototype.redrawLabel=function(e,t){var n=this.getLabelValue(e);if(null==e.text&&null!=n&&(mxUtils.isNode(n)||0<n.length)?this.createLabel(e,n):null==e.text||null!=n&&0!=n.length||(e.text.destroy(),e.text=null),null!=e.text){var a=(i=e.view.graph).isWrapping(e.cell),i=i.isLabelClipped(e.cell),o=this.getLabelBounds(e);!t&&e.text.value==n&&e.text.isWrapping==a&&e.text.isClipping==i&&e.text.scale==e.view.scale&&e.text.bounds.equals(o)||(e.text.value=n,e.text.bounds=o,e.text.scale=this.getTextScale(e),e.text.isWrapping=a,e.text.isClipping=i,e.text.redraw())}},mxCellRenderer.prototype.getTextScale=function(e){return e.view.scale},mxCellRenderer.prototype.getLabelBounds=function(e){var t=e.view.graph,n=e.view.scale,a=t.getModel().isEdge(e.cell),i=new mxRectangle(e.absoluteOffset.x,e.absoluteOffset.y);return e.text.updateMargin(),a?(a=e.text.getSpacing(),i.x+=a.x*n,i.y+=a.y*n,null!=(t=t.getCellGeometry(e.cell))&&(i.width=Math.max(0,e.text.margin.x*t.width*n-e.text.spacingLeft*n-e.text.spacingRight*n),i.height=Math.max(0,e.text.margin.y*t.height*n-e.text.spacingTop*n-e.text.spacingBottom*n))):(e.text.isPaintBoundsInverted()&&(a=i.x,i.x=i.y,i.y=a),i.x+=e.x,i.y+=e.y,i.width=Math.max(1,e.width),i.height=Math.max(1,e.height),t.isSwimlane(e.cell)&&(0<(t=t.getStartSize(e.cell)).width?(a=Math.min(i.width,t.width*n),e.shape.flipH&&(i.x+=i.width-a),i.width=a):0<t.height&&(a=Math.min(i.height,t.height*n),e.shape.flipV&&(i.y+=i.height-a),i.height=a)),this.rotateLabelBounds(e,i)),i},mxCellRenderer.prototype.rotateLabelBounds=function(e,t){if(e.text.isPaintBoundsInverted()){var n=(e.width-e.height)/2;t.x+=n,t.y-=n,n=t.width,t.width=t.height,t.height=n}if(t.x-=e.text.margin.x*t.width,t.y-=e.text.margin.y*t.height,"fill"!=e.style[mxConstants.STYLE_OVERFLOW]){n=e.view.scale;var a=e.text.getSpacing();t.x+=a.x*n,t.y+=a.y*n,t.width=Math.max(0,t.width-e.text.spacingLeft*n-e.text.spacingRight*n),t.height=Math.max(0,t.height-e.text.spacingTop*n-e.text.spacingBottom*n)}var i=e.text.getTextRotation();0!=i&&null!=e&&e.view.graph.model.isVertex(e.cell)&&(n=e.getCenterX(),a=e.getCenterY(),t.x!=n||t.y!=a)&&(i*=Math.PI/180,pt=mxUtils.getRotatedPoint(new mxPoint(t.x,t.y),Math.cos(i),Math.sin(i),new mxPoint(n,a)),t.x=pt.x,t.y=pt.y)},mxCellRenderer.prototype.redrawCellOverlays=function(o,s){if(this.createCellOverlays(o),null!=o.overlays){var r=mxUtils.mod(mxUtils.getValue(o.style,mxConstants.STYLE_ROTATION,0),90),e=mxUtils.toRadians(r),l=Math.cos(e),d=Math.sin(e);o.overlays.visit(function(e,t){var n=t.overlay.getBounds(o);if(!o.view.graph.getModel().isEdge(o.cell)&&null!=o.shape&&0!=r){var a=n.getCenterX(),i=n.getCenterY();a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),l,d,new mxPoint(o.getCenterX(),o.getCenterY()))).x,i=i.y;n.x=Math.round(a-n.width/2),n.y=Math.round(i-n.height/2)}!s&&null!=t.bounds&&t.scale==o.view.scale&&t.bounds.equals(n)||(t.bounds=n,t.scale=o.view.scale,t.redraw())})}},mxCellRenderer.prototype.redrawControl=function(e,t){if(null!=e.control){var n=this.getControlBounds(e),a=this.legacyControlPosition?mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0):e.shape.getTextRotation(),i=e.view.scale;!t&&e.control.scale==i&&e.control.bounds.equals(n)&&e.control.rotation==a||(e.control.rotation=a,e.control.bounds=n,e.control.scale=i,e.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(e){if(null!=e.control){var t=e.control.scale,n=e.control.bounds.width/t,a=(t=e.control.bounds.height/t,e.view.scale),i=e.getCenterX(),o=e.getCenterY();if(!e.view.graph.getModel().isEdge(e.cell)&&(i=e.x+n*a,o=e.y+t*a,null!=e.shape)){var s=e.shape.getShapeRotation();if(this.legacyControlPosition)s=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0);else if(e.shape.isPaintBoundsInverted()){var r=(e.width-e.height)/2;i=i+r,o=o-r}0!=s&&(r=mxUtils.toRadians(s),s=Math.cos(r),r=Math.sin(r),i=(o=mxUtils.getRotatedPoint(new mxPoint(i,o),s,r,new mxPoint(e.getCenterX(),e.getCenterY()))).x,o=o.y)}return e.view.graph.getModel().isEdge(e.cell),new mxRectangle(Math.round(i-n/2*a),Math.round(o-t/2*a),Math.round(n*a),Math.round(t*a))}return null},mxCellRenderer.prototype.redraw=function(e,t,n){if(null!=e.shape){var a=!1;e.view.graph.getModel().isEdge(e.cell),reconfigure=null!=t&&t,this.createControl(e),(e.orderChanged||e.invalidOrder)&&(e.view.graph.ordered?this.order(e):this.orderEdge(e)),!e.orderChanged&&mxUtils.equalEntries(e.shape.style,e.style)||(this.configureShape(e),t=!0),delete e.invalidOrder,delete e.orderChanged,!t&&null!=e.shape.bounds&&e.shape.scale==e.view.scale&&e.shape.bounds.equals(e)&&mxUtils.equalPoints(e.shape.points,e.absolutePoints)||(a=!0,e.shape.points=null!=e.absolutePoints?e.absolutePoints.slice():null,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.scale=e.view.scale,null==n||n?e.shape.redraw():e.shape.updateBoundingBox()),(null==n||n)&&(this.redrawLabel(e,a),this.redrawCellOverlays(e,a),this.redrawControl(e,a))}},mxCellRenderer.prototype.destroy=function(e){null!=e.shape&&(null!=e.text&&(e.text.destroy(),e.text=null),null!=e.overlays&&(e.overlays.visit(function(e,t){t.destroy()}),e.overlays=null),null!=e.control&&(e.control.destroy(),e.control=null),e.shape.destroy(),e.shape=null)};var mxEdgeStyle={EntityRelation:function(e,t,n,a,i){var o=e.view,s=o.graph;a=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*o.scale;var r=(d=e.absolutePoints)[0],l=d[d.length-1],d=!1;if(null!=r)(t=new mxCellState).x=r.x,t.y=r.y;else{if(null==t)return;var c=mxUtils.getPortConstraints(t,e,!0,mxConstants.DIRECTION_MASK_NONE);c!=mxConstants.DIRECTION_MASK_NONE?d=c==mxConstants.DIRECTION_MASK_WEST:(r=s.getCellGeometry(t.cell)).relative?d=r.x<=.5:null!=n&&(d=n.x+n.width<t.x)}r=!0,null!=l?((n=new mxCellState).x=l.x,n.y=l.y):null!=n&&((c=mxUtils.getPortConstraints(n,e,!1,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE?r=c==mxConstants.DIRECTION_MASK_WEST:(e=s.getCellGeometry(n.cell)).relative?r=e.x<=.5:null!=t&&(r=t.x+t.width<n.x)),null!=t&&null!=n&&(e=d?t.x:t.x+t.width,t=o.getRoutingCenterY(t),s=r?n.x:n.x+n.width,n=o.getRoutingCenterY(n),o=new mxPoint(e+(d?-a:a),t),l=new mxPoint(s+(r?-a:a),n),d==r?(a=d?Math.min(e,s)-a:Math.max(e,s)+a,i.push(new mxPoint(a,t)),i.push(new mxPoint(a,n))):(o.x<l.x==d?(a=t+(n-t)/2,i.push(o),i.push(new mxPoint(o.x,a)),i.push(new mxPoint(l.x,a))):i.push(o),i.push(l)))},Loop:function(e,t,n,a,i){if(null!=t){var o=(n=e.view).graph;null!=(a=null!=a&&0<a.length?a[0]:null)&&(a=n.transformControlPoint(e,a),mxUtils.contains(t,a.x,a.y)&&(a=null));var s=0,r=0,l=0,d=0;o=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,o.gridSize)*n.scale;(e=mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST))==mxConstants.DIRECTION_NORTH||e==mxConstants.DIRECTION_SOUTH?(s=n.getRoutingCenterX(t),r=o):(l=n.getRoutingCenterY(t),d=o),null==a||a.x<t.x||a.x>t.x+t.width?null!=a?(s=a.x,d=Math.max(Math.abs(l-a.y),d)):e==mxConstants.DIRECTION_NORTH?l=t.y-2*r:e==mxConstants.DIRECTION_SOUTH?l=t.y+t.height+2*r:s=e==mxConstants.DIRECTION_EAST?t.x-2*d:t.x+t.width+2*d:null!=a&&(s=n.getRoutingCenterX(t),r=Math.max(Math.abs(s-a.x),d),l=a.y,d=0),i.push(new mxPoint(s-r,l-d)),i.push(new mxPoint(s+r,l+d))}},ElbowConnector:function(e,t,n,a,i){var o=null!=a&&0<a.length?a[0]:null,s=!1,r=!1;if(null!=t&&null!=n)if(null!=o){var l=Math.min(t.x,n.x),d=Math.max(t.x+t.width,n.x+n.width),c=(r=Math.min(t.y,n.y),Math.max(t.y+t.height,n.y+n.height));s=(o=e.view.transformControlPoint(e,o)).y<r||o.y>c,r=o.x<l||o.x>d}else(s=(l=Math.max(t.x,n.x))==(d=Math.min(t.x+t.width,n.x+n.width)))||(r=(r=Math.max(t.y,n.y))==(c=Math.min(t.y+t.height,n.y+n.height)));r||!s&&e.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(e,t,n,a,i):mxEdgeStyle.TopToBottom(e,t,n,a,i)},SideToSide:function(e,t,n,a,i){var o=e.view;a=null!=a&&0<a.length?a[0]:null;var s=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=o.transformControlPoint(e,a)),null!=s&&((t=new mxCellState).x=s.x,t.y=s.y),null!=r&&((n=new mxCellState).x=r.x,n.y=r.y),null!=t&&null!=n&&(e=Math.max(t.x,n.x),s=Math.min(t.x+t.width,n.x+n.width),e=null!=a?a.x:s+(e-s)/2,s=o.getRoutingCenterY(t),o=o.getRoutingCenterY(n),null!=a&&(a.y>=t.y&&a.y<=t.y+t.height&&(s=a.y),a.y>=n.y&&a.y<=n.y+n.height&&(o=a.y)),!mxUtils.contains(n,e,s)&&!mxUtils.contains(t,e,s)&&i.push(new mxPoint(e,s)),!mxUtils.contains(n,e,o)&&!mxUtils.contains(t,e,o)&&i.push(new mxPoint(e,o)),1==i.length&&(null!=a?!mxUtils.contains(n,e,a.y)&&!mxUtils.contains(t,e,a.y)&&i.push(new mxPoint(e,a.y)):(o=Math.max(t.y,n.y),t=Math.min(t.y+t.height,n.y+n.height),i.push(new mxPoint(e,o+(t-o)/2)))))},TopToBottom:function(e,t,n,a,i){var o=e.view;a=null!=a&&0<a.length?a[0]:null;var s=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=o.transformControlPoint(e,a)),null!=s&&((t=new mxCellState).x=s.x,t.y=s.y),null!=r&&((n=new mxCellState).x=r.x,n.y=r.y),null!=t&&null!=n&&(s=Math.max(t.y,n.y),r=Math.min(t.y+t.height,n.y+n.height),e=o.getRoutingCenterX(t),null!=a&&a.x>=t.x&&a.x<=t.x+t.width&&(e=a.x),s=null!=a?a.y:r+(s-r)/2,!mxUtils.contains(n,e,s)&&!mxUtils.contains(t,e,s)&&i.push(new mxPoint(e,s)),e=null!=a&&a.x>=n.x&&a.x<=n.x+n.width?a.x:o.getRoutingCenterX(n),!mxUtils.contains(n,e,s)&&!mxUtils.contains(t,e,s)&&i.push(new mxPoint(e,s)),1==i.length&&(null!=a&&1==i.length?!mxUtils.contains(n,a.x,s)&&!mxUtils.contains(t,a.x,s)&&i.push(new mxPoint(a.x,s)):(o=Math.max(t.x,n.x),t=Math.min(t.x+t.width,n.x+n.width),i.push(new mxPoint(o+(t-o)/2,s)))))},SegmentConnector:function(e,t,n,a,i){var o=e.absolutePoints,s=!0,r=null,l=o[0];null==l&&null!=t?l=new mxPoint(e.view.getRoutingCenterX(t),e.view.getRoutingCenterY(t)):null!=l&&(l=l.clone());var d=o.length-1;if(null!=a&&0<a.length){r=e.view.transformControlPoint(e,a[0]);for(var c=t,m=o[0],u=!1,p=!1,g=(u=r,a.length),v=0;v<2;v++){var h=null!=m&&m.x==u.x,b=null!=m&&m.y==u.y,f=null!=c&&u.y>=c.y&&u.y<=c.y+c.height;c=null!=c&&u.x>=c.x&&u.x<=c.x+c.width,u=b||null==m&&f,p=h||null==m&&c;if(null!=m&&!b&&!h&&(f||c)){s=!f;break}if(p||u){s=u,1==v&&(s=0==a.length%2?u:p);break}c=n,m=o[d],u=e.view.transformControlPoint(e,a[g-1])}for(s&&(null!=o[0]&&o[0].y!=r.y||null==o[0]&&null!=t&&(r.y<t.y||r.y>t.y+t.height))?i.push(new mxPoint(l.x,r.y)):!s&&(null!=o[0]&&o[0].x!=r.x||null==o[0]&&null!=t&&(r.x<t.x||r.x>t.x+t.width))&&i.push(new mxPoint(r.x,l.y)),s?l.y=r.y:l.x=r.x,v=0;v<a.length;v++)s=!s,r=e.view.transformControlPoint(e,a[v]),s?l.y=r.y:l.x=r.x,i.push(l.clone())}else r=l,s=!0;if(null==(l=o[d])&&null!=n&&(l=new mxPoint(e.view.getRoutingCenterX(n),e.view.getRoutingCenterY(n))),s&&(null!=o[d]&&o[d].y!=r.y||null==o[d]&&null!=n&&(r.y<n.y||r.y>n.y+n.height))?i.push(new mxPoint(l.x,r.y)):!s&&(null!=o[d]&&o[d].x!=r.x||null==o[d]&&null!=n&&(r.x<n.x||r.x>n.x+n.width))&&i.push(new mxPoint(r.x,l.y)),null==o[0]&&null!=t)for(;1<i.length&&mxUtils.contains(t,i[1].x,i[1].y);)i=i.splice(1,1);if(null==o[d]&&null!=n)for(;1<i.length&&mxUtils.contains(n,i[i.length-1].x,i[i.length-1].y);)i=i.splice(i.length-1,1)},orthBuffer:10,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,OrthConnector:function(e,t,n,a,i){var o=e.view.graph,s=null!=t&&o.getModel().isEdge(t.cell);o=null!=n&&o.getModel().isEdge(n.cell);if(null!=a&&0<a.length||s||o)mxEdgeStyle.SegmentConnector(e,t,n,a,i);else{var r=(a=e.absolutePoints)[0],l=a[a.length-1];a=null!=t?t.x:r.x;s=null!=t?t.y:r.y;var d=null!=t?t.width:1,c=null!=t?t.height:1,m=null!=n?n.x:l.x,u=null!=n?n.y:l.y,p=null!=n?n.width:1,g=null!=n?n.height:1,v=(o=e.view.scale*mxEdgeStyle.orthBuffer,[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL]);for(null!=t&&(v[0]=mxUtils.getPortConstraints(t,e,!0,mxConstants.DIRECTION_MASK_ALL)),null!=n&&(v[1]=mxUtils.getPortConstraints(n,e,!1,mxConstants.DIRECTION_MASK_ALL)),e=[0,0],a=[[a,s,d,c],[m,u,p,g]],d=0;d<2;d++)mxEdgeStyle.limits[d][1]=a[d][0]-o,mxEdgeStyle.limits[d][2]=a[d][1]-o,mxEdgeStyle.limits[d][4]=a[d][0]+a[d][2]+o,mxEdgeStyle.limits[d][8]=a[d][1]+a[d][3]+o;for(d=a[0][0]+a[0][2]/2-(a[1][0]+a[1][2]/2),c=a[0][1]+a[0][3]/2-(a[1][1]+a[1][3]/2),d<(s=0)?s=c<0?2:1:c<=0&&(s=3,0==d&&(s=2)),(c=null)!=t&&(c=r),t=[[.5,.5],[.5,.5]],d=0;d<2;d++)null!=c&&(t[d][0]=(c.x-a[d][0])/a[d][2],t[d][0]<.01?e[d]=mxConstants.DIRECTION_MASK_WEST:.99<t[d][0]&&(e[d]=mxConstants.DIRECTION_MASK_EAST),t[d][1]=(c.y-a[d][1])/a[d][3],t[d][1]<.01?e[d]=mxConstants.DIRECTION_MASK_NORTH:.99<t[d][1]&&(e[d]=mxConstants.DIRECTION_MASK_SOUTH)),(c=null)!=n&&(c=l);for(d=a[0][1]-(a[1][1]+a[1][3]),c=a[0][0]-(a[1][0]+a[1][2]),m=a[1][1]-(a[0][1]+a[0][3]),u=a[1][0]-(a[0][0]+a[0][2]),mxEdgeStyle.vertexSeperations[1]=Math.max(c-2*o,0),mxEdgeStyle.vertexSeperations[2]=Math.max(d-2*o,0),mxEdgeStyle.vertexSeperations[4]=Math.max(m-2*o,0),mxEdgeStyle.vertexSeperations[3]=Math.max(u-2*o,0),n=[],l=[],(r=[])[0]=u<=c?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,l[0]=m<=d?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,r[1]=mxUtils.reversePortConstraints(r[0]),l[1]=mxUtils.reversePortConstraints(l[0]),c=u<=c?c:u,m=m<=d?d:m,p=!(u=[[0,0],[0,0]]),d=0;d<2;d++)0==e[d]&&(0==(r[d]&v[d])&&(r[d]=mxUtils.reversePortConstraints(r[d])),0==(l[d]&v[d])&&(l[d]=mxUtils.reversePortConstraints(l[d])),u[d][0]=l[d],u[d][1]=r[d]);for(2*o<m&&2*o<c&&(0<(r[0]&v[0])&&0<(l[1]&v[1])?(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=l[1],u[1][1]=r[1],p=!0):0<(l[0]&v[0])&&0<(r[1]&v[1])&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=r[1],u[1][1]=l[1],p=!0)),2*o<m&&!p&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=l[1],u[1][1]=r[1],p=!0),2*o<c&&!p&&(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=r[1],u[1][1]=l[1]),d=0;d<2;d++)0==e[d]&&(0==(u[d][0]&v[d])&&(u[d][0]=u[d][1]),n[d]=u[d][0]&v[d],n[d]|=(u[d][1]&v[d])<<8,n[d]|=(u[1-d][d]&v[d])<<16,n[d]|=(u[1-d][1-d]&v[d])<<24,0==(15&n[d])&&(n[d]<<=8),0==(3840&n[d])&&(n[d]=15&n[d]|n[d]>>8),0==(983040&n[d])&&(n[d]=65535&n[d]|(251658240&n[d])>>8),e[d]=15&n[d],v[d]==mxConstants.DIRECTION_MASK_WEST||v[d]==mxConstants.DIRECTION_MASK_NORTH||v[d]==mxConstants.DIRECTION_MASK_EAST||v[d]==mxConstants.DIRECTION_MASK_SOUTH)&&(e[d]=v[d]);switch(d=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0],v=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(d-=s)<1&&(d+=4),(v-=s)<1&&(v+=4),v=mxEdgeStyle.routePatterns[d-1][v-1],mxEdgeStyle.wayPoints1[0][0]=a[0][0],mxEdgeStyle.wayPoints1[0][1]=a[0][1],e[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=o,mxEdgeStyle.wayPoints1[0][1]+=t[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=t[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]+=a[0][3]+o;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=a[0][2]+o,mxEdgeStyle.wayPoints1[0][1]+=t[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=t[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]-=o}for(r=n=(o=0)<(e[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1,d=l=0;d<v.length;d++){g=(l=15&v[d])==mxConstants.DIRECTION_MASK_EAST?3:l,4<(g+=s)&&(g-=4),c=mxEdgeStyle.dirVectors[g-1],(l=0<g%2?0:1)!=n&&(o++,mxEdgeStyle.wayPoints1[o][0]=mxEdgeStyle.wayPoints1[o-1][0],mxEdgeStyle.wayPoints1[o][1]=mxEdgeStyle.wayPoints1[o-1][1]);var h=0<(v[d]&mxEdgeStyle.TARGET_MASK);p=0<(v[d]&mxEdgeStyle.SOURCE_MASK);15<(m=(m=(v[d]&mxEdgeStyle.SIDE_MASK)>>5)<<s)&&(m>>=4),u=0<(v[d]&mxEdgeStyle.CENTER_MASK),(p||h)&&m<9?(g=0,p=p?0:1,g=u&&0==l?a[p][0]+t[p][0]*a[p][2]:u?a[p][1]+t[p][1]*a[p][3]:mxEdgeStyle.limits[p][m],0==l?0<(m=(g-mxEdgeStyle.wayPoints1[o][0])*c[0])&&(mxEdgeStyle.wayPoints1[o][0]+=c[0]*m):0<(m=(g-mxEdgeStyle.wayPoints1[o][1])*c[1])&&(mxEdgeStyle.wayPoints1[o][1]+=c[1]*m)):u&&(mxEdgeStyle.wayPoints1[o][0]+=c[0]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2),mxEdgeStyle.wayPoints1[o][1]+=c[1]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2)),0<o&&mxEdgeStyle.wayPoints1[o][l]==mxEdgeStyle.wayPoints1[o-1][l]?o--:n=l}for(d=0;d<=o&&(d!=o||((0<(e[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1)==r?0:1)==(o+1)%2);d++)i.push(new mxPoint(mxEdgeStyle.wayPoints1[d][0],mxEdgeStyle.wayPoints1[d][1]))}},getRoutePattern:function(e,t,n,a){var i=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0];return e=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(i-=t)<1&&(i+=4),(e-=t)<1&&(e+=4),t=routePatterns[i-1][e-1],0!=n&&0!=a||null!=inlineRoutePatterns[i-1][e-1]&&(t=inlineRoutePatterns[i-1][e-1]),t}},mxStyleRegistry={values:[],putValue:function(e,t){mxStyleRegistry.values[e]=t},getValue:function(e){return mxStyleRegistry.values[e]},getName:function(e){for(var t in mxStyleRegistry.values)if(mxStyleRegistry.values[t]==e)return t;return null}};function mxGraphView(e){this.graph=e,this.translate=new mxPoint,this.graphBounds=new mxRectangle,this.states=new mxDictionary}function mxCurrentRootChange(e,t){if(this.view=e,this.previous=this.root=t,this.isUp=null==t,!this.isUp)for(var n=this.view.currentRoot,a=this.view.graph.getModel();null!=n;){if(n==t){this.isUp=!0;break}n=a.getParent(n)}}function mxGraph(e,t,n,a){this.mouseListeners=null,this.renderHint=n,this.dialect=mxClient.IS_SVG?mxConstants.DIALECT_SVG:n==mxConstants.RENDERING_HINT_EXACT&&mxClient.IS_VML?mxConstants.DIALECT_VML:n==mxConstants.RENDERING_HINT_FASTEST?mxConstants.DIALECT_STRICTHTML:n==mxConstants.RENDERING_HINT_FASTER?mxConstants.DIALECT_PREFERHTML:mxConstants.DIALECT_MIXEDHTML,this.model=null!=t?t:new mxGraphModel,this.multiplicities=[],this.imageBundles=[],this.cellRenderer=this.createCellRenderer(),this.setSelectionModel(this.createSelectionModel()),this.setStylesheet(null!=a?a:this.createStylesheet()),this.view=this.createGraphView(),this.graphModelChangeListener=mxUtils.bind(this,function(e,t){this.graphModelChanged(t.getProperty("edit").changes)}),this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener),this.createHandlers(),null!=e&&this.init(e),this.view.revalidate()}function mxCellOverlay(e,t,n,a,i,o){this.image=e,this.tooltip=t,this.align=null!=n?n:this.align,this.verticalAlign=null!=a?a:this.verticalAlign,this.offset=null!=i?i:new mxPoint,this.cursor=null!=o?o:"help"}function mxOutline(e,t){this.source=e,null!=t&&this.init(t)}function mxMultiplicity(e,t,n,a,i,o,s,r,l,d){this.source=e,this.type=t,this.attr=n,this.value=a,this.min=null!=i?i:0,this.max=null!=o?o:"n",this.validNeighbors=s,this.countError=mxResources.get(r)||r,this.typeError=mxResources.get(l)||l,this.validNeighborsAllowed=null==d||d}function mxLayoutManager(e){this.undoHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.beforeUndo(t.getProperty("edit"))}),this.moveHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.cellsMoved(t.getProperty("cells"),t.getProperty("event"))}),this.setGraph(e)}function mxSpaceManager(e,t,n,a){this.resizeHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.cellsResized(t.getProperty("cells"))}),this.foldHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.cellsResized(t.getProperty("cells"))}),this.shiftRightwards=null==t||t,this.shiftDownwards=null==n||n,this.extendParents=null==a||a,this.setGraph(e)}function mxSwimlaneManager(e,t,n,a){this.horizontal=null==t||t,this.addEnabled=null==n||n,this.resizeEnabled=null==a||a,this.addHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(t.getProperty("cells"))}),this.resizeHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(t.getProperty("cells"))}),this.setGraph(e)}function mxTemporaryCellStates(e,t,n){if(this.view=e,t=null!=t?t:1,this.oldBounds=e.getGraphBounds(),this.oldStates=e.getStates(),this.oldScale=e.getScale(),e.setStates(new mxDictionary),e.setScale(t),null!=n){t=e.createState(new mxCell);for(var a=0;a<n.length;a++)e.validateBounds(t,n[a]);var i=null;for(a=0;a<n.length;a++){var o=e.validatePoints(t,n[a]);null==i?i=o:i.add(o)}null==i&&(i=new mxRectangle),e.setGraphBounds(i)}}function mxCellStatePreview(e){this.graph=e,this.deltas={}}function mxConnectionConstraint(e,t){this.point=e,this.perimeter=null==t||t}function mxGraphHandler(e){this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.updatePreviewShape()}),this.graph.addListener(mxEvent.PAN,this.panHandler)}function mxPanningHandler(e,t){null!=e&&(this.graph=e,this.factoryMethod=t,this.graph.addMouseListener(this),this.init())}function mxCellMarker(e,t,n,a){mxEventSource.call(this),null!=e&&(this.graph=e,this.validColor=null!=t?t:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=t?n:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=a?a:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(e))}function mxSelectionCellsHandler(e){mxEventSource.call(this),this.graph=e,this.handlers=new mxDictionary,this.graph.addMouseListener(this),this.refreshHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.refresh()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler),this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}function mxConnectionHandler(e,t){mxEventSource.call(this),null!=e&&(this.graph=e,this.factoryMethod=t,this.init())}function mxConstraintHandler(e){this.graph=e}function mxRubberband(e){null!=e&&(this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.addListener(mxEvent.PAN,this.panHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxVertexHandler(e){null!=e&&(this.state=e,this.init())}function mxEdgeHandler(e){null!=e&&(this.state=e,this.init())}function mxElbowEdgeHandler(e){mxEdgeHandler.call(this,e)}function mxEdgeSegmentHandler(e){mxEdgeHandler.call(this,e)}function mxKeyHandler(e,t){null!=e&&(this.graph=e,this.target=t||document.documentElement,this.normalKeys=[],this.shiftKeys=[],this.controlKeys=[],this.controlShiftKeys=[],mxEvent.addListener(this.target,"keydown",mxUtils.bind(this,function(e){this.keyDown(e)})),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxTooltipHandler(e,t){null!=e&&(this.graph=e,this.delay=t||500,this.graph.addMouseListener(this))}function mxCellTracker(e,t,n){mxCellMarker.call(this,e,t),this.graph.addMouseListener(this),null!=n&&(this.getCell=n),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}function mxCellHighlight(e,t,n,a){null!=e&&(this.graph=e,this.highlightColor=null!=t?t:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=n?n:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=a&&a,this.repaintHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}function mxDefaultKeyHandler(t){if(null!=t){this.editor=t,this.handler=new mxKeyHandler(t.graph);var n=this.handler.escape;this.handler.escape=function(e){n.apply(this,arguments),t.hideProperties(),t.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",e))}}}function mxDefaultPopupMenu(e){this.config=e}function mxDefaultToolbar(e,t){this.editor=t,null!=e&&null!=t&&this.init(e)}function mxEditor(e){this.actions=[],this.addActions(),null!=document.body&&(this.cycleAttributeValues=[],this.popupHandler=new mxDefaultPopupMenu,this.undoManager=new mxUndoManager,this.graph=this.createGraph(),this.toolbar=this.createToolbar(),this.keyHandler=new mxDefaultKeyHandler(this),this.configure(e),this.graph.swimlaneIndicatorColorAttribute=this.cycleAttributeName,!mxClient.IS_LOCAL&&null!=this.urlInit&&(this.session=this.createSession()),null!=this.onInit&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector),mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter),mxGraphView.prototype=new mxEventSource,mxGraphView.prototype.constructor=mxGraphView,mxGraphView.prototype.EMPTY_POINT=new mxPoint,mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"",mxGraphView.prototype.allowEval=!1,mxGraphView.prototype.captureDocumentGesture=!0,mxGraphView.prototype.optimizeVmlReflows=!0,mxGraphView.prototype.rendering=!0,mxGraphView.prototype.graph=null,mxGraphView.prototype.currentRoot=null,mxGraphView.prototype.graphBounds=null,mxGraphView.prototype.scale=1,mxGraphView.prototype.translate=null,mxGraphView.prototype.updateStyle=!1,mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds},mxGraphView.prototype.setGraphBounds=function(e){this.graphBounds=e},mxGraphView.prototype.getBounds=function(e){var t=null;if(null!=e&&0<e.length)for(var n=this.graph.getModel(),a=0;a<e.length;a++)if(n.isVertex(e[a])||n.isEdge(e[a])){var i=this.getState(e[a]);null!=i&&(null==t?t=new mxRectangle(i.x,i.y,i.width,i.height):t.add(i))}return t},mxGraphView.prototype.setCurrentRoot=function(e){if(this.currentRoot!=e){var t=new mxCurrentRootChange(this,e);t.execute();var n=new mxUndoableEdit(this,!1);n.add(t),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n)),this.graph.sizeDidChange()}return e},mxGraphView.prototype.scaleAndTranslate=function(e,t,n){var a=this.scale,i=new mxPoint(this.translate.x,this.translate.y);this.scale==e&&this.translate.x==t&&this.translate.y==n||(this.scale=e,this.translate.x=t,this.translate.y=n,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",e,"previousScale",a,"translate",this.translate,"previousTranslate",i))},mxGraphView.prototype.getScale=function(){return this.scale},mxGraphView.prototype.setScale=function(e){var t=this.scale;this.scale!=e&&(this.scale=e,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",e,"previousScale",t))},mxGraphView.prototype.getTranslate=function(){return this.translate},mxGraphView.prototype.setTranslate=function(e,t){var n=new mxPoint(this.translate.x,this.translate.y);this.translate.x==e&&this.translate.y==t||(this.translate.x=e,this.translate.y=t,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",n))},mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear(),this.revalidate()},mxGraphView.prototype.revalidate=function(){this.invalidate(),this.validate()},mxGraphView.prototype.clear=function(e,t,n){var a=this.graph.getModel();if(e=e||a.getRoot(),t=null!=t&&t,n=null==n||n,this.removeState(e),n&&(t||e!=this.currentRoot)){n=a.getChildCount(e);for(var i=0;i<n;i++)this.clear(a.getChildAt(e,i),t)}else this.invalidate(e)},mxGraphView.prototype.invalidate=function(e,t,n,a){var i=this.graph.getModel();if(e=e||i.getRoot(),t=null==t||t,n=null==n||n,a=null!=a&&a,null!=(s=this.getState(e))&&(s.invalid=!0,a&&(s.orderChanged=!0)),t)for(var o=i.getChildCount(e),s=0;s<o;s++){var r=i.getChildAt(e,s);this.invalidate(r,t,n,a)}if(n)for(a=i.getEdgeCount(e),s=0;s<a;s++)this.invalidate(i.getEdgeAt(e,s),t,n)},mxGraphView.prototype.validate=function(e){var t=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource;var n=null;if(this.optimizeVmlReflows&&null!=this.canvas&&null==this.textDiv&&(8==document.documentMode||mxClient.IS_QUIRKS)){n=this.canvas.style.display,this.canvas.style.display="none";var a=document.createElement("div");a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",document.body.appendChild(a),this.textDiv=a}e=e||(null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot()),this.validateBounds(null,e),null==(e=this.validatePoints(null,e))&&(e=new mxRectangle),this.setGraphBounds(e),this.validateBackground(),null!=n&&(this.canvas.style.display=n,document.body.removeChild(this.textDiv),this.textDiv=null),window.status=mxResources.get(this.doneResource)||this.doneResource,mxLog.leave("mxGraphView.validate",t)},mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,"white","black")},mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var t=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(t,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);this.graph.pageVisible?(t=this.getBackgroundPageBounds(),null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(t),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=t,this.backgroundPageShape.redraw())):null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.graph.pageFormat,t=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,e.width*t,e.height*t)},mxGraphView.prototype.redrawBackgroundImage=function(e,t){e.scale=this.scale,e.bounds.x=this.scale*this.translate.x,e.bounds.y=this.scale*this.translate.y,e.bounds.width=this.scale*t.width,e.bounds.height=this.scale*t.height,e.redraw()},mxGraphView.prototype.validateBounds=function(e,t){var n=this.graph.getModel(),a=this.getState(t,!0);if(null!=a&&a.invalid){if(this.graph.isCellVisible(t)){if(t!=this.currentRoot&&null!=e)if(a.absoluteOffset.x=0,a.absoluteOffset.y=0,a.origin.x=e.origin.x,a.origin.y=e.origin.y,null!=(o=this.graph.getCellGeometry(t))){if(!n.isEdge(t)){var i=o.offset||this.EMPTY_POINT;o.relative?(a.origin.x+=o.x*e.width/this.scale+i.x,a.origin.y+=o.y*e.height/this.scale+i.y):(a.absoluteOffset.x=this.scale*i.x,a.absoluteOffset.y=this.scale*i.y,a.origin.x+=o.x,a.origin.y+=o.y)}if(a.x=this.scale*(this.translate.x+a.origin.x),a.y=this.scale*(this.translate.y+a.origin.y),a.width=this.scale*o.width,a.height=this.scale*o.height,n.isVertex(t)){if(o.relative&&0!=(i=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"))){var o=Math.cos(i),s=(i=Math.sin(i),new mxPoint(a.getCenterX(),a.getCenterY())),r=new mxPoint(e.getCenterX(),e.getCenterY());o=mxUtils.getRotatedPoint(s,o,i,r);a.x=o.x-a.width/2,a.y=o.y-a.height/2}this.updateVertexLabelOffset(a)}}}else this.removeState(t);null!=(i=this.graph.getChildOffsetForCell(t))&&(a.origin.x+=i.x,a.origin.y+=i.y)}if(null!=a&&(!this.graph.isCellCollapsed(t)||t==this.currentRoot))for(o=n.getChildCount(t),i=0;i<o;i++)s=n.getChildAt(t,i),this.validateBounds(a,s)},mxGraphView.prototype.updateVertexLabelOffset=function(e){var t=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);t==mxConstants.ALIGN_LEFT?e.absoluteOffset.x-=e.width:t==mxConstants.ALIGN_RIGHT&&(e.absoluteOffset.x+=e.width),(t=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?e.absoluteOffset.y-=e.height:t==mxConstants.ALIGN_BOTTOM&&(e.absoluteOffset.y+=e.height)},mxGraphView.prototype.validatePoints=function(e,t){var n=this.graph.getModel(),a=this.getState(t),i=null;if(null!=a){if(a.invalid){var o=this.graph.getCellGeometry(t);if(null!=o&&n.isEdge(t)){var s=this.getState(this.getVisibleTerminal(t,!0));if(a.setVisibleTerminalState(s,!0),null!=s&&n.isEdge(s.cell)&&!n.isAncestor(s.cell,t)){var r=this.getState(n.getParent(s.cell));this.validatePoints(r,s.cell)}var l=this.getState(this.getVisibleTerminal(t,!1));a.setVisibleTerminalState(l,!1),null!=l&&n.isEdge(l.cell)&&!n.isAncestor(l.cell,t)&&(r=this.getState(n.getParent(l.cell)),this.validatePoints(r,l.cell)),this.updateFixedTerminalPoints(a,s,l),this.updatePoints(a,o.points,s,l),this.updateFloatingTerminalPoints(a,s,l),this.updateEdgeBounds(a),this.updateEdgeLabelOffset(a)}else null!=o&&o.relative&&null!=e&&n.isEdge(e.cell)&&(null!=(o=this.getPoint(e,o))&&(a.x=o.x,a.y=o.y,o.x=o.x/this.scale-this.translate.x,o.y=o.y/this.scale-this.translate.y,a.origin=o,this.childMoved(e,a)));a.invalid=!1,t!=this.currentRoot&&this.graph.cellRenderer.redraw(a,!1,this.isRendering())}(n.isEdge(t)||n.isVertex(t))&&(null!=a.shape&&null!=a.shape.boundingBox&&(i=a.shape.boundingBox.clone()),null!=a.text&&!this.graph.isLabelClipped(a.cell)&&null!=a.text.boundingBox&&(null!=i?i.add(a.text.boundingBox):i=a.text.boundingBox.clone()))}if(null!=a&&(!this.graph.isCellCollapsed(t)||t==this.currentRoot))for(o=n.getChildCount(t),s=0;s<o;s++)r=n.getChildAt(t,s),null!=(r=this.validatePoints(a,r))&&(null==i?i=r:i.add(r));return i},mxGraphView.prototype.childMoved=function(e,t){var n=t.cell;if(!this.graph.isCellCollapsed(n)||n==this.currentRoot)for(var a=this.graph.getModel(),i=a.getChildCount(n),o=0;o<i;o++)this.validateBounds(t,a.getChildAt(n,o))},mxGraphView.prototype.updateFixedTerminalPoints=function(e,t,n){this.updateFixedTerminalPoint(e,t,!0,this.graph.getConnectionConstraint(e,t,!0)),this.updateFixedTerminalPoint(e,n,!1,this.graph.getConnectionConstraint(e,n,!1))},mxGraphView.prototype.updateFixedTerminalPoint=function(e,t,n,a){var i=null;if(null!=a&&(i=this.graph.getConnectionPoint(t,a)),null==i&&null==t){t=this.scale,a=this.translate;var o=e.origin;null!=(i=this.graph.getCellGeometry(e.cell).getTerminalPoint(n))&&(i=new mxPoint(t*(a.x+i.x+o.x),t*(a.y+i.y+o.y)))}e.setAbsoluteTerminalPoint(i,n)},mxGraphView.prototype.updatePoints=function(e,t,n,a){if(null!=e){var i=[];i.push(e.absolutePoints[0]);var o=this.getEdgeStyle(e,t,n,a);if(null!=o)o(e,n=this.getTerminalPort(e,n,!0),a=this.getTerminalPort(e,a,!1),t,i);else if(null!=t)for(o=0;o<t.length;o++)null!=t[o]&&(a=mxUtils.clone(t[o]),i.push(this.transformControlPoint(e,a)));t=e.absolutePoints,i.push(t[t.length-1]),e.absolutePoints=i}},mxGraphView.prototype.transformControlPoint=function(e,t){var n=e.origin;return new mxPoint(this.scale*(t.x+this.translate.x+n.x),this.scale*(t.y+this.translate.y+n.y))},mxGraphView.prototype.getEdgeStyle=function(e,t,n,a){return"string"==typeof(e=null!=n&&n==a?mxUtils.getValue(e.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(e.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:e.style[mxConstants.STYLE_EDGE])&&(null==(t=mxStyleRegistry.getValue(e))&&this.isAllowEval()&&(t=mxUtils.eval(e)),e=t),"function"==typeof e?e:null},mxGraphView.prototype.updateFloatingTerminalPoints=function(e,t,n){var a=e.absolutePoints,i=a[0];null==a[a.length-1]&&null!=n&&this.updateFloatingTerminalPoint(e,n,t,!1),null==i&&null!=t&&this.updateFloatingTerminalPoint(e,t,n,!0)},mxGraphView.prototype.updateFloatingTerminalPoint=function(e,t,n,a){t=this.getTerminalPort(e,t,a);var i=this.getNextPoint(e,n,a),o=this.graph.isOrthogonal(e);n=mxUtils.toRadians(Number(t.style[mxConstants.STYLE_ROTATION]||"0"));var s=new mxPoint(t.getCenterX(),t.getCenterY());if(0!=n){var r=Math.cos(-n),l=Math.sin(-n);i=mxUtils.getRotatedPoint(i,r,l,s)}r=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0),r+=parseFloat(e.style[a?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0),t=this.getPerimeterPoint(t,i,0==n&&o,r),0!=n&&(r=Math.cos(n),l=Math.sin(n),t=mxUtils.getRotatedPoint(t,r,l,s)),e.setAbsoluteTerminalPoint(t,a)},mxGraphView.prototype.getTerminalPort=function(e,t,n){return null!=(e=mxUtils.getValue(e.style,n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT))&&(null!=(e=this.getState(this.graph.getModel().getCell(e)))&&(t=e)),t},mxGraphView.prototype.getPerimeterPoint=function(e,t,n,a){var i=null;if(null!=e){var o=this.getPerimeterFunction(e);null!=o&&null!=t&&(0<(a=this.getPerimeterBounds(e,a)).width||0<a.height)&&(i=o(a,e,t,n)),null==i&&(i=this.getPoint(e))}return i},mxGraphView.prototype.getRoutingCenterX=function(e){var t=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return e.getCenterX()+t*e.width},mxGraphView.prototype.getRoutingCenterY=function(e){var t=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return e.getCenterY()+t*e.height},mxGraphView.prototype.getPerimeterBounds=function(e,t){return t=null!=t?t:0,null!=e&&(t+=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),e.getPerimeterBounds(t*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(e){if("string"==typeof(e=e.style[mxConstants.STYLE_PERIMETER])){var t=mxStyleRegistry.getValue(e);null==t&&this.isAllowEval()&&(t=mxUtils.eval(e)),e=t}return"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(e,t,n){var a=null;return null!=(e=e.absolutePoints)&&(n||2<e.length||null==t)&&(a=e.length,a=e[n?Math.min(1,a-1):Math.max(0,a-2)]),null==a&&null!=t&&(a=new mxPoint(t.getCenterX(),t.getCenterY())),a},mxGraphView.prototype.getVisibleTerminal=function(e,t){for(var n=this.graph.getModel(),a=n.getTerminal(e,t),i=a;null!=a&&a!=this.currentRoot;)this.graph.isCellVisible(i)&&!this.graph.isCellCollapsed(a)||(i=a),a=n.getParent(a);return n.getParent(i)==n.getRoot()&&(i=null),i},mxGraphView.prototype.updateEdgeBounds=function(e){var t=e.absolutePoints;if(e.length=0,null!=t&&0<t.length){var n=t[0],a=t[t.length-1];if(null==n||null==a)e.cell!=this.currentRoot&&this.clear(e.cell,!0);else{if(n.x!=a.x||n.y!=a.y){var i=a.x-n.x,o=a.y-n.y;e.terminalDistance=Math.sqrt(i*i+o*o)}else e.terminalDistance=0;a=0;var s=[];if(null!=(o=n)){n=o.x;for(var r=o.y,l=n,d=r,c=1;c<t.length;c++){var m=t[c];null!=m&&(i=o.x-m.x,o=o.y-m.y,i=Math.sqrt(i*i+o*o),s.push(i),a+=i,o=m,n=Math.min(o.x,n),r=Math.min(o.y,r),l=Math.max(o.x,l),d=Math.max(o.y,d))}e.length=a,e.segments=s,e.x=n,e.y=r,e.width=Math.max(1,l-n),e.height=Math.max(1,d-r)}}}},mxGraphView.prototype.getPoint=function(e,t){var n=e.getCenterX(),a=e.getCenterY();if(null==e.segments||null!=t&&!t.relative)null!=t&&(null!=(d=t.offset)&&(n+=d.x,a+=d.y));else{for(var i=e.absolutePoints.length,o=(.5+(null!=t?t.x/2:0))*e.length,s=e.segments[0],r=0,l=1;r+s<o&&l<i-1;)r+=s,s=e.segments[l++];if(i=0==s?0:(o-r)/s,o=e.absolutePoints[l-1],l=e.absolutePoints[l],null!=o&&null!=l){if(r=n=a=0,null!=t){a=t.y;var d=t.offset;null!=d&&(n=d.x,r=d.y)}d=l.x-o.x,l=l.y-o.y,n=o.x+d*i+((0==s?0:l/s)*a+n)*this.scale,a=o.y+l*i-((0==s?0:d/s)*a-r)*this.scale}}return new mxPoint(n,a)},mxGraphView.prototype.getRelativePoint=function(e,t,n){if(null!=(i=this.graph.getModel().getGeometry(e.cell))){var a=e.absolutePoints.length;if(i.relative&&1<a){for(var i=e.length,o=e.segments,s=e.absolutePoints[0],r=e.absolutePoints[1],l=mxUtils.ptSegDistSq(s.x,s.y,r.x,r.y,t,n),d=0,c=0,m=0,u=2;u<a;u++)c+=o[u-2],r=e.absolutePoints[u],(s=mxUtils.ptSegDistSq(s.x,s.y,r.x,r.y,t,n))<=l&&(l=s,d=u-1,m=c),s=r;return a=o[d],s=e.absolutePoints[d],l=(r=e.absolutePoints[d+1]).x,o=r.y,o=(l=(e=s.x-l)-(l=t-l))*e+(o=(d=s.y-o)-(o=n-o))*d,a<(e=Math.sqrt(o<=0?0:o*o/(e*e+d*d)))&&(e=a),a=Math.sqrt(mxUtils.ptSegDistSq(s.x,s.y,r.x,r.y,t,n)),-1==mxUtils.relativeCcw(s.x,s.y,r.x,r.y,t,n)&&(a=-a),new mxPoint((i/2-m-e)/i*-2,a/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(e){var t=e.absolutePoints;if(e.absoluteOffset.x=e.getCenterX(),e.absoluteOffset.y=e.getCenterY(),null!=t&&0<t.length&&null!=e.segments)if((i=this.graph.getCellGeometry(e.cell)).relative){null!=(n=this.getPoint(e,i))&&(e.absoluteOffset=n)}else{var n=t[0],a=t[t.length-1];if(null!=n&&null!=a){t=a.x-n.x;var i,o=a.y-n.y,s=a=0;null!=(i=i.offset)&&(a=i.x,s=i.y),i=n.y+o/2+s*this.scale,e.absoluteOffset.x=n.x+t/2+a*this.scale,e.absoluteOffset.y=i}}},mxGraphView.prototype.getState=function(e,t){t=t||!1;var n=null;return null!=e&&(n=this.states.get(e),this.graph.isCellVisible(e)&&(null==n&&t&&this.graph.isCellVisible(e)?(n=this.createState(e),this.states.put(e,n)):t&&null!=n&&this.updateStyle&&(n.style=this.graph.getCellStyle(e)))),n},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(e){this.rendering=e},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(e){this.allowEval=e},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(e){this.states=e},mxGraphView.prototype.getCellStates=function(e){if(null==e)return this.states;for(var t=[],n=0;n<e.length;n++){var a=this.getState(e[n]);null!=a&&t.push(a)}return t},mxGraphView.prototype.removeState=function(e){var t=null;return null!=e&&(null!=(t=this.states.remove(e))&&(this.graph.cellRenderer.destroy(t),t.destroy())),t},mxGraphView.prototype.createState=function(e){return e=new mxCellState(this,e,this.graph.getCellStyle(e)),this.graph.cellRenderer.initialize(e,this.isRendering()),e},mxGraphView.prototype.getCanvas=function(){return this.canvas},mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane},mxGraphView.prototype.getDrawPane=function(){return this.drawPane},mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane},mxGraphView.prototype.isContainerEvent=function(e){return(e=mxEvent.getSource(e))==this.graph.container||e.parentNode==this.backgroundPane||null!=e.parentNode&&e.parentNode.parentNode==this.backgroundPane||e==this.canvas.parentNode||e==this.canvas||e==this.backgroundPane||e==this.drawPane||e==this.overlayPane},mxGraphView.prototype.isScrollEvent=function(e){var t=mxUtils.getOffset(this.graph.container);e=new mxPoint(e.clientX-t.x,e.clientY-t.y);t=this.graph.container.offsetWidth;var n=this.graph.container.clientWidth;return n<t&&e.x>n+2&&e.x<=t||(t=this.graph.container.offsetHeight,(n=this.graph.container.clientHeight)<t&&e.y>n+2&&e.y<=t)},mxGraphView.prototype.init=function(){this.installListeners();var e=this.graph;e.dialect==mxConstants.DIALECT_SVG?this.createSvg():e.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var a=this.graph,i=a.container;if(null!=i){mxEvent.addGestureListeners(i,mxUtils.bind(this,function(e){mxClient.IS_TOUCH&&a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),this.isContainerEvent(e)&&(!mxClient.IS_IE&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(e))&&a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))})),mxEvent.addListener(i,"dblclick",mxUtils.bind(this,function(e){a.dblClick(e)}));a.addMouseListener({mouseDown:function(e,t){a.panningHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(e){var t,n;null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide(),this.captureDocumentGesture&&a.isMouseDown&&!mxEvent.isConsumed(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,(t=e,n=null,mxClient.IS_TOUCH&&(n=mxEvent.getClientX(t),t=mxEvent.getClientY(t),t=mxUtils.convertPoint(i,n,t),n=a.view.getState(a.getCellAt(t.x,t.y))),n)))}),this.endHandler=mxUtils.bind(this,function(e){this.captureDocumentGesture&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var e=this.graph.container;null!=e&&(this.canvas=this.createHtmlPane("100%","100%"),this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas),mxClient.IS_QUIRKS&&(e=mxUtils.bind(this,function(e){e=this.getGraphBounds(),this.updateHtmlCanvasSize(e.x+e.width+this.graph.border,e.y+e.height+this.graph.border)}),mxEvent.addListener(window,"resize",e)))},mxGraphView.prototype.updateHtmlCanvasSize=function(e,t){if(null!=this.graph.container){var n=this.graph.container.offsetHeight;this.canvas.style.width=this.graph.container.offsetWidth<e?e+"px":"100%",this.canvas.style.height=n<t?t+"px":"100%"}},mxGraphView.prototype.createHtmlPane=function(e,t){var n=document.createElement("DIV");return null!=e&&null!=t?(n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=e,n.style.height=t):n.style.position="relative",n},mxGraphView.prototype.createVml=function(){var e=this.graph.container;if(null!=e){var t=e.offsetWidth,n=e.offsetHeight;this.canvas=this.createVmlPane(t,n),this.backgroundPane=this.createVmlPane(t,n),this.drawPane=this.createVmlPane(t,n),this.overlayPane=this.createVmlPane(t,n),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas)}},mxGraphView.prototype.createVmlPane=function(e,t){var n=document.createElement(mxClient.VML_PREFIX+":group");return n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=e+"px",n.style.height=t+"px",n.setAttribute("coordsize",e+","+t),n.setAttribute("coordorigin","0,0"),n},mxGraphView.prototype.createSvg=function(){var e=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g"),this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.backgroundPane),this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.drawPane),this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.overlayPane);var t=document.createElementNS(mxConstants.NS_SVG,"svg");t.style.width="100%",t.style.height="100%",t.style.display="block",t.appendChild(this.canvas),null!=e&&(e.appendChild(t),"static"==mxUtils.getCurrentStyle(e).position&&(e.style.position="relative"))},mxGraphView.prototype.destroy=function(){var e=null!=this.canvas?this.canvas.ownerSVGElement:null;null==e&&(e=this.canvas),null!=e&&null!=e.parentNode&&(this.clear(this.currentRoot,!0),mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler),mxEvent.release(this.graph.container),e.parentNode.removeChild(e),this.overlayPane=this.drawPane=this.backgroundPane=this.canvas=this.endHandler=this.moveHandler=null)},mxCurrentRootChange.prototype.execute=function(){var e=this.view.currentRoot;this.view.currentRoot=this.previous,this.previous=e,null!=(e=this.view.graph.getTranslateForRoot(this.view.currentRoot))&&(this.view.translate=new mxPoint(-e.x,-e.y)),this.view.fireEvent(new mxEventObject(this.isUp?mxEvent.UP:mxEvent.DOWN,"root",this.view.currentRoot,"previous",this.previous)),this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh(),this.isUp=!this.isUp},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/graph"),mxGraph.prototype=new mxEventSource,mxGraph.prototype.constructor=mxGraph,mxGraph.prototype.EMPTY_ARRAY=[],mxGraph.prototype.mouseListeners=null,mxGraph.prototype.isMouseDown=!1,mxGraph.prototype.model=null,mxGraph.prototype.view=null,mxGraph.prototype.stylesheet=null,mxGraph.prototype.selectionModel=null,mxGraph.prototype.cellEditor=null,mxGraph.prototype.cellRenderer=null,mxGraph.prototype.multiplicities=null,mxGraph.prototype.renderHint=null,mxGraph.prototype.dialect=null,mxGraph.prototype.gridSize=10,mxGraph.prototype.gridEnabled=!0,mxGraph.prototype.portsEnabled=!0,mxGraph.prototype.doubleTapEnabled=!0,mxGraph.prototype.doubleTapTimeout=700,mxGraph.prototype.doubleTapTolerance=25,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchTime=0,mxGraph.prototype.gestureEnabled=!0,mxGraph.prototype.tolerance=4,mxGraph.prototype.defaultOverlap=.5,mxGraph.prototype.defaultParent=null,mxGraph.prototype.alternateEdgeStyle=null,mxGraph.prototype.backgroundImage=null,mxGraph.prototype.pageVisible=!1,mxGraph.prototype.pageBreaksVisible=!1,mxGraph.prototype.pageBreakColor="gray",mxGraph.prototype.pageBreakDashed=!0,mxGraph.prototype.minPageBreakDist=20,mxGraph.prototype.preferPageSize=!1,mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT,mxGraph.prototype.pageScale=1.5,mxGraph.prototype.enabled=!0,mxGraph.prototype.escapeEnabled=!0,mxGraph.prototype.invokesStopCellEditing=!0,mxGraph.prototype.enterStopsCellEditing=!1,mxGraph.prototype.useScrollbarsForPanning=!0,mxGraph.prototype.exportEnabled=!0,mxGraph.prototype.importEnabled=!0,mxGraph.prototype.cellsLocked=!1,mxGraph.prototype.cellsCloneable=!0,mxGraph.prototype.foldingEnabled=!0,mxGraph.prototype.cellsEditable=!0,mxGraph.prototype.cellsDeletable=!0,mxGraph.prototype.cellsMovable=!0,mxGraph.prototype.edgeLabelsMovable=!0,mxGraph.prototype.vertexLabelsMovable=!1,mxGraph.prototype.dropEnabled=!1,mxGraph.prototype.splitEnabled=!0,mxGraph.prototype.cellsResizable=!0,mxGraph.prototype.cellsBendable=!0,mxGraph.prototype.cellsSelectable=!0,mxGraph.prototype.cellsDisconnectable=!0,mxGraph.prototype.autoSizeCells=!1,mxGraph.prototype.autoScroll=!0,mxGraph.prototype.timerAutoScroll=!1,mxGraph.prototype.allowAutoPanning=!1,mxGraph.prototype.ignoreScrollbars=!1,mxGraph.prototype.autoExtend=!0,mxGraph.prototype.maximumGraphBounds=null,mxGraph.prototype.minimumGraphSize=null,mxGraph.prototype.minimumContainerSize=null,mxGraph.prototype.maximumContainerSize=null,mxGraph.prototype.resizeContainer=!1,mxGraph.prototype.border=0,mxGraph.prototype.ordered=!0,mxGraph.prototype.keepEdgesInForeground=!1,mxGraph.prototype.keepEdgesInBackground=!0,mxGraph.prototype.allowNegativeCoordinates=!0,mxGraph.prototype.constrainChildren=!0,mxGraph.prototype.extendParents=!0,mxGraph.prototype.extendParentsOnAdd=!0,mxGraph.prototype.collapseToPreferredSize=!0,mxGraph.prototype.zoomFactor=1.2,mxGraph.prototype.keepSelectionVisibleOnZoom=!1,mxGraph.prototype.centerZoom=!0,mxGraph.prototype.resetViewOnRootChange=!0,mxGraph.prototype.resetEdgesOnResize=!1,mxGraph.prototype.resetEdgesOnMove=!1,mxGraph.prototype.resetEdgesOnConnect=!0,mxGraph.prototype.allowLoops=!1,mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop,mxGraph.prototype.multigraph=!0,mxGraph.prototype.connectableEdges=!1,mxGraph.prototype.allowDanglingEdges=!0,mxGraph.prototype.cloneInvalidEdges=!1,mxGraph.prototype.disconnectOnMove=!0,mxGraph.prototype.labelsVisible=!0,mxGraph.prototype.htmlLabels=!1,mxGraph.prototype.swimlaneSelectionEnabled=!0,mxGraph.prototype.swimlaneNesting=!0,mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR,mxGraph.prototype.imageBundles=null,mxGraph.prototype.minFitScale=.1,mxGraph.prototype.maxFitScale=8,mxGraph.prototype.panDx=0,mxGraph.prototype.panDy=0,mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9),mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9),mxGraph.prototype.warningImage=new mxImage("/assets/plugins/mxgraph/images/warning.gif",16,16),mxGraph.prototype.alreadyConnectedResource="none"!=mxClient.language?"alreadyConnected":"",mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":"",mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"collapse-expand":"",mxGraph.prototype.init=function(e){this.container=e,this.cellEditor=this.createCellEditor(),this.view.init(),this.sizeDidChange(),mxClient.IS_IE&&(mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})),mxEvent.addListener(e,"selectstart",mxUtils.bind(this,function(){return this.isEditing()}))),8==document.documentMode&&e.insertAdjacentHTML("beforeend",'<v:group style="DISPLAY: none;"></v:group>')},mxGraph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(e){this.stylesheet=e},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(e){this.selectionModel=e},mxGraph.prototype.getSelectionCellsForChanges=function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n];if(a.constructor!=mxRootChange){var i=null;a instanceof mxChildChange&&null==a.previous?i=a.child:null!=a.cell&&a.cell instanceof mxCell&&(i=a.cell),null!=i&&mxUtils.indexOf(t,i)<0&&t.push(i)}}return this.getModel().getTopmostCells(t)},mxGraph.prototype.graphModelChanged=function(e){for(var t=0;t<e.length;t++)this.processChange(e[t]);this.removeSelectionCells(this.getRemovedCellsForChanges(e)),this.view.validate(),this.sizeDidChange()},mxGraph.prototype.getRemovedCellsForChanges=function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n];if(a instanceof mxRootChange)break;a instanceof mxChildChange?null!=a.previous&&null==a.parent&&(t=t.concat(this.model.getDescendants(a.child))):a instanceof mxVisibleChange&&(t=t.concat(this.model.getDescendants(a.cell)))}return t},mxGraph.prototype.processChange=function(e){if(e instanceof mxRootChange)this.clearSelection(),this.removeStateForCell(e.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(e instanceof mxChildChange){var t=this.model.getParent(e.child);null!=t?this.view.invalidate(e.child,!0,!1,null!=e.previous):(this.removeStateForCell(e.child),this.view.currentRoot==e.child&&this.home()),t!=e.previous&&(null!=t&&this.view.invalidate(t,!1,!1),null!=e.previous&&this.view.invalidate(e.previous,!1,!1))}else e instanceof mxTerminalChange||e instanceof mxGeometryChange?this.view.invalidate(e.cell):e instanceof mxValueChange?this.view.invalidate(e.cell,!1,!1):e instanceof mxStyleChange?(this.view.invalidate(e.cell,!0,!0,!1),this.view.removeState(e.cell)):null!=e.cell&&e.cell instanceof mxCell&&this.removeStateForCell(e.cell)},mxGraph.prototype.removeStateForCell=function(e){for(var t=this.model.getChildCount(e),n=0;n<t;n++)this.removeStateForCell(this.model.getChildAt(e,n));this.view.removeState(e)},mxGraph.prototype.addCellOverlay=function(e,t){null==e.overlays&&(e.overlays=[]),e.overlays.push(t);var n=this.view.getState(e);return null!=n&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",e,"overlay",t)),t},mxGraph.prototype.getCellOverlays=function(e){return e.overlays},mxGraph.prototype.removeCellOverlay=function(e,t){if(null==t)this.removeCellOverlays(e);else{var n=mxUtils.indexOf(e.overlays,t);0<=n?(e.overlays.splice(n,1),0==e.overlays.length&&(e.overlays=null),null!=(n=this.view.getState(e))&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",t))):t=null}return t},mxGraph.prototype.removeCellOverlays=function(e){var t=e.overlays;if(null!=t){e.overlays=null;var n=this.view.getState(e);for(null!=n&&this.cellRenderer.redraw(n),n=0;n<t.length;n++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",t[n]))}return t},mxGraph.prototype.clearCellOverlays=function(e){e=null!=e?e:this.model.getRoot(),this.removeCellOverlays(e);for(var t=this.model.getChildCount(e),n=0;n<t;n++){var a=this.model.getChildAt(e,n);this.clearCellOverlays(a)}},mxGraph.prototype.setCellWarning=function(n,e,t,a){return null!=e&&0<e.length?(e=new mxCellOverlay(t=null!=t?t:this.warningImage,"<font color=red>"+e+"</font>"),a&&e.addListener(mxEvent.CLICK,mxUtils.bind(this,function(e,t){this.isEnabled()&&this.setSelectionCell(n)})),this.addCellOverlay(n,e)):(this.removeCellOverlays(n),null)},mxGraph.prototype.startEditing=function(e){this.startEditingAtCell(null,e)},mxGraph.prototype.startEditingAtCell=function(e,t){null==e&&(null!=(e=this.getSelectionCell())&&!this.isCellEditable(e)&&(e=null)),null!=e&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",e,"event",t)),this.cellEditor.startEditing(e,t))},mxGraph.prototype.getEditingValue=function(e,t){return this.convertValueToString(e)},mxGraph.prototype.stopEditing=function(e){this.cellEditor.stopEditing(e)},mxGraph.prototype.labelChanged=function(e,t,n){this.model.beginUpdate();try{this.cellLabelChanged(e,t,this.isAutoSizeCell(e)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",e,"value",t,"event",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellLabelChanged=function(e,t,n){this.model.beginUpdate();try{this.model.setValue(e,t),n&&this.cellSizeUpdated(e,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(e){this.stopEditing(!0),this.connectionHandler.reset(),this.graphHandler.reset(),e=this.getSelectionCells();for(var t=0;t<e.length;t++){var n=this.view.getState(e[t]);null!=n&&null!=n.handler&&n.handler.reset()}},mxGraph.prototype.click=function(e){var t=e.getEvent(),n=e.getCell(),a=new mxEventObject(mxEvent.CLICK,"event",t,"cell",n);e.isConsumed()&&a.consume(),this.fireEvent(a),this.isEnabled()&&!mxEvent.isConsumed(t)&&!a.isConsumed()&&(null!=n?this.selectCellForEvent(n,t):(n=null,this.isSwimlaneSelectionEnabled()&&(n=this.getSwimlaneAt(e.getGraphX(),e.getGraphY())),null!=n?this.selectCellForEvent(n,t):this.isToggleEvent(t)||this.clearSelection()))},mxGraph.prototype.dblClick=function(e,t){var n=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",t);this.fireEvent(n),this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed()&&null!=t&&this.isCellEditable(t)&&this.startEditingAtCell(t,e)},mxGraph.prototype.scrollPointToVisible=function(e,t,n,a){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.active&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(e+this.panDx,t+this.panDy));else{var i=this.container;if(a=null!=a?a:20,e>=i.scrollLeft&&t>=i.scrollTop&&e<=i.scrollLeft+i.clientWidth&&t<=i.scrollTop+i.clientHeight){var o=i.scrollLeft+i.clientWidth-e;if(o<a){if(e=i.scrollLeft,i.scrollLeft+=a-o,n&&e==i.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){e=this.view.getDrawPane().ownerSVGElement;var s=this.container.scrollWidth+a-o}else s=Math.max(i.clientWidth,i.scrollWidth)+a-o,e=this.view.getCanvas();e.style.width=s+"px",i.scrollLeft+=a-o}}else(o=e-i.scrollLeft)<a&&(i.scrollLeft-=a-o);(o=i.scrollTop+i.clientHeight-t)<a?(e=i.scrollTop,i.scrollTop+=a-o,e==i.scrollTop&&n&&(this.dialect==mxConstants.DIALECT_SVG?(e=this.view.getDrawPane().ownerSVGElement,t=this.container.scrollHeight+a-o):(t=Math.max(i.clientHeight,i.scrollHeight)+a-o,e=this.view.getCanvas()),e.style.height=t+"px",i.scrollTop+=a-o)):(o=t-i.scrollTop)<a&&(i.scrollTop-=a-o)}}},mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)},mxGraph.prototype.getBorderSizes=function(){function e(e){var t=0;t="thin"==e?2:"medium"==e?4:"thick"==e?6:parseInt(e);return isNaN(t)&&(t=0),t}var t=mxUtils.getCurrentStyle(this.container),n=new mxRectangle;return n.x=e(t.borderLeftWidth)+parseInt(t.paddingLeft||0),n.y=e(t.borderTopWidth)+parseInt(t.paddingTop||0),n.width=e(t.borderRightWidth)+parseInt(t.paddingRight||0),n.height=e(t.borderBottomWidth)+parseInt(t.paddingBottom||0),n},mxGraph.prototype.getPreferredPageSize=function(e,t,n){e=this.view.scale;var a=this.view.translate,i=this.pageFormat,o=e*this.pageScale;i=new mxRectangle(0,0,i.width*o,i.height*o);return t=this.pageBreaksVisible?Math.ceil(t/i.width):1,n=this.pageBreaksVisible?Math.ceil(n/i.height):1,new mxRectangle(0,0,t*i.width+2+a.x/e,n*i.height+2+a.y/e)},mxGraph.prototype.sizeDidChange=function(){var e=this.getGraphBounds();if(null!=this.container){var t=this.getBorder(),n=Math.max(0,e.x+e.width+1+t);t=Math.max(0,e.y+e.height+1+t);if(null!=this.minimumContainerSize&&(n=Math.max(n,this.minimumContainerSize.width),t=Math.max(t,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(n,t),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var a=this.getPreferredPageSize(e,n,t);null!=a&&(n=a.width,t=a.height)}null!=this.minimumGraphSize&&(n=Math.max(n,this.minimumGraphSize.width*this.view.scale),t=Math.max(t,this.minimumGraphSize.height*this.view.scale)),n=Math.ceil(n-1),t=Math.ceil(t-1),this.dialect==mxConstants.DIALECT_SVG?((a=this.view.getDrawPane().ownerSVGElement).style.minWidth=Math.max(1,n)+"px",a.style.minHeight=Math.max(1,t)+"px",a.style.width="100%",a.style.height="100%"):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,n),Math.max(1,t)):(this.view.canvas.style.minWidth=Math.max(1,n)+"px",this.view.canvas.style.minHeight=Math.max(1,t)+"px"),this.updatePageBreaks(this.pageBreaksVisible,n-1,t-1)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",e))},mxGraph.prototype.doResizeContainer=function(e,t){if(mxClient.IS_IE)if(mxClient.IS_QUIRKS){var n=this.getBorderSizes();e+=Math.max(2,n.x+n.width+1),t+=Math.max(2,n.y+n.height+1)}else 9<=document.documentMode?(e+=3,t+=5):(e+=1,t+=1);else t+=1;null!=this.maximumContainerSize&&(e=Math.min(this.maximumContainerSize.width,e),t=Math.min(this.maximumContainerSize.height,t)),this.container.style.width=Math.ceil(e)+"px",this.container.style.height=Math.ceil(t)+"px"},mxGraph.prototype.updatePageBreaks=function(e,t,n){var a=this.view.scale,i=this.view.translate,o=this.pageFormat,s=a*this.pageScale;i=new mxRectangle(a*i.x,a*i.y,o.width*s,o.height*s);if(e=e&&Math.min(i.width,i.height)>this.minPageBreakDist,i.x=mxUtils.mod(i.x,i.width),i.y=mxUtils.mod(i.y,i.height),o=e?Math.ceil((t-i.x)/i.width):0,e=e?Math.ceil((n-i.y)/i.height):0,null==this.horizontalPageBreaks&&0<o&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(s=0;s<=o;s++){var r=[new mxPoint(i.x+s*i.width,1),new mxPoint(i.x+s*i.width,n)];null!=this.horizontalPageBreaks[s]?(this.horizontalPageBreaks[s].scale=1,this.horizontalPageBreaks[s].points=r,this.horizontalPageBreaks[s].redraw()):((r=new mxPolyline(r,this.pageBreakColor,this.scale)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.horizontalPageBreaks[s]=r)}for(s=o;s<this.horizontalPageBreaks.length;s++)this.horizontalPageBreaks[s].destroy();this.horizontalPageBreaks.splice(o,this.horizontalPageBreaks.length-o)}if(null==this.verticalPageBreaks&&0<e&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(s=0;s<=e;s++)r=[new mxPoint(1,i.y+s*i.height),new mxPoint(t,i.y+s*i.height)],null!=this.verticalPageBreaks[s]?(this.verticalPageBreaks[s].scale=1,this.verticalPageBreaks[s].points=r,this.verticalPageBreaks[s].redraw()):((r=new mxPolyline(r,this.pageBreakColor,a)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.verticalPageBreaks[s]=r);for(s=e;s<this.verticalPageBreaks.length;s++)this.verticalPageBreaks[s].destroy();this.verticalPageBreaks.splice(e,this.verticalPageBreaks.length-e)}},mxGraph.prototype.getCellStyle=function(e){var t=this.model.getStyle(e),n=null;n=this.model.isEdge(e)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();return null!=t&&(n=this.postProcessCellStyle(this.stylesheet.getCellStyle(t,n))),null==n&&(n=mxGraph.prototype.EMPTY_ARRAY),n},mxGraph.prototype.postProcessCellStyle=function(e){if(null!=e){var t=e[mxConstants.STYLE_IMAGE],n=this.getImageFromBundles(t);null!=n?e[mxConstants.STYLE_IMAGE]=n:n=t,null!=n&&"data:image/"==n.substring(0,11)&&(0<(t=n.indexOf(","))&&(n=n.substring(0,t)+";base64,"+n.substring(t+1)),e[mxConstants.STYLE_IMAGE]=n)}return e},mxGraph.prototype.setCellStyle=function(e,t){if(null!=(t=t||this.getSelectionCells())){this.model.beginUpdate();try{for(var n=0;n<t.length;n++)this.model.setStyle(t[n],e)}finally{this.model.endUpdate()}}},mxGraph.prototype.toggleCellStyle=function(e,t,n){n=n||this.getSelectionCell(),this.toggleCellStyles(e,t,[n])},mxGraph.prototype.toggleCellStyles=function(e,t,n){var a;(t=null!=t&&t,null!=(n=n||this.getSelectionCells())&&0<n.length)&&(null!=(a=null!=(a=this.view.getState(n[0]))?a.style:this.getCellStyle(n[0]))&&(t=mxUtils.getValue(a,e,t)?0:1,this.setCellStyles(e,t,n)))},mxGraph.prototype.setCellStyles=function(e,t,n){n=n||this.getSelectionCells(),mxUtils.setCellStyles(this.model,n,e,t)},mxGraph.prototype.toggleCellStyleFlags=function(e,t,n){this.setCellStyleFlags(e,t,null,n)},mxGraph.prototype.setCellStyleFlags=function(e,t,n,a){if(null!=(a=a||this.getSelectionCells())&&0<a.length){var i;if(null==n)null!=(i=null!=(i=this.view.getState(a[0]))?i.style:this.getCellStyle(a[0]))&&(n=(parseInt(i[e]||0)&t)!=t);mxUtils.setCellStyleFlags(this.model,a,e,t,n)}},mxGraph.prototype.alignCells=function(e,t,n){if(null==t&&(t=this.getSelectionCells()),null!=t&&1<t.length){if(null==n)for(var a=0;a<t.length;a++){var i=this.getCellGeometry(t[a]);if(null!=i&&!this.model.isEdge(t[a]))if(null==n){if(e==mxConstants.ALIGN_CENTER){n=i.x+i.width/2;break}if(e==mxConstants.ALIGN_RIGHT)n=i.x+i.width;else if(e==mxConstants.ALIGN_TOP)n=i.y;else{if(e==mxConstants.ALIGN_MIDDLE){n=i.y+i.height/2;break}n=e==mxConstants.ALIGN_BOTTOM?i.y+i.height:i.x}}else n=e==mxConstants.ALIGN_RIGHT?Math.max(n,i.x+i.width):e==mxConstants.ALIGN_TOP?Math.min(n,i.y):e==mxConstants.ALIGN_BOTTOM?Math.max(n,i.y+i.height):Math.min(n,i.x)}if(null!=n){this.model.beginUpdate();try{for(a=0;a<t.length;a++)null!=(i=this.getCellGeometry(t[a]))&&!this.model.isEdge(t[a])&&(i=i.clone(),e==mxConstants.ALIGN_CENTER?i.x=n-i.width/2:e==mxConstants.ALIGN_RIGHT?i.x=n-i.width:e==mxConstants.ALIGN_TOP?i.y=n:e==mxConstants.ALIGN_MIDDLE?i.y=n-i.height/2:e==mxConstants.ALIGN_BOTTOM?i.y=n-i.height:i.x=n,this.model.setGeometry(t[a],i));this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",e,"cells",t))}finally{this.model.endUpdate()}}}return t},mxGraph.prototype.flipEdge=function(e){if(null!=e&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var t=this.model.getStyle(e);null==t||0==t.length?this.model.setStyle(e,this.alternateEdgeStyle):this.model.setStyle(e,null),this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",e))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.addImageBundle=function(e){this.imageBundles.push(e)},mxGraph.prototype.removeImageBundle=function(e){for(var t=[],n=0;n<this.imageBundles.length;n++)this.imageBundles[n]!=e&&t.push(this.imageBundles[n]);this.imageBundles=t},mxGraph.prototype.getImageFromBundles=function(e){if(null!=e)for(var t=0;t<this.imageBundles.length;t++){var n=this.imageBundles[t].getImage(e);if(null!=n)return n}return null},mxGraph.prototype.orderCells=function(e,t){null==t&&(t=mxUtils.sortCells(this.getSelectionCells(),!0)),this.model.beginUpdate();try{this.cellsOrdered(t,e),this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",e,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsOrdered=function(e,t){if(null!=e){this.model.beginUpdate();try{for(var n=0;n<e.length;n++){var a=this.model.getParent(e[n]);t?this.model.add(a,e[n],n):this.model.add(a,e[n],this.model.getChildCount(a)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",t,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.groupCells=function(e,t,n){null==n&&(n=mxUtils.sortCells(this.getSelectionCells(),!0)),n=this.getCellsForGroup(n),null==e&&(e=this.createGroupCell(n));var a=this.getBoundsForGroup(e,n,t);if(0<n.length&&null!=a){var i=this.model.getParent(e);null==i&&(i=this.model.getParent(n[0])),this.model.beginUpdate();try{null==this.getCellGeometry(e)&&this.model.setGeometry(e,new mxGeometry);var o=this.model.getChildCount(i);this.cellsAdded([e],i,o,null,null,!1),o=this.model.getChildCount(e),this.cellsAdded(n,e,o,null,null,!1,!1),this.cellsMoved(n,-a.x,-a.y,!1,!0),this.cellsResized([e],[a]),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",e,"border",t,"cells",n))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.getCellsForGroup=function(e){var t=[];if(null!=e&&0<e.length){var n=this.model.getParent(e[0]);t.push(e[0]);for(var a=1;a<e.length;a++)this.model.getParent(e[a])==n&&t.push(e[a])}return t},mxGraph.prototype.getBoundsForGroup=function(e,t,n){return null!=(t=this.getBoundingBoxFromGeometry(t))&&(this.isSwimlane(e)&&(e=this.getStartSize(e),t.x-=e.width,t.y-=e.height,t.width+=e.width,t.height+=e.height),t.x-=n,t.y-=n,t.width+=2*n,t.height+=2*n),t},mxGraph.prototype.createGroupCell=function(e){return(e=new mxCell("")).setVertex(!0),e.setConnectable(!1),e},mxGraph.prototype.ungroupCells=function(e){var t=[];if(null==e){e=this.getSelectionCells();for(var n=[],a=0;a<e.length;a++)0<this.model.getChildCount(e[a])&&n.push(e[a]);e=n}if(null!=e&&0<e.length){this.model.beginUpdate();try{for(a=0;a<e.length;a++){if(null!=(i=this.model.getChildren(e[a]))&&0<i.length){var i=i.slice(),o=this.model.getParent(e[a]),s=this.model.getChildCount(o);this.cellsAdded(i,o,s,null,null,!0),t=t.concat(i)}}this.cellsRemoved(this.addAllEdges(e)),this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",e))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.removeCellsFromParent=function(e){null==e&&(e=this.getSelectionCells()),this.model.beginUpdate();try{var t=this.getDefaultParent(),n=this.model.getChildCount(t);this.cellsAdded(e,t,n,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",e))}finally{this.model.endUpdate()}return e},mxGraph.prototype.updateGroupBounds=function(e,t,n){null==e&&(e=this.getSelectionCells()),t=null!=t?t:0,n=null!=n&&n,this.model.beginUpdate();try{for(var a=0;a<e.length;a++){if(null!=(r=this.getCellGeometry(e[a]))){var i=this.getChildCells(e[a]);if(null!=i&&0<i.length){var o=this.getBoundingBoxFromGeometry(i);if(0<o.width&&0<o.height){var s=this.isSwimlane(e[a])?this.getStartSize(e[a]):new mxRectangle,r=r.clone();n&&(r.x+=o.x-s.width-t,r.y+=o.y-s.height-t),r.width=o.width+s.width+2*t,r.height=o.height+s.height+2*t,this.model.setGeometry(e[a],r),this.moveCells(i,-o.x+s.width+t,-o.y+s.height+t)}}}}}finally{this.model.endUpdate()}return e},mxGraph.prototype.cloneCells=function(e,t){t=null==t||t;var n=null;if(null!=e){for(var a={},i=(n=[],0);i<e.length;i++){a[o=mxCellPath.create(e[i])]=e[i],n.push(e[i])}if(0<n.length){var o=this.view.scale,s=this.view.translate;for(n=this.model.cloneCells(e,!0),i=0;i<e.length;i++)if(!t&&this.model.isEdge(n[i])&&null!=this.getEdgeValidationError(n[i],this.model.getTerminal(n[i],!0),this.model.getTerminal(n[i],!1)))n[i]=null;else{var r=this.model.getGeometry(n[i]);if(null!=r){var l=this.view.getState(e[i]),d=this.view.getState(this.model.getParent(e[i]));if(null!=l&&null!=d){var c=d.origin.x;d=d.origin.y;if(this.model.isEdge(n[i])){l=l.absolutePoints;for(var m=this.model.getTerminal(e[i],!0),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);for(null==m&&r.setTerminalPoint(new mxPoint(l[0].x/o-s.x,l[0].y/o-s.y),!0),m=this.model.getTerminal(e[i],!1),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);if(null==m&&(m=l.length-1,r.setTerminalPoint(new mxPoint(l[m].x/o-s.x,l[m].y/o-s.y),!1)),null!=(r=r.points))for(l=0;l<r.length;l++)r[l].x+=c,r[l].y+=d}else r.x+=c,r.y+=d}}}}else n=[]}return n},mxGraph.prototype.insertVertex=function(e,t,n,a,i,o,s,r,l){return t=this.createVertex(e,t,n,a,i,o,s,r,l),this.addCell(t,e)},mxGraph.prototype.createVertex=function(e,t,n,a,i,o,s,r,l){return(e=new mxGeometry(a,i,o,s)).relative=null!=l&&l,(n=new mxCell(n,e,r)).setId(t),n.setVertex(!0),n.setConnectable(!0),n},mxGraph.prototype.insertEdge=function(e,t,n,a,i,o){return t=this.createEdge(e,t,n,a,i,o),this.addEdge(t,e,a,i)},mxGraph.prototype.createEdge=function(e,t,n,a,i,o){return(e=new mxCell(n,new mxGeometry,o)).setId(t),e.setEdge(!0),e.geometry.relative=!0,e},mxGraph.prototype.addEdge=function(e,t,n,a,i){return this.addCell(e,t,i,n,a)},mxGraph.prototype.addCell=function(e,t,n,a,i){return this.addCells([e],t,n,a,i)[0]},mxGraph.prototype.addCells=function(e,t,n,a,i){null==t&&(t=this.getDefaultParent()),null==n&&(n=this.model.getChildCount(t)),this.model.beginUpdate();try{this.cellsAdded(e,t,n,a,i,!1,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",e,"parent",t,"index",n,"source",a,"target",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsAdded=function(e,t,n,a,i,o,s){if(null!=e&&null!=t&&null!=n){this.model.beginUpdate();try{for(var r=null!=(d=o?this.view.getState(t):null)?d.origin:null,l=new mxPoint(0,0),d=0;d<e.length;d++)if(null==e[d])n--;else{var c=this.model.getParent(e[d]);if(null!=r&&e[d]!=t&&t!=c){var m=this.view.getState(c),u=null!=m?m.origin:l;if(null!=(p=this.model.getGeometry(e[d]))){var p,g=u.x-r.x,v=u.y-r.y;(p=p.clone()).translate(g,v),!p.relative&&this.model.isVertex(e[d])&&!this.isAllowNegativeCoordinates()&&(p.x=Math.max(0,p.x),p.y=Math.max(0,p.y)),this.model.setGeometry(e[d],p)}}t==c&&n+d>this.model.getChildCount(t)&&n--,this.model.add(t,e[d],n+d),this.isExtendParentsOnAdd()&&this.isExtendParent(e[d])&&this.extendParent(e[d]),(null==s||s)&&this.constrainChild(e[d]),null!=a&&this.cellConnected(e[d],a,!0),null!=i&&this.cellConnected(e[d],i,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",e,"parent",t,"index",n,"source",a,"target",i,"absolute",o))}finally{this.model.endUpdate()}}},mxGraph.prototype.removeCells=function(e,t){t=null==t||t,null==e&&(e=this.getDeletableCells(this.getSelectionCells())),t&&(e=this.getDeletableCells(this.addAllEdges(e))),this.model.beginUpdate();try{this.cellsRemoved(e),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells",e,"includeEdges",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsRemoved=function(e){if(null!=e&&0<e.length){var t=this.view.scale,n=this.view.translate;this.model.beginUpdate();try{for(var a={},i=0;i<e.length;i++){var o=mxCellPath.create(e[i]);a[o]=e[i]}for(i=0;i<e.length;i++){for(var s=this.getConnections(e[i]),r=0;r<s.length;r++)if(null==a[o=mxCellPath.create(s[r])]){if(null!=(d=this.model.getGeometry(s[r]))){var l=this.view.getState(s[r]);if(null!=l){var d=d.clone(),c=l.getVisibleTerminal(!0)==e[i],m=l.absolutePoints,u=c?0:m.length-1;d.setTerminalPoint(new mxPoint(m[u].x/t-n.x,m[u].y/t-n.y),c),this.model.setTerminal(s[r],null,c),this.model.setGeometry(s[r],d)}}}this.model.remove(e[i])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.splitEdge=function(e,t,n,a,i){a=a||0,i=i||0,null==n&&(n=this.cloneCells([e])[0]);var o=this.model.getParent(e),s=this.model.getTerminal(e,!0);this.model.beginUpdate();try{this.cellsMoved(t,a,i,!1,!1),this.cellsAdded(t,o,this.model.getChildCount(o),null,null,!0),this.cellsAdded([n],o,this.model.getChildCount(o),s,t[0],!1),this.cellConnected(e,t[0],!0),this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",e,"cells",t,"newEdge",n,"dx",a,"dy",i))}finally{this.model.endUpdate()}return n},mxGraph.prototype.toggleCells=function(e,t,n){null==t&&(t=this.getSelectionCells()),n&&(t=this.addAllEdges(t)),this.model.beginUpdate();try{this.cellsToggled(t,e),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",e,"cells",t,"includeEdges",n))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsToggled=function(e,t){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var n=0;n<e.length;n++)this.model.setVisible(e[n],t)}finally{this.model.endUpdate()}}},mxGraph.prototype.foldCells=function(e,t,n,a){t=null!=t&&t,null==n&&(n=this.getFoldableCells(this.getSelectionCells(),e)),this.stopEditing(!1),this.model.beginUpdate();try{this.cellsFolded(n,e,t,a),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",e,"recurse",t,"cells",n))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsFolded=function(e,t,n,a){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var i=0;i<e.length;i++)if((!a||this.isCellFoldable(e[i],t))&&t!=this.isCellCollapsed(e[i])&&(this.model.setCollapsed(e[i],t),this.swapBounds(e[i],t),this.isExtendParent(e[i])&&this.extendParent(e[i]),n)){var o=this.model.getChildren(e[i]);this.foldCells(o,t,n)}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",e,"collapse",t,"recurse",n))}finally{this.model.endUpdate()}}},mxGraph.prototype.swapBounds=function(e,t){if(null!=e){var n=this.model.getGeometry(e);null!=n&&(n=n.clone(),this.updateAlternateBounds(e,n,t),n.swap(),this.model.setGeometry(e,n))}},mxGraph.prototype.updateAlternateBounds=function(e,t,n){if(null!=e&&null!=t){if(n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e),null==t.alternateBounds){var a=t;this.collapseToPreferredSize&&(null!=(e=this.getPreferredSizeForCell(e))&&(a=e,0<(e=mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE))&&(a.height=Math.max(a.height,e)))),t.alternateBounds=new mxRectangle(0,0,a.width,a.height)}if(null!=t.alternateBounds){t.alternateBounds.x=t.x,t.alternateBounds.y=t.y;var i=mxUtils.toRadians(n[mxConstants.STYLE_ROTATION]||"0");0!=i&&(e=t.alternateBounds.getCenterX()-t.getCenterX(),n=t.alternateBounds.getCenterY()-t.getCenterY(),a=Math.cos(i),i=Math.sin(i),t.alternateBounds.x+=a*e-i*n-e,t.alternateBounds.y+=i*e+a*n-n)}}},mxGraph.prototype.addAllEdges=function(e){var t=e.slice();return t.concat(this.getAllEdges(e))},mxGraph.prototype.getAllEdges=function(e){var t=[];if(null!=e)for(var n=0;n<e.length;n++){for(var a=this.model.getEdgeCount(e[n]),i=0;i<a;i++)t.push(this.model.getEdgeAt(e[n],i));a=this.model.getChildren(e[n]),t=t.concat(this.getAllEdges(a))}return t},mxGraph.prototype.updateCellSize=function(e,t){t=null!=t&&t,this.model.beginUpdate();try{this.cellSizeUpdated(e,t),this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",e,"ignoreChildren",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellSizeUpdated=function(e,t){if(null!=e){this.model.beginUpdate();try{var n=this.getPreferredSizeForCell(e),a=this.model.getGeometry(e);if(null!=n&&null!=a){var i=this.isCellCollapsed(e);a=a.clone();if(this.isSwimlane(e)){var o=this.view.getState(e),s=null!=o?o.style:this.getCellStyle(e),r=this.model.getStyle(e);null==r&&(r=""),mxUtils.getValue(s,mxConstants.STYLE_HORIZONTAL,!0)?(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,n.height+8),i&&(a.height=n.height+8),a.width=n.width):(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,n.width+8),i&&(a.width=n.width+8),a.height=n.height),this.model.setStyle(e,r)}else a.width=n.width,a.height=n.height;if(!t&&!i){var l=this.view.getBounds(this.model.getChildren(e));if(null!=l){var d=this.view.translate,c=this.view.scale,m=(l.y+l.height)/c-a.y-d.y;a.width=Math.max(a.width,(l.x+l.width)/c-a.x-d.x),a.height=Math.max(a.height,m)}}this.cellsResized([e],[a])}}finally{this.model.endUpdate()}}},mxGraph.prototype.getPreferredSizeForCell=function(e){var t=null;if(null!=e){var n=this.view.getState(e),a=null!=n?n.style:this.getCellStyle(e);if(null!=a&&!this.model.isEdge(e)){var i=a[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE,o=0;t=0;null==this.getImage(n)&&null==a[mxConstants.STYLE_IMAGE]||a[mxConstants.STYLE_SHAPE]!=mxConstants.SHAPE_LABEL||(a[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(o+=parseFloat(a[mxConstants.STYLE_IMAGE_WIDTH])||mxLabel.prototype.imageSize),a[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(t+=parseFloat(a[mxConstants.STYLE_IMAGE_HEIGHT])||mxLabel.prototype.imageSize)),o+=2*(a[mxConstants.STYLE_SPACING]||0),o+=a[mxConstants.STYLE_SPACING_LEFT]||0,o+=a[mxConstants.STYLE_SPACING_RIGHT]||0,t+=2*(a[mxConstants.STYLE_SPACING]||0),t+=a[mxConstants.STYLE_SPACING_TOP]||0,t+=a[mxConstants.STYLE_SPACING_BOTTOM]||0,null!=(n=this.getFoldingImage(n))&&(o+=n.width+8),null!=(n=this.getLabel(e))&&0<n.length?(this.isHtmlLabel(e)||(n=n.replace(/\n/g,"<br>")),e=(i=mxUtils.getSizeForString(n,i,a[mxConstants.STYLE_FONTFAMILY])).width+o,t=i.height+t,mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)||(a=t,t=e,e=a),this.gridEnabled&&(e=this.snap(e+this.gridSize/2),t=this.snap(t+this.gridSize/2)),t=new mxRectangle(0,0,e,t)):t=new mxRectangle(0,0,a=4*this.gridSize,a)}}return t},mxGraph.prototype.handleGesture=function(e,t){if(.2<Math.abs(1-t.scale)){var n=this.view.scale,a=this.view.translate,i=e.width*t.scale,o=e.height*t.scale,s=e.y-(o-e.height)/2;n=new mxRectangle(this.snap((e.x-(i-e.width)/2)/n)-a.x,this.snap(s/n)-a.y,this.snap(i/n),this.snap(o/n));this.resizeCell(e.cell,n)}},mxGraph.prototype.resizeCell=function(e,t){return this.resizeCells([e],[t])[0]},mxGraph.prototype.resizeCells=function(e,t){this.model.beginUpdate();try{this.cellsResized(e,t),this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",e,"bounds",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsResized=function(e,t){if(null!=e&&null!=t&&e.length==t.length){this.model.beginUpdate();try{for(var n=0;n<e.length;n++){var a=t[n],i=this.model.getGeometry(e[n]);if(null!=i&&(i.x!=a.x||i.y!=a.y||i.width!=a.width||i.height!=a.height)){if((i=i.clone()).relative){var o=i.offset;null!=o&&(o.x+=a.x-i.x,o.y+=a.y-i.y)}else i.x=a.x,i.y=a.y;i.width=a.width,i.height=a.height,!i.relative&&this.model.isVertex(e[n])&&!this.isAllowNegativeCoordinates()&&(i.x=Math.max(0,i.x),i.y=Math.max(0,i.y)),this.model.setGeometry(e[n],i),this.isExtendParent(e[n])&&this.extendParent(e[n])}}this.resetEdgesOnResize&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",e,"bounds",t))}finally{this.model.endUpdate()}}},mxGraph.prototype.extendParent=function(e){if(null!=e){var t=this.model.getParent(e),n=this.model.getGeometry(t);null!=t&&null!=n&&!this.isCellCollapsed(t)&&(null!=(e=this.model.getGeometry(e))&&(n.width<e.x+e.width||n.height<e.y+e.height))&&((n=n.clone()).width=Math.max(n.width,e.x+e.width),n.height=Math.max(n.height,e.y+e.height),this.cellsResized([t],[n]))}},mxGraph.prototype.importCells=function(e,t,n,a,i){return this.moveCells(e,t,n,!0,a,i)},mxGraph.prototype.moveCells=function(e,t,n,a,i,o){if(t=null!=t?t:0,n=null!=n?n:0,a=null!=a&&a,null!=e&&(0!=t||0!=n||a||null!=i)){this.model.beginUpdate();try{a&&(e=this.cloneCells(e,this.isCloneInvalidEdges()),null==i&&(i=this.getDefaultParent()));var s=this.isAllowNegativeCoordinates();if(null!=i&&this.setAllowNegativeCoordinates(!0),this.cellsMoved(e,t,n,!a&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==i),this.setAllowNegativeCoordinates(s),null!=i){var r=this.model.getChildCount(i);this.cellsAdded(e,i,r,null,null,!0)}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",e,"dx",t,"dy",n,"clone",a,"target",i,"event",o))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.cellsMoved=function(e,t,n,a,i){if(null!=e&&(0!=t||0!=n)){this.model.beginUpdate();try{a&&this.disconnectGraph(e);for(var o=0;o<e.length;o++)this.translateCell(e[o],t,n),i&&this.constrainChild(e[o]);this.resetEdgesOnMove&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",e,"dx",n,"dy",n,"disconnect",a))}finally{this.model.endUpdate()}}},mxGraph.prototype.translateCell=function(e,t,n){var a=this.model.getGeometry(e);null!=a&&((a=a.clone()).translate(t,n),!a.relative&&this.model.isVertex(e)&&!this.isAllowNegativeCoordinates()&&(a.x=Math.max(0,a.x),a.y=Math.max(0,a.y)),a.relative&&!this.model.isEdge(e)&&(null==a.offset?a.offset=new mxPoint(t,n):(a.offset.x+=t,a.offset.y+=n)),this.model.setGeometry(e,a))},mxGraph.prototype.getCellContainmentArea=function(e){if(null!=e&&!this.model.isEdge(e)){var t=this.model.getParent(e);if(t==this.getDefaultParent()||t==this.getCurrentRoot())return this.getMaximumGraphBounds();if(null!=t&&t!=this.getDefaultParent())if(null!=(i=this.model.getGeometry(t))){var n=e=0,a=i.width,i=i.height;return this.isSwimlane(t)&&(e=(t=this.getStartSize(t)).width,a-=t.width,n=t.height,i-=t.height),new mxRectangle(e,n,a,i)}}return null},mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds},mxGraph.prototype.constrainChild=function(e){if(null!=e){var t=this.model.getGeometry(e),n=this.isConstrainChild(e)?this.getCellContainmentArea(e):this.getMaximumGraphBounds();null!=t&&null!=n&&!t.relative&&(t.x<n.x||t.y<n.y||n.width<t.x+t.width||n.height<t.y+t.height)&&(e=this.getOverlap(e),0<n.width&&(t.x=Math.min(t.x,n.x+n.width-(1-e)*t.width)),0<n.height&&(t.y=Math.min(t.y,n.y+n.height-(1-e)*t.height)),t.x=Math.max(t.x,n.x-t.width*e),t.y=Math.max(t.y,n.y-t.height*e))}},mxGraph.prototype.resetEdges=function(e){if(null!=e){for(var t={},n=0;n<e.length;n++){var a=mxCellPath.create(e[n]);t[a]=e[n]}this.model.beginUpdate();try{for(n=0;n<e.length;n++){var i=this.model.getEdges(e[n]);if(null!=i)for(a=0;a<i.length;a++){var o=this.view.getState(i[a]),s=null!=o?o.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[a],!0),r=null!=o?o.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[a],!1),l=mxCellPath.create(s),d=mxCellPath.create(r);(null==t[l]||null==t[d])&&this.resetEdge(i[a])}this.resetEdges(this.model.getChildren(e[n]))}}finally{this.model.endUpdate()}}},mxGraph.prototype.resetEdge=function(e){var t=this.model.getGeometry(e);return null!=t&&null!=t.points&&0<t.points.length&&((t=t.clone()).points=[],this.model.setGeometry(e,t)),e},mxGraph.prototype.getAllConnectionConstraints=function(e,t){return null!=e&&null!=e.shape&&null!=e.shape.stencil?e.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(e,t,n){t=null;var a=e.style[n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=a){var i=e.style[n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=i&&(t=new mxPoint(parseFloat(a),parseFloat(i)))}return a=!1,null!=t&&(a=mxUtils.getValue(e.style,n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0)),new mxConnectionConstraint(t,a)},mxGraph.prototype.setConnectionConstraint=function(e,t,n,a){if(null!=a){this.model.beginUpdate();try{null==a||null==a.point?(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[e]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[e]),this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e])):null!=a.point&&(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,a.point.x,[e]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,a.point.y,[e]),a.perimeter?this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e]):this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[e]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(e,t){var n=null;if(null!=e){var a=this.view.getPerimeterBounds(e),i=new mxPoint(a.getCenterX(),a.getCenterY()),o=e.style[mxConstants.STYLE_DIRECTION],s=0;if(null!=o&&("north"==o?s+=270:"west"==o?s+=180:"south"==o&&(s+=90),"north"==o||"south"==o)){a.x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var r=a.width;a.width=a.height,a.height=r}if(null!=t.point){var l=n=1,d=0,c=0;if(this.getModel().isVertex(e.cell)){var m=e.style[mxConstants.STYLE_FLIPH],u=e.style[mxConstants.STYLE_FLIPV];null!=e.shape.stencil&&(m=1==mxUtils.getValue(e.style,"stencilFlipH",0)||m,u=1==mxUtils.getValue(e.style,"stencilFlipV",0)||u),"north"!=o&&"south"!=o||(r=m,m=u,u=r),m&&(n=-1,d=-a.width),u&&(l=-1,c=-a.height)}n=new mxPoint(a.x+t.point.x*a.width*n-d,a.y+t.point.y*a.height*l-c)}o=e.style[mxConstants.STYLE_ROTATION]||0,t.perimeter?(0!=s&&null!=n&&(r=a=0,90==s?r=1:180==s?a=-1:270==o&&(r=-1),n=mxUtils.getRotatedPoint(n,a,r,i)),null!=n&&t.perimeter&&(n=this.view.getPerimeterPoint(e,n,!1))):o+=s,0!=o&&null!=n&&(s=mxUtils.toRadians(o),a=Math.cos(s),r=Math.sin(s),n=mxUtils.getRotatedPoint(n,a,r,i))}return n},mxGraph.prototype.connectCell=function(e,t,n,a){this.model.beginUpdate();try{var i=this.model.getTerminal(e,n);this.cellConnected(e,t,n,a),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",e,"terminal",t,"source",n,"previous",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellConnected=function(e,t,n,a){if(null!=e){this.model.beginUpdate();try{var i=this.model.getTerminal(e,n);this.setConnectionConstraint(e,t,n,a),this.isPortsEnabled()&&(a=null,this.isPort(t)&&(a=t.getId(),t=this.getTerminalForPort(t,n)),this.setCellStyles(n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,a,[e])),this.model.setTerminal(e,t,n),this.resetEdgesOnConnect&&this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",e,"terminal",t,"source",n,"previous",i))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(e){if(null!=e){this.model.beginUpdate();try{for(var t=this.view.scale,n=this.view.translate,a={},i=0;i<e.length;i++){a[mxCellPath.create(e[i])]=e[i]}for(i=0;i<e.length;i++)if(this.model.isEdge(e[i])){if(null!=(r=this.model.getGeometry(e[i]))){var o=this.view.getState(e[i]),s=this.view.getState(this.model.getParent(e[i]));if(null!=o&&null!=s){var r=r.clone(),l=-s.origin.x,d=-s.origin.y,c=o.absolutePoints,m=this.model.getTerminal(e[i],!0);if(null!=m&&this.isCellDisconnectable(e[i],m,!0)){for(var u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);null==m&&(r.setTerminalPoint(new mxPoint(c[0].x/t-n.x+l,c[0].y/t-n.y+d),!0),this.model.setTerminal(e[i],null,!0))}var p=this.model.getTerminal(e[i],!1);if(null!=p&&this.isCellDisconnectable(e[i],p,!1)){for(var g=mxCellPath.create(p);null!=p&&null==a[g];)p=this.model.getParent(p),g=mxCellPath.create(p);if(null==p){var v=c.length-1;r.setTerminalPoint(new mxPoint(c[v].x/t-n.x+l,c[v].y/t-n.y+d),!1),this.model.setTerminal(e[i],null,!1)}}this.model.setGeometry(e[i],r)}}}}finally{this.model.endUpdate()}}},mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot},mxGraph.prototype.getTranslateForRoot=function(e){return null},mxGraph.prototype.isPort=function(e){return!1},mxGraph.prototype.getTerminalForPort=function(e,t){return this.model.getParent(e)},mxGraph.prototype.getChildOffsetForCell=function(e){return null},mxGraph.prototype.enterGroup=function(e){null!=(e=e||this.getSelectionCell())&&this.isValidRoot(e)&&(this.view.setCurrentRoot(e),this.clearSelection())},mxGraph.prototype.exitGroup=function(){var e=this.model.getRoot(),t=this.getCurrentRoot();if(null!=t){for(var n=this.model.getParent(t);n!=e&&!this.isValidRoot(n)&&this.model.getParent(n)!=e;)n=this.model.getParent(n);n==e||this.model.getParent(n)==e?this.view.setCurrentRoot(null):this.view.setCurrentRoot(n),null!=this.view.getState(t)&&this.setSelectionCell(t)}},mxGraph.prototype.home=function(){var e=this.getCurrentRoot();null!=e&&(this.view.setCurrentRoot(null),null!=this.view.getState(e)&&this.setSelectionCell(e))},mxGraph.prototype.isValidRoot=function(e){return null!=e},mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()},mxGraph.prototype.getCellBounds=function(e,t,n){var a=[e];if(t&&(a=a.concat(this.model.getEdges(e))),a=this.view.getBounds(a),n){n=this.model.getChildCount(e);for(var i=0;i<n;i++){var o=this.getCellBounds(this.model.getChildAt(e,i),t,!0);null!=a?a.add(o):a=o}}return a},mxGraph.prototype.getBoundingBoxFromGeometry=function(e,t){t=null!=t&&t;var n=null;if(null!=e)for(var a=0;a<e.length;a++)if(t||this.model.isVertex(e[a])){var i=this.getCellGeometry(e[a]);if(null!=i){var o=i.points;if(null!=o&&0<o.length){for(var s=new mxRectangle(o[0].x,o[0].y,0,0),r=function(e){null!=e&&s.add(new mxRectangle(e.x,e.y,0,0))},l=1;l<o.length;l++)r(o[l]);r(i.getTerminalPoint(!0)),r(i.getTerminalPoint(!1))}null==n?n=new mxRectangle(i.x,i.y,i.width,i.height):n.add(i)}}return n},mxGraph.prototype.refresh=function(e){this.view.clear(e,null==e),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(e){return this.gridEnabled&&(e=Math.round(e/this.gridSize)*this.gridSize),e},mxGraph.prototype.panGraph=function(e,t){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-e,this.container.scrollTop=-t;else{var n=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==e&&0==t){if(mxClient.IS_IE?n.setAttribute("transform","translate("+e+","+t+")"):n.removeAttribute("transform"),null!=this.shiftPreview1){for(var a=this.shiftPreview1.firstChild;null!=a;){var i=a.nextSibling;this.container.appendChild(a),a=i}for(this.shiftPreview1.parentNode.removeChild(this.shiftPreview1),this.shiftPreview1=null,this.container.appendChild(n.parentNode),a=this.shiftPreview2.firstChild;null!=a;)i=a.nextSibling,this.container.appendChild(a),a=i;this.shiftPreview2.parentNode.removeChild(this.shiftPreview2),this.shiftPreview2=null}}else{if(n.setAttribute("transform","translate("+e+","+t+")"),null==this.shiftPreview1){this.shiftPreview1=document.createElement("div"),this.shiftPreview1.style.position="absolute",this.shiftPreview1.style.overflow="visible",this.shiftPreview2=document.createElement("div"),this.shiftPreview2.style.position="absolute",this.shiftPreview2.style.overflow="visible";var o=this.shiftPreview1;for(a=this.container.firstChild;null!=a;)i=a.nextSibling,a!=n.parentNode?o.appendChild(a):o=this.shiftPreview2,a=i;this.container.insertBefore(this.shiftPreview1,n.parentNode),this.container.appendChild(this.shiftPreview2)}this.shiftPreview1.style.left=e+"px",this.shiftPreview1.style.top=t+"px",this.shiftPreview2.style.left=e+"px",this.shiftPreview2.style.top=t+"px"}else n.style.left=e+"px",n.style.top=t+"px";this.panDx=e,this.panDy=t,this.fireEvent(new mxEventObject(mxEvent.PAN))}},mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)},mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)},mxGraph.prototype.zoomActual=function(){1==this.view.scale?this.view.setTranslate(0,0):(this.view.translate.x=0,this.view.translate.y=0,this.view.setScale(1))},mxGraph.prototype.zoomTo=function(e,t){this.zoom(e/this.view.scale,t)},mxGraph.prototype.zoom=function(e,t){t=null!=t?t:this.centerZoom;var n=this.view.scale*e,a=this.view.getState(this.getSelectionCell());if(this.keepSelectionVisibleOnZoom&&null!=a)a=new mxRectangle(a.x*e,a.y*e,a.width*e,a.height*e),this.view.scale=n,this.scrollRectToVisible(a)||(this.view.revalidate(),this.view.setScale(n));else if(t&&!mxUtils.hasScrollbars(this.container)){a=this.container.offsetWidth;var i=this.container.offsetHeight;if(1<e){var o=(e-1)/(2*n);a=a*-o,i=i*-o}else a*=o=(1/e-1)/(2*this.view.scale),i*=o;this.view.scaleAndTranslate(n,this.view.translate.x+a,this.view.translate.y+i)}else this.view.setScale(n),mxUtils.hasScrollbars(this.container)&&(i=a=0,t&&(a=this.container.offsetWidth*(e-1)/2,i=this.container.offsetHeight*(e-1)/2),this.container.scrollLeft=Math.round(this.container.scrollLeft*e+a),this.container.scrollTop=Math.round(this.container.scrollTop*e+i))},mxGraph.prototype.zoomToRect=function(e){var t=this.container.clientWidth/e.width/(this.container.clientHeight/e.height);e.x=Math.max(0,e.x),e.y=Math.max(0,e.y);var n=Math.min(this.container.scrollWidth,e.x+e.width),a=Math.min(this.container.scrollHeight,e.y+e.height);e.width=n-e.x,e.height=a-e.y,t<1?(n=((t=e.height/t)-e.height)/2,e.height=t,t=Math.min(e.y,n),e.y-=t,a=Math.min(this.container.scrollHeight,e.y+e.height),e.height=a-e.y):(n=((t*=e.width)-e.width)/2,e.width=t,t=Math.min(e.x,n),e.x-=t,n=Math.min(this.container.scrollWidth,e.x+e.width),e.width=n-e.x),t=this.container.clientWidth/e.width,n=this.view.scale*t,mxUtils.hasScrollbars(this.container)?(this.view.setScale(n),this.container.scrollLeft=Math.round(e.x*t),this.container.scrollTop=Math.round(e.y*t)):this.view.scaleAndTranslate(n,this.view.translate.x-e.x/this.view.scale,this.view.translate.y-e.y/this.view.scale)},mxGraph.prototype.fit=function(e,t){if(null!=this.container){e=null!=e?e:0,t=null!=t&&t;var n=this.container.clientWidth,a=this.container.clientHeight,i=this.view.getGraphBounds();t&&null!=i.x&&null!=i.y&&(i.width+=i.x,i.height+=i.y,i.x=0,i.y=0);var o=this.view.scale,s=i.width/o,r=i.height/o;null!=this.backgroundImage&&(s=Math.max(s,this.backgroundImage.width-i.x/o),r=Math.max(r,this.backgroundImage.height-i.y/o));var l=t?e:2*e;n=Math.floor(100*Math.min(n/(s+l),a/(r+l)))/100;null!=this.minFitScale&&(n=Math.max(n,this.minFitScale)),null!=this.maxFitScale&&(n=Math.min(n,this.maxFitScale)),t?this.view.scale!=n&&this.view.setScale(n):mxUtils.hasScrollbars(this.container)?(this.view.setScale(n),null!=i.x&&(this.container.scrollLeft=Math.round(i.x/o)*n-e-Math.max(0,(this.container.clientWidth-s*n)/2)),null!=i.y&&(this.container.scrollTop=Math.round(i.y/o)*n-e-Math.max(0,(this.container.clientHeight-r*n)/2))):this.view.scaleAndTranslate(n,null!=i.x?Math.floor(this.view.translate.x-i.x/o+e+1):e,null!=i.y?Math.floor(this.view.translate.y-i.y/o+e+1):e)}return this.view.scale},mxGraph.prototype.scrollCellToVisible=function(e,t){var n=-this.view.translate.x,a=-this.view.translate.y,i=this.view.getState(e);null!=i&&(n=new mxRectangle(n+i.x,a+i.y,i.width,i.height),t&&null!=this.container&&(a=this.container.clientWidth,i=this.container.clientHeight,n.x=n.getCenterX()-a/2,n.width=a,n.y=n.getCenterY()-i/2,n.height=i),this.scrollRectToVisible(n)&&this.view.setTranslate(this.view.translate.x,this.view.translate.y))},mxGraph.prototype.scrollRectToVisible=function(e){var t=!1;if(null!=e){var n=this.container.offsetWidth,a=this.container.offsetHeight,i=Math.min(n,e.width),o=Math.min(a,e.height);if(mxUtils.hasScrollbars(this.container)){n=this.container,e.x+=this.view.translate.x,e.y+=this.view.translate.y;var s=n.scrollLeft-e.x;a=Math.max(s-n.scrollLeft,0);0<s?n.scrollLeft-=s+2:0<(s=e.x+i-n.scrollLeft-n.clientWidth)&&(n.scrollLeft+=s+2),i=n.scrollTop-e.y,s=Math.max(0,i-n.scrollTop),0<i?n.scrollTop-=i+2:0<(i=e.y+o-n.scrollTop-n.clientHeight)&&(n.scrollTop+=i+2),!this.useScrollbarsForPanning&&(0!=a||0!=s)&&this.view.setTranslate(a,s)}else{s=-this.view.translate.x;var r=-this.view.translate.y,l=this.view.scale;e.x+i>s+n&&(this.view.translate.x-=(e.x+i-n-s)/l,t=!0),e.y+o>r+a&&(this.view.translate.y-=(e.y+o-a-r)/l,t=!0),e.x<s&&(this.view.translate.x+=(s-e.x)/l,t=!0),e.y<r&&(this.view.translate.y+=(r-e.y)/l,t=!0),t&&(this.view.refresh(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.refresh())}}return t},mxGraph.prototype.getCellGeometry=function(e){return this.model.getGeometry(e)},mxGraph.prototype.isCellVisible=function(e){return this.model.isVisible(e)},mxGraph.prototype.isCellCollapsed=function(e){return this.model.isCollapsed(e)},mxGraph.prototype.isCellConnectable=function(e){return this.model.isConnectable(e)},mxGraph.prototype.isOrthogonal=function(e){var t=e.style[mxConstants.STYLE_ORTHOGONAL];return null!=t?t:(e=this.view.getEdgeStyle(e))==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom||e==mxEdgeStyle.EntityRelation||e==mxEdgeStyle.OrthConnector},mxGraph.prototype.isLoop=function(e){var t=e.getVisibleTerminalState(!0);return e=e.getVisibleTerminalState(!1),null!=t&&t==e},mxGraph.prototype.isCloneEvent=function(e){return mxEvent.isControlDown(e)},mxGraph.prototype.isToggleEvent=function(e){return mxClient.IS_MAC?mxEvent.isMetaDown(e):mxEvent.isControlDown(e)},mxGraph.prototype.isGridEnabledEvent=function(e){return null!=e&&!mxEvent.isAltDown(e)},mxGraph.prototype.isConstrainedEvent=function(e){return mxEvent.isShiftDown(e)},mxGraph.prototype.isForceMarqueeEvent=function(e){return mxEvent.isAltDown(e)},mxGraph.prototype.validationAlert=function(e){mxUtils.alert(e)},mxGraph.prototype.isEdgeValid=function(e,t,n){return null==this.getEdgeValidationError(e,t,n)},mxGraph.prototype.getEdgeValidationError=function(e,t,n){if(null!=e&&!this.isAllowDanglingEdges()&&(null==t||null==n))return"";if(null!=e&&null==this.model.getTerminal(e,!0)&&null==this.model.getTerminal(e,!1))return null;if(!this.allowLoops&&t==n&&null!=t||!this.isValidConnection(t,n))return"";if(null!=t&&null!=n){var a="";if(!this.multigraph)(1<(i=this.model.getEdgesBetween(t,n,!0)).length||1==i.length&&i[0]!=e)&&(a+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n");var i=this.model.getDirectedEdgeCount(t,!0,e),o=this.model.getDirectedEdgeCount(n,!1,e);if(null!=this.multiplicities)for(var s=0;s<this.multiplicities.length;s++){var r=this.multiplicities[s].check(this,e,t,n,i,o);null!=r&&(a+=r)}return null!=(r=this.validateEdge(e,t,n))&&(a+=r),0<a.length?a:null}return this.allowDanglingEdges?null:""},mxGraph.prototype.validateEdge=function(e,t,n){return null},mxGraph.prototype.validateGraph=function(e,t){e=null!=e?e:this.model.getRoot(),t=null!=t?t:{};for(var n=!0,a=this.model.getChildCount(e),i=0;i<a;i++){var o=this.model.getChildAt(e,i),s=t;this.isValidRoot(o)&&(s={}),null!=(s=this.validateGraph(o,s))?this.setCellWarning(o,s.replace(/\n/g,"<br>")):this.setCellWarning(o,null),n=n&&null==s}return a="",this.isCellCollapsed(e)&&!n&&(a+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),a=this.model.isEdge(e)?a+(this.getEdgeValidationError(e,this.model.getTerminal(e,!0),this.model.getTerminal(e,!1))||""):a+(this.getCellValidationError(e)||""),null!=(i=this.validateCell(e,t))&&(a+=i),null==this.model.getParent(e)&&this.view.validate(),0<a.length||!n?a:null},mxGraph.prototype.getCellValidationError=function(e){var t=this.model.getDirectedEdgeCount(e,!0),n=this.model.getDirectedEdgeCount(e,!1);e=this.model.getValue(e);var a="";if(null!=this.multiplicities)for(var i=0;i<this.multiplicities.length;i++){var o=this.multiplicities[i];o.source&&mxUtils.isNode(e,o.type,o.attr,o.value)&&(0==o.max&&0<t||1==o.min&&0==t||1==o.max&&1<t)?a+=o.countError+"\n":!o.source&&mxUtils.isNode(e,o.type,o.attr,o.value)&&(0==o.max&&0<n||1==o.min&&0==n||1==o.max&&1<n)&&(a+=o.countError+"\n")}return 0<a.length?a:null},mxGraph.prototype.validateCell=function(e,t){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(e){this.backgroundImage=e},mxGraph.prototype.getFoldingImage=function(e){if(null!=e&&this.foldingEnabled&&!this.getModel().isEdge(e.cell)){var t=this.isCellCollapsed(e.cell);if(this.isCellFoldable(e.cell,!t))return t?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(e){if(null!=(e=this.model.getValue(e))){if(mxUtils.isNode(e))return e.nodeName;if("function"==typeof e.toString)return e.toString()}return""},mxGraph.prototype.getLabel=function(e){var t="";if(this.labelsVisible&&null!=e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);mxUtils.getValue(n,mxConstants.STYLE_NOLABEL,!1)||(t=this.convertValueToString(e))}return t},mxGraph.prototype.isHtmlLabel=function(e){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(e){this.htmlLabels=e},mxGraph.prototype.isWrapping=function(e){var t=this.view.getState(e);return null!=(e=null!=t?t.style:this.getCellStyle(e))&&"wrap"==e[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(e){var t=this.view.getState(e);return null!=(e=null!=t?t.style:this.getCellStyle(e))&&"hidden"==e[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(e,n,t,a){var i=null;return null!=e&&(null==e.control||n!=e.control.node&&n.parentNode!=e.control.node||(i=this.collapseExpandResource,i=mxResources.get(i)||i),null==i&&null!=e.overlays&&e.overlays.visit(function(e,t){null!=i||n!=t.node&&n.parentNode!=t.node||(i=t.overlay.toString())}),null==i&&(null!=(t=this.selectionCellsHandler.getHandler(e.cell))&&"function"==typeof t.getTooltipForNode&&(i=t.getTooltipForNode(n))),null==i&&(i=this.getTooltipForCell(e.cell))),i},mxGraph.prototype.getTooltipForCell=function(e){return null!=e&&null!=e.getTooltip?e.getTooltip():this.convertValueToString(e)},mxGraph.prototype.getCursorForCell=function(e){return null},mxGraph.prototype.getStartSize=function(e){var t=new mxRectangle,n=this.view.getState(e);return null!=(e=null!=n?n.style:this.getCellStyle(e))&&(n=parseInt(mxUtils.getValue(e,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,!0)?t.height=n:t.width=n),t},mxGraph.prototype.getImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.getVerticalAlign=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(e){this.border=e},mxGraph.prototype.isSwimlane=function(e){var t;if(null!=e&&this.model.getParent(e)!=this.model.getRoot()&&(null!=(t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e))&&!this.model.isEdge(e)))return t[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE;return!1},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(e){this.resizeContainer=e},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(e){this.enabled=e},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(e){this.escapeEnabled=e},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(e){this.invokesStopCellEditing=e},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(e){this.enterStopsCellEditing=e},mxGraph.prototype.isCellLocked=function(e){var t=this.model.getGeometry(e);return this.isCellsLocked()||null!=t&&this.model.isVertex(e)&&t.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(e){this.cellsLocked=e},mxGraph.prototype.getCloneableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellCloneable(e)}))},mxGraph.prototype.isCellCloneable=function(e){var t=this.view.getState(e);return e=null!=t?t.style:this.getCellStyle(e),this.isCellsCloneable()&&0!=e[mxConstants.STYLE_CLONEABLE]},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(e){this.cellsCloneable=e},mxGraph.prototype.getExportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canExportCell(e)}))},mxGraph.prototype.canExportCell=function(e){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canImportCell(e)}))},mxGraph.prototype.canImportCell=function(e){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(e){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(e){this.cellsSelectable=e},mxGraph.prototype.getDeletableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellDeletable(e)}))},mxGraph.prototype.isCellDeletable=function(e){var t=this.view.getState(e);return e=null!=t?t.style:this.getCellStyle(e),this.isCellsDeletable()&&0!=e[mxConstants.STYLE_DELETABLE]},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(e){this.cellsDeletable=e},mxGraph.prototype.isLabelMovable=function(e){return!this.isCellLocked(e)&&(this.model.isEdge(e)&&this.edgeLabelsMovable||this.model.isVertex(e)&&this.vertexLabelsMovable)},mxGraph.prototype.getMovableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellMovable(e)}))},mxGraph.prototype.isCellMovable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsMovable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_MOVABLE]},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(e){this.cellsMovable=e},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(e){this.portsEnabled=e},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(e){this.gridSize=e},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(e){this.tolerance=e},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(e){this.vertexLabelsMovable=e},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(e){this.edgeLabelsMovable=e},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(e){this.swimlaneNesting=e},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(e){this.swimlaneSelectionEnabled=e},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(e){this.multigraph=e},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(e){this.allowDanglingEdges=e},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(e){this.connectableEdges=e},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(e){this.cloneInvalidEdges=e},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(e){this.allowLoops=e},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(e){this.disconnectOnMove=e},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(e){this.dropEnabled=e},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(e){this.splitEnabled=e},mxGraph.prototype.isCellResizable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsResizable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_RESIZABLE]},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(e){this.cellsResizable=e},mxGraph.prototype.isTerminalPointMovable=function(e,t){return!0},mxGraph.prototype.isCellBendable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsBendable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_BENDABLE]},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(e){this.cellsBendable=e},mxGraph.prototype.isCellEditable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsEditable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(e){this.cellsEditable=e},mxGraph.prototype.isCellDisconnectable=function(e,t,n){return this.isCellsDisconnectable()&&!this.isCellLocked(e)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(e){this.cellsDisconnectable=e},mxGraph.prototype.isValidSource=function(e){return null==e&&this.allowDanglingEdges||null!=e&&(!this.model.isEdge(e)||this.connectableEdges)&&this.isCellConnectable(e)},mxGraph.prototype.isValidTarget=function(e){return this.isValidSource(e)},mxGraph.prototype.isValidConnection=function(e,t){return this.isValidSource(e)&&this.isValidTarget(t)},mxGraph.prototype.setConnectable=function(e){this.connectionHandler.setEnabled(e)},mxGraph.prototype.isConnectable=function(e){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(e){this.tooltipHandler.setEnabled(e)},mxGraph.prototype.setPanning=function(e){this.panningHandler.panningEnabled=e},mxGraph.prototype.isEditing=function(e){if(null!=this.cellEditor){var t=this.cellEditor.getEditingCell();return null==e?null!=t:e==t}return!1},mxGraph.prototype.isAutoSizeCell=function(e){var t=this.view.getState(e);return e=null!=t?t.style:this.getCellStyle(e),this.isAutoSizeCells()||1==e[mxConstants.STYLE_AUTOSIZE]},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(e){this.autoSizeCells=e},mxGraph.prototype.isExtendParent=function(e){return!this.getModel().isEdge(e)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(e){this.extendParents=e},mxGraph.prototype.isExtendParentsOnAdd=function(){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(e){this.extendParentsOnAdd=e},mxGraph.prototype.isConstrainChild=function(e){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(e))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(e){this.constrainChildren=e},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(e){this.allowNegativeCoordinates=e},mxGraph.prototype.getOverlap=function(e){return this.isAllowOverlapParent(e)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(e){return!1},mxGraph.prototype.getFoldableCells=function(e,t){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellFoldable(e,t)}))},mxGraph.prototype.isCellFoldable=function(e,t){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return 0<this.model.getChildCount(e)&&0!=n[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(e,t,n){return null!=e&&(this.isSplitEnabled()&&this.isSplitTarget(e,t,n)||!this.model.isEdge(e)&&(this.isSwimlane(e)||0<this.model.getChildCount(e)&&!this.isCellCollapsed(e)))},mxGraph.prototype.isSplitTarget=function(e,t,n){return!(!this.model.isEdge(e)||null==t||1!=t.length||!this.isCellConnectable(t[0])||null!=this.getEdgeValidationError(e,this.model.getTerminal(e,!0),t[0]))&&(n=this.model.getTerminal(e,!0),e=this.model.getTerminal(e,!1),!this.model.isAncestor(t[0],n)&&!this.model.isAncestor(t[0],e))},mxGraph.prototype.getDropTarget=function(e,t,n){if(!this.isSwimlaneNesting())for(var a=0;a<e.length;a++)if(this.isSwimlane(e[a]))return null;if((a=mxUtils.convertPoint(this.container,mxEvent.getClientX(t),mxEvent.getClientY(t))).x-=this.panDx,a.y-=this.panDy,a=this.getSwimlaneAt(a.x,a.y),null==n)n=a;else if(null!=a){for(var i=this.model.getParent(a);null!=i&&this.isSwimlane(i)&&i!=n;)i=this.model.getParent(i);i==n&&(n=a)}for(;null!=n&&!this.isValidDropTarget(n,e,t)&&!this.model.isLayer(n);)n=this.model.getParent(n);return!this.model.isLayer(n)&&mxUtils.indexOf(e,n)<0?n:null},mxGraph.prototype.getDefaultParent=function(){var e=this.defaultParent;return null==e&&(null==(e=this.getCurrentRoot())&&(e=this.model.getRoot(),e=this.model.getChildAt(e,0))),e},mxGraph.prototype.setDefaultParent=function(e){this.defaultParent=e},mxGraph.prototype.getSwimlane=function(e){for(;null!=e&&!this.isSwimlane(e);)e=this.model.getParent(e);return e},mxGraph.prototype.getSwimlaneAt=function(e,t,n){if(null!=(n=n||this.getDefaultParent()))for(var a=this.model.getChildCount(n),i=0;i<a;i++){var o=this.model.getChildAt(n,i),s=this.getSwimlaneAt(e,t,o);if(null!=s)return s;if(this.isSwimlane(o)&&(s=this.view.getState(o),this.intersects(s,e,t)))return o}return null},mxGraph.prototype.getCellAt=function(e,t,n,a,i){if(a=null==a||a,i=null==i||i,null!=(n=null!=n?n:this.getDefaultParent()))for(var o=this.model.getChildCount(n)-1;0<=o;o--){var s=this.model.getChildAt(n,o),r=this.getCellAt(e,t,s,a,i);if(null!=r)return r;if(this.isCellVisible(s)&&(i&&this.model.isEdge(s)||a&&this.model.isVertex(s))&&(r=this.view.getState(s),this.intersects(r,e,t)))return s}return null},mxGraph.prototype.intersects=function(e,t,n){if(null!=e){var a=e.absolutePoints;if(null!=a){e=this.tolerance*this.tolerance;for(var i=a[0],o=1;o<a.length;o++){var s=a[o];if(mxUtils.ptSegDistSq(i.x,i.y,s.x,s.y,t,n)<=e)return!0;i=s}}else if(0!=(i=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(a=Math.cos(-i),i=Math.sin(-i),o=new mxPoint(e.getCenterX(),e.getCenterY()),t=(i=mxUtils.getRotatedPoint(new mxPoint(t,n),a,i,o)).x,n=i.y),mxUtils.contains(e,t,n))return!0}return!1},mxGraph.prototype.hitsSwimlaneContent=function(e,t,n){var a=this.getView().getState(e);if(e=this.getStartSize(e),null!=a){var i=this.getView().getScale();if(t-=a.x,n-=a.y,0<e.width&&0<t&&t>e.width*i||0<e.height&&0<n&&n>e.height*i)return!0}return!1},mxGraph.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraph.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraph.prototype.getChildCells=function(e,t,n){for(e=null!=e?e:this.getDefaultParent(),e=this.model.getChildCells(e,null!=t&&t,null!=n&&n),t=[],n=0;n<e.length;n++)this.isCellVisible(e[n])&&t.push(e[n]);return t},mxGraph.prototype.getConnections=function(e,t){return this.getEdges(e,t,!0,!0,!1)},mxGraph.prototype.getIncomingEdges=function(e,t){return this.getEdges(e,t,!0,!1,!1)},mxGraph.prototype.getOutgoingEdges=function(e,t){return this.getEdges(e,t,!1,!0,!1)},mxGraph.prototype.getEdges=function(e,t,n,a,i,o){n=null==n||n,a=null==a||a,i=null==i||i,o=null!=o&&o;for(var s=[],r=this.isCellCollapsed(e),l=this.model.getChildCount(e),d=0;d<l;d++){var c=this.model.getChildAt(e,d);!r&&this.isCellVisible(c)||(s=s.concat(this.model.getEdges(c,n,a)))}for(s=s.concat(this.model.getEdges(e,n,a)),r=[],d=0;d<s.length;d++)l=null!=(c=this.view.getState(s[d]))?c.getVisibleTerminal(!0):this.view.getVisibleTerminal(s[d],!0),c=null!=c?c.getVisibleTerminal(!1):this.view.getVisibleTerminal(s[d],!1),(i&&l==c||l!=c&&(n&&c==e&&(null==t||this.isValidAncestor(l,t,o))||a&&l==e&&(null==t||this.isValidAncestor(c,t,o))))&&r.push(s[d]);return r},mxGraph.prototype.isValidAncestor=function(e,t,n){return n?this.model.isAncestor(t,e):this.model.getParent(e)==t},mxGraph.prototype.getOpposites=function(e,t,n,a){n=null==n||n,a=null==a||a;var i=[],o={};if(null!=e)for(var s=0;s<e.length;s++){var r=null!=(l=this.view.getState(e[s]))?l.getVisibleTerminal(!0):this.view.getVisibleTerminal(e[s],!0),l=null!=l?l.getVisibleTerminal(!1):this.view.getVisibleTerminal(e[s],!1);if(r==t&&null!=l&&l!=t&&a){var d=mxCellPath.create(l);null==o[d]&&(o[d]=l,i.push(l))}else l==t&&null!=r&&r!=t&&n&&(null==o[d=mxCellPath.create(r)]&&(o[d]=r,i.push(r)))}return i},mxGraph.prototype.getEdgesBetween=function(e,t,n){n=null!=n&&n;for(var a=this.getEdges(e),i=[],o=0;o<a.length;o++){var s=null!=(r=this.view.getState(a[o]))?r.getVisibleTerminal(!0):this.view.getVisibleTerminal(a[o],!0),r=null!=r?r.getVisibleTerminal(!1):this.view.getVisibleTerminal(a[o],!1);(s==e&&r==t||!n&&s==t&&r==e)&&i.push(a[o])}return i},mxGraph.prototype.getPointForEvent=function(e,t){var n=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a=this.view.scale,i=this.view.translate,o=0!=t?this.gridSize/2:0;return n.x=this.snap(n.x/a-i.x-o),n.y=this.snap(n.y/a-i.y-o),n},mxGraph.prototype.getCells=function(e,t,n,a,i,o){if(o=null!=o?o:[],0<n||0<a){var s=e+n,r=t+a;if(null!=(i=i||this.getDefaultParent()))for(var l=this.model.getChildCount(i),d=0;d<l;d++){var c=this.model.getChildAt(i,d),m=this.view.getState(c);if(this.isCellVisible(c)&&null!=m){var u=m;0!=(m=mxUtils.getValue(m.style,mxConstants.STYLE_ROTATION)||0)&&(u=mxUtils.getBoundingBox(u,m)),u.x>=e&&u.y+u.height<=r&&u.y>=t&&u.x+u.width<=s?o.push(c):this.getCells(e,t,n,a,c,o)}}}return o},mxGraph.prototype.getCellsBeyond=function(e,t,n,a,i){var o=[];if((a||i)&&(null==n&&(n=this.getDefaultParent()),null!=n))for(var s=this.model.getChildCount(n),r=0;r<s;r++){var l=this.model.getChildAt(n,r),d=this.view.getState(l);this.isCellVisible(l)&&null!=d&&(!a||d.x>=e)&&(!i||d.y>=t)&&o.push(l)}return o},mxGraph.prototype.findTreeRoots=function(e,t,n){t=null!=t&&t,n=null!=n&&n;var a=[];if(null!=e){for(var i=this.getModel(),o=i.getChildCount(e),s=null,r=0,l=0;l<o;l++){var d=i.getChildAt(e,l);if(this.model.isVertex(d)&&this.isCellVisible(d)){for(var c=this.getConnections(d,t?e:null),m=0,u=0,p=0;p<c.length;p++)this.view.getVisibleTerminal(c[p],!0)==d?m++:u++;(n&&0==m&&0<u||!n&&0==u&&0<m)&&a.push(d),r<(c=n?u-m:m-u)&&(r=c,s=d)}}0==a.length&&null!=s&&a.push(s)}return a},mxGraph.prototype.traverse=function(e,t,n,a,i){if(null!=n&&null!=e){t=null==t||t,i=i||[];var o=mxCellPath.create(e);if(null==i[o]&&(null==(a=n(i[o]=e,a))||a)&&0<(a=this.model.getEdgeCount(e)))for(o=0;o<a;o++){var s=this.model.getEdgeAt(e,o),r=this.model.getTerminal(s,!0)==e;t&&!r||(r=this.model.getTerminal(s,!r),this.traverse(r,t,n,s,i))}}},mxGraph.prototype.isCellSelected=function(e){return this.getSelectionModel().isSelected(e)},mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()},mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()},mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length},mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]},mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()},mxGraph.prototype.setSelectionCell=function(e){this.getSelectionModel().setCell(e)},mxGraph.prototype.setSelectionCells=function(e){this.getSelectionModel().setCells(e)},mxGraph.prototype.addSelectionCell=function(e){this.getSelectionModel().addCell(e)},mxGraph.prototype.addSelectionCells=function(e){this.getSelectionModel().addCells(e)},mxGraph.prototype.removeSelectionCell=function(e){this.getSelectionModel().removeCell(e)},mxGraph.prototype.removeSelectionCells=function(e){this.getSelectionModel().removeCells(e)},mxGraph.prototype.selectRegion=function(e,t){var n=this.getCells(e.x,e.y,e.width,e.height);return this.selectCellsForEvent(n,t),n},mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)},mxGraph.prototype.selectPreviousCell=function(){this.selectCell()},mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)},mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)},mxGraph.prototype.selectCell=function(e,t,n){var a=0<(i=this.selectionModel).cells.length?i.cells[0]:null;1<i.cells.length&&i.clear();var i=null!=a?this.model.getParent(a):this.getDefaultParent(),o=this.model.getChildCount(i);null==a&&0<o?(e=this.model.getChildAt(i,0),this.setSelectionCell(e)):null!=a&&!t||null==this.view.getState(i)||null==this.model.getGeometry(i)?null!=a&&n?0<this.model.getChildCount(a)&&(e=this.model.getChildAt(a,0),this.setSelectionCell(e)):0<o&&(t=i.getIndex(a),e?(t++,e=this.model.getChildAt(i,t%o)):(t--,e=this.model.getChildAt(i,t<0?o-1:t)),this.setSelectionCell(e)):this.getCurrentRoot()!=i&&this.setSelectionCell(i)},mxGraph.prototype.selectAll=function(e){e=e||this.getDefaultParent(),null!=(e=this.model.getChildren(e))&&this.setSelectionCells(e)},mxGraph.prototype.selectVertices=function(e){this.selectCells(!0,!1,e)},mxGraph.prototype.selectEdges=function(e){this.selectCells(!1,!0,e)},mxGraph.prototype.selectCells=function(t,n,e){e=e||this.getDefaultParent();var a=mxUtils.bind(this,function(e){return null!=this.view.getState(e)&&0==this.model.getChildCount(e)&&(this.model.isVertex(e)&&t||this.model.isEdge(e)&&n)});e=this.model.filterDescendants(a,e),this.setSelectionCells(e)},mxGraph.prototype.selectCellForEvent=function(e,t){var n=this.isCellSelected(e);this.isToggleEvent(t)?n?this.removeSelectionCell(e):this.addSelectionCell(e):(!n||1!=this.getSelectionCount())&&this.setSelectionCell(e)},mxGraph.prototype.selectCellsForEvent=function(e,t){this.isToggleEvent(t)?this.addSelectionCells(e):this.setSelectionCells(e)},mxGraph.prototype.createHandler=function(e){var t=null;return null!=e&&(this.model.isEdge(e.cell)?(t=this.view.getEdgeStyle(e),t=this.isLoop(e)||t==mxEdgeStyle.ElbowConnector||t==mxEdgeStyle.SideToSide||t==mxEdgeStyle.TopToBottom?new mxElbowEdgeHandler(e):t==mxEdgeStyle.SegmentConnector||t==mxEdgeStyle.OrthConnector?new mxEdgeSegmentHandler(e):new mxEdgeHandler(e)):t=new mxVertexHandler(e)),t},mxGraph.prototype.addMouseListener=function(e){null==this.mouseListeners&&(this.mouseListeners=[]),this.mouseListeners.push(e)},mxGraph.prototype.removeMouseListener=function(e){if(null!=this.mouseListeners)for(var t=0;t<this.mouseListeners.length;t++)if(this.mouseListeners[t]==e){this.mouseListeners.splice(t,1);break}},mxGraph.prototype.updateMouseEvent=function(e){if(null==e.graphX||null==e.graphY){var t=mxUtils.convertPoint(this.container,e.getX(),e.getY());e.graphX=t.x-this.panDx,e.graphY=t.y-this.panDy}},mxGraph.prototype.fireMouseEvent=function(e,t,n){if(null==n&&(n=this),this.updateMouseEvent(t),e==mxEvent.MOUSE_DOWN&&(this.isMouseDown=!0),mxClient.IS_TOUCH&&this.doubleTapEnabled&&e==mxEvent.MOUSE_DOWN){var a=(new Date).getTime();a-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-t.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-t.getY())<this.doubleTapTolerance?(this.lastTouchTime=0,this.dblClick(t.getEvent(),t.getCell()),t.getEvent().cancelBubble=!0):(this.lastTouchX=t.getX(),this.lastTouchY=t.getY(),this.lastTouchTime=a)}if(a=2!=t.getEvent().detail,mxClient.IS_IE&&"CSS1Compat"==document.compatMode&&((null!=this.lastMouseX&&Math.abs(this.lastMouseX-t.getX())>this.doubleTapTolerance||null!=this.lastMouseY&&Math.abs(this.lastMouseY-t.getY())>this.doubleTapTolerance)&&(a=!0),e==mxEvent.MOUSE_UP&&(this.lastMouseX=t.getX(),this.lastMouseY=t.getY())),(e!=mxEvent.MOUSE_UP||this.isMouseDown)&&a){if(e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1),!this.isEditing()&&(mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||mxClient.IS_IE&&mxClient.IS_SVG||t.getEvent().target!=this.container)){if(e==mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&this.scrollPointToVisible(t.getGraphX(),t.getGraphY(),this.autoExtend),null!=this.mouseListeners)for(n=[n,t],t.getEvent().returnValue=!0,a=0;a<this.mouseListeners.length;a++){var i=this.mouseListeners[a];e==mxEvent.MOUSE_DOWN?i.mouseDown.apply(i,n):e==mxEvent.MOUSE_MOVE?i.mouseMove.apply(i,n):e==mxEvent.MOUSE_UP&&i.mouseUp.apply(i,n)}e==mxEvent.MOUSE_UP&&this.click(t)}}else e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1)},mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&this.cellEditor.destroy(),null!=this.view&&this.view.destroy(),null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)},mxCellOverlay.prototype=new mxEventSource,mxCellOverlay.prototype.constructor=mxCellOverlay,mxCellOverlay.prototype.image=null,mxCellOverlay.prototype.tooltip=null,mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT,mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM,mxCellOverlay.prototype.offset=null,mxCellOverlay.prototype.cursor=null,mxCellOverlay.prototype.defaultOverlap=.5,mxCellOverlay.prototype.getBounds=function(e){var t=e.view.graph.getModel().isEdge(e.cell),n=e.view.scale,a=null,i=this.image.width,o=this.image.height;return t?1==(t=e.absolutePoints).length%2?a=t[Math.floor(t.length/2)]:(e=t[(a=t.length/2)-1],t=t[a],a=new mxPoint(e.x+(t.x-e.x)/2,e.y+(t.y-e.y)/2)):((a=new mxPoint).x=this.align==mxConstants.ALIGN_LEFT?e.x:this.align==mxConstants.ALIGN_CENTER?e.x+e.width/2:e.x+e.width,a.y=this.verticalAlign==mxConstants.ALIGN_TOP?e.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE?e.y+e.height/2:e.y+e.height),new mxRectangle(Math.round(a.x-(i*this.defaultOverlap-this.offset.x)*n),Math.round(a.y-(o*this.defaultOverlap-this.offset.y)*n),i*n,o*n)},mxCellOverlay.prototype.toString=function(){return this.tooltip},mxOutline.prototype.source=null,mxOutline.prototype.outline=null,mxOutline.prototype.graphRenderHint=mxConstants.RENDERING_HINT_FASTER,mxOutline.prototype.enabled=!0,mxOutline.prototype.showViewport=!0,mxOutline.prototype.border=10,mxOutline.prototype.sizerSize=8,mxOutline.prototype.updateOnPan=!1,mxOutline.prototype.sizerImage=null,mxOutline.prototype.suspended=!1,mxOutline.prototype.init=function(e){this.outline=new mxGraph(e,this.source.getModel(),this.graphRenderHint,this.source.getStylesheet()),this.outline.foldingEnabled=!1,this.outline.autoScroll=!1;var t=this.outline.graphModelChanged;this.outline.graphModelChanged=mxUtils.bind(this,function(e){!this.suspended&&null!=this.outline&&t.apply(this.outline,arguments)}),mxClient.IS_SVG&&((e=this.outline.getView().getCanvas().parentNode).setAttribute("shape-rendering","optimizeSpeed"),e.setAttribute("image-rendering","optimizeSpeed")),this.outline.labelsVisible=!1,this.outline.setEnabled(!1),this.updateHandler=mxUtils.bind(this,function(e,t){!this.suspended&&!this.active&&this.update()}),this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler),this.outline.addMouseListener(this),(e=this.source.getView()).addListener(mxEvent.SCALE,this.updateHandler),e.addListener(mxEvent.TRANSLATE,this.updateHandler),e.addListener(mxEvent.SCALE_AND_TRANSLATE,this.updateHandler),e.addListener(mxEvent.DOWN,this.updateHandler),e.addListener(mxEvent.UP,this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.panHandler=mxUtils.bind(this,function(e){this.updateOnPan&&this.updateHandler.apply(this,arguments)}),this.source.addListener(mxEvent.PAN,this.panHandler),this.refreshHandler=mxUtils.bind(this,function(e){this.outline.setStylesheet(this.source.getStylesheet()),this.outline.refresh()}),this.source.addListener(mxEvent.REFRESH,this.refreshHandler),this.bounds=new mxRectangle(0,0,0,0),this.selectionBorder=new mxRectangleShape(this.bounds,null,mxConstants.OUTLINE_COLOR,mxConstants.OUTLINE_STROKEWIDTH),this.selectionBorder.dialect=this.outline.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.init(this.outline.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.outline),this.selectionBorder.node.style.background="",this.sizer=this.createSizer(),this.sizer.init(this.outline.getView().getOverlayPane()),this.enabled&&(this.sizer.node.style.cursor="pointer"),mxEvent.addListener(this.sizer.node,mxClient.IS_TOUCH?"touchstart":"mousedown",mxUtils.bind(this,function(e){this.outline.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))})),this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display,this.selectionBorder.node.style.cursor="move",this.update(!1)},mxOutline.prototype.isEnabled=function(){return this.enabled},mxOutline.prototype.setEnabled=function(e){this.enabled=e},mxOutline.prototype.setZoomEnabled=function(e){this.sizer.node.style.visibility=e?"visible":"hidden"},mxOutline.prototype.refresh=function(){this.update(!0)},mxOutline.prototype.createSizer=function(){var e=null!=this.sizerImage?new mxImageShape(new mxRectangle(0,0,this.sizerImage.width,this.sizerImage.height),this.sizerImage.src):new mxRectangleShape(new mxRectangle(0,0,this.sizerSize,this.sizerSize),mxConstants.OUTLINE_HANDLE_FILLCOLOR,mxConstants.OUTLINE_HANDLE_STROKECOLOR);return e.dialect=this.outline.dialect,e},mxOutline.prototype.getSourceContainerSize=function(){return new mxRectangle(0,0,this.source.container.scrollWidth,this.source.container.scrollHeight)},mxOutline.prototype.getOutlineOffset=function(e){return null},mxOutline.prototype.update=function(e){if(null!=this.source){var t=this.source.view.scale,n=new mxRectangle((n=this.source.getGraphBounds()).x/t+this.source.panDx,n.y/t+this.source.panDy,n.width/t,n.height/t),a=new mxRectangle(0,0,this.source.container.clientWidth/t,this.source.container.clientHeight/t);(o=n.clone()).add(a);var i=this.getSourceContainerSize(),o=(a=Math.max(i.width/t,o.width),t=Math.max(i.height/t,o.height),Math.max(0,this.outline.container.clientWidth-this.border));i=Math.max(0,this.outline.container.clientHeight-this.border);if(0<(o=Math.min(o/a,i/t))){this.outline.getView().scale!=o&&(this.outline.getView().scale=o,e=!0),(a=this.outline.getView()).currentRoot!=this.source.getView().currentRoot&&a.setCurrentRoot(this.source.getView().currentRoot);i=(t=this.source.view.translate).x+this.source.panDx;var s=t.y+this.source.panDy;null!=(o=this.getOutlineOffset(o))&&(i+=o.x,s+=o.y),n.x<0&&(i-=n.x),n.y<0&&(s-=n.y),a.translate.x==i&&a.translate.y==s||(a.translate.x=i,a.translate.y=s,e=!0);n=a.translate,i=(o=this.source.getView().scale)/a.scale,s=1/a.scale;var r=this.source.container;this.bounds=new mxRectangle((n.x-t.x-this.source.panDx)/s,(n.y-t.y-this.source.panDy)/s,r.clientWidth/i,r.clientHeight/i),this.bounds.x+=this.source.container.scrollLeft*a.scale/o,this.bounds.y+=this.source.container.scrollTop*a.scale/o,(n=this.selectionBorder.bounds).x==this.bounds.x&&n.y==this.bounds.y&&n.width==this.bounds.width&&n.height==this.bounds.height||(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()),n=this.sizer.bounds,a=new mxRectangle(this.bounds.x+this.bounds.width-n.width/2,this.bounds.y+this.bounds.height-n.height/2,n.width,n.height),n.x==a.x&&n.y==a.y&&n.width==a.width&&n.height==a.height||(this.sizer.bounds=a,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw()),e&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(e,t){this.enabled&&this.showViewport&&(this.zoom=t.isSource(this.sizer),this.startX=t.getX(),this.startY=t.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):this.dy0=this.dx0=0),t.consume()},mxOutline.prototype.mouseMove=function(e,t){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var n=t.getX()-this.startX,a=t.getY()-this.startY,i=null;if(this.zoom)a=n/((i=this.source.container).clientWidth/i.clientHeight),i=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+n),Math.max(1,this.bounds.height+a)),this.selectionBorder.bounds=i,this.selectionBorder.redraw();else{var o=this.outline.getView().scale;i=new mxRectangle(this.bounds.x+n,this.bounds.y+a,this.bounds.width,this.bounds.height);this.selectionBorder.bounds=i,this.selectionBorder.redraw(),n=n/o*this.source.getView().scale,a=a/o*this.source.getView().scale,this.source.panGraph(-n-this.dx0,-a-this.dy0)}n=this.sizer.bounds,this.sizer.bounds=new mxRectangle(i.x+i.width-n.width/2,i.y+i.height-n.height/2,n.width,n.height),"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw(),t.consume()}},mxOutline.prototype.mouseUp=function(e,t){if(this.active){var n=t.getX()-this.startX,a=t.getY()-this.startY;if(0<Math.abs(n)||0<Math.abs(a)){if(this.zoom){a=this.selectionBorder.bounds.width;var i=this.source.getView().scale;this.source.zoomTo(i-n*i/a,!1)}else this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)||(this.source.panGraph(0,0),n/=this.outline.getView().scale,a/=this.outline.getView().scale,i=this.source.getView().translate,this.source.getView().setTranslate(i.x-n,i.y-a));this.update(),t.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){null!=this.source&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.source=null),null!=this.outline&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),null!=this.sizer&&(this.sizer.destroy(),this.sizer=null)},mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(e,t,n,a,i,o){var s="";return(this.source&&this.checkTerminal(e,n,t)||!this.source&&this.checkTerminal(e,a,t))&&(null!=this.countError&&(this.source&&(0==this.max||i>=this.max)||!this.source&&(0==this.max||o>=this.max))&&(s+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&0<this.validNeighbors.length&&(this.checkNeighbors(e,t,n,a)||(s+=this.typeError+"\n"))),0<s.length?s:null},mxMultiplicity.prototype.checkNeighbors=function(e,t,n,a){t=e.model.getValue(n),a=e.model.getValue(a),n=!this.validNeighborsAllowed;for(var i=this.validNeighbors,o=0;o<i.length;o++){if(this.source&&this.checkType(e,a,i[o])){n=this.validNeighborsAllowed;break}if(!this.source&&this.checkType(e,t,i[o])){n=this.validNeighborsAllowed;break}}return n},mxMultiplicity.prototype.checkTerminal=function(e,t,n){return t=e.model.getValue(t),this.checkType(e,t,this.type,this.attr,this.value)},mxMultiplicity.prototype.checkType=function(e,t,n,a,i){return null!=t&&(isNaN(t.nodeType)?t==n:mxUtils.isNode(t,n,a,i))},mxLayoutManager.prototype=new mxEventSource,mxLayoutManager.prototype.constructor=mxLayoutManager,mxLayoutManager.prototype.graph=null,mxLayoutManager.prototype.bubbling=!0,mxLayoutManager.prototype.enabled=!0,mxLayoutManager.prototype.updateHandler=null,mxLayoutManager.prototype.moveHandler=null,mxLayoutManager.prototype.isEnabled=function(){return this.enabled},mxLayoutManager.prototype.setEnabled=function(e){this.enabled=e},mxLayoutManager.prototype.isBubbling=function(){return this.bubbling},mxLayoutManager.prototype.setBubbling=function(e){this.bubbling=e},mxLayoutManager.prototype.getGraph=function(){return this.graph},mxLayoutManager.prototype.setGraph=function(e){if(null!=this.graph){var t=this.graph.getModel();t.removeListener(this.undoHandler),this.graph.removeListener(this.moveHandler)}this.graph=e,null!=this.graph&&((t=this.graph.getModel()).addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler))},mxLayoutManager.prototype.getLayout=function(e){return null},mxLayoutManager.prototype.beforeUndo=function(e){e=this.getCellsForChanges(e.changes);var t=this.getGraph().getModel();if(this.isBubbling())for(var n=t.getParents(e);0<n.length;)e=e.concat(n),n=t.getParents(n);this.layoutCells(mxUtils.sortCells(e,!1))},mxLayoutManager.prototype.cellsMoved=function(e,t){if(null!=e&&null!=t)for(var n=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(t),mxEvent.getClientY(t)),a=this.getGraph().getModel(),i=0;i<e.length;i++){var o=this.getLayout(a.getParent(e[i]));null!=o&&o.moveCell(e[i],n.x,n.y)}},mxLayoutManager.prototype.getCellsForChanges=function(e){for(var t=[],n={},a=0;a<e.length;a++){if((i=e[a])instanceof mxRootChange)return[];for(var i=this.getCellsForChange(i),o=0;o<i.length;o++)if(null!=i[o]){var s=mxCellPath.create(i[o]);null==n[s]&&(n[s]=i[o],t.push(i[o]))}}return t},mxLayoutManager.prototype.getCellsForChange=function(e){var t=this.getGraph().getModel();return e instanceof mxChildChange?[e.child,e.previous,t.getParent(e.child)]:e instanceof mxTerminalChange||e instanceof mxGeometryChange?[e.cell,t.getParent(e.cell)]:[]},mxLayoutManager.prototype.layoutCells=function(e){if(0<e.length){var t=this.getGraph().getModel();t.beginUpdate();try{for(var n=null,a=0;a<e.length;a++)e[a]!=t.getRoot()&&e[a]!=n&&(n=e[a],this.executeLayout(this.getLayout(n),n));this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",e))}finally{t.endUpdate()}}},mxLayoutManager.prototype.executeLayout=function(e,t){null!=e&&null!=t&&e.execute(t)},mxLayoutManager.prototype.destroy=function(){this.setGraph(null)},mxSpaceManager.prototype=new mxEventSource,mxSpaceManager.prototype.constructor=mxSpaceManager,mxSpaceManager.prototype.graph=null,mxSpaceManager.prototype.enabled=!0,mxSpaceManager.prototype.shiftRightwards=!0,mxSpaceManager.prototype.shiftDownwards=!0,mxSpaceManager.prototype.extendParents=!0,mxSpaceManager.prototype.resizeHandler=null,mxSpaceManager.prototype.foldHandler=null,mxSpaceManager.prototype.isCellIgnored=function(e){return!this.getGraph().getModel().isVertex(e)},mxSpaceManager.prototype.isCellShiftable=function(e){return this.getGraph().getModel().isVertex(e)&&this.getGraph().isCellMovable(e)},mxSpaceManager.prototype.isEnabled=function(){return this.enabled},mxSpaceManager.prototype.setEnabled=function(e){this.enabled=e},mxSpaceManager.prototype.isShiftRightwards=function(){return this.shiftRightwards},mxSpaceManager.prototype.setShiftRightwards=function(e){this.shiftRightwards=e},mxSpaceManager.prototype.isShiftDownwards=function(){return this.shiftDownwards},mxSpaceManager.prototype.setShiftDownwards=function(e){this.shiftDownwards=e},mxSpaceManager.prototype.isExtendParents=function(){return this.extendParents},mxSpaceManager.prototype.setExtendParents=function(e){this.extendParents=e},mxSpaceManager.prototype.getGraph=function(){return this.graph},mxSpaceManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.resizeHandler),this.graph.removeListener(this.foldHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.RESIZE_CELLS,this.resizeHandler),this.graph.addListener(mxEvent.FOLD_CELLS,this.foldHandler))},mxSpaceManager.prototype.cellsResized=function(e){if(null!=e){var t=this.graph.getModel();t.beginUpdate();try{for(var n=0;n<e.length;n++)if(!this.isCellIgnored(e[n])){this.cellResized(e[n]);break}}finally{t.endUpdate()}}},mxSpaceManager.prototype.cellResized=function(e){var t=this.getGraph(),n=t.getView(),a=t.getModel(),i=n.getState(e),o=n.getState(a.getParent(e));if(null!=i&&null!=o){var s=this.getCellsToShift(i),r=a.getGeometry(e);if(null!=s&&null!=r){var l=n.translate,d=n.scale,c=(n=i.x-o.origin.x-l.x*d,o=i.y-o.origin.y-l.y*d,l=i.x+i.width,i.y+i.height),m=i.width-r.width*d+n-r.x*d,u=i.height-r.height*d+o-r.y*d,p=1-r.width*d/i.width;i=1-r.height*d/i.height;a.beginUpdate();try{for(r=0;r<s.length;r++)s[r]!=e&&this.isCellShiftable(s[r])&&this.shiftCell(s[r],m,u,n,o,l,c,p,i,this.isExtendParents()&&t.isExtendParent(s[r]))}finally{a.endUpdate()}}}},mxSpaceManager.prototype.shiftCell=function(e,t,n,a,i,o,s,r,l,d){var c=(a=this.getGraph()).getView().getState(e);if(null!=c){var m=a.getModel();if(null!=(p=m.getGeometry(e))){m.beginUpdate();try{if(this.isShiftRightwards())if(c.x>=o)(p=p.clone()).translate(-t,0);else{var u=Math.max(0,c.x-x0);(p=p.clone()).translate(-r*u,0)}if(this.isShiftDownwards())if(c.y>=s)(p=p.clone()).translate(0,-n);else{var p,g=Math.max(0,c.y-i);(p=p.clone()).translate(0,-l*g)}p!=m.getGeometry(e)&&(m.setGeometry(e,p),d&&a.extendParent(e))}finally{m.endUpdate()}}}},mxSpaceManager.prototype.getCellsToShift=function(e){var t=this.getGraph(),n=t.getModel().getParent(e.cell),a=this.isShiftDownwards(),i=this.isShiftRightwards();return t.getCellsBeyond(e.x+(a?0:e.width),e.y+(a&&i?0:e.height),n,i,a)},mxSpaceManager.prototype.destroy=function(){this.setGraph(null)},mxSwimlaneManager.prototype=new mxEventSource,mxSwimlaneManager.prototype.constructor=mxSwimlaneManager,mxSwimlaneManager.prototype.graph=null,mxSwimlaneManager.prototype.enabled=!0,mxSwimlaneManager.prototype.horizontal=!0,mxSwimlaneManager.prototype.addEnabled=!0,mxSwimlaneManager.prototype.resizeEnabled=!0,mxSwimlaneManager.prototype.addHandler=null,mxSwimlaneManager.prototype.resizeHandler=null,mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled},mxSwimlaneManager.prototype.setEnabled=function(e){this.enabled=e},mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal},mxSwimlaneManager.prototype.setHorizontal=function(e){this.horizontal=e},mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled},mxSwimlaneManager.prototype.setAddEnabled=function(e){this.addEnabled=e},mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled},mxSwimlaneManager.prototype.setResizeEnabled=function(e){this.resizeEnabled=e},mxSwimlaneManager.prototype.getGraph=function(){return this.graph},mxSwimlaneManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler),this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler))},mxSwimlaneManager.prototype.isSwimlaneIgnored=function(e){return!this.getGraph().isSwimlane(e)},mxSwimlaneManager.prototype.isCellHorizontal=function(e){if(this.graph.isSwimlane(e)){var t=this.graph.view.getState(e);return e=null!=t?t.style:this.graph.getCellStyle(e),1==mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,1)}return!this.isHorizontal()},mxSwimlaneManager.prototype.cellsAdded=function(e){if(null!=e){var t=this.getGraph().getModel();t.beginUpdate();try{for(var n=0;n<e.length;n++)this.isSwimlaneIgnored(e[n])||this.swimlaneAdded(e[n])}finally{t.endUpdate()}}},mxSwimlaneManager.prototype.swimlaneAdded=function(e){for(var t=this.getGraph().getModel(),n=t.getParent(e),a=t.getChildCount(n),i=null,o=0;o<a;o++){var s=t.getChildAt(n,o);if(s!=e&&!this.isSwimlaneIgnored(s)&&null!=(i=t.getGeometry(s)))break}null!=i&&this.resizeSwimlane(e,i.width,i.height)},mxSwimlaneManager.prototype.cellsResized=function(e){if(null!=e){var t=this.getGraph().getModel();t.beginUpdate();try{for(var n=0;n<e.length;n++)if(!this.isSwimlaneIgnored(e[n])){var a=t.getGeometry(e[n]);if(null!=a){for(var i=new mxRectangle(0,0,a.width,a.height),o=s=e[n];null!=o;){var s=o,r=(o=t.getParent(o),this.graph.isSwimlane(o)?this.graph.getStartSize(o):new mxRectangle);i.width+=r.width,i.height+=r.height}this.resizeSwimlane(s,i.width,i.height)}}}finally{t.endUpdate()}}},mxSwimlaneManager.prototype.resizeSwimlane=function(e,t,n){var a=this.getGraph().getModel();a.beginUpdate();try{if(!this.isSwimlaneIgnored(e))if(null!=(r=a.getGeometry(e))){var i=this.isCellHorizontal(e);(i&&r.height!=n||!i&&r.width!=t)&&(r=r.clone(),i?r.height=n:r.width=t,a.setGeometry(e,r))}var o=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle;t-=o.width,n-=o.height;for(var s=a.getChildCount(e),r=0;r<s;r++){var l=a.getChildAt(e,r);this.resizeSwimlane(l,t,n)}}finally{a.endUpdate()}},mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)},mxTemporaryCellStates.prototype.view=null,mxTemporaryCellStates.prototype.oldStates=null,mxTemporaryCellStates.prototype.oldBounds=null,mxTemporaryCellStates.prototype.oldScale=null,mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale),this.view.setStates(this.oldStates),this.view.setGraphBounds(this.oldBounds)},mxCellStatePreview.prototype.graph=null,mxCellStatePreview.prototype.deltas=null,mxCellStatePreview.prototype.count=0,mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count},mxCellStatePreview.prototype.moveState=function(e,t,n,a,i){a=null==a||a,i=null==i||i;var o=mxCellPath.create(e.cell),s=this.deltas[o];return null==s?(s=new mxPoint(t,n),this.deltas[o]=s,this.count++):a?(s.X+=t,s.Y+=n):(s.X=t,s.Y=n),i&&this.addEdges(e),s},mxCellStatePreview.prototype.show=function(e){var t,n=this.graph.getModel(),a=n.getRoot();for(t in this.deltas){var i=mxCellPath.resolve(a,t),o=this.graph.view.getState(i),s=this.deltas[t];i=this.graph.view.getState(n.getParent(i));this.translateState(i,o,s.x,s.y)}for(t in this.deltas)i=mxCellPath.resolve(a,t),o=this.graph.view.getState(i),s=this.deltas[t],i=this.graph.view.getState(n.getParent(i)),this.revalidateState(i,o,s.x,s.y,e)},mxCellStatePreview.prototype.translateState=function(e,t,n,a){if(null!=t){var i=this.graph.getModel();if(i.isVertex(t.cell)){t.invalid=!0,this.graph.view.validateBounds(e,t.cell),e=i.getGeometry(t.cell);var o=mxCellPath.create(t.cell);0==n&&0==a||null==e||e.relative&&null==this.deltas[o]||(t.x+=n,t.y+=a)}for(e=i.getChildCount(t.cell),o=0;o<e;o++)this.translateState(t,this.graph.view.getState(i.getChildAt(t.cell,o)),n,a)}},mxCellStatePreview.prototype.revalidateState=function(e,t,n,a,i){if(null!=t){t.invalid=!0,this.graph.view.validatePoints(e,t.cell);var o=mxCellPath.create(t.cell),s=this.graph.getModel(),r=this.graph.getCellGeometry(t.cell);for(0==n&&0==a||null==r||!r.relative||!s.isVertex(t.cell)||null!=e&&!s.isVertex(e.cell)&&null==this.deltas[o]||(t.x+=n,t.y+=a,this.graph.cellRenderer.redraw(t)),null!=i&&i(t),e=s.getChildCount(t.cell),o=0;o<e;o++)this.revalidateState(t,this.graph.view.getState(s.getChildAt(t.cell,o)),n,a,i)}},mxCellStatePreview.prototype.addEdges=function(e){for(var t=this.graph.getModel(),n=t.getEdgeCount(e.cell),a=0;a<n;a++){var i=this.graph.view.getState(t.getEdgeAt(e.cell,a));null!=i&&this.moveState(i,0,0)}},mxConnectionConstraint.prototype.point=null,mxConnectionConstraint.prototype.perimeter=null,mxGraphHandler.prototype.graph=null,mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50,mxGraphHandler.prototype.enabled=!0,mxGraphHandler.prototype.highlightEnabled=!0,mxGraphHandler.prototype.cloneEnabled=!0,mxGraphHandler.prototype.moveEnabled=!0,mxGraphHandler.prototype.guidesEnabled=!1,mxGraphHandler.prototype.guide=null,mxGraphHandler.prototype.currentDx=null,mxGraphHandler.prototype.currentDy=null,mxGraphHandler.prototype.updateCursor=!0,mxGraphHandler.prototype.selectEnabled=!0,mxGraphHandler.prototype.removeCellsFromParent=!0,mxGraphHandler.prototype.connectOnDrop=!1,mxGraphHandler.prototype.scrollOnMove=!0,mxGraphHandler.prototype.minimumSize=6,mxGraphHandler.prototype.previewColor="black",mxGraphHandler.prototype.htmlPreview=!1,mxGraphHandler.prototype.shape=null,mxGraphHandler.prototype.scaleGrid=!1,mxGraphHandler.prototype.rotationEnabled=!0,mxGraphHandler.prototype.isEnabled=function(){return this.enabled},mxGraphHandler.prototype.setEnabled=function(e){this.enabled=e},mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled},mxGraphHandler.prototype.setCloneEnabled=function(e){this.cloneEnabled=e},mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled},mxGraphHandler.prototype.setMoveEnabled=function(e){this.moveEnabled=e},mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled},mxGraphHandler.prototype.setSelectEnabled=function(e){this.selectEnabled=e},mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent},mxGraphHandler.prototype.setRemoveCellsFromParent=function(e){this.removeCellsFromParent=e},mxGraphHandler.prototype.getInitialCellForEvent=function(e){return e.getCell()},mxGraphHandler.prototype.isDelayedSelection=function(e){return this.graph.isCellSelected(e)},mxGraphHandler.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(t.getEvent())&&null!=t.getState()){var n=this.getInitialCellForEvent(t);if(this.cell=null,this.delayedSelection=this.isDelayedSelection(n),this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(n,t.getEvent()),this.isMoveEnabled()){var a=this.graph.model,i=a.getGeometry(n);this.graph.isCellMovable(n)&&(!a.isEdge(n)||1<this.graph.getSelectionCount()||null!=i.points&&0<i.points.length||null==a.getTerminal(n,!0)||null==a.getTerminal(n,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(t.getEvent())&&this.graph.isCellsCloneable())&&this.start(n,t.getX(),t.getY()),this.cellWasClicked=!0,!mxClient.IS_SF&&!mxClient.IS_GC||"SELECT"!=t.getSource().nodeName?t.consume():mxClient.IS_SF&&"SELECT"==t.getSource().nodeName&&(this.cellWasClicked=!1,this.first=null)}}},mxGraphHandler.prototype.getGuideStates=function(){var e=this.graph.getDefaultParent(),t=this.graph.getModel(),n=mxUtils.bind(this,function(e){return null!=this.graph.view.getState(e)&&t.isVertex(e)&&null!=t.getGeometry(e)&&!t.getGeometry(e).relative});return this.graph.view.getCellStates(t.filterDescendants(n,e))},mxGraphHandler.prototype.getCells=function(e){return!this.delayedSelection&&this.graph.isCellMovable(e)?[e]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(e){return null!=(e=this.getBoundingBox(e))&&(e.grow(-1,-1),e.width<this.minimumSize&&(e.x-=(this.minimumSize-e.width)/2,e.width=this.minimumSize),e.height<this.minimumSize&&(e.y-=(this.minimumSize-e.height)/2,e.height=this.minimumSize)),e},mxGraphHandler.prototype.getBoundingBox=function(e){var t=null;if(null!=e&&0<e.length)for(var n=this.graph.getModel(),a=0;a<e.length;a++)if(n.isVertex(e[a])||n.isEdge(e[a])){var i=this.graph.view.getState(e[a]);if(null!=i){var o=i;n.isVertex(e[a])&&null!=i.shape&&null!=i.shape.boundingBox&&(o=i.shape.boundingBox),null==t?t=new mxRectangle(o.x,o.y,o.width,o.height):t.add(o)}}return t},mxGraphHandler.prototype.createPreviewShape=function(e){return(e=new mxRectangleShape(e,null,this.previewColor)).isDashed=!0,this.htmlPreview?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.pointerEvents=!1),e},mxGraphHandler.prototype.start=function(e,t,n){this.cell=e,this.first=mxUtils.convertPoint(this.graph.container,t,n),this.cells=this.getCells(this.cell),this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),this.guidesEnabled&&(this.guide=new mxGuide(this.graph,this.getGuideStates()))},mxGraphHandler.prototype.useGuidesForEvent=function(e){return null==this.guide||this.guide.isEnabledForEvent(e.getEvent())},mxGraphHandler.prototype.snap=function(e){var t=this.scaleGrid?this.graph.view.scale:1;return e.x=this.graph.snap(e.x/t)*t,e.y=this.graph.snap(e.y/t)*t,e},mxGraphHandler.prototype.mouseMove=function(e,t){var n=this.graph;if(!t.isConsumed()&&n.isMouseDown&&null!=this.cell&&null!=this.first&&null!=this.bounds){var a=(o=mxUtils.convertPoint(n.container,t.getX(),t.getY())).x-this.first.x,i=o.y-this.first.y,o=n.tolerance;if(null!=this.shape||Math.abs(a)>o||Math.abs(i)>o){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3)),null==this.shape&&(this.shape=this.createPreviewShape(this.bounds));var s=n.isGridEnabledEvent(t.getEvent());o=!0;if(null!=this.guide&&this.useGuidesForEvent(t))o=!1,a=(i=this.guide.move(this.bounds,new mxPoint(a,i),s)).x,i=i.y;else if(s){var r=n.getView().translate,l=n.getView().scale;s=this.bounds.x-(n.snap(this.bounds.x/l-r.x)+r.x)*l,r=this.bounds.y-(n.snap(this.bounds.y/l-r.y)+r.y)*l,a=(i=this.snap(new mxPoint(a,i))).x-s,i=i.y-r}for(null!=this.guide&&o&&this.guide.hide(),n.isConstrainedEvent(t.getEvent())&&(Math.abs(a)>Math.abs(i)?i=0:a=0),this.currentDx=a,this.currentDy=i,this.updatePreviewShape(),o=null,i=t.getCell(),n.isDropEnabled()&&this.highlightEnabled&&(o=n.getDropTarget(this.cells,t.getEvent(),i)),s=o,r=n.getModel();null!=s&&s!=this.cells[0];)s=r.getParent(s);l=n.isCloneEvent(t.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled();var d=!1;null==(a=n.getView().getState(o))||null!=s||r.getParent(this.cell)==o&&!l?(this.target=null,this.connectOnDrop&&null!=i&&1==this.cells.length&&n.getModel().isVertex(i)&&n.isCellConnectable(i)&&(null!=(a=n.getView().getState(i))&&(n=null==n.getEdgeValidationError(null,this.cell,i)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,this.setHighlightColor(n),d=!0))):(this.target!=o&&(this.target=o,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),d=!0),null!=a&&d?this.highlight.highlight(a):this.highlight.hide()}t.consume(),mxEvent.consume(t.getEvent())}else!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||t.isConsumed()||null==t.getState()||n.isMouseDown||(null==(a=n.getCursorForCell(t.getCell()))&&n.isEnabled()&&n.isCellMovable(t.getCell())&&(a=n.getModel().isEdge(t.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),t.getState().setCursor(a),t.consume())},mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx-this.graph.panDx),Math.round(this.pBounds.y+this.currentDy-this.graph.panDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())},mxGraphHandler.prototype.setHighlightColor=function(e){null!=this.highlight&&this.highlight.setHighlightColor(e)},mxGraphHandler.prototype.mouseUp=function(e,t){if(!t.isConsumed()){var n=this.graph;if(null!=this.cell&&null!=this.first&&null!=this.shape&&null!=this.currentDx&&null!=this.currentDy){var a=n.getView().scale,i=n.isCloneEvent(t.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled(),o=this.currentDx/a,s=(a=this.currentDy/a,t.getCell());this.connectOnDrop&&null==this.target&&null!=s&&n.getModel().isVertex(s)&&n.isCellConnectable(s)&&n.isEdgeValid(null,this.cell,s)?n.connectionHandler.connect(this.cell,s,t.getEvent()):(s=this.target,n.isSplitEnabled()&&n.isSplitTarget(s,this.cells,t.getEvent())?n.splitEdge(s,this.cells,null,o,a):this.moveCells(this.cells,o,a,i,this.target,t.getEvent()))}else this.isSelectEnabled()&&this.delayedSelection&&null!=this.cell&&this.selectDelayed(t)}this.cellWasClicked&&t.consume(),this.reset()},mxGraphHandler.prototype.selectDelayed=function(e){this.graph.selectCellForEvent(this.cell,e.getEvent())},mxGraphHandler.prototype.reset=function(){this.destroyShapes(),this.delayedSelection=this.cellWasClicked=!1,this.target=this.cell=this.first=this.guides=this.currentDy=this.currentDx=null},mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,t,n){if(this.graph.getModel().isVertex(e)){if(e=this.graph.getView().getState(e),n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(n),mxEvent.getClientY(n)),0!=(a=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))){t=Math.cos(-a);var a=Math.sin(-a),i=new mxPoint(e.getCenterX(),e.getCenterY());n=mxUtils.getRotatedPoint(n,t,a,i)}return null!=e&&!mxUtils.contains(e,n.x,n.y)}return!1},mxGraphHandler.prototype.moveCells=function(e,t,n,a,i,o){a&&(e=this.graph.getCloneableCells(e)),null==i&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(this.graph.getModel().getParent(this.cell),e,o)&&(i=this.graph.getDefaultParent()),e=this.graph.moveCells(e,t-this.graph.panDx/this.graph.view.scale,n-this.graph.panDy/this.graph.view.scale,a,i,o),this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(e[0]),a&&this.graph.setSelectionCells(e)},mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.guide&&(this.guide.destroy(),this.guide=null),null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)},mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.destroyShapes()},mxPanningHandler.prototype=new mxPopupMenu,mxPanningHandler.prototype.constructor=mxPanningHandler,mxPanningHandler.prototype.graph=null,mxPanningHandler.prototype.triggerX=null,mxPanningHandler.prototype.triggerY=null,mxPanningHandler.prototype.usePopupTrigger=!0,mxPanningHandler.prototype.useLeftButtonForPanning=!1,mxPanningHandler.prototype.selectOnPopup=!0,mxPanningHandler.prototype.clearSelectionOnBackground=!0,mxPanningHandler.prototype.ignoreCell=!1,mxPanningHandler.prototype.previewEnabled=!0,mxPanningHandler.prototype.useGrid=!1,mxPanningHandler.prototype.panningEnabled=!0,mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled},mxPanningHandler.prototype.setPanningEnabled=function(e){this.panningEnabled=e},mxPanningHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this),mxEvent.addListener(this.div,mxClient.IS_TOUCH?"touchmove":"mousemove",mxUtils.bind(this,function(e){this.graph.tooltipHandler.hide()}))},mxPanningHandler.prototype.isPanningTrigger=function(e){var t=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())&&mxEvent.isLeftMouseButton(t)||mxEvent.isControlDown(t)&&mxEvent.isShiftDown(t)||this.usePopupTrigger&&mxEvent.isPopupTrigger(t)},mxPanningHandler.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.isEnabled()){this.hideMenu(),this.dx0=-this.graph.container.scrollLeft,this.dy0=-this.graph.container.scrollTop;var n=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY());this.triggerX=n.x,this.triggerY=n.y,this.popupTrigger=this.isPopupTrigger(t),this.panningTrigger=this.isPanningEnabled()&&this.isPanningTrigger(t),this.startX=t.getX(),this.startY=t.getY(),this.panningTrigger&&this.consumePanningTrigger(t)}},mxPanningHandler.prototype.consumePanningTrigger=function(e){e.consume()},mxPanningHandler.prototype.mouseMove=function(e,t){var n=t.getX()-this.startX,a=t.getY()-this.startY;if(this.active)this.previewEnabled&&(this.useGrid&&(n=this.graph.snap(n),a=this.graph.snap(a)),this.graph.panGraph(n+this.dx0,a+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",t)),t.consume();else if(this.panningTrigger){var i=this.active;this.active=Math.abs(n)>this.graph.tolerance||Math.abs(a)>this.graph.tolerance,!i&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",t))}},mxPanningHandler.prototype.mouseUp=function(e,t){var n=Math.abs(t.getX()-this.startX),a=Math.abs(t.getY()-this.startY);if(this.active){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){n=t.getX()-this.startX,a=t.getY()-this.startY,this.useGrid&&(n=this.graph.snap(n),a=this.graph.snap(a));var i=this.graph.getView().scale,o=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(o.x+n/i,o.y+a/i)}this.active=!1,this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",t)),t.consume()}else this.popupTrigger&&n<this.graph.tolerance&&a<this.graph.tolerance&&(n=this.getCellForPopupEvent(t),this.graph.isEnabled()&&this.selectOnPopup&&null!=n&&!this.graph.isCellSelected(n)?this.graph.setSelectionCell(n):this.clearSelectionOnBackground&&null==n&&this.graph.clearSelection(),this.graph.tooltipHandler.hide(),a=mxUtils.getScrollOrigin(),a=new mxPoint(t.getX()+a.x,t.getY()+a.y),this.popup(a.x+1,a.y+1,n,t.getEvent()),t.consume());this.popupTrigger=this.panningTrigger=!1},mxPanningHandler.prototype.getCellForPopupEvent=function(e){return e.getCell()},mxPanningHandler.prototype.panGraph=function(e,t){this.graph.getView().setTranslate(e,t)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxPopupMenu.prototype.destroy.apply(this)},mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,mxCellMarker.prototype.validColor=null,mxCellMarker.prototype.invalidColor=null,mxCellMarker.prototype.currentColor=null,mxCellMarker.prototype.validState=null,mxCellMarker.prototype.markedState=null,mxCellMarker.prototype.setEnabled=function(e){this.enabled=e},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(e){this.hotspot=e},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(e){this.hotspotEnabled=e},mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled},mxCellMarker.prototype.hasValidState=function(){return null!=this.validState},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){(this.validState=null)!=this.markedState&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(e){var t=null;if(this.isEnabled()){var n=null!=(t=this.getState(e))&&this.isValidState(t);e=this.getMarkerColor(e.getEvent(),t,n),this.validState=n?t:null,t==this.markedState&&e==this.currentColor||(this.currentColor=e,null!=t&&null!=this.currentColor?(this.markedState=t,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark()))}return t},mxCellMarker.prototype.markCell=function(e,t){var n=this.graph.getView().getState(e);null!=n&&(this.currentColor=null!=t?t:this.validColor,this.markedState=n,this.mark())},mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor),this.highlight.highlight(this.markedState),this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))},mxCellMarker.prototype.unmark=function(){this.mark()},mxCellMarker.prototype.isValidState=function(e){return!0},mxCellMarker.prototype.getMarkerColor=function(e,t,n){return n?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(e){var t=this.graph.getView();return cell=this.getCell(e),null!=(t=this.getStateToMark(t.getState(cell)))&&this.intersects(t,e)?t:null},mxCellMarker.prototype.getCell=function(e){return e.getCell()},mxCellMarker.prototype.getStateToMark=function(e){return e},mxCellMarker.prototype.intersects=function(e,t){return!this.hotspotEnabled||mxUtils.intersectsHotspot(e,t.getGraphX(),t.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,mxSelectionCellsHandler.prototype.refreshHandler=null,mxSelectionCellsHandler.prototype.maxHandlers=100,mxSelectionCellsHandler.prototype.handlers=null,mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled},mxSelectionCellsHandler.prototype.setEnabled=function(e){this.enabled=e},mxSelectionCellsHandler.prototype.getHandler=function(e){return this.handlers.get(e)},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(e,t){t.reset.apply(t)})},mxSelectionCellsHandler.prototype.refresh=function(){var e=this.handlers;this.handlers=new mxDictionary;for(var t=this.graph.getSelectionCells(),n=0;n<t.length;n++){var a=this.graph.view.getState(t[n]);if(null!=a){var i=e.remove(t[n]);null!=i&&(i.state!=a?(i.destroy(),i=null):i.redraw()),null==i&&(i=this.graph.createHandler(a),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",a))),null!=i&&this.handlers.put(t[n],i)}}e.visit(mxUtils.bind(this,function(e,t){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",t.state)),t.destroy()}))},mxSelectionCellsHandler.prototype.mouseDown=function(e,t){if(this.graph.isEnabled()&&this.isEnabled()){var n=[e,t];this.handlers.visit(function(e,t){t.mouseDown.apply(t,n)})}},mxSelectionCellsHandler.prototype.mouseMove=function(e,t){if(this.graph.isEnabled()&&this.isEnabled()){var n=[e,t];this.handlers.visit(function(e,t){t.mouseMove.apply(t,n)})}},mxSelectionCellsHandler.prototype.mouseUp=function(e,t){if(this.graph.isEnabled()&&this.isEnabled()){var n=[e,t];this.handlers.visit(function(e,t){t.mouseUp.apply(t,n)})}},mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.refreshHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.refreshHandler=null)},mxUtils.extend(mxConnectionHandler,mxEventSource),mxConnectionHandler.prototype.graph=null,mxConnectionHandler.prototype.factoryMethod=!0,mxConnectionHandler.prototype.moveIconFront=!1,mxConnectionHandler.prototype.moveIconBack=!1,mxConnectionHandler.prototype.connectImage=null,mxConnectionHandler.prototype.targetConnectImage=!1,mxConnectionHandler.prototype.enabled=!0,mxConnectionHandler.prototype.select=!0,mxConnectionHandler.prototype.createTarget=!1;mxConnectionHandler.prototype.marker=null,mxConnectionHandler.prototype.constraintHandler=null,mxConnectionHandler.prototype.error=null,mxConnectionHandler.prototype.waypointsEnabled=!1,mxConnectionHandler.prototype.tapAndHoldEnabled=!0,mxConnectionHandler.prototype.tapAndHoldDelay=500,mxConnectionHandler.prototype.tapAndHoldInProgress=!1,mxConnectionHandler.prototype.tapAndHoldValid=!1,mxConnectionHandler.prototype.tapAndHoldTolerance=4,mxConnectionHandler.prototype.initialTouchX=0,mxConnectionHandler.prototype.initialTouchY=0,mxConnectionHandler.prototype.ignoreMouseDown=!1,mxConnectionHandler.prototype.first=null,mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET),mxConnectionHandler.prototype.edgeState=null,mxConnectionHandler.prototype.changeHandler=null,mxConnectionHandler.prototype.drillHandler=null,mxConnectionHandler.prototype.mouseDownCounter=0,mxConnectionHandler.prototype.movePreviewAway=mxClient.IS_VML,mxConnectionHandler.prototype.isEnabled=function(){return this.enabled},mxConnectionHandler.prototype.setEnabled=function(e){this.enabled=e},mxConnectionHandler.prototype.isCreateTarget=function(){return this.createTarget},mxConnectionHandler.prototype.setCreateTarget=function(e){this.createTarget=e},mxConnectionHandler.prototype.createShape=function(){var e=new mxPolyline([],mxConstants.INVALID_COLOR);if(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=!0,this.graph.dialect==mxConstants.DIALECT_SVG)e.node.setAttribute("pointer-events","none");else{var t=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(e.node,this.graph,t)}return e},mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this),this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.changeHandler=mxUtils.bind(this,function(e){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell)),null!=this.iconState?this.redrawIcons(this.icons,this.iconState):(this.destroyIcons(this.icons),this.previous=null),this.constraintHandler.reset()}),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler),this.drillHandler=mxUtils.bind(this,function(e){this.destroyIcons(this.icons)}),this.graph.addListener(mxEvent.START_EDITING,this.drillHandler),this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler),this.graph.getView().addListener(mxEvent.UP,this.drillHandler)},mxConnectionHandler.prototype.isConnectableCell=function(e){return!0},mxConnectionHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph);return a.hotspotEnabled=!0,a.getCell=mxUtils.bind(this,function(e,t){return t=mxCellMarker.prototype.getCell.apply(a,arguments),this.error=null,this.isConnectableCell(t)?(null!=t?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,t),null!=this.error&&0==this.error.length&&(t=null,this.isCreateTarget()&&(this.error=null))):this.isValidSource(t)||(t=null):this.isConnecting()&&!this.isCreateTarget()&&!this.graph.allowDanglingEdges&&(this.error=""),t):null}),a.isValidState=mxUtils.bind(this,function(e){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(a,arguments)}),a.getMarkerColor=mxUtils.bind(this,function(e,t,n){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(a,arguments):null}),a.intersects=mxUtils.bind(this,function(e,t){return!(null==this.connectImage&&!this.isConnecting())||mxCellMarker.prototype.intersects.apply(a,arguments)}),a},mxConnectionHandler.prototype.start=function(e,t,n,a){this.previous=e,this.first=new mxPoint(t,n),this.edgeState=null!=a?a:this.createEdgeState(null),this.marker.currentColor=this.marker.validColor,this.marker.markedState=e,this.marker.mark(),this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))},mxConnectionHandler.prototype.isConnecting=function(){return null!=this.first&&null!=this.shape},mxConnectionHandler.prototype.isValidSource=function(e){return this.graph.isValidSource(e)},mxConnectionHandler.prototype.isValidTarget=function(e){return!0},mxConnectionHandler.prototype.validateConnection=function(e,t){return this.isValidTarget(t)?this.graph.getEdgeValidationError(null,e,t):""},mxConnectionHandler.prototype.getConnectImage=function(e){return this.connectImage},mxConnectionHandler.prototype.isMoveIconToFrontForState=function(e){return null!=e.text&&e.text.node.parentNode==this.graph.container||this.moveIconFront},mxConnectionHandler.prototype.createIcons=function(e){if(null!=(i=this.getConnectImage(e))&&null!=e){this.iconState=e;var t=[],n=new mxImageShape(new mxRectangle(0,0,i.width,i.height),i.src,null,null,0);n.preserveImageAspect=!1,this.isMoveIconToFrontForState(e)?(n.dialect=mxConstants.DIALECT_STRICTHTML,n.init(this.graph.container)):(n.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,n.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=n.node.previousSibling&&n.node.parentNode.insertBefore(n.node,n.node.parentNode.firstChild)),n.node.style.cursor=mxConstants.CURSOR_CONNECT;var a=mxUtils.bind(this,function(){return null!=this.currentState?this.currentState:e}),i=mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(this.icon=n,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,a())))});return mxEvent.redirectMouseEvents(n.node,this.graph,a,i),t.push(n),this.redrawIcons(t,this.iconState),t}return null},mxConnectionHandler.prototype.redrawIcons=function(e,t){if(null!=e&&null!=e[0]&&null!=t){var n=this.getIconPosition(e[0],t);e[0].bounds.x=n.x,e[0].bounds.y=n.y,e[0].redraw()}},mxConnectionHandler.prototype.getIconPosition=function(e,t){var n=this.graph.getView().scale,a=t.getCenterX(),i=t.getCenterY();if(this.graph.isSwimlane(t.cell)){a=0!=(o=this.graph.getStartSize(t.cell)).width?t.x+o.width*n/2:a,i=0!=o.height?t.y+o.height*n/2:i;if(0!=(o=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0))){n=Math.cos(o);var o=Math.sin(o),s=new mxPoint(t.getCenterX(),t.getCenterY());a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),n,o,s)).x,i=i.y}}return new mxPoint(a-e.bounds.width/2,i-e.bounds.height/2)},mxConnectionHandler.prototype.destroyIcons=function(e){if(null!=e){this.iconState=null;for(var t=0;t<e.length;t++)e[t].destroy()}},mxConnectionHandler.prototype.isStartEvent=function(e){return!this.graph.isForceMarqueeEvent(e.getEvent())&&(null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon))},mxConnectionHandler.prototype.mouseDown=function(e,t){if(this.mouseDownCounter++,this.isEnabled()&&this.graph.isEnabled()&&!t.isConsumed()&&!this.isConnecting()&&this.isStartEvent(t)){if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(t.getGraphX(),t.getGraphY()),this.edgeState=this.createEdgeState(t),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape()),null==this.previous&&null!=this.edgeState){var n=this.graph.getPointForEvent(t.getEvent());this.edgeState.cell.geometry.setTerminalPoint(n,!0)}this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)),t.consume()}else if(mxClient.IS_TOUCH&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress&&this.isEnabled()&&this.graph.isEnabled()&&!this.isConnecting()){this.tapAndHoldInProgress=!0,this.initialTouchX=t.getX(),this.initialTouchY=t.getY();var a=this.graph.view.getState(this.marker.getCell(t));this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,function(){this.tapAndHoldValid&&this.tapAndHold(t,a),this.tapAndHoldValid=this.tapAndHoldInProgress=!1}),this.tapAndHoldDelay),this.tapAndHoldValid=!0}this.selectedIcon=this.icon,this.icon=null},mxConnectionHandler.prototype.tapAndHold=function(e,t){null!=t&&(this.marker.currentColor=this.marker.validColor,this.marker.markedState=t,this.marker.mark(),this.first=new mxPoint(e.getGraphX(),e.getGraphY()),this.edgeState=this.createEdgeState(e),this.previous=t,this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)))},mxConnectionHandler.prototype.isImmediateConnectSource=function(e){return!this.graph.isCellMovable(e.cell)},mxConnectionHandler.prototype.createEdgeState=function(e){return null},mxConnectionHandler.prototype.updateCurrentState=function(e){var t=this.marker.process(e);this.constraintHandler.update(e,null==this.first),this.currentState=t},mxConnectionHandler.prototype.convertWaypoint=function(e){var t=this.graph.getView().getScale(),n=this.graph.getView().getTranslate();e.x=e.x/t-n.x,e.y=e.y/t-n.y},mxConnectionHandler.prototype.mouseMove=function(e,t){if(this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-t.getX())<this.tapAndHoldTolerance&&Math.abs(this.initialTouchY-t.getY())<this.tapAndHoldTolerance),t.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{if(!this.isEnabled()&&null!=this.currentState&&(this.destroyIcons(this.icons),this.currentState=null),(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&this.updateCurrentState(t),null!=this.first){var n=this.graph.getView().scale,a=null,i=n=new mxPoint(this.graph.snap(t.getGraphX()/n)*n,this.graph.snap(t.getGraphY()/n)*n);null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint&&(a=this.constraintHandler.currentConstraint,i=this.constraintHandler.currentPoint.clone());var o=this.first;if(null!=this.selectedIcon){var s=this.selectedIcon.bounds.width,r=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(s=this.getIconPosition(this.selectedIcon,this.currentState),this.selectedIcon.bounds.x=s.x,this.selectedIcon.bounds.y=s.y):(s=new mxRectangle(t.getGraphX()+this.connectIconOffset.x,t.getGraphY()+this.connectIconOffset.y,s,r),this.selectedIcon.bounds=s),this.selectedIcon.redraw()}if(null!=this.edgeState){if(this.edgeState.absolutePoints=[null,null!=this.currentState?null:i],this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint),null!=this.currentState&&(null==a&&(a=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,a)),(o=null)!=this.waypoints)for(o=[],i=0;i<this.waypoints.length;i++)a=this.waypoints[i].clone(),this.convertWaypoint(a),o[i]=a;this.graph.view.updatePoints(this.edgeState,o,this.previous,this.currentState),this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState),i=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],o=this.edgeState.absolutePoints[0]}else null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(null!=(s=this.getTargetPerimeterPoint(this.currentState,t))&&(i=s)),null==this.sourceConstraint&&null!=this.previous&&(null!=(s=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:i,t))&&(o=s));if(null==this.currentState&&this.movePreviewAway){if(s=o,null!=this.edgeState&&2<this.edgeState.absolutePoints.length&&(null!=(a=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2])&&(s=a)),a=i.x-s.x,s=i.y-s.y,0==(r=Math.sqrt(a*a+s*s)))return;i.x-=4*a/r,i.y-=4*s/r}null==this.shape&&(a=Math.abs(n.x-this.first.x),s=Math.abs(n.y-this.first.y),a>this.graph.tolerance||s>this.graph.tolerance)&&(this.shape=this.createShape(),this.updateCurrentState(t)),null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(n=[o],null!=this.waypoints&&(n=n.concat(this.waypoints)),n.push(i),this.shape.points=n),this.drawPreview()),mxEvent.consume(t.getEvent()),t.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(this.icons),(this.icons=null)!=this.currentState&&null==this.error&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),t.consume())),this.previous=this.currentState):this.previous==this.currentState&&null!=this.currentState&&null==this.icons&&!this.graph.isMouseDown&&t.consume():this.constraintHandler.reset();if(null!=this.constraintHandler.currentConstraint&&this.marker.reset(),!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){for(n=!1,o=t.getSource(),i=0;i<this.icons.length&&!n;i++)n=o==this.icons[i].node||o.parentNode==this.icons[i].node;n||this.updateIcons(this.currentState,this.icons,t)}}},mxConnectionHandler.prototype.getTargetPerimeterPoint=function(e,t){var n=null,a=(i=e.view).getPerimeterFunction(e);if(null!=a){var i,o=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());null!=(i=a(i.getPerimeterBounds(e),this.edgeState,o,!1))&&(n=i)}else n=new mxPoint(e.getCenterX(),e.getCenterY());return n},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(e,t,n){n=null;var a=e.view,i=a.getPerimeterFunction(e),o=new mxPoint(e.getCenterX(),e.getCenterY());if(null!=i){var s=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0),r=-s*(Math.PI/180);0!=s&&(t=mxUtils.getRotatedPoint(new mxPoint(t.x,t.y),Math.cos(r),Math.sin(r),o)),null!=(e=i(a.getPerimeterBounds(e),e,t,!1))&&(0!=s&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(-r),Math.sin(-r),o)),n=e)}else n=o;return n},mxConnectionHandler.prototype.updateIcons=function(e,t,n){},mxConnectionHandler.prototype.isStopEvent=function(e){return null!=e.getState()},mxConnectionHandler.prototype.addWaypointForEvent=function(e){var t=mxUtils.convertPoint(this.graph.container,e.getX(),e.getY()),n=Math.abs(t.x-this.first.x);t=Math.abs(t.y-this.first.y);(null!=this.waypoints||1<this.mouseDownCounter&&(n>this.graph.tolerance||t>this.graph.tolerance))&&(null==this.waypoints&&(this.waypoints=[]),n=this.graph.view.scale,t=new mxPoint(this.graph.snap(e.getGraphX()/n)*n,this.graph.snap(e.getGraphY()/n)*n),this.waypoints.push(t))},mxConnectionHandler.prototype.mouseUp=function(e,t){if(!t.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(t))return this.addWaypointForEvent(t),void t.consume();if(null==this.error){var n=null!=this.previous?this.previous.cell:null,a=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),this.connect(n,a,t.getEvent(),t.getCell())}else null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,evt),0<this.error.length&&this.graph.validationAlert(this.error);this.destroyIcons(this.icons),t.consume()}null!=this.first&&this.reset(),this.tapAndHoldValid=this.tapAndHoldInProgress=!1},mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),this.destroyIcons(this.icons),this.icons=null,this.marker.reset(),this.constraintHandler.reset(),this.sourceConstraint=this.error=this.previous=this.edgeState=this.selectedIcon=null,this.mouseDownCounter=0,this.icon=this.first=null,this.fireEvent(new mxEventObject(mxEvent.RESET))},mxConnectionHandler.prototype.drawPreview=function(){var e=null==this.error;this.shape.strokewidth=this.getEdgeWidth(e),e=this.getEdgeColor(e),this.shape.stroke=e,this.shape.redraw()},mxConnectionHandler.prototype.getEdgeColor=function(e){return e?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(e){return e?3:1},mxConnectionHandler.prototype.connect=function(e,t,n,a){if(null!=t||this.isCreateTarget()||this.graph.allowDanglingEdges){var i=this.graph.getModel(),o=null;i.beginUpdate();try{if(null!=e&&null==t&&this.isCreateTarget()&&null!=(t=this.createTargetVertex(n,e))){if(null!=(a=this.graph.getDropTarget([t],n,a))&&this.graph.getModel().isEdge(a))a=this.graph.getDefaultParent();else{var s=this.graph.getView().getState(a);if(null!=s){var r=i.getGeometry(t);r.x-=s.origin.x,r.y-=s.origin.y}}this.graph.addCell(t,a)}var l=this.graph.getDefaultParent();if(null!=e&&null!=t&&i.getParent(e)==i.getParent(t)&&i.getParent(i.getParent(e))!=i.getRoot()&&(l=i.getParent(e),null!=e.geometry&&e.geometry.relative&&null!=t.geometry&&t.geometry.relative&&(l=i.getParent(l))),r=s=null,null!=this.edgeState&&(s=this.edgeState.cell.value,r=this.edgeState.cell.style),null!=(o=this.insertEdge(l,null,s,e,t,r))){this.graph.setConnectionConstraint(o,e,!0,this.sourceConstraint),this.graph.setConnectionConstraint(o,t,!1,this.constraintHandler.currentConstraint),null!=this.edgeState&&i.setGeometry(o,this.edgeState.cell.geometry);var d=i.getGeometry(o);if(null==d&&((d=new mxGeometry).relative=!0,i.setGeometry(o,d)),null!=this.waypoints&&0<this.waypoints.length){var c=this.graph.view.scale,m=this.graph.view.translate;for(d.points=[],e=0;e<this.waypoints.length;e++){var u=this.waypoints[e];d.points.push(new mxPoint(u.x/c-m.x,u.y/c-m.y))}}null==t&&((u=this.graph.getPointForEvent(n,!1)).x-=this.graph.panDx/this.graph.view.scale,u.y-=this.graph.panDy/this.graph.view.scale,d.setTerminalPoint(u,!1)),this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",o,"event",n,"target",a))}}catch(e){mxLog.show(),mxLog.debug(e.message)}finally{i.endUpdate()}this.select&&this.selectCells(o,t)}},mxConnectionHandler.prototype.selectCells=function(e,t){this.graph.setSelectionCell(e)},mxConnectionHandler.prototype.insertEdge=function(e,t,n,a,i,o){return null==this.factoryMethod?this.graph.insertEdge(e,t,n,a,i,o):(t=this.createEdge(n,a,i,o),this.graph.addEdge(t,e,a,i))},mxConnectionHandler.prototype.createTargetVertex=function(e,t){for(var n=this.graph.getCellGeometry(t);null!=n&&n.relative;)t=this.graph.getModel().getParent(t),n=this.graph.getCellGeometry(t);var a=this.graph.cloneCells([t])[0];if(null!=(n=this.graph.getModel().getGeometry(a))){var i=this.graph.getPointForEvent(e);if(n.x=this.graph.snap(i.x-n.width/2)-this.graph.panDx/this.graph.view.scale,n.y=this.graph.snap(i.y-n.height/2)-this.graph.panDy/this.graph.view.scale,null!=this.first){var o=this.graph.view.getState(t);if(null!=o){var s=this.getAlignmentTolerance();Math.abs(this.graph.snap(this.first.x)-this.graph.snap(i.x))<=s?n.x=o.x:Math.abs(this.graph.snap(this.first.y)-this.graph.snap(i.y))<=s&&(n.y=o.y)}}}return a},mxConnectionHandler.prototype.getAlignmentTolerance=function(){return this.graph.isGridEnabled()?this.graph.gridSize:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(e,t,n,a){var i=null;return null!=this.factoryMethod&&(i=this.factoryMethod(t,n,a)),null==i&&((i=new mxCell(e||"")).setEdge(!0),i.setStyle(a),(e=new mxGeometry).relative=!0,i.setGeometry(e)),i},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null)},mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR,mxConstraintHandler.prototype.isEnabled=function(){return this.enabled},mxConstraintHandler.prototype.setEnabled=function(e){this.enabled=e},mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var e=0;e<this.focusIcons.length;e++)this.focusIcons[e].destroy();this.focusIcons=null}null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),this.focusPoints=this.currentFocus=this.currentPoint=this.currentFocusArea=this.currentConstraint=null},mxConstraintHandler.prototype.getTolerance=function(){return this.graph.getTolerance()},mxConstraintHandler.prototype.getImageForConstraint=function(e,t,n){return this.pointImage},mxConstraintHandler.prototype.isEventIgnored=function(e,t){return!1},mxConstraintHandler.prototype.update=function(e,t){if(this.isEnabled()&&!this.isEventIgnored(e)){var n=this.getTolerance(),a=new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n),i=null!=e.getCell()&&this.graph.isCellConnectable(e.getCell());if((null==this.currentFocusArea||!mxUtils.intersects(this.currentFocusArea,a)||null!=e.getState()&&null!=this.currentFocus&&i)&&(this.currentFocusArea=null,e.getState()!=this.currentFocus))if(this.currentFocus=null,this.constraints=null!=e.getState()&&i?this.graph.getAllConnectionConstraints(e.getState(),t):null,null!=this.constraints){if(this.currentFocus=e.getState(),this.currentFocusArea=new mxRectangle(e.getState().x,e.getState().y,e.getState().width,e.getState().height),null!=this.focusIcons){for(i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}for(this.focusIcons=[],this.focusPoints=[],i=0;i<this.constraints.length;i++){var o,s=this.graph.getConnectionPoint(e.getState(),this.constraints[i]),r=(o=this.getImageForConstraint(e.getState(),this.constraints[i],s)).src;(o=new mxImageShape(o=new mxRectangle(s.x-o.width/2,s.y-o.height/2,o.width,o.height),r)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,o.preserveImageAspect=!1,o.init(this.graph.getView().getOverlayPane()),null!=o.node.previousSibling&&o.node.parentNode.insertBefore(o.node,o.node.parentNode.firstChild),r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),o.redraw(),mxEvent.redirectMouseEvents(o.node,this.graph,r),this.currentFocusArea.add(o.bounds),this.focusIcons.push(o),this.focusPoints.push(s)}this.currentFocusArea.grow(n)}else if(null!=this.focusIcons){for(null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}if(this.currentPoint=this.currentConstraint=null,null!=this.focusIcons&&null!=this.constraints&&(null==e.getState()||this.currentFocus==e.getState()))for(i=0;i<this.focusIcons.length;i++)if(mxUtils.intersects(this.focusIcons[i].bounds,a)){this.currentConstraint=this.constraints[i],this.currentPoint=this.focusPoints[i],(n=this.focusIcons[i].bounds.clone()).grow(mxClient.IS_IE?3:2),mxClient.IS_IE&&(n.width-=1,n.height-=1),null==this.focusHighlight?((n=new mxRectangleShape(n,null,this.highlightColor,3)).dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,n.init(this.graph.getView().getOverlayPane()),this.focusHighlight=n,r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),mxEvent.redirectMouseEvents(n.node,this.graph,r)):(this.focusHighlight.bounds=n,this.focusHighlight.redraw());break}null==this.currentConstraint&&null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)}},mxConstraintHandler.prototype.destroy=function(){this.reset()},mxRubberband.prototype.defaultOpacity=20,mxRubberband.prototype.enabled=!0,mxRubberband.prototype.div=null,mxRubberband.prototype.sharedDiv=null,mxRubberband.prototype.currentX=0,mxRubberband.prototype.currentY=0,mxRubberband.prototype.isEnabled=function(){return this.enabled},mxRubberband.prototype.setEnabled=function(e){this.enabled=e},mxRubberband.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&(this.graph.isForceMarqueeEvent(t.getEvent())||null==t.getState())){var n=mxUtils.getOffset(this.graph.container),a=mxUtils.getScrollOrigin(this.graph.container);if(a.x-=n.x,a.y-=n.y,this.start(t.getX()+a.x,t.getY()+a.y),mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC){var i=this.graph.container,o=function(e){e=new mxMouseEvent(e);var t=mxUtils.convertPoint(i,e.getX(),e.getY());return e.graphX=t.x,e.graphY=t.y,e};this.dragHandler=mxUtils.bind(this,function(e){this.mouseMove(this.graph,o(e))}),this.dropHandler=mxUtils.bind(this,function(e){this.mouseUp(this.graph,o(e))}),mxEvent.addListener(document,"mousemove",this.dragHandler),mxEvent.addListener(document,"mouseup",this.dropHandler)}t.consume(!1)}},mxRubberband.prototype.start=function(e,t){this.first=new mxPoint(e,t)},mxRubberband.prototype.mouseMove=function(e,t){if(!t.isConsumed()&&null!=this.first){var n=mxUtils.getScrollOrigin(this.graph.container),a=mxUtils.getOffset(this.graph.container);n.x-=a.x,n.y-=a.y;a=t.getX()+n.x,n=t.getY()+n.y;var i=this.first.x-a,o=this.first.y-n,s=this.graph.tolerance;(null!=this.div||Math.abs(i)>s||Math.abs(o)>s)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(a,n),t.consume())}},mxRubberband.prototype.createShape=function(){return null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv),this.sharedDiv},mxRubberband.prototype.mouseUp=function(e,t){var n=null!=this.div;this.reset(),n&&(n=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(n,t.getEvent()),t.consume())},mxRubberband.prototype.reset=function(){null!=this.div&&this.div.parentNode.removeChild(this.div),null!=this.dragHandler&&(mxEvent.removeListener(document,"mousemove",this.dragHandler),this.dragHandler=null),null!=this.dropHandler&&(mxEvent.removeListener(document,"mouseup",this.dropHandler),this.dropHandler=null),this.currentY=this.currentX=0,this.div=this.first=null},mxRubberband.prototype.update=function(e,t){this.currentX=e,this.currentY=t,this.repaint()},mxRubberband.prototype.repaint=function(){if(null!=this.div){var e=this.currentX-this.graph.panDx,t=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,e),this.y=Math.min(this.first.y,t),this.width=Math.max(this.first.x,e)-this.x,this.height=Math.max(this.first.y,t)-this.y,e=mxClient.IS_VML?this.graph.panDy:0,this.div.style.left=this.x+(mxClient.IS_VML?this.graph.panDx:0)+"px",this.div.style.top=this.y+e+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px"}},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))},mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.init(this.graph.getView().getOverlayPane()),this.graph.isCellMovable(this.state.cell)&&(this.selectionBorder.node.style.cursor=mxConstants.CURSOR_MOVABLE_VERTEX),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells){var e=this.graph.isCellResizable(this.state.cell);if(this.sizers=[],e||this.graph.isLabelMovable(this.state.cell)&&2<=this.state.width&&2<=this.state.height){var t=0;e&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",t++)),this.sizers.push(this.createSizer("n-resize",t++)),this.sizers.push(this.createSizer("ne-resize",t++)),this.sizers.push(this.createSizer("w-resize",t++)),this.sizers.push(this.createSizer("e-resize",t++)),this.sizers.push(this.createSizer("sw-resize",t++)),this.sizers.push(this.createSizer("s-resize",t++))),this.sizers.push(this.createSizer("se-resize",t++))),null!=(e=this.graph.model.getGeometry(this.state.cell))&&!e.relative&&!this.graph.isSwimlane(this.state.cell)&&this.graph.isLabelMovable(this.state.cell)&&(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,null,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.rotationEnabled&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)&&(this.rotationShape=this.createSizer("pointer",mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape)),this.redraw()},mxVertexHandler.prototype.getSelectionBounds=function(e){return new mxRectangle(Math.round(e.x),Math.round(e.y),Math.round(e.width),Math.round(e.height))},mxVertexHandler.prototype.createSelectionShape=function(e){return(e=new mxRectangleShape(e,null,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(e,t,n,a){return n=new mxRectangle(0,0,n=n||mxConstants.HANDLE_SIZE,n),(a=this.createSizerShape(n,t,a)).isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(a.bounds.height-=1,a.bounds.width-=1,a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(a.node,this.graph,this.state),this.graph.isEnabled()&&(a.node.style.cursor=e),this.isSizerVisible(t)||(a.node.style.visibility="hidden"),a},mxVertexHandler.prototype.isSizerVisible=function(e){return!0},mxVertexHandler.prototype.createSizerShape=function(e,t,n){return null!=this.handleImage?(e.width=this.handleImage.width,e.height=this.handleImage.height,new mxImageShape(e,this.handleImage.src)):t==mxEvent.ROTATION_HANDLE?new mxEllipse(e,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(e,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(e,t,n){null!=e&&(e.bounds.x=Math.round(t-e.bounds.width/2),e.bounds.y=Math.round(n-e.bounds.height/2),e.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(e){if(e.isSource(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(e.isSource(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(var t=this.tolerance,n=(t=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<t)?new mxRectangle(e.getGraphX()-t,e.getGraphY()-t,2*t,2*t):null,0);n<this.sizers.length;n++)if(e.isSource(this.sizers[n])||null!=t&&mxUtils.intersects(this.sizers[n].bounds,t))return n;return null},mxVertexHandler.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(t.getEvent())&&(0<this.tolerance||t.getState()==this.state)){var n=this.getHandleForEvent(t);null!=n&&(this.start(t.getX(),t.getY(),n),t.consume())}},mxVertexHandler.prototype.start=function(e,t,n){e=mxUtils.convertPoint(this.graph.container,e,t),this.startX=e.x,this.startY=e.y,this.index=n,this.selectionBorder.node.style.display=n==mxEvent.ROTATION_HANDLE?"inline":"none",this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container))},mxVertexHandler.prototype.mouseMove=function(e,t){if(t.isConsumed()||null==this.index)null!=this.getHandleForEvent(t)&&t.consume(!1);else{var n=new mxPoint(t.getGraphX(),t.getGraphY()),a=this.graph.isGridEnabledEvent(t.getEvent()),i=this.graph.getView().scale;if(this.index==mxEvent.LABEL_HANDLE)a&&(n.x=this.graph.snap(n.x/i)*i,n.y=this.graph.snap(n.y/i)*i),this.moveSizerTo(this.sizers[this.sizers.length-1],n.x,n.y);else if(this.index==mxEvent.ROTATION_HANDLE){var o=this.state.x+this.state.width/2-n.x,s=this.state.y+this.state.height/2-n.y;this.currentAlpha=0!=o?180*Math.atan(s/o)/Math.PI+90:s<0?180:0,0<o&&(this.currentAlpha-=180),this.rotationRaster&&(o=n.x-this.state.getCenterX(),s=n.y-this.state.getCenterY(),o=Math.abs(Math.sqrt(o*o+s*s)-this.state.height/2-20),o=Math.max(1,5*Math.min(3,Math.max(0,Math.round(80/Math.abs(o))))),this.currentAlpha=Math.round(this.currentAlpha/o)*o),this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw()}else{var r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),l=Math.cos(-r),d=Math.sin(-r),c=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),m=(o=n.x-this.startX,s=n.y-this.startY,n=this.graph.view.translate,d*o+l*s);o=l*o-d*s;this.bounds=this.union(this.selectionBounds,o,m,this.index,a,i,n),l=Math.cos(r),c=(d=Math.sin(r))*(o=(s=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY())).x-c.x)+l*(s=s.y-c.y)-s,this.bounds.x+=l*o-d*s-o,this.bounds.y+=c,this.drawPreview()}t.consume()}},mxVertexHandler.prototype.mouseUp=function(e,t){if(!t.isConsumed()&&null!=this.index&&null!=this.state){var n=new mxPoint(t.getGraphX(),t.getGraphY());this.graph.getModel().beginUpdate();try{if(this.index==mxEvent.ROTATION_HANDLE)null!=this.currentAlpha&&this.rotateCell(this.state.cell,this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0));else{var a=this.graph.isGridEnabledEvent(t.getEvent()),i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(-i),s=Math.sin(-i),r=(n=s*(r=n.x-this.startX)+o*(l=n.y-this.startY),o*r-s*l),l=n,d=this.graph.view.scale;this.resizeCell(this.state.cell,r/d,l/d,this.index,a)}}finally{this.graph.getModel().endUpdate()}this.reset(),t.consume()}},mxVertexHandler.prototype.rotateCell=function(e,t){var n=this.graph.getModel();if(n.isVertex(e)){if(null!=(o=e==this.state?this.state:this.graph.view.getState(e))&&this.graph.setCellStyles(mxConstants.STYLE_ROTATION,(o.style[mxConstants.STYLE_ROTATION]||0)+t,[e]),this.state.cell!=e&&(null!=(o=this.graph.getCellGeometry(e))&&!o.relative))if(0!=t){var a=this.graph.getModel().getParent(e),i=this.graph.getCellGeometry(a);if(!o.relative&&null!=i){var o,s=mxUtils.toRadians(t),r=(a=Math.cos(s),s=Math.sin(s),new mxPoint(o.getCenterX(),o.getCenterY()));i=new mxPoint(i.width/2,i.height/2),a=mxUtils.getRotatedPoint(r,a,s,i);(o=o.clone()).x=a.x-o.width/2,o.y=a.y-o.height/2,n.setGeometry(e,o)}}else(o=o.clone()).x+=dx,o.y+=dy,n.setGeometry(e,o);for(o=n.getChildCount(e),a=0;a<o;a++)this.rotateCell(n.getChildAt(e,a),t)}},mxVertexHandler.prototype.reset=function(){this.index=this.currentAlpha=null,null!=this.preview&&(this.preview.destroy(),this.preview=null),null!=this.selectionBorder&&(this.selectionBorder.node.style.display="inline",this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview())},mxVertexHandler.prototype.resizeCell=function(e,t,n,a,i){var o=this.graph.model.getGeometry(e);if(null!=o)if(a==mxEvent.LABEL_HANDLE)a=this.graph.view.scale,t=(this.labelShape.bounds.getCenterX()-this.startX)/a,n=(this.labelShape.bounds.getCenterY()-this.startY)/a,null==(o=o.clone()).offset?o.offset=new mxPoint(t,n):(o.offset.x+=t,o.offset.y+=n),this.graph.model.setGeometry(e,o);else{if(a=this.union(o,t,n,a,i,1,new mxPoint(0,0)),0!=(r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"))){t=a.getCenterX()-o.getCenterX(),n=a.getCenterY()-o.getCenterY(),i=Math.cos(r);var s=Math.sin(r),r=i*t-s*n-t;t=s*t+i*n-n,n=a.x-o.x;var l=a.y-o.y,d=i*n-s*l;i=s*n+i*l,a.x+=r,a.y+=t,this.graph.isCellCollapsed(e)||0==r&&0==t||(n=o.x-a.x+d,l=o.y-a.y+i,this.moveChildren(e,n,l))}this.graph.resizeCell(e,a)}},mxVertexHandler.prototype.moveChildren=function(e,t,n){for(var a=this.graph.getModel(),i=a.getChildCount(e),o=0;o<i;o++){var s=a.getChildAt(e,o);if(a.isVertex(s)){var r=this.graph.getCellGeometry(s);null!=r&&!r.relative&&((r=r.clone()).x+=t,r.y+=n,a.setGeometry(s,r))}}},mxVertexHandler.prototype.union=function(e,t,n,a,i,o,s){if(this.singleSizer){s=e.x+e.width+t;var r=e.y+e.height+n;return i&&(s=this.graph.snap(s/o)*o,r=this.graph.snap(r/o)*o),(o=new mxRectangle(e.x,e.y,0,0)).add(new mxRectangle(s,r,0,0)),o}var l=(r=e.x-s.x*o)+e.width,d=e.y-s.y*o;return e=d+e.height,4<a?(e+=n,i&&(e=this.graph.snap(e/o)*o)):a<3&&(d+=n,i&&(d=this.graph.snap(d/o)*o)),0==a||3==a||5==a?(r+=t,i&&(r=this.graph.snap(r/o)*o)):2!=a&&4!=a&&7!=a||(l+=t,i&&(l=this.graph.snap(l/o)*o)),e-=d,(i=l-r)<0&&(r+=i,i=Math.abs(i)),e<0&&(d+=e,e=Math.abs(e)),new mxRectangle(r+s.x*o,d+s.y*o,i,e)},mxVertexHandler.prototype.redraw=function(){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.state.x,this.state.y,this.state.width,this.state.height);var e=this.state;if(null!=this.sizers){var t=e.x+e.width,n=e.y+e.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],t,n);else{var a=e.x+e.width/2,i=e.y+e.height/2;if(1<this.sizers.length){var o=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"),s=Math.cos(o),r=(o=Math.sin(o),new mxPoint(e.getCenterX(),e.getCenterY())),l=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),s,o,r);this.moveSizerTo(this.sizers[0],l.x,l.y),l.x=a,l.y=e.y,l=mxUtils.getRotatedPoint(l,s,o,r),this.moveSizerTo(this.sizers[1],l.x,l.y),l.x=t,l.y=e.y,l=mxUtils.getRotatedPoint(l,s,o,r),this.moveSizerTo(this.sizers[2],l.x,l.y),l.x=e.x,l.y=i,l=mxUtils.getRotatedPoint(l,s,o,r),this.moveSizerTo(this.sizers[3],l.x,l.y),l.x=t,l.y=i,l=mxUtils.getRotatedPoint(l,s,o,r),this.moveSizerTo(this.sizers[4],l.x,l.y),l.x=e.x,l.y=n,l=mxUtils.getRotatedPoint(l,s,o,r),this.moveSizerTo(this.sizers[5],l.x,l.y),l.x=a,l.y=n,l=mxUtils.getRotatedPoint(l,s,o,r),this.moveSizerTo(this.sizers[6],l.x,l.y),l.x=t,l.y=n,l=mxUtils.getRotatedPoint(l,s,o,r),this.moveSizerTo(this.sizers[7],l.x,l.y),this.moveSizerTo(this.sizers[8],a+e.absoluteOffset.x,i+e.absoluteOffset.y)}else 2<=this.state.width&&2<=this.state.height?this.moveSizerTo(this.sizers[0],a+e.absoluteOffset.x,i+e.absoluteOffset.y):this.moveSizerTo(this.sizers[0],e.x,e.y)}}null!=this.rotationShape&&(o=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),s=Math.cos(o),o=Math.sin(o),r=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),l=mxUtils.getRotatedPoint(new mxPoint(e.x+e.width/2,e.y-16),s,o,r),this.moveSizerTo(this.rotationShape,l.x,l.y)),this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.drawPreview()},mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw()),this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()},mxVertexHandler.prototype.destroy=function(){if(null!=this.preview&&(this.preview.destroy(),this.preview=null),this.selectionBorder.destroy(),this.labelShape=this.selectionBorder=null,null!=this.sizers)for(var e=0;e<this.sizers.length;e++)this.sizers[e].destroy(),this.sizers[e]=null},mxEdgeHandler.prototype.graph=null,mxEdgeHandler.prototype.state=null,mxEdgeHandler.prototype.marker=null,mxEdgeHandler.prototype.constraintHandler=null,mxEdgeHandler.prototype.error=null,mxEdgeHandler.prototype.shape=null,mxEdgeHandler.prototype.bends=null,mxEdgeHandler.prototype.labelShape=null,mxEdgeHandler.prototype.cloneEnabled=!0,mxEdgeHandler.prototype.addEnabled=!1,mxEdgeHandler.prototype.removeEnabled=!1,mxEdgeHandler.prototype.preferHtml=!1,mxEdgeHandler.prototype.allowHandleBoundsCheck=!0,mxEdgeHandler.prototype.snapToTerminals=!1,mxEdgeHandler.prototype.handleImage=null,mxEdgeHandler.prototype.tolerance=0,mxEdgeHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.points=[],this.abspoints=this.getSelectionPoints(this.state),this.shape=this.createSelectionShape(this.abspoints),this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,this.shape.init(this.graph.getView().getOverlayPane()),this.shape.svgStrokeTolerance=0,this.shape.node.style.cursor=mxConstants.CURSOR_MOVABLE_EDGE,mxEvent.addListener(this.shape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e,this.state.cell)})),mxEvent.addGestureListeners(this.shape.node,mxUtils.bind(this,function(e){this.addEnabled&&this.isAddPointEvent(e)?this.addPoint(this.state,e):this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,this.state))}),mxUtils.bind(this,function(e){var t=this.state.cell;if(null!=this.index){var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));t=this.graph.getCellAt(n.x,n.y);this.graph.isSwimlane(t)&&this.graph.hitsSwimlaneContent(t,n.x,n.y)&&(t=null)}this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,this.graph.getView().getState(t)))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,this.state))})),this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container,!this.preferHtml){var e=this.state.getVisibleTerminalState(!0);null!=e&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container),this.preferHtml||null!=(e=this.state.getVisibleTerminalState(!1))&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container)}(this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells||mxGraphHandler.prototype.maxCells<=0)&&(this.bends=this.createBends()),this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape=new mxRectangleShape(new mxRectangle,mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR),this.labelShape.pointerEvents=!1,this.initBend(this.labelShape),this.labelShape.node.style.cursor=mxConstants.CURSOR_LABEL_HANDLE,mxEvent.redirectMouseEvents(this.labelShape.node,this.graph,this.state),this.redraw()},mxEdgeHandler.prototype.isAddPointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.isRemovePointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.getSelectionPoints=function(e){return e.absolutePoints},mxEdgeHandler.prototype.createSelectionShape=function(e){return(e=new mxPolyline(e,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxEdgeHandler.prototype.getSelectionColor=function(){return mxConstants.EDGE_SELECTION_COLOR},mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH},mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED},mxEdgeHandler.prototype.isConnectableCell=function(e){return!0},mxEdgeHandler.prototype.createMarker=function(){var e=new mxCellMarker(this.graph),a=this;return e.getCell=function(e){var t=mxCellMarker.prototype.getCell.apply(this,arguments);if(!a.isConnectableCell(t))return null;var n=a.graph.getModel();return(t==a.state.cell||null!=t&&!a.graph.connectableEdges&&n.isEdge(t))&&(t=null),t},e.isValidState=function(e){var t=a.graph.getModel();t=null!=(t=a.graph.view.getTerminalPort(e,a.graph.view.getState(t.getTerminal(a.state.cell,!a.isSource)),!a.isSource))?t.cell:null;return a.error=a.validateConnection(a.isSource?e.cell:t,a.isSource?t:e.cell),null==a.error},e},mxEdgeHandler.prototype.validateConnection=function(e,t){return this.graph.getEdgeValidationError(this.state.cell,e,t)},mxEdgeHandler.prototype.createBends=function(){for(var e=this.state.cell,t=[],n=0;n<this.abspoints.length;n++)if(this.isHandleVisible(n)){var a=n==this.abspoints.length-1;if((a=0==n||a)||this.graph.isCellBendable(e)){var i=this.createHandleShape(n);if(this.initBend(i),mxClient.IS_TOUCH&&i.node.setAttribute("pointer-events","none"),this.isHandleEnabled(n))if(mxClient.IS_TOUCH){var o=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(i.node,this.graph,o)}else i.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(i.node,this.graph,this.state);t.push(i),a||(this.points.push(new mxPoint(0,0)),i.node.style.visibility="hidden")}}return t},mxEdgeHandler.prototype.isHandleEnabled=function(e){return!0},mxEdgeHandler.prototype.isHandleVisible=function(e){return!0},mxEdgeHandler.prototype.createHandleShape=function(e){return null!=this.handleImage?new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src):(e=mxConstants.HANDLE_SIZE,this.preferHtml&&(e-=1),new mxRectangleShape(new mxRectangle(0,0,e,e),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR))},mxEdgeHandler.prototype.initBend=function(e){this.preferHtml?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()))},mxEdgeHandler.prototype.getHandleForEvent=function(e){if(null!=this.bends)for(var t=this.tolerance,n=(t=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<t)?new mxRectangle(e.getGraphX()-t,e.getGraphY()-t,2*t,2*t):null,0);n<this.bends.length;n++)if((e.isSource(this.bends[n])||null!=t&&mxUtils.intersects(this.bends[n].bounds,t))&&"hidden"!=this.bends[n].node.style.visibility)return n;return!(e.isSource(this.labelShape)&&"hidden"!=this.labelShape.node.style.visibility||e.isSource(this.state.text))||(mxClient.IS_SF||mxClient.IS_GC)&&"SELECT"==e.getSource().nodeName?null:mxEvent.LABEL_HANDLE},mxEdgeHandler.prototype.mouseDown=function(e,t){var n=null;null!=(n=this.getHandleForEvent(t))&&!t.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(t.getEvent())&&(this.removeEnabled&&this.isRemovePointEvent(t.getEvent())?this.removePoint(this.state,n):(n!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(t.getCell()))&&this.start(t.getX(),t.getY(),n),t.consume())},mxEdgeHandler.prototype.start=function(e,t,n){this.startX=e,this.startY=t,this.isSource=null!=this.bends&&0==n,this.isTarget=null!=this.bends&&n==this.bends.length-1,this.isLabel=n==mxEvent.LABEL_HANDLE,this.isSource||this.isTarget?(e=this.state.cell,(null==(t=this.graph.model.getTerminal(e,this.isSource))&&this.graph.isTerminalPointMovable(e,this.isSource)||null!=t&&this.graph.isCellDisconnectable(e,t,this.isSource))&&(this.index=n)):this.index=n},mxEdgeHandler.prototype.clonePreviewState=function(e,t){return this.state.clone()},mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxEdgeHandler.prototype.getPointForEvent=function(e){var n=new mxPoint(e.getGraphX(),e.getGraphY()),a=this.getSnapToTerminalTolerance(),t=this.graph.getView(),i=!1,o=!1;if(this.snapToTerminals&&0<a){var s=function(e){if(null!=e){var t=e.x;Math.abs(n.x-t)<a&&(n.x=t,i=!0),e=e.y,Math.abs(n.y-e)<a&&(n.y=e,o=!0)}},r=function(e){null!=e&&s.call(this,new mxPoint(t.getRoutingCenterX(e),t.getRoutingCenterY(e)))};if(r.call(this,this.state.getVisibleTerminalState(!0)),r.call(this,this.state.getVisibleTerminalState(!1)),null!=this.abspoints)for(r=0;r<this.abspoints;r++)r!=this.index&&s.call(this,this.abspoints[r])}return this.graph.isGridEnabledEvent(e.getEvent())&&(e=t.scale,r=t.translate,i||(n.x=(this.graph.snap(n.x/e-r.x)+r.x)*e),o||(n.y=(this.graph.snap(n.y/e-r.y)+r.y)*e)),n},mxEdgeHandler.prototype.getPreviewTerminalState=function(e){this.constraintHandler.update(e,this.isSource),this.marker.process(e),e=this.marker.getValidState();var t=null;return null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint&&this.marker.reset(),null!=e?t=e:null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(t=this.constraintHandler.currentFocus),t},mxEdgeHandler.prototype.getPreviewPoints=function(e){var t=null!=(t=this.graph.getCellGeometry(this.state.cell)).points?t.points.slice():null;return this.isSource||this.isTarget?this.graph.resetEdgesOnConnect&&(t=null):(this.convertPoint(e,!1),null==t?t=[e]:t[this.index-1]=e),t},mxEdgeHandler.prototype.updatePreviewState=function(e,t,n){var a=this.isSource?n:this.state.getVisibleTerminalState(!0),i=this.isTarget?n:this.state.getVisibleTerminalState(!1),o=this.graph.getConnectionConstraint(e,a,!0),s=this.graph.getConnectionConstraint(e,i,!1),r=this.constraintHandler.currentConstraint;null==r&&(r=new mxConnectionConstraint),this.isSource?o=r:this.isTarget&&(s=r),(!this.isSource||null!=a)&&e.view.updateFixedTerminalPoint(e,a,!0,o),(!this.isTarget||null!=i)&&e.view.updateFixedTerminalPoint(e,i,!1,s),(this.isSource||this.isTarget)&&null==n&&(e.setAbsoluteTerminalPoint(t,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:"")),e.view.updatePoints(e,this.points,a,i),e.view.updateFloatingTerminalPoints(e,a,i)},mxEdgeHandler.prototype.mouseMove=function(e,t){if(null!=this.index&&null!=this.marker){var n=this.getPointForEvent(t);if(this.isLabel)this.label.x=n.x,this.label.y=n.y;else{this.points=this.getPreviewPoints(n);var a=this.isSource||this.isTarget?this.getPreviewTerminalState(t):null,i=this.clonePreviewState(n,null!=a?a.cell:null);this.updatePreviewState(i,n,a),this.setPreviewColor(null==this.error?this.marker.validColor:this.marker.invalidColor),this.abspoints=i.absolutePoints,this.active=!0}this.drawPreview(),mxEvent.consume(t.getEvent()),t.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(t)&&t.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(e,t){if(null!=this.index&&null!=this.marker){var n=this.state.cell;if(t.getX()!=this.startX||t.getY()!=this.startY)if(null!=this.error)0<this.error.length&&this.graph.validationAlert(this.error);else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var a=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),null!=a)n=this.connect(n,a,this.isSource,this.graph.isCloneEvent(t.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable(),t);else if(this.graph.isAllowDanglingEdges()){(a=this.abspoints[this.isSource?0:this.abspoints.length-1]).x=a.x/this.graph.view.scale-this.graph.view.translate.x,a.y=a.y/this.graph.view.scale-this.graph.view.translate.y;var i=this.graph.getView().getState(this.graph.getModel().getParent(n));null!=i&&(a.x-=i.origin.x,a.y-=i.origin.y),a.x-=this.graph.panDx/this.graph.view.scale,a.y-=this.graph.panDy/this.graph.view.scale,this.changeTerminalPoint(n,a,this.isSource)}}else this.active?this.changePoints(n,this.points):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().revalidate(this.state.cell));null!=this.marker&&(this.reset(),n!=this.state.cell&&this.graph.setSelectionCell(n)),t.consume()}},mxEdgeHandler.prototype.reset=function(){this.points=this.label=this.index=this.error=null,this.isTarget=this.isSource=this.isLabel=this.active=!1,this.marker.reset(),this.constraintHandler.reset(),this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR),this.redraw()},mxEdgeHandler.prototype.setPreviewColor=function(e){null!=this.shape&&(this.shape.stroke=e)},mxEdgeHandler.prototype.convertPoint=function(e,t){var n=this.graph.getView().getScale(),a=this.graph.getView().getTranslate();return t&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/n-a.x),e.y=Math.round(e.y/n-a.y),null!=(n=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell)))&&(e.x-=n.origin.x,e.y-=n.origin.y),e},mxEdgeHandler.prototype.moveLabel=function(e,t,n){var a=this.graph.getModel();if(null!=(i=a.getGeometry(e.cell))){var i=i.clone(),o=this.graph.getView().getRelativePoint(e,t,n);i.x=o.x,i.y=o.y;var s=this.graph.getView().scale;i.offset=new mxPoint(0,0),o=this.graph.view.getPoint(e,i),i.offset=new mxPoint((t-o.x)/s,(n-o.y)/s),a.setGeometry(e.cell,i)}},mxEdgeHandler.prototype.connect=function(e,t,n,a,i){var o=(i=this.graph.getModel()).getParent(e);i.beginUpdate();try{if(a){var s=e.clone();i.add(o,s,i.getChildCount(o));var r=i.getTerminal(e,!n);this.graph.connectCell(s,r,!n),e=s}var l=this.constraintHandler.currentConstraint;null==l&&(l=new mxConnectionConstraint),this.graph.connectCell(e,t,n,l)}finally{i.endUpdate()}return e},mxEdgeHandler.prototype.changeTerminalPoint=function(e,t,n){var a=this.graph.getModel(),i=a.getGeometry(e);if(null!=i){a.beginUpdate();try{(i=i.clone()).setTerminalPoint(t,n),a.setGeometry(e,i),this.graph.connectCell(e,null,n,new mxConnectionConstraint)}finally{a.endUpdate()}}},mxEdgeHandler.prototype.changePoints=function(e,t){var n=this.graph.getModel(),a=n.getGeometry(e);null!=a&&((a=a.clone()).points=t,n.setGeometry(e,a))},mxEdgeHandler.prototype.addPoint=function(e,t){var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),a=this.graph.isGridEnabledEvent(t);this.convertPoint(n,a),this.addPointAt(e,n.x,n.y),mxEvent.consume(t)},mxEdgeHandler.prototype.addPointAt=function(e,t,n){var a=this.graph.getCellGeometry(e.cell);if(t=new mxPoint(t,n),null!=a){a=a.clone(),n=this.graph.view.translate;var i=this.graph.view.scale;n=mxUtils.findNearestSegment(e,(t.x+n.x)*i,(t.y+n.y)*i),null==a.points?a.points=[t]:a.points.splice(n,0,t),this.graph.getModel().setGeometry(e.cell,a),this.destroy(),this.init()}},mxEdgeHandler.prototype.removePoint=function(e,t){if(0<t&&t<this.abspoints.length-1){var n=this.graph.getCellGeometry(this.state.cell);null!=n&&null!=n.points&&((n=n.clone()).points.splice(t-1,1),this.graph.getModel().setGeometry(e.cell,n),this.destroy(),this.init())}},mxEdgeHandler.prototype.getHandleFillColor=function(e){e=0==e;var t=this.state.cell,n=this.graph.getModel().getTerminal(t,e),a=mxConstants.HANDLE_FILLCOLOR;return null!=n&&!this.graph.isCellDisconnectable(t,n,e)||null==n&&!this.graph.isTerminalPointMovable(t,e)?a=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=n&&this.graph.isCellDisconnectable(t,n,e)&&(a=mxConstants.CONNECT_HANDLE_FILLCOLOR),a},mxEdgeHandler.prototype.redraw=function(){this.abspoints=this.state.absolutePoints.slice();var e=this.state.cell,t=mxConstants.LABEL_HANDLE_SIZE;if(this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-t/2),Math.round(this.label.y-t/2),t,t),this.labelShape.redraw(),null!=(t=this.graph.getLabel(e))&&0<t.length&&this.graph.isLabelMovable(e)?this.labelShape.node.style.visibility="visible":this.labelShape.node.style.visibility="hidden",null!=this.bends&&0<this.bends.length){var n=this.abspoints.length-1,a=(e=this.abspoints[0],this.abspoints[0].y);t=this.bends[0].bounds;this.bends[0].bounds=new mxRectangle(Math.round(this.abspoints[0].x-t.width/2),Math.round(a-t.height/2),t.width,t.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw();a=this.abspoints[n];var i=this.abspoints[n].x,o=(n=this.abspoints[n].y,this.bends.length-1);t=this.bends[o].bounds;this.bends[o].bounds=new mxRectangle(Math.round(i-t.width/2),Math.round(n-t.height/2),t.width,t.height),this.bends[o].fill=this.getHandleFillColor(o),this.bends[o].redraw(),this.redrawInnerBends(e,a)}this.drawPreview()},mxEdgeHandler.prototype.redrawInnerBends=function(e,t){var n=this.graph.getModel().getGeometry(this.state.cell).points;if(null!=n){null==this.points&&(this.points=[]);for(var a=1;a<this.bends.length-1;a++)if(null!=this.bends[a])if(null!=this.abspoints[a]){var i=this.abspoints[a].x,o=this.abspoints[a].y,s=this.bends[a].bounds;this.bends[a].node.style.visibility="visible",this.bends[a].bounds=new mxRectangle(Math.round(i-s.width/2),Math.round(o-s.height/2),s.width,s.height),this.bends[a].redraw(),this.points[a-1]=n[a-1]}else this.bends[a].destroy(),this.bends[a]=null}},mxEdgeHandler.prototype.drawPreview=function(){if(this.isLabel){var e=mxConstants.LABEL_HANDLE_SIZE;e=new mxRectangle(Math.round(this.label.x-e/2),Math.round(this.label.y-e/2),e,e);this.labelShape.bounds=e,this.labelShape.redraw()}else this.shape.points=this.abspoints,this.shape.redraw()},mxEdgeHandler.prototype.destroy=function(){if(null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.bends)for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null)},mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler),mxElbowEdgeHandler.prototype=new mxEdgeHandler,mxElbowEdgeHandler.prototype.constructor=mxElbowEdgeHandler,mxElbowEdgeHandler.prototype.flipEnabled=!0,mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":"",mxElbowEdgeHandler.prototype.createBends=function(){var e=[],t=this.createHandleShape(0);return this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none"),e.push(this.createVirtualBend()),this.points.push(new mxPoint(0,0)),t=this.createHandleShape(2),this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none"),e},mxElbowEdgeHandler.prototype.createVirtualBend=function(){var e=this.createHandleShape();this.initBend(e);var t=this.getCursorForBend();return e.node.style.cursor=t,t=mxUtils.bind(this,function(e){!mxEvent.isConsumed(e)&&this.flipEnabled&&(this.graph.flipEdge(this.state.cell,e),mxEvent.consume(e))}),mxEvent.redirectMouseEvents(e.node,this.graph,this.state,null,null,null,t),this.graph.isCellBendable(this.state.cell)||(e.node.style.display="none"),e},mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"},mxElbowEdgeHandler.prototype.getTooltipForNode=function(e){var t=null;return null==this.bends||null==this.bends[1]||e!=this.bends[1].node&&e.parentNode!=this.bends[1].node||(t=this.doubleClickOrientationResource,t=mxResources.get(t)||t),t},mxElbowEdgeHandler.prototype.convertPoint=function(e,t){var n=this.graph.getView().getScale(),a=this.graph.getView().getTranslate(),i=this.state.origin;t&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/n-a.x-i.x),e.y=Math.round(e.y/n-a.y-i.y)},mxElbowEdgeHandler.prototype.redrawInnerBends=function(e,t){var n=null==(n=null!=(n=this.graph.getModel().getGeometry(this.state.cell).points)?n[0]:null)?new mxPoint(e.x+(t.x-e.x)/2,e.y+(t.y-e.y)/2):new mxPoint(this.graph.getView().scale*(n.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(n.y+this.graph.getView().translate.y+this.state.origin.y)),a=(i=this.bends[1].bounds).width,i=i.height;null==this.handleImage&&(i=a=mxConstants.HANDLE_SIZE);var o=new mxRectangle(Math.round(n.x-a/2),Math.round(n.y-i/2),a,i);null==this.handleImage&&"hidden"!=this.labelShape.node.style.visibility&&mxUtils.intersects(o,this.labelShape.bounds)&&(a+=3,i+=3,o=new mxRectangle(Math.round(n.x-a/2),Math.round(n.y-i/2),a,i)),this.bends[1].bounds=o,this.bends[1].redraw()},mxUtils.extend(mxEdgeSegmentHandler,mxEdgeHandler),mxEdgeSegmentHandler.prototype=new mxElbowEdgeHandler,mxEdgeSegmentHandler.prototype.constructor=mxEdgeSegmentHandler,mxEdgeSegmentHandler.prototype.getPreviewPoints=function(e){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);this.convertPoint(e,!1);var t=this.state.absolutePoints,n=t[0].clone();this.convertPoint(n,!1);for(var a=[],i=1;i<t.length;i++){var o=t[i].clone();this.convertPoint(o,!1),i==this.index&&(n.x==o.x?(n.x=e.x,o.x=e.x):(n.y=e.y,o.y=e.y)),i<t.length-1&&a.push(o),n=o}if(1==a.length){if(n=this.state.view,i=this.state.getVisibleTerminalState(!0),null!=(o=this.state.getVisibleTerminalState(!1))&null!=i){var s=this.state.origin.x,r=this.state.origin.y;mxUtils.contains(o,a[0].x+s,a[0].y+r)?t[1].y==t[2].y?a[0].y=n.getRoutingCenterY(i)-r:a[0].x=n.getRoutingCenterX(i)-s:mxUtils.contains(i,a[0].x+s,a[0].y+r)&&(t[1].y==t[0].y?a[0].y=n.getRoutingCenterY(o)-r:a[0].x=n.getRoutingCenterX(o)-s)}}else 0==a.length&&(a=[e]);return a},mxEdgeSegmentHandler.prototype.createBends=function(){var e=[],t=this.createHandleShape(0);this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none");var n=this.state.absolutePoints;if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var a=0;a<n.length-1;a++)t=this.createVirtualBend(),e.push(t),t.node.style.cursor=0==n[a].x-n[a+1].x?"col-resize":"row-resize",this.points.push(new mxPoint(0,0)),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none")}return t=this.createHandleShape(n.length),this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none"),e},mxEdgeSegmentHandler.prototype.redraw=function(){this.refresh(),mxEdgeHandler.prototype.redraw.apply(this,arguments)},mxEdgeSegmentHandler.prototype.refresh=function(){if(null!=this.bends){for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null);this.bends=this.createBends()}},mxEdgeSegmentHandler.prototype.redrawInnerBends=function(e,t){if(this.graph.isCellBendable(this.state.cell)){var n=mxConstants.HANDLE_SIZE,a=this.state.absolutePoints;if(null!=a&&1<a.length)for(var i=0;i<this.state.absolutePoints.length-1;i++)if(null!=this.bends[i+1]){e=a[i],t=a[i+1];var o=new mxPoint(e.x+(t.x-e.x)/2,e.y+(t.y-e.y)/2);this.bends[i+1].bounds=new mxRectangle(Math.round(o.x-n/2),Math.round(o.y-n/2),n,n),this.bends[i+1].redraw()}}},mxEdgeSegmentHandler.prototype.changePoints=function(e,t){t=[];var n=this.abspoints;if(1<n.length)for(var a=n[0],i=n[1],o=2;o<n.length;o++){var s=n[o];Math.round(a.x)==Math.round(i.x)&&Math.round(i.x)==Math.round(s.x)||Math.round(a.y)==Math.round(i.y)&&Math.round(i.y)==Math.round(s.y)||(i=(a=i).clone(),this.convertPoint(i,!1),t.push(i)),i=s}mxElbowEdgeHandler.prototype.changePoints.apply(this,arguments)},mxKeyHandler.prototype.graph=null,mxKeyHandler.prototype.target=null,mxKeyHandler.prototype.normalKeys=null,mxKeyHandler.prototype.shiftKeys=null,mxKeyHandler.prototype.controlKeys=null,mxKeyHandler.prototype.controlShiftKeys=null,mxKeyHandler.prototype.enabled=!0,mxKeyHandler.prototype.isEnabled=function(){return this.enabled},mxKeyHandler.prototype.setEnabled=function(e){this.enabled=e},mxKeyHandler.prototype.bindKey=function(e,t){this.normalKeys[e]=t},mxKeyHandler.prototype.bindShiftKey=function(e,t){this.shiftKeys[e]=t},mxKeyHandler.prototype.bindControlKey=function(e,t){this.controlKeys[e]=t},mxKeyHandler.prototype.bindControlShiftKey=function(e,t){this.controlShiftKeys[e]=t},mxKeyHandler.prototype.isControlDown=function(e){return mxEvent.isControlDown(e)},mxKeyHandler.prototype.getFunction=function(e){return null!=e?this.isControlDown(e)?mxEvent.isShiftDown(e)?this.controlShiftKeys[e.keyCode]:this.controlKeys[e.keyCode]:mxEvent.isShiftDown(e)?this.shiftKeys[e.keyCode]:this.normalKeys[e.keyCode]:null},mxKeyHandler.prototype.isGraphEvent=function(e){if((e=mxEvent.getSource(e))==this.target||e.parentNode==this.target||null!=this.graph.cellEditor&&e==this.graph.cellEditor.textarea)return!0;for(;null!=e;){if(e==this.graph.container)return!0;e=e.parentNode}return!1},mxKeyHandler.prototype.keyDown=function(e){if(this.graph.isEnabled()&&!mxEvent.isConsumed(e)&&this.isGraphEvent(e)&&this.isEnabled())if(27==e.keyCode)this.escape(e);else if(!this.graph.isEditing()){var t=this.getFunction(e);null!=t&&(t(e),mxEvent.consume(e))}},mxKeyHandler.prototype.escape=function(e){this.graph.isEscapeEnabled()&&this.graph.escape(e)},mxKeyHandler.prototype.destroy=function(){this.target=null},mxTooltipHandler.prototype.zIndex=10005,mxTooltipHandler.prototype.graph=null,mxTooltipHandler.prototype.delay=null,mxTooltipHandler.prototype.hideOnHover=!1,mxTooltipHandler.prototype.enabled=!0,mxTooltipHandler.prototype.isEnabled=function(){return this.enabled},mxTooltipHandler.prototype.setEnabled=function(e){this.enabled=e},mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover},mxTooltipHandler.prototype.setHideOnHover=function(e){this.hideOnHover=e},mxTooltipHandler.prototype.init=function(){null!=document.body&&(this.div=document.createElement("div"),this.div.className="mxTooltip",this.div.style.visibility="hidden",this.div.style.zIndex=this.zIndex,document.body.appendChild(this.div),mxEvent.addListener(this.div,"mousedown",mxUtils.bind(this,function(e){this.hideTooltip()})))},mxTooltipHandler.prototype.mouseDown=function(e,t){this.reset(t,!1),this.hideTooltip()},mxTooltipHandler.prototype.mouseMove=function(e,t){t.getX()==this.lastX&&t.getY()==this.lastY||(this.reset(t,!0),(this.isHideOnHover()||t.getState()!=this.state||t.getSource()!=this.node&&(!this.stateSource||null!=t.getState()&&this.stateSource==(t.isSource(t.getState().shape)||!t.isSource(t.getState().text))))&&this.hideTooltip()),this.lastX=t.getX(),this.lastY=t.getY()},mxTooltipHandler.prototype.mouseUp=function(e,t){this.reset(t,!0),this.hideTooltip()},mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)},mxTooltipHandler.prototype.reset=function(e,t){if(this.resetTimer(),t&&this.isEnabled()&&null!=e.getState()&&(null==this.div||"hidden"==this.div.style.visibility)){var n=e.getState(),a=e.getSource(),i=e.getX(),o=e.getY(),s=e.isSource(n.shape)||e.isSource(n.text);this.thread=window.setTimeout(mxUtils.bind(this,function(){if(!this.graph.isEditing()&&!this.graph.panningHandler.isMenuShowing()){var e=this.graph.getTooltip(n,a,i,o);this.show(e,i,o),this.state=n,this.node=a,this.stateSource=s}}),this.delay)}},mxTooltipHandler.prototype.hide=function(){this.resetTimer(),this.hideTooltip()},mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden")},mxTooltipHandler.prototype.show=function(e,t,n){if(null!=e&&0<e.length){null==this.div&&this.init();var a=mxUtils.getScrollOrigin();this.div.style.left=t+a.x+"px",this.div.style.top=n+mxConstants.TOOLTIP_VERTICAL_OFFSET+a.y+"px",mxUtils.isNode(e)?(this.div.innerHTML="",this.div.appendChild(e)):this.div.innerHTML=e.replace(/\n/g,"<br>"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null},mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(e,t){},mxCellTracker.prototype.mouseMove=function(e,t){this.isEnabled()&&this.process(t)},mxCellTracker.prototype.mouseUp=function(e,t){this.reset()},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=!0,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(e){this.highlightColor=e,null!=this.shape&&(this.shape.stroke=e)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),!this.keepOnTop&&this.shape.node.parentNode.firstChild!=this.shape.node&&this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)},mxCellHighlight.prototype.createShape=function(){var e=null;return(e=this.graph.model.isEdge(this.state.cell)?new mxPolyline(this.state.absolutePoints,this.highlightColor,this.strokeWidth):new mxRectangleShape(new mxRectangle,null,this.highlightColor,this.strokeWidth)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(e.node,this.graph,this.state),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=this.dashed,e},mxCellHighlight.prototype.repaint=function(){if(null!=this.state&&null!=this.shape){var e=0;this.graph.model.isEdge(this.state.cell)?this.shape.points=this.state.absolutePoints:(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),e=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),0!=e&&(this.shape.rotation=e),this.shape.redraw()}},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(e){this.state!=e&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=e,null!=this.state&&this.drawHighlight())},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),null!=this.shape&&(this.shape.destroy(),this.shape=null)},mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(e,t,n){var a=mxUtils.bind(this,function(){this.editor.execute(t)});n?this.handler.bindControlKey(e,a):this.handler.bindKey(e,a)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(e,t,n,a){if(null!=this.config){var i=this.createConditions(e,n,a);this.addItems(e,t,n,a,i,this.config.firstChild,null)}},mxDefaultPopupMenu.prototype.addItems=function(e,t,n,a,i,o,s){for(var r=!1;null!=o;){if("add"==o.nodeName){if(null==(l=o.getAttribute("if"))||i[l]){var l=o.getAttribute("as"),d=(l=mxResources.get(l)||l,mxUtils.eval(mxUtils.getTextContent(o))),c=o.getAttribute("action"),m=o.getAttribute("icon"),u=o.getAttribute("iconCls");r&&(t.addSeparator(s),r=!1),null!=m&&this.imageBasePath&&(m=this.imageBasePath+m),l=this.addAction(t,e,l,m,d,c,n,s,u),this.addItems(e,t,n,a,i,o.firstChild,l)}}else"separator"==o.nodeName&&(r=!0);o=o.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(e,t,n,a,i,o,s,r,l){return e.addItem(n,a,function(e){"function"==typeof i&&i.call(t,t,s,e),null!=o&&t.execute(o,s,e)},r,l)},mxDefaultPopupMenu.prototype.createConditions=function(e,t,n){var a=e.graph.getModel(),i=a.getChildCount(t),o=[];for(o.nocell=null==t,o.ncells=1<e.graph.getSelectionCount(),o.notRoot=a.getRoot()!=a.getParent(e.graph.getDefaultParent()),o.cell=null!=t,a=null!=t&&1==e.graph.getSelectionCount(),o.nonEmpty=a&&0<i,o.expandable=a&&e.graph.isCellFoldable(t,!1),o.collapsable=a&&e.graph.isCellFoldable(t,!0),o.validRoot=a&&e.graph.isValidRoot(t),o.emptyValidRoot=o.validRoot&&0==i,o.swimlane=a&&e.graph.isSwimlane(t),i=this.config.getElementsByTagName("condition"),a=0;a<i.length;a++){var s=mxUtils.eval(mxUtils.getTextContent(i[a])),r=i[a].getAttribute("name");null!=r&&"function"==typeof s&&(o[r]=s(e,t,n))}return o},mxDefaultToolbar.prototype.editor=null,mxDefaultToolbar.prototype.toolbar=null,mxDefaultToolbar.prototype.resetHandler=null,mxDefaultToolbar.prototype.spacing=4,mxDefaultToolbar.prototype.connectOnDrop=!1,mxDefaultToolbar.prototype.init=function(e){null!=e&&(this.toolbar=new mxToolbar(e),this.toolbar.addListener(mxEvent.SELECT,mxUtils.bind(this,function(e,t){var n=t.getProperty("function");this.editor.insertFunction=null!=n?mxUtils.bind(this,function(){n.apply(this,arguments),this.toolbar.resetMode()}):null})),this.resetHandler=mxUtils.bind(this,function(){null!=this.toolbar&&this.toolbar.resetMode(!0)}),this.editor.graph.addListener(mxEvent.DOUBLE_CLICK,this.resetHandler),this.editor.addListener(mxEvent.ESCAPE,this.resetHandler))},mxDefaultToolbar.prototype.addItem=function(e,t,n,a){var i=mxUtils.bind(this,function(){null!=n&&0<n.length&&this.editor.execute(n)});return this.toolbar.addItem(e,t,i,a)},mxDefaultToolbar.prototype.addSeparator=function(e){e=e||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(e)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(e){return this.toolbar.addActionCombo(e)},mxDefaultToolbar.prototype.addActionOption=function(e,t,n){var a=mxUtils.bind(this,function(){this.editor.execute(n)});this.addOption(e,t,a)},mxDefaultToolbar.prototype.addOption=function(e,t,n){return this.toolbar.addOption(e,t,n)},mxDefaultToolbar.prototype.addMode=function(e,t,n,a,i){var o=mxUtils.bind(this,function(){this.editor.setMode(n),null!=i&&i(this.editor)});return this.toolbar.addSwitchMode(e,t,o,a)},mxDefaultToolbar.prototype.addPrototype=function(e,t,n,a,i,o){var s=function(){return"function"==typeof n?n():null!=n?n.clone():null},r=mxUtils.bind(this,function(e,t){"function"==typeof i?i(this.editor,s(),e,t):this.drop(s(),e,t),this.toolbar.resetMode(),mxEvent.consume(e)});return e=this.toolbar.addMode(e,t,r,a,null,o),this.installDropHandler(e,function(e,t,n){r(t,n)}),e},mxDefaultToolbar.prototype.drop=function(e,t,n){var a=this.editor.graph,i=a.getModel();if(null!=n&&!i.isEdge(n)&&this.connectOnDrop&&a.isCellConnectable(n))this.connect(e,t,n);else{for(;null!=n&&!a.isValidDropTarget(n,[e],t);)n=i.getParent(n);this.insert(e,t,n)}},mxDefaultToolbar.prototype.insert=function(e,t,n){var a=this.editor.graph;if(a.canImportCell(e)){var i=mxEvent.getClientX(t),o=mxEvent.getClientY(t);i=mxUtils.convertPoint(a.container,i,o);return a.isSplitEnabled()&&a.isSplitTarget(n,[e],t)?a.splitEdge(n,[e],null,i.x,i.y):this.editor.addVertex(n,e,i.x,i.y)}return null},mxDefaultToolbar.prototype.connect=function(e,t,n){var a=(t=this.editor.graph).getModel();if(null!=n&&t.isCellConnectable(e)&&t.isEdgeValid(null,n,e)){var i=null;a.beginUpdate();try{var o=a.getGeometry(n),s=a.getGeometry(e).clone();s.x=o.x+(o.width-s.width)/2,s.y=o.y+(o.height-s.height)/2;var r=this.spacing*t.gridSize,l=20*a.getDirectedEdgeCount(n,!0);this.editor.horizontalFlow?s.x+=(s.width+o.width)/2+r+l:s.y+=(s.height+o.height)/2+r+l,e.setGeometry(s);var d=a.getParent(n);if(t.addCell(e,d),t.constrainChild(e),i=this.editor.createEdge(n,e),null==a.getGeometry(i)){var c=new mxGeometry;c.relative=!0,a.setGeometry(i,c)}t.addEdge(i,d,n,e)}finally{a.endUpdate()}t.setSelectionCells([e,i]),t.scrollCellToVisible(e)}},mxDefaultToolbar.prototype.installDropHandler=function(t,n){var a=document.createElement("img");a.setAttribute("src",t.getAttribute("src"));var i=mxUtils.bind(this,function(e){a.style.width=2*t.offsetWidth+"px",a.style.height=2*t.offsetHeight+"px",mxUtils.makeDraggable(t,this.editor.graph,n,a),mxEvent.removeListener(a,"load",i)});mxClient.IS_IE?i():mxEvent.addListener(a,"load",i)},mxDefaultToolbar.prototype.destroy=function(){null!=this.resetHandler&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null)},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource="none"!=mxClient.language?"askZoom":"",mxEditor.prototype.lastSavedResource="none"!=mxClient.language?"lastSaved":"",mxEditor.prototype.currentFileResource="none"!=mxClient.language?"currentFile":"",mxEditor.prototype.propertiesResource="none"!=mxClient.language?"properties":"",mxEditor.prototype.tasksResource="none"!=mxClient.language?"tasks":"",mxEditor.prototype.helpResource="none"!=mxClient.language?"help":"",mxEditor.prototype.outlineResource="none"!=mxClient.language?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.session=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed="
",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.urlInit=null,mxEditor.prototype.urlNotify=null,mxEditor.prototype.urlPoll=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(e){this.modified=e},mxEditor.prototype.addActions=function(){this.addAction("save",function(e){e.save()}),this.addAction("print",function(e){new mxPrintPreview(e.graph,1).open()}),this.addAction("show",function(e){mxUtils.show(e.graph,null,10,10)}),this.addAction("exportImage",function(e){var t=e.getUrlImage();if(null==t||mxClient.IS_LOCAL)e.execute("show");else{var n=mxUtils.getViewXml(e.graph,1);n=mxUtils.getXml(n,"\n");mxUtils.submit(t,e.postParameterName+"="+encodeURIComponent(n),document,"_blank")}}),this.addAction("refresh",function(e){e.graph.refresh()}),this.addAction("cut",function(e){e.graph.isEnabled()&&mxClipboard.cut(e.graph)}),this.addAction("copy",function(e){e.graph.isEnabled()&&mxClipboard.copy(e.graph)}),this.addAction("paste",function(e){e.graph.isEnabled()&&mxClipboard.paste(e.graph)}),this.addAction("delete",function(e){e.graph.isEnabled()&&e.graph.removeCells()}),this.addAction("group",function(e){e.graph.isEnabled()&&e.graph.setSelectionCell(e.groupCells())}),this.addAction("ungroup",function(e){e.graph.isEnabled()&&e.graph.setSelectionCells(e.graph.ungroupCells())}),this.addAction("removeFromParent",function(e){e.graph.isEnabled()&&e.graph.removeCellsFromParent()}),this.addAction("undo",function(e){e.graph.isEnabled()&&e.undo()}),this.addAction("redo",function(e){e.graph.isEnabled()&&e.redo()}),this.addAction("zoomIn",function(e){e.graph.zoomIn()}),this.addAction("zoomOut",function(e){e.graph.zoomOut()}),this.addAction("actualSize",function(e){e.graph.zoomActual()}),this.addAction("fit",function(e){e.graph.fit()}),this.addAction("showProperties",function(e,t){e.showProperties(t)}),this.addAction("selectAll",function(e){e.graph.isEnabled()&&e.graph.selectAll()}),this.addAction("selectNone",function(e){e.graph.isEnabled()&&e.graph.clearSelection()}),this.addAction("selectVertices",function(e){e.graph.isEnabled()&&e.graph.selectVertices()}),this.addAction("selectEdges",function(e){e.graph.isEnabled()&&e.graph.selectEdges()}),this.addAction("edit",function(e,t){e.graph.isEnabled()&&e.graph.isCellEditable(t)&&e.graph.startEditingAtCell(t)}),this.addAction("toBack",function(e,t){e.graph.isEnabled()&&e.graph.orderCells(!0)}),this.addAction("toFront",function(e,t){e.graph.isEnabled()&&e.graph.orderCells(!1)}),this.addAction("enterGroup",function(e,t){e.graph.enterGroup(t)}),this.addAction("exitGroup",function(e){e.graph.exitGroup()}),this.addAction("home",function(e){e.graph.home()}),this.addAction("selectPrevious",function(e){e.graph.isEnabled()&&e.graph.selectPreviousCell()}),this.addAction("selectNext",function(e){e.graph.isEnabled()&&e.graph.selectNextCell()}),this.addAction("selectParent",function(e){e.graph.isEnabled()&&e.graph.selectParentCell()}),this.addAction("selectChild",function(e){e.graph.isEnabled()&&e.graph.selectChildCell()}),this.addAction("collapse",function(e){e.graph.isEnabled()&&e.graph.foldCells(!0)}),this.addAction("collapseAll",function(e){if(e.graph.isEnabled()){var t=e.graph.getChildVertices();e.graph.foldCells(!0,!1,t)}}),this.addAction("expand",function(e){e.graph.isEnabled()&&e.graph.foldCells(!1)}),this.addAction("expandAll",function(e){if(e.graph.isEnabled()){var t=e.graph.getChildVertices();e.graph.foldCells(!1,!1,t)}}),this.addAction("bold",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)}),this.addAction("italic",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)}),this.addAction("underline",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)}),this.addAction("shadow",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_SHADOW)}),this.addAction("alignCellsLeft",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_LEFT)}),this.addAction("alignCellsCenter",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_CENTER)}),this.addAction("alignCellsRight",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_RIGHT)}),this.addAction("alignCellsTop",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_TOP)}),this.addAction("alignCellsMiddle",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_MIDDLE)}),this.addAction("alignCellsBottom",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_BOTTOM)}),this.addAction("alignFontLeft",function(e){e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)}),this.addAction("alignFontCenter",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)}),this.addAction("alignFontRight",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)}),this.addAction("alignFontTop",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)}),this.addAction("alignFontMiddle",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)}),this.addAction("alignFontBottom",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)}),this.addAction("zoom",function(e){var t=100*e.graph.getView().scale;t=parseFloat(mxUtils.prompt(mxResources.get(e.askZoomResource)||e.askZoomResource,t))/100;isNaN(t)||e.graph.getView().setScale(t)}),this.addAction("toggleTasks",function(e){null!=e.tasks?e.tasks.setVisible(!e.tasks.isVisible()):e.showTasks()}),this.addAction("toggleHelp",function(e){null!=e.help?e.help.setVisible(!e.help.isVisible()):e.showHelp()}),this.addAction("toggleOutline",function(e){null==e.outline?e.showOutline():e.outline.setVisible(!e.outline.isVisible())}),this.addAction("toggleConsole",function(e){mxLog.setVisible(!mxLog.isVisible())})},mxEditor.prototype.createSession=function(){var e=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.SESSION,"session",e))});return this.connect(this.urlInit,this.urlPoll,this.urlNotify,e)},mxEditor.prototype.configure=function(e){null!=e&&(new mxCodec(e.ownerDocument).decode(e,this),this.resetHistory())},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=(new Date).getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(e,t){this.actions[e]=t},mxEditor.prototype.execute=function(t,e,n){var a=this.actions[t];if(null!=a)try{var i=arguments;i[0]=this,a.apply(this,i)}catch(e){throw mxUtils.error("Cannot execute "+t+": "+e.message,280,!0),e}else mxUtils.error("Cannot find action "+t,280,!0)},mxEditor.prototype.addTemplate=function(e,t){this.templates[e]=t},mxEditor.prototype.getTemplate=function(e){return this.templates[e]},mxEditor.prototype.createGraph=function(){var e=new mxGraph(null,null,this.graphRenderHint);return e.setTooltips(!0),e.setPanning(!0),this.installDblClickHandler(e),this.installUndoHandler(e),this.installDrillHandler(e),this.installChangeHandler(e),this.installInsertHandler(e),e.panningHandler.factoryMethod=mxUtils.bind(this,function(e,t,n){return this.createPopupMenu(e,t,n)}),e.connectionHandler.factoryMethod=mxUtils.bind(this,function(e,t){return this.createEdge(e,t)}),this.createSwimlaneManager(e),this.createLayoutManager(e),e},mxEditor.prototype.createSwimlaneManager=function(e){return(e=new mxSwimlaneManager(e,!1)).isHorizontal=mxUtils.bind(this,function(){return this.horizontalFlow}),e.isEnabled=mxUtils.bind(this,function(){return this.maintainSwimlanes}),e},mxEditor.prototype.createLayoutManager=function(a){var e=new mxLayoutManager(a),i=this;return e.getLayout=function(e){var t=null,n=i.graph.getModel();return null!=n.getParent(e)&&(i.layoutSwimlanes&&a.isSwimlane(e)?(null==i.swimlaneLayout&&(i.swimlaneLayout=i.createSwimlaneLayout()),t=i.swimlaneLayout):i.layoutDiagram&&(a.isValidRoot(e)||null==n.getParent(n.getParent(e)))&&(null==i.diagramLayout&&(i.diagramLayout=i.createDiagramLayout()),t=i.diagramLayout)),t},e},mxEditor.prototype.setGraphContainer=function(e){null==this.graph.container&&(this.graph.init(e),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(e),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.installDblClickHandler=function(a){a.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,function(e,t){var n=t.getProperty("cell");null!=n&&a.isEnabled()&&null!=this.dblClickAction&&(this.execute(this.dblClickAction,n),t.consume())}))},mxEditor.prototype.installUndoHandler=function(a){var e=mxUtils.bind(this,function(e,t){var n=t.getProperty("edit");this.undoManager.undoableEditHappened(n)});a.getModel().addListener(mxEvent.UNDO,e),a.getView().addListener(mxEvent.UNDO,e),e=function(e,t){var n=t.getProperty("edit").changes;a.setSelectionCells(a.getSelectionCellsForChanges(n))},this.undoManager.addListener(mxEvent.UNDO,e),this.undoManager.addListener(mxEvent.REDO,e)},mxEditor.prototype.installDrillHandler=function(e){var t=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.ROOT))});e.getView().addListener(mxEvent.DOWN,t),e.getView().addListener(mxEvent.UP,t)},mxEditor.prototype.installChangeHandler=function(o){var e=mxUtils.bind(this,function(e,t){this.setModified(!0),1==this.validating&&o.validateGraph();for(var n=t.getProperty("edit").changes,a=0;a<n.length;a++){var i=n[a];if(i instanceof mxRootChange||i instanceof mxValueChange&&i.cell==this.graph.model.root||i instanceof mxCellAttributeChange&&i.cell==this.graph.model.root){this.fireEvent(new mxEventObject(mxEvent.ROOT));break}}});o.getModel().addListener(mxEvent.CHANGE,e)},mxEditor.prototype.installInsertHandler=function(e){var n=this;e.addMouseListener({mouseDown:function(e,t){null==n.insertFunction||t.isPopupTrigger()||!n.forcedInserting&&null!=t.getState()||(n.graph.clearSelection(),n.insertFunction(t.getEvent(),t.getCell()),this.isActive=!0,t.consume())},mouseMove:function(e,t){this.isActive&&t.consume()},mouseUp:function(e,t){this.isActive&&(this.isActive=!1,t.consume())}})},mxEditor.prototype.createDiagramLayout=function(){var e=this.graph.gridSize,t=new mxStackLayout(this.graph,!this.horizontalFlow,this.swimlaneSpacing,2*e,2*e);return t.isVertexIgnored=function(e){return!t.graph.isSwimlane(e)},t},mxEditor.prototype.createSwimlaneLayout=function(){return new mxCompactTreeLayout(this.graph,this.horizontalFlow)},mxEditor.prototype.createToolbar=function(){return new mxDefaultToolbar(null,this)},mxEditor.prototype.setToolbarContainer=function(e){this.toolbar.init(e),mxClient.IS_QUIRKS&&new mxDivResizer(e)},mxEditor.prototype.setStatusContainer=function(e){null==this.status&&(this.status=e,this.addListener(mxEvent.SAVE,mxUtils.bind(this,function(){var e=(new Date).toLocaleString();this.setStatus((mxResources.get(this.lastSavedResource)||this.lastSavedResource)+": "+e)})),this.addListener(mxEvent.OPEN,mxUtils.bind(this,function(){this.setStatus((mxResources.get(this.currentFileResource)||this.currentFileResource)+": "+this.filename)})),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.setStatus=function(e){null!=this.status&&null!=e&&(this.status.innerHTML=e)},mxEditor.prototype.setTitleContainer=function(t){this.addListener(mxEvent.ROOT,mxUtils.bind(this,function(e){t.innerHTML=this.getTitle()})),mxClient.IS_QUIRKS&&new mxDivResizer(t)},mxEditor.prototype.treeLayout=function(e,t){null!=e&&new mxCompactTreeLayout(this.graph,t).execute(e)},mxEditor.prototype.getTitle=function(){for(var e="",t=this.graph,n=t.getCurrentRoot();null!=n&&null!=t.getModel().getParent(t.getModel().getParent(n));)t.isValidRoot(n)&&(e=" > "+t.convertValueToString(n)+e),n=t.getModel().getParent(n);return this.getRootTitle()+e},mxEditor.prototype.getRootTitle=function(){var e=this.graph.getModel().getRoot();return this.graph.convertValueToString(e)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var e=null!=this.groupBorderSize?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),e)},mxEditor.prototype.createGroup=function(){return this.graph.getModel().cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(e){if(null!=e){var t=mxUtils.load(e).getXml();this.readGraphModel(t.documentElement),this.filename=e,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",e))}},mxEditor.prototype.readGraphModel=function(e){new mxCodec(e.ownerDocument).decode(e,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(e,t){if(null!=(e=e||this.getUrlPost())&&0<e.length){var n=this.writeGraphModel(t);this.postDiagram(e,n),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",e))},mxEditor.prototype.postDiagram=function(t,n){this.escapePostData&&(n=encodeURIComponent(n)),mxUtils.post(t,this.postParameterName+"="+n,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.POST,"request",e,"url",t,"data",n))}))},mxEditor.prototype.writeGraphModel=function(e){e=null!=e?e:this.linefeed;var t=(new mxCodec).encode(this.graph.getModel());return mxUtils.getXml(t,e)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.connect=function(e,t,n,a){var i=null;return mxClient.IS_LOCAL||((i=new mxSession(this.graph.getModel(),e,t,n)).addListener(mxEvent.RECEIVE,mxUtils.bind(this,function(e,t){null!=t.getProperty("node").getAttribute("namespace")&&this.resetHistory()})),i.addListener(mxEvent.DISCONNECT,a),i.addListener(mxEvent.CONNECT,a),i.addListener(mxEvent.NOTIFY,a),i.addListener(mxEvent.GET,a),i.start()),i},mxEditor.prototype.swapStyles=function(e,t){var n=this.graph.getStylesheet().styles[t];this.graph.getView().getStylesheet().putCellStyle(t,this.graph.getStylesheet().styles[e]),this.graph.getStylesheet().putCellStyle(e,n),this.graph.refresh()},mxEditor.prototype.showProperties=function(e){if(null==(e=e||this.graph.getSelectionCell())&&(null==(e=this.graph.getCurrentRoot())&&(e=this.graph.getModel().getRoot())),null!=e){this.graph.stopEditing(!0);var t=(n=mxUtils.getOffset(this.graph.container)).x+10,n=n.y;if(null==this.properties||this.movePropertiesDialog){var a=this.graph.getCellBounds(e);null!=a&&(t+=a.x+Math.min(200,a.width),n+=a.y)}else t=this.properties.getX(),n=this.properties.getY();this.hideProperties(),null!=(e=this.createProperties(e))&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,e,t,n,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return null!=this.properties},mxEditor.prototype.createProperties=function(n){var a=this.graph.getModel(),e=a.getValue(n);if(mxUtils.isNode(e)){var t=new mxForm("properties");t.addText("ID",n.getId()).setAttribute("readonly","true");var i=null,o=null,s=null,r=null,l=null;a.isVertex(n)&&(null!=(i=a.getGeometry(n))&&(o=t.addText("top",i.y),s=t.addText("left",i.x),r=t.addText("width",i.width),l=t.addText("height",i.height)));var d=a.getStyle(n),c=t.addText("Style",d||""),m=e.attributes,u=[];for(e=0;e<m.length;e++)u[e]=t.addTextarea(m[e].nodeName,m[e].nodeValue,"label"==m[e].nodeName?4:2);return e=mxUtils.bind(this,function(){this.hideProperties(),a.beginUpdate();try{null!=i&&((i=i.clone()).x=parseFloat(s.value),i.y=parseFloat(o.value),i.width=parseFloat(r.value),i.height=parseFloat(l.value),a.setGeometry(n,i)),0<c.value.length?a.setStyle(n,c.value):a.setStyle(n,null);for(var e=0;e<m.length;e++){var t=new mxCellAttributeChange(n,m[e].nodeName,u[e].value);a.execute(t)}this.graph.isAutoSizeCell(n)&&this.graph.updateCellSize(n)}finally{a.endUpdate()}}),d=mxUtils.bind(this,function(){this.hideProperties()}),t.addButtons(e,d),t.table}return null},mxEditor.prototype.hideProperties=function(){null!=this.properties&&(this.properties.destroy(),this.properties=null)},mxEditor.prototype.showTasks=function(){if(null==this.tasks){var t=document.createElement("div");t.style.padding="4px",t.style.paddingLeft="20px";var e=document.body.clientWidth;(e=new mxWindow(mxResources.get(this.tasksResource)||this.tasksResource,t,e-220,this.tasksTop,200)).setClosable(!0),e.destroyOnClose=!1;var n=mxUtils.bind(this,function(e){mxEvent.release(t),t.innerHTML="",this.createTasks(t)});this.graph.getModel().addListener(mxEvent.CHANGE,n),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,n),this.graph.addListener(mxEvent.ROOT,n),null!=this.tasksWindowImage&&e.setImage(this.tasksWindowImage),this.tasks=e,this.createTasks(t)}this.tasks.setVisible(!0)},mxEditor.prototype.refreshTasks=function(e){null!=this.tasks&&(e=this.tasks.content,mxEvent.release(e),e.innerHTML="",this.createTasks(e))},mxEditor.prototype.createTasks=function(e){},mxEditor.prototype.showHelp=function(e){if(null==this.help){var t=document.createElement("iframe");t.setAttribute("src",mxResources.get("urlHelp")||this.urlHelp),t.setAttribute("height","100%"),t.setAttribute("width","100%"),t.setAttribute("frameBorder","0"),t.style.backgroundColor="white",e=document.body.clientWidth;var n=document.body.clientHeight||document.documentElement.clientHeight,a=new mxWindow(mxResources.get(this.helpResource)||this.helpResource,t,(e-this.helpWidth)/2,(n-this.helpHeight)/3,this.helpWidth,this.helpHeight);a.setMaximizable(!0),a.setClosable(!0),a.destroyOnClose=!1,a.setResizable(!0),null!=this.helpWindowImage&&a.setImage(this.helpWindowImage),mxClient.IS_NS&&(e=function(e){t.setAttribute("height",a.div.offsetHeight-26+"px")},a.addListener(mxEvent.RESIZE_END,e),a.addListener(mxEvent.MAXIMIZE,e),a.addListener(mxEvent.NORMALIZE,e),a.addListener(mxEvent.SHOW,e)),this.help=a}this.help.setVisible(!0)},mxEditor.prototype.showOutline=function(){if(null==this.outline){var e=document.createElement("div");e.style.overflow="hidden",e.style.width="100%",e.style.height="100%",e.style.background="white",e.style.cursor="move";var t=new mxWindow(mxResources.get(this.outlineResource)||this.outlineResource,e,600,480,200,200,!1),n=new mxOutline(this.graph,e);t.setClosable(!0),t.setResizable(!0),t.destroyOnClose=!1,t.addListener(mxEvent.RESIZE_END,function(){n.update()}),this.outline=t,this.outline.outline=n}this.outline.setVisible(!0),this.outline.outline.update(!0)},mxEditor.prototype.setMode=function(e){"select"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!1)):"connect"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!0)):"pan"==e&&(this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.setConnectable(!1))},mxEditor.prototype.createPopupMenu=function(e,t,n){this.popupHandler.createMenu(this,e,t,n)},mxEditor.prototype.createEdge=function(e,t){var n=null;if(null!=this.defaultEdge)n=this.graph.getModel().cloneCell(this.defaultEdge);else{(n=new mxCell("")).setEdge(!0);var a=new mxGeometry;a.relative=!0,n.setGeometry(a)}return null!=(a=this.getEdgeStyle())&&n.setStyle(a),n},mxEditor.prototype.getEdgeStyle=function(){return this.defaultEdgeStyle},mxEditor.prototype.consumeCycleAttribute=function(e){return null!=this.cycleAttributeValues&&0<this.cycleAttributeValues.length&&this.graph.isSwimlane(e)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(e){if(null!=this.cycleAttributeName){var t=this.consumeCycleAttribute(e);null!=t&&e.setStyle(e.getStyle()+";"+this.cycleAttributeName+"="+t)}},mxEditor.prototype.addVertex=function(e,t,n,a){for(var i=this.graph.getModel();null!=e&&!this.graph.isValidDropTarget(e);)e=i.getParent(e);e=null!=e?e:this.graph.getSwimlaneAt(n,a);var o=this.graph.getView().scale,s=i.getGeometry(t),r=i.getGeometry(e);if(this.graph.isSwimlane(t)&&!this.graph.swimlaneNesting)e=null;else{if(null==e&&this.swimlaneRequired)return null;if(null!=e&&null!=r){var l=this.graph.getView().getState(e);if(null!=l){if(n-=l.origin.x*o,a-=l.origin.y*o,this.graph.isConstrainedMoving){r=s.width;var d=s.height,c=l.x+l.width;c<n+r&&(n-=n+r-c),(c=l.y+l.height)<a+d&&(a-=a+d-c)}}else null!=r&&(n-=r.x*o,a-=r.y*o)}}(s=s.clone()).x=this.graph.snap(n/o-this.graph.getView().translate.x-this.graph.gridSize/2),s.y=this.graph.snap(a/o-this.graph.getView().translate.y-this.graph.gridSize/2),t.setGeometry(s),null==e&&(e=this.graph.getDefaultParent()),this.cycleAttribute(t),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",t,"parent",e)),i.beginUpdate();try{null!=(t=this.graph.addCell(t,e))&&(this.graph.constrainChild(t),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",t)))}finally{i.endUpdate()}return null!=t&&(this.graph.setSelectionCell(t),this.graph.scrollCellToVisible(t),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",t))),t},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.templates=this.status=null)};var mxCodecRegistry={codecs:[],aliases:[],register:function(e){if(null!=e){var t=e.getName();mxCodecRegistry.codecs[t]=e;var n=mxUtils.getFunctionName(e.template.constructor);n!=t&&mxCodecRegistry.addAlias(n,t)}return e},addAlias:function(e,t){mxCodecRegistry.aliases[e]=t},getCodec:function(e){var t=null;if(null!=e){t=mxUtils.getFunctionName(e);var n=mxCodecRegistry.aliases[t];if(null!=n&&(t=n),null==(t=mxCodecRegistry.codecs[t]))try{t=new mxObjectCodec(new e),mxCodecRegistry.register(t)}catch(e){}}return t}};function mxCodec(e){this.document=e||mxUtils.createXmlDocument(),this.objects=[]}function mxObjectCodec(e,t,n,a){for(var i in this.template=e,this.exclude=null!=t?t:[],this.idrefs=null!=n?n:[],this.mapping=null!=a?a:[],this.reverse={},this.mapping)this.reverse[this.mapping[i]]=i}mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(e,t){return this.objects[e]=t},mxCodec.prototype.getObject=function(e){var t=null;return null!=e&&(null==(t=this.objects[e])&&(null==(t=this.lookup(e))&&(null!=(e=this.getElementById(e))&&(t=this.decode(e))))),t},mxCodec.prototype.lookup=function(e){return null},mxCodec.prototype.getElementById=function(e,t){return mxUtils.findNodeByAttribute(this.document.documentElement,null!=t?t:"id",e)},mxCodec.prototype.getId=function(e){var t=null;return null!=e&&(null==(t=this.reference(e))&&e instanceof mxCell&&(null==(t=e.getId())&&(0==(t=mxCellPath.create(e)).length&&(t="root")))),t},mxCodec.prototype.reference=function(e){return null},mxCodec.prototype.encode=function(e){var t=null;if(null!=e&&null!=e.constructor){var n=mxCodecRegistry.getCodec(e.constructor);null!=n?t=n.encode(this,e):mxUtils.isNode(e)?t=mxClient.IS_IE?e.cloneNode(!0):this.document.importNode(e,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(e.constructor))}return t},mxCodec.prototype.decode=function(a,b){var c=null;if(null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){var d=null;try{d=eval(a.nodeName)}catch(e){}try{var f=mxCodecRegistry.getCodec(d);null!=f?c=f.decode(this,a,b):(c=a.cloneNode(!0),c.removeAttribute("as"))}catch(e){mxLog.debug("Cannot decode "+a.nodeName+": "+e.message)}}return c},mxCodec.prototype.encodeCell=function(e,t,n){if(t.appendChild(this.encode(e)),null==n||n){n=e.getChildCount();for(var a=0;a<n;a++)this.encodeCell(e.getChildAt(a),t)}},mxCodec.prototype.isCellCodec=function(e){return null!=e&&"function"==typeof e.isCellCodec&&e.isCellCodec()},mxCodec.prototype.decodeCell=function(e,t){t=null==t||t;var n=null;if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){if(n=mxCodecRegistry.getCodec(e.nodeName),!this.isCellCodec(n))for(var a=e.firstChild;null!=a&&!this.isCellCodec(n);)n=mxCodecRegistry.getCodec(a.nodeName),a=a.nextSibling;this.isCellCodec(n)||(n=mxCodecRegistry.getCodec(mxCell)),n=n.decode(this,e),t&&this.insertIntoGraph(n)}return n},mxCodec.prototype.insertIntoGraph=function(e){var t=e.parent,n=e.getTerminal(!0),a=e.getTerminal(!1);e.setTerminal(null,!1),e.setTerminal(null,!0),(e.parent=null)!=t&&t.insert(e),null!=n&&n.insertEdge(e,!0),null!=a&&a.insertEdge(e,!1)},mxCodec.prototype.setAttribute=function(e,t,n){null!=t&&null!=n&&e.setAttribute(t,n)},mxObjectCodec.prototype.template=null,mxObjectCodec.prototype.exclude=null,mxObjectCodec.prototype.idrefs=null,mxObjectCodec.prototype.mapping=null,mxObjectCodec.prototype.reverse=null,mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)},mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor},mxObjectCodec.prototype.getFieldName=function(e){if(null!=e){var t=this.reverse[e];null!=t&&(e=t)}return e},mxObjectCodec.prototype.getAttributeName=function(e){if(null!=e){var t=this.mapping[e];null!=t&&(e=t)}return e},mxObjectCodec.prototype.isExcluded=function(e,t,n,a){return t==mxObjectIdentity.FIELD_NAME||0<=mxUtils.indexOf(this.exclude,t)},mxObjectCodec.prototype.isReference=function(e,t,n,a){return 0<=mxUtils.indexOf(this.idrefs,t)},mxObjectCodec.prototype.encode=function(e,t){var n=e.document.createElement(this.getName());return t=this.beforeEncode(e,t,n),this.encodeObject(e,t,n),this.afterEncode(e,t,n)},mxObjectCodec.prototype.encodeObject=function(e,t,n){for(var a in e.setAttribute(n,"id",e.getId(t)),t){var i=a,o=t[i];null!=o&&!this.isExcluded(t,i,o,!0)&&(mxUtils.isNumeric(i)&&(i=null),this.encodeValue(e,t,i,o,n))}},mxObjectCodec.prototype.encodeValue=function(e,t,n,a,i){if(null!=a){if(this.isReference(t,n,a,!0)){var o=e.getId(a);if(null==o)return void mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+n+"="+a);a=o}o=this.template[n],(null==n||e.encodeDefaults||o!=a)&&(n=this.getAttributeName(n),this.writeAttribute(e,t,n,a,i))}},mxObjectCodec.prototype.writeAttribute=function(e,t,n,a,i){"object"!=typeof a?this.writePrimitiveAttribute(e,t,n,a,i):this.writeComplexAttribute(e,t,n,a,i)},mxObjectCodec.prototype.writePrimitiveAttribute=function(e,t,n,a,i){a=this.convertValueToXml(a),null==n?(t=e.document.createElement("add"),"function"==typeof a?t.appendChild(e.document.createTextNode(a)):e.setAttribute(t,"value",a),i.appendChild(t)):"function"!=typeof a&&e.setAttribute(i,n,a)},mxObjectCodec.prototype.writeComplexAttribute=function(e,t,n,a,i){null!=(e=e.encode(a))?(null!=n&&e.setAttribute("as",n),i.appendChild(e)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+n+": "+a)},mxObjectCodec.prototype.convertValueToXml=function(e){return void 0!==e.length||1!=e&&0!=e||(e=1==e?"1":"0"),e},mxObjectCodec.prototype.convertValueFromXml=function(e){return mxUtils.isNumeric(e)&&(e=parseFloat(e)),e},mxObjectCodec.prototype.beforeEncode=function(e,t,n){return t},mxObjectCodec.prototype.afterEncode=function(e,t,n){return n},mxObjectCodec.prototype.decode=function(e,t,n){var a=t.getAttribute("id"),i=e.objects[a];return null==i&&(i=n||this.cloneTemplate(),null!=a&&e.putObject(a,i)),t=this.beforeDecode(e,t,i),this.decodeNode(e,t,i),this.afterDecode(e,t,i)},mxObjectCodec.prototype.decodeNode=function(e,t,n){null!=t&&(this.decodeAttributes(e,t,n),this.decodeChildren(e,t,n))},mxObjectCodec.prototype.decodeAttributes=function(e,t,n){if(null!=(t=t.attributes))for(var a=0;a<t.length;a++)this.decodeAttribute(e,t[a],n)},mxObjectCodec.prototype.decodeAttribute=function(e,t,n){var a=t.nodeName;if("as"!=a&&"id"!=a){t=this.convertValueFromXml(t.nodeValue);var i=this.getFieldName(a);if(this.isReference(n,i,t,!1)){if(null==(e=e.getObject(t)))return void mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+a+"="+t);t=e}this.isExcluded(n,a,t,!1)||(n[a]=t)}},mxObjectCodec.prototype.decodeChildren=function(e,t,n){for(t=t.firstChild;null!=t;){var a=t.nextSibling;t.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,t,n)&&this.decodeChild(e,t,n),t=a}},mxObjectCodec.prototype.decodeChild=function(e,t,n){var a=this.getFieldName(t.getAttribute("as"));if(null==a||!this.isExcluded(n,a,t,!1)){var i=this.getFieldTemplate(n,a,t),o=null;"add"==t.nodeName?null==(o=t.getAttribute("value"))&&(o=mxUtils.eval(mxUtils.getTextContent(t))):o=e.decode(t,i),this.addObjectValue(n,a,o,i)}},mxObjectCodec.prototype.getFieldTemplate=function(e,t,n){return(e=e[t])instanceof Array&&0<e.length&&(e=null),e},mxObjectCodec.prototype.addObjectValue=function(e,t,n,a){null!=n&&n!=a&&(null!=t&&0<t.length?e[t]=n:e.push(n))},mxObjectCodec.prototype.processInclude=function(e,t,n){if("include"==t.nodeName){if(null!=(t=t.getAttribute("name")))try{var a=mxUtils.load(t).getDocumentElement();null!=a&&e.decode(a,n)}catch(e){}return!0}return!1},mxObjectCodec.prototype.beforeDecode=function(e,t,n){return t},mxObjectCodec.prototype.afterDecode=function(e,t,n){return n},mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);return e.isCellCodec=function(){return!0},e.isExcluded=function(e,t,n,a){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||a&&"value"==t&&n.nodeType==mxConstants.NODETYPE_ELEMENT},e.afterEncode=function(e,t,n){if(null!=t.value&&t.value.nodeType==mxConstants.NODETYPE_ELEMENT){var a=n;(n=mxClient.IS_IE?t.value.cloneNode(!0):e.document.importNode(t.value,!0)).appendChild(a),e=a.getAttribute("id"),n.setAttribute("id",e),a.removeAttribute("id")}return n},e.beforeDecode=function(e,t,n){var a=t,i=this.getName();if(t.nodeName!=i?(null!=(a=t.getElementsByTagName(i)[0])&&a.parentNode==t?(mxUtils.removeWhitespace(a,!0),mxUtils.removeWhitespace(a,!1),a.parentNode.removeChild(a)):a=null,n.value=t.cloneNode(!0),null!=(t=n.value.getAttribute("id"))&&(n.setId(t),n.value.removeAttribute("id"))):n.setId(t.getAttribute("id")),null!=a)for(t=0;t<this.idrefs.length;t++){i=this.idrefs[t];var o=a.getAttribute(i);if(null!=o){a.removeAttribute(i);var s=e.objects[o]||e.lookup(o);null==s&&(null!=(o=e.getElementById(o))&&(s=(mxCodecRegistry.codecs[o.nodeName]||this).decode(e,o))),n[i]=s}}return a},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphModel);return e.encodeObject=function(e,t,n){var a=e.document.createElement("root");e.encodeCell(t.getRoot(),a),n.appendChild(a)},e.decodeChild=function(e,t,n){"root"==t.nodeName?this.decodeRoot(e,t,n):mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeRoot=function(e,t,n){var a=null;for(t=t.firstChild;null!=t;){var i=e.decodeCell(t);null!=i&&null==i.getParent()&&(a=i),t=t.nextSibling}null!=a&&n.setRoot(a)},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxRootChange,["model","previous","root"]);return e.afterEncode=function(e,t,n){return e.encodeCell(t.root,n),n},e.beforeDecode=function(e,t,n){if(null!=t.firstChild&&t.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(t=t.cloneNode(!0)).firstChild;for(n.root=e.decodeCell(a,!1),n=a.nextSibling,a.parentNode.removeChild(a),a=n;null!=a;)n=a.nextSibling,e.decodeCell(a),a.parentNode.removeChild(a),a=n}return t},e.afterDecode=function(e,t,n){return n.previous=n.root,n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);return e.isReference=function(e,t,n,a){return!("child"!=t||null==e.previous&&a)||0<=mxUtils.indexOf(this.idrefs,t)},e.afterEncode=function(e,t,n){return this.isReference(t,"child",t.child,!0)?n.setAttribute("child",e.getId(t.child)):e.encodeCell(t.child,n),n},e.beforeDecode=function(e,t,n){if(null!=t.firstChild&&t.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(t=t.cloneNode(!0)).firstChild;for(n.child=e.decodeCell(a,!1),n=a.nextSibling,a.parentNode.removeChild(a),a=n;null!=a;){if(n=a.nextSibling,a.nodeType==mxConstants.NODETYPE_ELEMENT){var i=a.getAttribute("id");null==e.lookup(i)&&e.decodeCell(a)}a.parentNode.removeChild(a),a=n}}else a=t.getAttribute("child"),n.child=e.getObject(a);return t},e.afterDecode=function(e,t,n){return n.child.parent=n.previous,n.previous=n.parent,n.previousIndex=n.index,n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return e.afterDecode=function(e,t,n){return n.previous=n.terminal,n},e}());var mxGenericChangeCodec=function(e,a){var t=new mxObjectCodec(e,["model","previous"],["cell"]);return t.afterDecode=function(e,t,n){return mxUtils.isNode(n.cell)&&(n.cell=e.decodeCell(n.cell,!1)),n.previous=n[a],n},t};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),mxCodecRegistry.register(new mxObjectCodec(new mxGraph,"graphListeners eventListeners view container cellRenderer editor selection".split(" "))),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphView);return e.encode=function(e,t){return this.encodeCell(e,t,t.graph.getModel().getRoot())},e.encodeCell=function(e,t,n){var a=t.graph.getModel(),i=t.getState(n),o=a.getParent(n);if(null==o||null!=i){var s=a.getChildCount(n),r=t.graph.getCellGeometry(n),l=null;if(o==a.getRoot()?l="layer":null==o?l="graph":a.isEdge(n)?l="edge":0<s&&null!=r?l="group":a.isVertex(n)&&(l="vertex"),null!=l){var d=e.document.createElement(l);if(null!=t.graph.getLabel(n)&&(d.setAttribute("label",t.graph.getLabel(n)),t.graph.isHtmlLabel(n)&&d.setAttribute("html",!0)),null==o){var c=t.getGraphBounds();null!=c&&(d.setAttribute("x",Math.round(c.x)),d.setAttribute("y",Math.round(c.y)),d.setAttribute("width",Math.round(c.width)),d.setAttribute("height",Math.round(c.height))),d.setAttribute("scale",t.scale)}else if(null!=i&&null!=r){for(c in i.style)"function"==typeof(o=i.style[c])&&"object"==typeof o&&(o=mxStyleRegistry.getName(o)),null!=o&&"function"!=typeof o&&"object"!=typeof o&&d.setAttribute(c,o);if(null!=(o=i.absolutePoints)&&0<o.length){for(r=Math.round(o[0].x)+","+Math.round(o[0].y),c=1;c<o.length;c++)r+=" "+Math.round(o[c].x)+","+Math.round(o[c].y);d.setAttribute("points",r)}else d.setAttribute("x",Math.round(i.x)),d.setAttribute("y",Math.round(i.y)),d.setAttribute("width",Math.round(i.width)),d.setAttribute("height",Math.round(i.height));null!=(c=i.absoluteOffset)&&(0!=c.x&&d.setAttribute("dx",Math.round(c.x)),0!=c.y&&d.setAttribute("dy",Math.round(c.y)))}for(c=0;c<s;c++)null!=(i=this.encodeCell(e,t,a.getChildAt(n,c)))&&d.appendChild(i)}}return d},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxStylesheet);return e.encode=function(e,t){var n,a=e.document.createElement(this.getName());for(n in t.styles){var i=t.styles[n],o=e.document.createElement("add");if(null!=n){for(var s in o.setAttribute("as",n),i){var r=this.getStringValue(s,i[s]);if(null!=r){var l=e.document.createElement("add");l.setAttribute("value",r),l.setAttribute("as",s),o.appendChild(l)}}0<o.childNodes.length&&a.appendChild(o)}}return a},e.getStringValue=function(e,t){var n=typeof t;return"function"==n?t=mxStyleRegistry.getName(style[j]):"object"==n&&(t=null),t},e.decode=function(e,t,n){n=n||new this.template.constructor;var a=t.getAttribute("id");for(null!=a&&(e.objects[a]=n),t=t.firstChild;null!=t;){if(!this.processInclude(e,t,n)&&"add"==t.nodeName&&null!=(a=t.getAttribute("as"))){var i=t.getAttribute("extend"),o=null!=i?mxUtils.clone(n.styles[i]):null;for(null==o&&(null!=i&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+i+" not found to extend"),o={}),i=t.firstChild;null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT){var s=i.getAttribute("as");if("add"==i.nodeName){var r=mxUtils.getTextContent(i),l=null;null!=r&&0<r.length?l=mxUtils.eval(r):(l=i.getAttribute("value"),mxUtils.isNumeric(l)&&(l=parseFloat(l))),null!=l&&(o[s]=l)}else"remove"==i.nodeName&&delete o[s]}i=i.nextSibling}n.putCellStyle(a,o)}t=t.nextSibling}return n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultKeyHandler);return e.encode=function(e,t){return null},e.decode=function(e,t,n){if(null!=n)for(t=t.firstChild;null!=t;){if(!this.processInclude(e,t,n)&&"add"==t.nodeName){var a=t.getAttribute("as"),i=t.getAttribute("action"),o=t.getAttribute("control");n.bindAction(a,i,o)}t=t.nextSibling}return n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultToolbar);return e.encode=function(e,t){return null},e.decode=function(e,t,n){if(null!=n){var a=n.editor;for(t=t.firstChild;null!=t;){if(t.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,t,n))if("separator"==t.nodeName)n.addSeparator();else if("br"==t.nodeName)n.toolbar.addBreak();else if("hr"==t.nodeName)n.toolbar.addLine();else if("add"==t.nodeName){var i=t.getAttribute("as"),o=(i=mxResources.get(i)||i,t.getAttribute("icon")),s=t.getAttribute("pressedIcon"),r=t.getAttribute("action"),l=t.getAttribute("mode"),d=t.getAttribute("template"),c="0"!=t.getAttribute("toggle"),m=mxUtils.getTextContent(t),u=null;if(null!=r)u=n.addItem(i,o,r,s);else if(null!=l){var p=mxUtils.eval(m);u=n.addMode(i,o,l,s,p)}else if(null!=d||null!=m&&0<m.length)u=a.templates[d],d=t.getAttribute("style"),null!=u&&null!=d&&(u=u.clone()).setStyle(d),(d=null)!=m&&0<m.length&&(d=mxUtils.eval(m)),u=n.addPrototype(i,o,u,s,d,c);else if(0<(s=mxUtils.getChildNodes(t)).length)if(null==o)for(d=n.addActionCombo(i),i=0;i<s.length;i++)"separator"==(c=s[i]).nodeName?n.addOption(d,"---"):"add"==c.nodeName&&(o=c.getAttribute("as"),c=c.getAttribute("action"),n.addActionOption(d,o,c));else{var g=null,v=n.addPrototype(i,o,function(){if(null!=(e=a.templates[g.value])){var e=e.clone(),t=g.options[g.selectedIndex].cellStyle;return null!=t&&e.setStyle(t),e}return mxLog.warn("Template "+e+" not found"),null},null,null,c);g=n.addCombo();for(mxEvent.addListener(g,"change",function(){n.toolbar.selectMode(v,function(e){return e=mxUtils.convertPoint(a.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a.addVertex(null,p(),e.x,e.y)}),n.toolbar.noReset=!1}),i=0;i<s.length;i++)"separator"==(c=s[i]).nodeName?n.addOption(g,"---"):"add"==c.nodeName&&(o=c.getAttribute("as"),m=c.getAttribute("template"),n.addOption(g,o,m||d).cellStyle=c.getAttribute("style"))}null!=u&&(null!=(d=t.getAttribute("id"))&&0<d.length&&u.setAttribute("id",d))}t=t.nextSibling}}return n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultPopupMenu);return e.encode=function(e,t){return null},e.decode=function(e,t,n){var a=t.getElementsByTagName("include")[0];return null!=a?this.processInclude(e,a,n):null!=n&&(n.config=t),n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxEditor,"modified lastSnapshot ignoredChanges undoManager graphContainer toolbarContainer".split(" "));return e.afterDecode=function(e,t,n){return null!=(e=t.getAttribute("defaultEdge"))&&(t.removeAttribute("defaultEdge"),n.defaultEdge=n.templates[e]),null!=(e=t.getAttribute("defaultGroup"))&&(t.removeAttribute("defaultGroup"),n.defaultGroup=n.templates[e]),n},e.decodeChild=function(e,t,n){if("Array"==t.nodeName){if("templates"==t.getAttribute("as"))return void this.decodeTemplates(e,t,n)}else if("ui"==t.nodeName)return void this.decodeUi(e,t,n);mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeUi=function(e,t,n){for(e=t.firstChild;null!=e;){if("add"==e.nodeName){t=e.getAttribute("as");var a=e.getAttribute("element"),i=e.getAttribute("style"),o=null;if(null!=a)null!=(o=document.getElementById(a))&&null!=i&&(o.style.cssText+=";"+i);else{a=parseInt(e.getAttribute("x"));var s=parseInt(e.getAttribute("y")),r=e.getAttribute("width"),l=e.getAttribute("height");(o=document.createElement("div")).style.cssText=i,new mxWindow(mxResources.get(t)||t,o,a,s,r,l,!1,!0).setVisible(!0)}"graph"==t?n.setGraphContainer(o):"toolbar"==t?n.setToolbarContainer(o):"title"==t?n.setTitleContainer(o):"status"==t?n.setStatusContainer(o):"map"==t&&n.setMapContainer(o)}else"resource"==e.nodeName?mxResources.add(e.getAttribute("basename")):"stylesheet"==e.nodeName&&mxClient.link("stylesheet",e.getAttribute("name"));e=e.nextSibling}},e.decodeTemplates=function(e,t,n){null==n.templates&&(n.templates=[]),t=mxUtils.getChildNodes(t);for(var a=0;a<t.length;a++){for(var i=t[a].getAttribute("as"),o=t[a].firstChild;null!=o&&1!=o.nodeType;)o=o.nextSibling;null!=o&&(n.templates[i]=e.decodeCell(o))}},e}()),EditorUi=function(e,t,n){this.projectDesignController=e,this.editor=t||new Editor,this.container=n||document.body;var a=t.graph,i=this;this.container.style.overflow="hidden",(new Image).src=mxPopupMenu.prototype.submenuImage,null!=mxConnectionHandler.prototype.connectImage&&((new Image).src=mxConnectionHandler.prototype.connectImage.src),this.actions=new Actions(this),this.menus=new Menus(this),this.createDivs(),this.refresh(),this.createUi();var o=mxUtils.bind(this,function(e){return null==e&&(e=window.event),!!this.isSelectionAllowed(e)||a.isEditing()});this.container==document.body&&(this.menubarContainer.onselectstart=o,this.menubarContainer.onmousedown=o,this.toolbarContainer.onselectstart=o,this.toolbarContainer.onmousedown=o,this.diagramContainer.onselectstart=o,this.diagramContainer.onmousedown=o,this.sidebarContainer.onselectstart=o,this.sidebarContainer.onmousedown=o,this.footerContainer.onselectstart=o,this.footerContainer.onmousedown=o),mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?(mxEvent.addListener(this.diagramContainer,"contextmenu",o),mxEvent.addListener(this.sidebarContainer,"contextmenu",o)):(this.diagramContainer.oncontextmenu=o,this.sidebarContainer.oncontextmenu=o),a.init(this.diagramContainer),a.refresh(),a.container.setAttribute("tabindex","0"),a.container.style.cursor="default",a.container.style.backgroundImage="url("+t.gridImage+")",a.container.style.backgroundPosition="-1px -1px",a.container.focus();var s=a.fireMouseEvent;a.fireMouseEvent=function(e,t,n){e==mxEvent.MOUSE_DOWN&&this.container.focus(),s.apply(this,arguments)},this.createMultiplicities(a.multiplicities,["start","finally","end"],[[1,1],[1,1],[0,0]],[[0,0],[0,0],[1,"n"]]),this.createMultiplicities(a.multiplicities,["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[[1,1],[0,0],[0,1],[0,1],[0,1],[1,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["login","pause","unpause","logout"],[[1,2],[1,2],[1,2],[1,2]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["set","math"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["background","playback","menu","saydigits","saynumber","sayphonetic","tts","ispeechtts","awspolly","getdigits","getsecretdigits","lumenvoxtts"],[[1,"n"],[1,1],[1,"n"],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,"n"],[1,"n"],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["record"],[[1,1]],[[1,"n"]]),this.createMultiplicities(a.multiplicities,["database","ispeechasr","sendSMS","sendMail","sendFax","googleasr","lumenvoxasr","tildeasr"],[[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["gotoc","gotoif","gotoiftime","vswitch"],[[0,0],[1,2],[1,2],[1,"n"]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["queuelog","goal"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["noop","system","agi","subproject","custom_app"],[[1,1],[1,1],[0,1],[0,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),a.dblClick=function(e,n){var t=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",n);this.fireEvent(t),!this.isEnabled()||mxEvent.isConsumed(e)||t.isConsumed()||(this.getModel().isEdge(n)?0<=["background","gotoif","gotoiftime","menu","getdigits","getsecretdigits","vswitch","login","pause","unpause","logout"].indexOf(n.source.value.tagName)&&this.startEditingAtCell(n):this.getModel().isVertex(n)&&i.projectDesignController.openDialog(n.getValue(),function(e){for(var t=0;t<e.length;t+=1)n.setAttribute(e[t].name,e[t].value);a.refresh(n)}),t.consume())},a.panningHandler.autoExpand=!0,a.panningHandler.factoryMethod=mxUtils.bind(this,function(e,t,n){this.menus.createPopupMenu(e,t,n)}),t.outline.init(this.outlineContainer),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){a.panningHandler.hideMenu()})),mxClient.IS_TOUCH&&(mxEvent.addListener(a.container,"gesturechange",mxUtils.bind(this,function(e){a.view.getDrawPane().setAttribute("transform","scale("+e.scale+")"),a.view.getOverlayPane().style.visibility="hidden"})),mxEvent.addListener(a.container,"gestureend",mxUtils.bind(this,function(e){a.view.getDrawPane().removeAttribute("transform"),a.zoomToCenter=!0,a.zoom(e.scale),a.view.getOverlayPane().style.visibility="visible"})));var r=this.createKeyHandler(t);this.getKeyHandler=function(){return r},mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.refresh(),a.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.init(),this.open(),this.refresh()},EditorUi.prototype.splitSize=mxClient.IS_TOUCH?16:8,EditorUi.prototype.menubarHeight=33,EditorUi.prototype.toolbarHeight=36,EditorUi.prototype.footerHeight=0,EditorUi.prototype.hsplitPosition=204,EditorUi.prototype.vsplitPosition=190,EditorUi.prototype.init=function(){this.addUndoListener(),this.addSelectionListener();var e=this.actions.get("paste"),t=function(){e.setEnabled(!mxClipboard.isEmpty())},n=mxClipboard.cut;mxClipboard.cut=function(){n.apply(this,arguments),t()};var a=mxClipboard.copy;mxClipboard.copy=function(){a.apply(this,arguments),t()}},EditorUi.prototype.isSelectionAllowed=function(e){return!1},EditorUi.prototype.exportXML=function(e){var t=window.document.createElement("a");t.href="data:attachment/text;charset=utf-8,"+encodeURI(e),t.download=this.editor.filename+".xml",t.target="_self",t.click()},EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(e,t){try{var n=mxUtils.parseXml(e);this.editor.setGraphXml(n.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=t&&(this.editor.filename=t)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}}))}catch(e){}},EditorUi.prototype.openString=function(e,t,n){try{var a=mxUtils.parseXml(e);this.editor.setGraphXml(a.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=t&&(this.editor.filename=t),null!=n&&(this.editor.data=n)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}},EditorUi.prototype.validate=function(e,t){for(var n=this.editor.graph,a=(e=null!=e?e:n.model.getRoot(),t=null!=t?t:{},!0),i=n.model.getChildCount(e),o=0;o<i;o++){var s=n.model.getChildAt(e,o),r=t;n.isValidRoot(s)&&(r={}),null!=(r=this.validate(s,r))?n.setCellWarning(s,r.replace(/\n/g,"<br>")):n.setCellWarning(s,null),a=a&&null==r}if(i="",n.model.isVertex(e))switch(e.value.nodeName){case"start":i=this.validateBlock("start")?"":"Only one Start block is allowed\n";break;case"finally":i=this.validateBlock("finally")?"":"Only one Finally block is allowed\n";break;case"playback":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n";break;case"answer":i=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"menu":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("digit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("response")?"":mxResources.get("invalidTimeout")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getsecretdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("hiddendigitsnum")?"":mxResources.get("wrongHiddenDigitsnum")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"vswitch":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"database":i=0<e.value.getAttribute("odbc_id")?"":mxResources.get("noDatabaseSelected")+"\n",i+=""!==e.value.getAttribute("query")?"":mxResources.get("missingQuery")+"\n";break;case"set":case"math":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"gotoc":i=""!==e.value.getAttribute("context")?"":mxResources.get("noContextSelected")+"\n",i+=""!==e.value.getAttribute("extension")?"":mxResources.get("noExtensionSelected")+"\n",i+=1<=e.value.getAttribute("priority")?"":mxResources.get("invalidPriority")+"\n";break;case"system":case"agi":i=""!==e.value.getAttribute("command")?"":mxResources.get("noCommandSelected")+"\n";break;case"gotoif":i=""!==e.value.getAttribute("condition")?"":mxResources.get("noConditionSelected")+"\n";break;case"saydigits":i=""!==e.value.getAttribute("digits")?"":mxResources.get("noDigitsSelected")+"\n";break;case"saynumber":i=""!==e.value.getAttribute("number")?"":mxResources.get("noNumberSelected")+"\n";break;case"sayphonetic":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"record":i=""!==e.value.getAttribute("file")?"":mxResources.get("noFileSelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"goal":i=""!==e.value.getAttribute("goalname")?"":mxResources.get("noGoalSelected")+"\n";break;case"ext_dial":i="-1"!==e.value.getAttribute("trunk_name")?"":mxResources.get("noTrunkSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"dial":i=0<e.value.getAttribute("sip_id")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"queue":i="-1"!==e.value.getAttribute("queue_id")?"":mxResources.get("noQueueSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"callback":i="-1"!==e.value.getAttribute("list_id")?"":mxResources.get("noListSelected")+"\n",i+=""!==e.value.getAttribute("name")?"":mxResources.get("noFirstNameSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noPhoneSelected")+"\n",i+=0<=e.value.getAttribute("delay")?"":mxResources.get("invalidDelay")+"\n";break;case"gotoiftime":i=0<e.value.getAttribute("interval_id")?"":mxResources.get("noIntervalSelected")+"\n";break;case"voicemail":i=""!==e.value.getAttribute("mailbox")?"":mxResources.get("noBoxNumberSelected")+"\n";break;case"subproject":i=0<e.value.getAttribute("project_id")?"":mxResources.get("noProjectSelected")+"\n";break;case"sendSMS":i=0<e.value.getAttribute("sms_account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("sms_text")?"":mxResources.get("noTextSelected")+"\n";break;case"sendMail":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n";break;case"sendFax":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("attachment_path")?"":mxResources.get("noAttachmentSelected")+"\n";break;case"tts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"awspolly":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i=""!==e.value.getAttribute("aws_access_key_id")?"":mxResources.get("noAccessKeySelected")+"\n",i=""!==e.value.getAttribute("aws_secret_access_key")?"":mxResources.get("noSecretAccessKeySelected")+"\n";break;case"ispeechtts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-10<=e.value.getAttribute("speed")&&e.value.getAttribute("speed")<=10?"":mxResources.get("invalidSpeed")+"\n";break;case"lumenvoxtts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"lumenvoxasr":i=""!==e.value.getAttribute("grammar")?"":mxResources.get("noGrammarSelected")+"\n";break;case"ispeechasr":case"googleasr":i=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"tildeasr":i=""!==e.value.getAttribute("appid")?"":mxResources.get("noAppIdInserted")+"\n",i+=""!==e.value.getAttribute("appsecret")?"":mxResources.get("noAppSecretInserted")+"\n",i+=""!==e.value.getAttribute("uri")?"":mxResources.get("noUriInserted")+"\n";break;case"custom_app":i=""!==e.value.getAttribute("application")?"":mxResources.get("noApplicationSelected")+"\n";break;case"login":case"pause":case"unpause":case"logout":i=""!==e.value.getAttribute("findBy")?"":mxResources.get("noFindBySelected")+"\n"}if(n.model.isEdge(e))switch(n.model.getCell(e.source.getId()).value.nodeName){case"background":i+=(l=/^[0-9]{1,45}$|^[i]{1}$|^[t]{1}$|^[*]{1}$|^[#]{1}$/).test(String(e.getValue()))?"":mxResources.get("numberOrInvalidOrTimeout")+"\n";break;case"menu":if(e.getValue()){var l=/^[0-9]+$|^[-]{1}$|^[i]{1}$|^[t]{1}$|^[*]{1}$|^[#]{1}$/;String(e.getValue()).split(",").forEach(function(e){i+=l.test(e)?"":mxResources.get("numberOrAll")+"\n"})}else i=i+mxResources.get("numberOrAll")+"\n";break;case"getsecretdigits":case"getdigits":if(e.getValue())i+=(l=/^(x|i|-)$/).test(String(e.getValue()))?"":mxResources.get("numberOrInvalidOrDefault")+"\n";else i=i+mxResources.get("numberOrInvalidOrDefault")+"\n";break;case"gotoif":case"gotoiftime":if(e.getValue())i+=(l=/^(true){1}$|^(false){1}$/).test(String(e.getValue()))?"":mxResources.get("trueOrFalse")+"\n";else i=i+mxResources.get("trueOrFalse")+"\n";break;case"login":case"pause":case"unpause":case"logout":if(e.getValue())i+=(l=/^(success){1}$|^(failure){1}$/).test(String(e.getValue()))?"":mxResources.get("successOrFailure")+"\n";else i=i+mxResources.get("successOrFailure")+"\n"}return n.isCellCollapsed(e)&&!a&&(i+=(mxResources.get(n.containsValidationErrorsResource)||n.containsValidationErrorsResource)+"\n"),i=n.model.isEdge(e)?i+(n.getEdgeValidationError(e,n.model.getTerminal(e,!0),n.model.getTerminal(e,!1))||""):i+(n.getCellValidationError(e)||""),null!=(o=n.validateCell(e,t))&&(i+=o),null==n.model.getParent(e)&&n.view.validate(),0<i.length||!a?i:null},EditorUi.prototype.validateBlock=function(t){var n=this.editor.graph,e=n.getDefaultParent(),a=0;return e.children.forEach(function(e){n.model.isVertex(e)&&e.value.nodeName==t&&a++}),!(1<a)},EditorUi.prototype.getUrl=function(e){var t=null!=e?e:window.location.pathname,n=0<t.indexOf("?")?1:0;for(var a in urlParams)t+=0==n?"?":"&",t+=a+"="+urlParams[a],n++;return t},EditorUi.prototype.addUndoListener=function(){var e=this.actions.get("undo"),t=this.actions.get("redo"),n=this.editor.undoManager,a=function(){e.setEnabled(n.canUndo()),t.setEnabled(n.canRedo())};n.addListener(mxEvent.ADD,a),n.addListener(mxEvent.UNDO,a),n.addListener(mxEvent.REDO,a),n.addListener(mxEvent.CLEAR,a),a()},EditorUi.prototype.addSelectionListener=function(){var e=mxUtils.bind(this,function(){var e=this.editor.graph,t=!e.isSelectionEmpty(),n=!1,a=!1,i=e.getSelectionCells();if(null!=i)for(var o=0;o<i.length;o++){var s=i[o];if(e.getModel().isEdge(s)&&(a=!0),e.getModel().isVertex(s)&&(n=!0),a&&n)break}var r=["cut","copy","delete","duplicate","bold","italic","style","underline","toFront","toBack","dashed","rounded","shadow","tilt","autosize"];for(o=0;o<r.length;o++)this.actions.get(r[o]).setEnabled(t);this.actions.get("curved").setEnabled(a),this.actions.get("rotation").setEnabled(n),this.actions.get("wordWrap").setEnabled(n),this.actions.get("group").setEnabled(1<e.getSelectionCount()),this.actions.get("ungroup").setEnabled(1==e.getSelectionCount()&&0<e.getModel().getChildCount(e.getSelectionCell()));var l=n&&1==e.getSelectionCount();this.actions.get("removeFromGroup").setEnabled(l&&e.getModel().isVertex(e.getModel().getParent(e.getSelectionCell())));var d=["fontFamily","fontSize","alignment","position","text","format","arrange","linewidth","spacing"];for(o=0;o<d.length;o++)this.menus.get(d[o]).setEnabled(t);d=["line","lineend","linestart"];for(o=0;o<d.length;o++)this.menus.get(d[o]).setEnabled(a);this.actions.get("setAsDefaultEdge").setEnabled(a),this.menus.get("align").setEnabled(1<e.getSelectionCount()),this.menus.get("direction").setEnabled(n||a&&e.isLoop(e.view.getState(e.getSelectionCell()))),this.menus.get("navigation").setEnabled(e.foldingEnabled&&(null!=e.view.currentRoot||1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell()))),this.actions.get("home").setEnabled(null!=e.view.currentRoot),this.actions.get("exitGroup").setEnabled(null!=e.view.currentRoot);var c=1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell());this.actions.get("enterGroup").setEnabled(c),this.actions.get("expand").setEnabled(c),this.actions.get("collapse").setEnabled(c),this.actions.get("editLink").setEnabled(1==e.getSelectionCount()),this.actions.get("openLink").setEnabled(1==e.getSelectionCount()&&null!=e.getLinkForCell(e.getSelectionCell()))});this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},EditorUi.prototype.refresh=function(){var e=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),t=this.container.clientWidth+390,n=this.container.clientHeight+190;this.container==document.body&&(t=document.body.clientWidth||document.documentElement.clientWidth,n=e&&document.body.clientHeight||document.documentElement.clientHeight);var a=Math.max(0,Math.min(this.hsplitPosition,t-this.splitSize-20)),i=Math.max(0,Math.min(this.vsplitPosition,n-this.menubarHeight-this.toolbarHeight-this.splitSize-1));this.menubarContainer.style.height=this.menubarHeight+"px",this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px";var o=this.menubarHeight+this.toolbarHeight;if(mxClient.IS_QUIRKS||(o+=1),this.sidebarContainer.style.top=o+"px",this.sidebarContainer.style.width=a+"px",this.outlineContainer.style.width=a+"px",this.outlineContainer.style.height=i+"px",this.diagramContainer.style.left=a+this.splitSize+"px",this.diagramContainer.style.top=this.sidebarContainer.style.top,this.hsplit.style.top=this.sidebarContainer.style.top,this.hsplit.style.bottom=this.outlineContainer.style.bottom,this.hsplit.style.left=a+"px",this.vsplit.style.width=this.sidebarContainer.style.width,this.vsplit.style.bottom=i+this.footerHeight+"px",e){this.menubarContainer.style.width=t+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width;var s=n-i-this.splitSize-this.menubarHeight-this.toolbarHeight;this.sidebarContainer.style.height=s+"px",this.diagramContainer.style.width=t-a-this.splitSize+"px";var r=n-this.menubarHeight-this.toolbarHeight;this.diagramContainer.style.height=r+"px",this.hsplit.style.height=r+"px"}else this.sidebarContainer.style.bottom=i+this.splitSize+"px",this.diagramContainer.style.bottom=this.outlineContainer.style.bottom},EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer"),this.toolbarContainer=this.createDiv("geToolbarContainer"),this.sidebarContainer=this.createDiv("geSidebarContainer"),this.outlineContainer=this.createDiv("geOutlineContainer"),this.diagramContainer=this.createDiv("geDiagramContainer"),this.footerContainer=this.createDiv("geFooterContainer"),this.hsplit=this.createDiv("geHsplit"),this.vsplit=this.createDiv("geVsplit"),this.menubarContainer.style.top="0px",this.menubarContainer.style.left="0px",this.menubarContainer.style.right="0px",this.toolbarContainer.style.left="0px",this.toolbarContainer.style.right="0px",this.sidebarContainer.style.left="0px",this.outlineContainer.style.bottom="0px",this.outlineContainer.style.left="0px",this.diagramContainer.style.overflow="scroll",this.diagramContainer.style.right="0px",this.footerContainer.style.left="0px",this.footerContainer.style.right="0px",this.footerContainer.style.bottom="0px",this.vsplit.style.left="0px",this.vsplit.style.height=this.splitSize+"px",this.hsplit.style.width=this.splitSize+"px"},EditorUi.prototype.createUi=function(){this.menubar=this.menus.createMenubar(this.createDiv("geMenubar")),this.menubarContainer.appendChild(this.menubar.container),this.toolbar=this.createToolbar(this.createDiv("geToolbar")),this.toolbarContainer.appendChild(this.toolbar.container),this.sidebar=this.createSidebar(this.sidebarContainer),this.footerContainer.appendChild(this.createFooter()),this.statusContainer=this.createStatusContainer(),this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.container.appendChild(this.menubarContainer),this.container.appendChild(this.toolbarContainer),this.container.appendChild(this.sidebarContainer),this.container.appendChild(this.outlineContainer),this.container.appendChild(this.diagramContainer),this.container.appendChild(this.footerContainer),this.container.appendChild(this.hsplit),this.container.appendChild(this.vsplit),this.addSplitHandler(this.hsplit,!0,0,mxUtils.bind(this,function(e){this.hsplitPosition=e,this.refresh(),this.editor.graph.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.addSplitHandler(this.vsplit,!1,this.footerHeight,mxUtils.bind(this,function(e){this.vsplitPosition=e,this.refresh(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()}))},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.setStatusText=function(e){this.statusContainer.innerHTML=e},EditorUi.prototype.createToolbar=function(e){return new Toolbar(this,e)},EditorUi.prototype.createSidebar=function(e){return new Sidebar(this,e)},EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")},EditorUi.prototype.createDiv=function(e){var t=document.createElement("div");return t.className=e,t},EditorUi.prototype.createHeader=function(e){return document.createElement(e)},EditorUi.prototype.createForm=function(e){var t=document.createElement("form");return t.className=e,t},EditorUi.prototype.addSplitHandler=function(t,n,a,i){var o=null,s=null;function r(e){if(null!=o){var t=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e));i(Math.max(0,s+(n?t.x-o.x:o.y-t.y)-a)),mxEvent.consume(e)}}function e(e){r(e),s=o=null}mxEvent.addGestureListeners(t,function(e){o=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e)),s=parseInt(n?t.style.left:t.style.bottom),mxEvent.consume(e)}),mxEvent.addListener(document,"mousemove",r),mxEvent.addListener(document,"touchmove",r),mxEvent.addListener(document,"mouseup",e),mxEvent.addListener(document,"touchend",e)},EditorUi.prototype.executeLayout=function(e,t,n){var a=this.editor.graph,i=a.getSelectionCell();t=null!=this.animate?this.animate:t,a.getModel().beginUpdate();try{e.execute(a.getDefaultParent(),i)}catch(e){throw e}finally{if(t&&navigator.userAgent.indexOf("Camino")<0){var o=new mxMorphing(a);o.addListener(mxEvent.DONE,mxUtils.bind(this,function(){a.getModel().endUpdate()})),o.startAnimation()}else a.getModel().endUpdate()}},EditorUi.prototype.createKeyHandler=function(e){var a=this.editor.graph,s=new mxKeyHandler(a);function t(e){if(!a.isSelectionEmpty()){var t=0,n=0;37==e?t=-1:38==e?n=-1:39==e?t=1:40==e&&(n=1),a.moveCells(a.getSelectionCells(),t,n),a.scrollCellToVisible(a.getSelectionCell())}}s.isControlDown=function(e){return mxEvent.isControlDown(e)||mxClient.IS_MAC&&e.metaKey};var n=mxUtils.bind(this,function(e,t,n,a){var i=this.actions.get(n);if(null!=i){var o=function(){i.enabled&&i.funct()};t?a?s.bindControlShiftKey(e,o):s.bindControlKey(e,o):a?s.bindShiftKey(e,o):s.bindKey(e,o)}});return s.enter=function(){},s.bindKey(8,function(){a.foldCells(!0)}),s.bindKey(13,function(){a.foldCells(!1)}),s.bindKey(33,function(){a.exitGroup()}),s.bindKey(34,function(){a.enterGroup()}),s.bindKey(36,function(){a.home()}),s.bindKey(35,function(){a.refresh()}),s.bindKey(37,function(){t(37)}),s.bindKey(38,function(){t(38)}),s.bindKey(39,function(){t(39)}),s.bindKey(40,function(){t(40)}),s.bindKey(113,function(){a.startEditingAtCell()}),n(46,!1,"delete"),n(82,!0,"tilt"),n(83,!0,"save"),n(83,!0,"saveAs",!0),n(107,!1,"zoomIn"),n(109,!1,"zoomOut"),n(65,!0,"selectAll"),n(86,!0,"selectVertices",!0),n(69,!0,"selectEdges",!0),n(69,!0,"export"),n(66,!0,"toBack"),n(70,!0,"toFront"),n(68,!0,"duplicate"),n(90,!0,"undo"),n(89,!0,"redo"),n(88,!0,"cut"),n(67,!0,"copy"),n(81,!0,"connect"),n(86,!0,"paste"),n(71,!0,"group"),n(71,!0,"grid",!0),n(85,!0,"ungroup"),n(112,!1,"about"),n(80,!0,"publish",!0),s},EditorUi.prototype.createMultiplicities=function(e,t,n,a){for(var i=0;i<t.length;i++)e.push(new mxMultiplicity(!0,t[i],null,null,n[i][0],n[i][1],null,mxResources.get(t[i])+mxResources.get("musthave")+n[i][0]+mxResources.get("outgoingedge"),null)),e.push(new mxMultiplicity(!1,t[i],null,null,a[i][0],a[i][1],null,mxResources.get(t[i])+mxResources.get("musthave")+a[i][0]+mxResources.get("incomingedge"),null))};var useLocalStorage=(mxClient.IS_TOUCH||"local"==urlParams.storage)&&"undefined"!=typeof localStorage,fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList,touchStyle=mxClient.IS_TOUCH||"1"==urlParams.touch,counter=0;try{for(var op=window;null!=op.opener&&!isNaN(op.opener.counter);)op=op.opener;null!=op&&(op.counter++,counter=op.counter)}catch(e){}function Sidebar(e,t){this.editorUi=e,this.container=t,this.palettes=new Object,this.taglist=new Object,this.showTooltips=!0,this.graph=new Graph(document.createElement("div"),null,null,this.editorUi.editor.graph.getStylesheet()),this.graph.resetViewOnRootChange=!1,this.graph.foldingEnabled=!1,this.graph.setConnectable(!1),this.graph.autoScroll=!1,this.graph.setTooltips(!1),this.graph.setEnabled(!1),this.graph.container.style.visibility="hidden",this.graph.container.style.position="absolute",this.graph.container.style.overflow="hidden",this.graph.container.style.height="1px",this.graph.container.style.width="1px",mxClient.IS_IE||mxClient.IS_IE11||(this.graph.container.style.display="none"),document.body.appendChild(this.graph.container),this.pointerUpHandler=mxUtils.bind(this,function(){this.showTooltips=!0}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),this.pointerDownHandler=mxUtils.bind(this,function(){this.showTooltips=!1,this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler),this.pointerMoveHandler=mxUtils.bind(this,function(e){for(var t=mxEvent.getSource(e);null!=t;){if(t==this.currentElt)return;t=t.parentNode}this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler),this.pointerOutHandler=mxUtils.bind(this,function(e){null==e.toElement&&null==e.relatedTarget&&this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler),mxEvent.addListener(t,"scroll",mxUtils.bind(this,function(){this.showTooltips=!0})),this.init(),mxClient.IS_SVG||((new Image).src=IMAGE_PATH+"/tooltip.png")}function Actions(e){this.editorUi=e,this.actions=new Object,this.init()}function Action(e,t,n,a,i){mxEventSource.call(this),this.label=e,this.funct=t,this.enabled=null==n||n,this.iconCls=a,this.shortcut=i}function Menubar(e,t){this.editorUi=e,this.container=t,mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function Menu(e,t){mxEventSource.call(this),this.funct=e,this.enabled=null==t||t}function Toolbar(e,t){this.editorUi=e,this.container=t,this.init(),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function createCheckbox(e){var t=document.createElement("input");return t.setAttribute("type","checkbox"),e&&t.setAttribute("checked",!0),t}function createDropdownFromApi(e,n,a,i,t,o,s,r){var l=new XMLHttpRequest;l.open("GET",e,!1),l.setRequestHeader("Authorization","Bearer "+t.editor.data.token),l.send(null);var d=[];200===l.status&&(d=JSON.parse(l.response));var c=document.createElement("select"),m=document.createElement("option");return m.text="-- None --",m.value="-1",c.appendChild(m),d.rows.forEach(function(t){r&&t[a]==r||((m=document.createElement("option")).text=t[a],o&&s?(m.value=s,o.forEach(function(e){m.value=m.value.replace("%"+e+"%",t[e])}),m.selected=m.value==n):(m.value=t[i],m.selected=t[i]==n),c.appendChild(m))}),c.className="form-control select2",c}function createDropdownWithOptgroupFromApi(e,t,n,a,i,o){var s=new XMLHttpRequest;s.open("GET",e,!1),s.setRequestHeader("Authorization","Bearer "+i.editor.data.token),s.send(null);var r=[];200===s.status&&(r=JSON.parse(s.response));var l=document.createElement("select"),d=document.createElement("option");d.text="-- None --",d.value="-1",l.appendChild(d);var c=_.groupBy(r.rows,o);for(var m in c)if(c.hasOwnProperty(m)){var u=document.createElement("optgroup");u.label=_.capitalize(m),c[m].forEach(function(e){(d=document.createElement("option")).text=e[n],d.value=e[a],d.selected=e[a]==t,u.appendChild(d)}),l.appendChild(u)}return l.className="form-control select2",l}function createGroupedDropdownFromApi(e,t,n,a,i,o){var s=new XMLHttpRequest;s.open("GET",e,!1),s.setRequestHeader("Authorization","Bearer "+i.editor.data.token),s.send(null);var r=[];200===s.status&&(r=JSON.parse(s.response));var l=document.createElement("select"),d=document.createElement("option");return d.text="-- None --",d.value="0",l.appendChild(d),r.rows.forEach(function(e){(d=document.createElement("option")).className="select-group-father",d.text=e[n].toUpperCase(),d.value=e[a],d.selected=e[a]==t,l.appendChild(d),e[o].forEach(function(e){(d=document.createElement("option")).className="select-group-son",d.text="-"+_.capitalize(e[n]),d.value=e[a],d.selected=e[a]==t,l.appendChild(d)})}),l.className="form-control select2",l}function createDropdownFromArray(e,t){var n=document.createElement("select");for(var a in e){var i=document.createElement("option");i.text=e[a],i.value=a,(0<t||""!=t)&&(i.selected=t===a),n.appendChild(i)}return n.className="form-control select2",n}function createDropdownFromTigerDialList(e){var t=document.createElement("select"),n=[],a=new XMLHttpRequest;try{if(a.open("POST","/api/rest/list/list",!1),a.send(JSON.stringify({page:1,size:6e5})),200===a.status){var i=JSON.parse(a.response);if(0<i.status){var o=i.response.RMI.rows;for(var s in o)n[o[s].id]=o[s].name}}}catch(e){console.log(e)}for(var r in n){var l=document.createElement("option");l.text=n[r],l.value=r,(0<e||""!=e)&&(l.selected=e===r),t.appendChild(l)}return t.className="form-control select2",t}function Dialog(e,t,n,a,i,o,s){var r=0;mxClient.IS_IE&&9!=document.documentMode&&(r=60),n+=r,a+=r;Math.max(0,Math.round((document.body.scrollWidth-n)/2)),Math.max(0,Math.round((Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)-a)/3));var l=e.createDiv("geDialog");l.className="modal fade in center",l.style.display="block",l.style.paddingRight="12px";var d=e.createDiv("geModalDialog");d.className="modal-dialog",d.appendChild(t),l.appendChild(d),null==this.bg&&(this.bg=e.createDiv("background"),this.bg.className="modal-backdrop fade in",mxClient.IS_QUIRKS&&new mxDivResizer(this.bg)),i&&document.body.appendChild(this.bg),document.body.appendChild(l),this.onDialogClose=s,this.container=l}function ImportDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body"),i=n.createDiv("modal-footer"),o=n.createHeader("h4");mxUtils.write(o,mxResources.get("import")+" XML");var s=mxUtils.button("",function(){n.hideDialog()});s.className="close",t.appendChild(s),t.appendChild(o);var r=n.createDiv("row"),l=n.createDiv("col-md-12"),d=document.createElement("textarea");d.style.width="100%",d.style.height="374px";var c=document.createElement("input");c.type="file",c.setAttribute("accept","text/xml"),c.addEventListener("change",function(e){var t=e.target.files[0];if(console.log(t),t)if("text/xml"===t.type){var n=new FileReader;n.onload=function(e){var t=e.target.result;mxUtils.write(d,t)},n.readAsText(t)}else alert("Failed to load format file");else alert("Failed to load file")},!1),l.appendChild(c),l.appendChild(d),r.appendChild(l),a.appendChild(r);var m=mxUtils.button(mxResources.get("import"),mxUtils.bind(this,function(e){var t=mxUtils.parseXml(d.value);n.editor.setGraphXml(t.documentElement),n.hideDialog()}));m.className="btn blue";var u=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});u.className="btn default",i.appendChild(m),i.appendChild(u),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function AboutDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),o=e.createHeader("h4");mxUtils.write(o,mxResources.get("about")+" Cally Square");var s=mxUtils.button("",function(){e.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=document.createElement("img");r.style.border="0px",r.setAttribute("width","176"),r.setAttribute("width","151"),r.setAttribute("src",IMAGE_PATH+"/logo.png"),a.appendChild(r),mxUtils.br(a),mxUtils.write(a,"Powered by Xenialab "+mxClient.VERSION),mxUtils.br(a);var l=document.createElement("a");l.setAttribute("href","http://www.callysquare.com/"),l.setAttribute("target","_blank"),mxUtils.write(l,"www.callysquare.com"),a.appendChild(l),mxUtils.br(a),mxUtils.br(a);var d=mxUtils.button(mxResources.get("close"),function(){e.hideDialog()});d.className="btn default",i.appendChild(d),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function SaveDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),o=e.createHeader("h4");mxUtils.write(o,mxResources.get("saveAs"));var s=mxUtils.button("",function(){e.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_copy"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("save"),function(){e.saveAs(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function NewDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),o=e.createHeader("h4");mxUtils.write(o,mxResources.get("new"));var s=mxUtils.button("",function(){e.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_new"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("new"),function(){e.new(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function DescriptionDialog(e){console.log(e.editor.data);var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),o=e.createHeader("h4");mxUtils.write(o,mxResources.get("description"));var s=mxUtils.button("",function(){e.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=e.createDiv("form-horizontal form-row-seperated"),l="description",d=e.editor.data.description||"",c=e.createDiv("form-group"),m=document.createElement("label");m.className="col-sm-4 control-label",mxUtils.write(m,mxResources.get(l)),c.appendChild(m);var u=document.createElement("input");u.setAttribute("value",d),u.className="form-control",u.setAttribute("id","_description");var p=e.createDiv("col-sm-8");p.appendChild(u),c.appendChild(p),r.appendChild(c),a.appendChild(r);var g=mxUtils.button(mxResources.get("update"),function(){e.description(u.value),e.hideDialog()});g.className="btn blue";var v=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});v.className="btn default",i.appendChild(g),i.appendChild(v),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function VariableDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),o=e.createHeader("h4");mxUtils.write(o,mxResources.get("variable"));var s=mxUtils.button("",function(){e.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=e.createDiv("form-horizontal form-row-seperated"),l="name",d="_"+l,c="variable name",m=e.createDiv("form-group"),u=document.createElement("label");u.className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var p=document.createElement("input");p.setAttribute("value",c),p.className="form-control",p.setAttribute("id",d);var g=e.createDiv("col-sm-8");g.appendChild(p),m.appendChild(g),r.appendChild(m),d="_"+(l="description"),c="variable description",m=e.createDiv("form-group last"),(u=document.createElement("label")).className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var v=document.createElement("input");v.setAttribute("value",c),v.className="form-control",v.setAttribute("id",d),(g=e.createDiv("col-sm-8")).appendChild(v),m.appendChild(g),r.appendChild(m),a.appendChild(r);var h=mxUtils.button(mxResources.get("new"),function(){e.variable(p.value,v.value),e.hideDialog()});h.className="btn blue";var b=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});b.className="btn default",i.appendChild(h),i.appendChild(b),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function OpenDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),o=e.createHeader("h4");mxUtils.write(o,mxResources.get("open"));var s=mxUtils.button("",function(){e.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=e.createDiv("row"),l=e.createDiv("col-md-4"),d=e.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=new XMLHttpRequest;m.open("GET","/api/square/projects",!1),m.setRequestHeader("Authorization","Bearer "+e.editor.data.token),m.send(null);var u=[];200===m.status&&(u=JSON.parse(m.response));for(var p=document.createElement("select"),g=0;g<u.length;g++){var v=document.createElement("option");v.text=u[g].name,v.value=u[g].id,p.appendChild(v)}p.className="form-control",d.appendChild(p),r.appendChild(l),r.appendChild(d),a.appendChild(r);var h=mxUtils.button(mxResources.get("open"),function(){console.log(p),console.log(p.value),window.open("square/project/"+p.value,"_blank"),e.hideDialog()});h.className="btn blue";var b=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});b.className="btn default",i.appendChild(h),i.appendChild(b),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function RenameDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body"),i=n.createDiv("modal-footer"),o=n.createHeader("h4");mxUtils.write(o,mxResources.get("rename"));var s=mxUtils.button("",function(){n.hideDialog()});s.className="close",t.appendChild(s),t.appendChild(o);var r=n.createDiv("row"),l=n.createDiv("col-md-4"),d=n.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=n.editor.filename,u=document.createElement("input");u.setAttribute("value",m),u.className="form-control",d.appendChild(u),r.appendChild(l),r.appendChild(d),a.appendChild(r);var p=mxUtils.button(mxResources.get("save"),function(){var t=new XMLHttpRequest;t.open("PUT",SAVE_URL+n.editor.data.id,!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.setRequestHeader("Authorization","Bearer "+n.editor.data.token),t.send("name="+u.value),t.onload=function(e){200===t.status?(n.editor.setStatus("Project successfully renamed"),n.editor.filename=u.value):(console.log(t.response),n.editor.setStatus(JSON.parse(t.response).errors[0].message))},t.onerror=function(e){mxUtils.alert(t.statusText)},n.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function EditFileDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body"),i=t.createDiv("modal-footer"),o=t.createHeader("h4");mxUtils.write(o,mxResources.get("edit"));var s=mxUtils.button("",function(){t.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=t.createDiv("row"),l=t.createDiv("col-md-12"),d=document.createElement("textarea");if(d.style.width="100%",d.style.height="374px",d.value=mxUtils.getPrettyXml(t.editor.getGraphXml()),fileSupport){d.addEventListener("dragover",function(e){e.stopPropagation(),e.preventDefault()},!1),d.addEventListener("drop",function(e){if(e.stopPropagation(),e.preventDefault(),0<e.dataTransfer.files.length){var t=e.dataTransfer.files[0],n=new FileReader;n.onload=function(e){d.value=e.target.result},n.readAsText(t)}},!1)}l.appendChild(d),r.appendChild(l),a.appendChild(r);var c=mxUtils.button(mxResources.get("save"),function(){var e=mxUtils.parseXml(d.value);t.editor.setGraphXml(e.documentElement),t.hideDialog()});c.className="btn blue";var m=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});m.className="btn default",i.appendChild(c),i.appendChild(m),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function ExportDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body form"),i=t.createDiv("modal-footer"),o=t.createHeader("h4");mxUtils.write(o,mxResources.get("export")+" XML");var s=mxUtils.button("",function(){t.hideDialog()});s.className="close",n.appendChild(s),n.appendChild(o);var r=t.createDiv("form-horizontal form-row-seperated"),l=t.createDiv("form-group last"),d=document.createElement("label");d.className="col-sm-4 control-label",mxUtils.write(d,mxResources.get("filename"));var c=document.createElement("input");c.setAttribute("value",t.editor.getOrCreateFilename()),c.className="form-control";var m=t.createDiv("col-sm-8");m.appendChild(c),l.appendChild(d),l.appendChild(m),r.appendChild(l),a.appendChild(r);var u=mxUtils.button(mxResources.get("export"),mxUtils.bind(this,function(e){t.save(!1);encodeURIComponent(mxUtils.getXml(t.editor.getGraphXml()));new mxXmlRequest(SAVE_URL+t.editor.data.id+"/download","filename="+c.value,"GET").simulate(document,"_blank"),t.hideDialog()}));u.className="btn blue";var p=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});p.className="btn default",i.appendChild(u),i.appendChild(p),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function GeneralDialog(i,o){console.log("general");var s=i.editor.graph,e=i.createDiv("md-dialog"),t=i.createDiv("md-toolbar"),n=i.createDiv("md-dialog-content"),a=i.createDiv("md-dialog-actions"),r=i.createHeader("h4");mxUtils.write(r,mxResources.get("edit")+" "+mxResources.get(o.value.nodeName));var l=mxUtils.button("",function(){i.hideDialog()});l.className="close",t.appendChild(l),t.appendChild(r);for(var d=o.value.attributes.length,c=i.createDiv("form-horizontal form-row-seperated"),m=0;m<d;m++){var u,p=o.value.attributes[m].name,g="_"+p,v=o.value.attributes[m].value,h=i.createDiv(m==d-1?"form-group last":"form-group"),b=document.createElement("label");switch(b.className="col-sm-4 control-label",mxUtils.write(b,mxResources.get(p)),h.appendChild(b),p){case"sip_id":u=createDropdownWithOptgroupFromApi("/api/users/all",v,"fullname","id",i,"role");break;case"queue_id":u=createDropdownFromApi("/api/voice/queues",v,"name","name",i);break;case"trunk_name":u=createDropdownFromApi("/api/trunks",v,"name","name",i);break;case"variable_id":u=createDropdownFromApi("/api/variables",v,"name","id",i);break;case"account_id":u="sendMail"==o.value.nodeName?createDropdownFromApi("/api/mail/servers/out",v,"username","id",i):createDropdownFromApi("/api/sms/accounts",v,"name","id",i);break;case"template_id":u=createDropdownFromApi("/api/templates",v,"name","id",i);break;case"context":u=createDropdownFromApi("/api/voice/contexts",v,"name","name",i);break;case"mailbox":u=createDropdownFromApi("/api/voice/voicemails",v,"mailbox","id",i,["mailbox","context"],"%mailbox%@%context%");break;case"model":u=createDropdownFromArray(ISPEECHASRMODEL,v);break;case"ispeech_asr_language":u=createDropdownFromArray(ISPEECHASRLANG,v);break;case"beep":u=createDropdownFromArray(ISPEECHBEEP,v);break;case"hiddendigitspos":u=createDropdownFromArray(SECRETDIGITSPOS,v);break;case"ispeech_tts_language":u=createDropdownFromArray(ISPEECHLANG,v);break;case"google_tts_language":u=createDropdownFromArray(GOOGLETTSLANG,v);break;case"intKey":u=createDropdownFromArray(ASRINTKEYS,v);break;case"recordingFormat":u=createDropdownFromArray(RECORDINGFORMAT,v);break;case"answer":u=createDropdownFromArray(BOOLSELECT,v);break;case"list_id":u=createDropdownFromTigerDialList(v);break;case"interval_id":u=createGroupedDropdownFromApi("/api/intervals",v,"name","id",i,"SubIntervals");break;case"project_id":u=createDropdownFromApi("/api/square/projects",v,"name","id",i,null,null,i.editor.getOrCreateFilename());break;case"odbc_id":u=createDropdownFromApi("/api/square/odbc",v,"name","id",i);break;case"file_id":u=createDropdownFromApi("/api/sounds",v,"display_name","id",i);break;case"timeout":case"digit":case"mindigit":case"maxdigit":case"response":case"retry":case"speed":(u=document.createElement("input")).setAttribute("type","number"),u.setAttribute("min",0),u.setAttribute("max",1e3),u.setAttribute("value",v),u.className="form-control";break;case"text":case"key":case"query":case"condition":case"command":case"body":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control";break;case"sms_text":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control",u.setAttribute("maxlength","160");break;default:(u=document.createElement("input")).setAttribute("value",v),u.className="form-control"}u.setAttribute("id",g);var f=i.createDiv("col-sm-8");if(f.appendChild(u),mxResources.get("help_"+p)){var A=i.createDiv("p");A.className="help-block",mxUtils.write(A,mxResources.get("help_"+p)),f.appendChild(A)}h.appendChild(f),c.appendChild(h)}n.appendChild(c);var E=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(e){for(var t=0;t<o.value.attributes.length;t++){var n="_"+o.value.attributes[t].name,a=o.value.attributes[t].name;o.setAttribute(a,document.getElementById(n).value)}s.refresh(o),i.hideDialog()}));E.className="btn blue";var y=mxUtils.button(mxResources.get("cancel"),function(){i.hideDialog()});y.className="btn default",a.appendChild(E),a.appendChild(y),e.appendChild(t),e.appendChild(n),e.appendChild(a),this.container=e}Editor=function(){mxEventSource.call(this),this.init(),this.initStencilRegistry(),this.graph=new Graph,this.outline=new mxOutline(this.graph),this.outline.updateOnPan=!0,this.undoManager=this.createUndoManager(),this.status="",this.filename=null,this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[counter])+".xml"},this.getFilename=function(){return this.filename},this.setStatus=function(e){this.status=e,this.fireEvent(new mxEventObject("statusChanged"))},this.getStatus=function(){return this.status},this.modified=!1,this.graphChangeListener=function(){this.modified=!0},this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)})),window.onbeforeunload=mxUtils.bind(this,function(){if(this.modified)return mxResources.get("allChangesLost")}),this.graph.resetViewOnRootChange=!1,this.graph.scrollbars=!0,this.graph.background=null},mxUtils.extend(Editor,mxEventSource),Editor.prototype.gridImage=IMAGE_PATH+"/grid.gif",Editor.prototype.transparentImage=IMAGE_PATH+"/transparent.gif",Editor.prototype.setGraphXml=function(e){var t=new mxCodec(e.ownerDocument);if("mxGraphModel"==e.nodeName){this.graph.view.scale=Number(e.getAttribute("scale")||1),this.graph.gridEnabled="0"!=e.getAttribute("grid"),this.graph.graphHandler.guidesEnabled="0"!=e.getAttribute("guides"),this.graph.setTooltips("0"!=e.getAttribute("tooltips")),this.graph.setConnectable("0"!=e.getAttribute("connect")),this.graph.foldingEnabled="0"!=e.getAttribute("fold"),this.graph.scrollbars="0"!=e.getAttribute("scrollbars"),this.graph.scrollbars||(this.graph.container.scrollLeft=0,this.graph.container.scrollTop=0,this.graph.view.translate.x=Number(e.getAttribute("dx")||0),this.graph.view.translate.y=Number(e.getAttribute("dy")||0)),this.graph.pageVisible="1"==e.getAttribute("page"),this.graph.pageBreaksVisible=this.graph.pageVisible,this.graph.preferPageSize=this.graph.pageBreaksVisible;var n=e.getAttribute("pageScale");this.graph.pageScale=null!=n?n:1.5;var a=e.getAttribute("pageWidth"),i=e.getAttribute("pageHeight");null!=a&&null!=i&&(this.graph.pageFormat=new mxRectangle(0,0,parseFloat(a),parseFloat(i)),this.outline.outline.pageFormat=this.graph.pageFormat);var o=e.getAttribute("background");null!=o&&0<o.length&&(this.graph.background=o),t.decode(e,this.graph.getModel()),this.updateGraphComponents()}},Editor.prototype.getGraphXml=function(){var e=new mxCodec(mxUtils.createXmlDocument()).encode(this.graph.getModel());return 0==this.graph.view.translate.x&&0==this.graph.view.translate.y||(e.setAttribute("dx",Math.round(100*this.graph.view.translate.x)/100),e.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100)),1!=this.graph.view.scale&&e.setAttribute("scale",Math.round(1e3*this.graph.view.scale)/1e3),e.setAttribute("grid",this.graph.isGridEnabled()?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0"),e.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0"),e.setAttribute("fold",this.graph.foldingEnabled?"1":"0"),e.setAttribute("page",this.graph.pageVisible?"1":"0"),e.setAttribute("pageScale",this.graph.pageScale),e.setAttribute("pageWidth",this.graph.pageFormat.width),e.setAttribute("pageHeight",this.graph.pageFormat.height),this.graph.scrollbars||e.setAttribute("scrollbars","0"),null!=this.graph.background&&e.setAttribute("background",this.graph.background),e},Editor.prototype.updateGraphComponents=function(){var e=this.graph,t=this.outline;if(null!=e.container&&null!=t.outline.container){null!=e.background?"none"==e.background?e.container.style.backgroundColor="transparent":(null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=e.background,e.view.backgroundPageShape.reconfigure()),e.container.style.backgroundColor=e.background):e.container.style.backgroundColor="",e.pageVisible?(e.container.style.backgroundColor="#ebebeb",e.container.style.borderStyle="solid",e.container.style.borderColor="#e5e5e5",e.container.style.borderTopWidth="1px",e.container.style.borderLeftWidth="1px",e.container.style.borderRightWidth="0px",e.container.style.borderBottomWidth="0px"):e.container.style.border="",t.outline.container.style.backgroundColor=e.container.style.backgroundColor,t.outline.pageVisible==e.pageVisible&&t.outline.pageScale==e.pageScale||(t.outline.pageScale=e.pageScale,t.outline.pageVisible=e.pageVisible,t.outline.view.validate()),e.scrollbars&&"hidden"==e.container.style.overflow&&!touchStyle?e.container.style.overflow="auto":e.scrollbars&&!touchStyle||(e.container.style.overflow="hidden");var n=mxClient.IS_IE&&9<=document.documentMode?"url("+this.transparentImage+")":"none";e.container.style.backgroundImage=!e.pageVisible&&e.isGridEnabled()?"url("+this.gridImage+")":n,null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+this.gridImage+")":"none")}},Editor.prototype.init=function(){mxClient.IS_IE6&&mxClient.link("stylesheet",CSS_PATH+"/grapheditor-ie6.css"),mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE),mxConstants.DEFAULT_HOTSPOT=.3;var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var n=e.apply(this,arguments);return n.intersects=mxUtils.bind(this,function(e,t){return!!this.isConnecting()||mxCellMarker.prototype.intersects.apply(n,arguments)}),n},mxConstants.SHADOWCOLOR="#d0d0d0",mxConstants.HANDLE_FILLCOLOR="#99ccff",mxConstants.HANDLE_STROKECOLOR="#0088cf",mxConstants.VERTEX_SELECTION_COLOR="#00a8ff",mxConstants.OUTLINE_COLOR="#00a8ff",mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff",mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff",mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff",mxConstants.EDGE_SELECTION_COLOR="#00a8ff",mxConstants.DEFAULT_VALID_COLOR="#00a8ff",mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff",mxConstants.GUIDE_COLOR="#0088cf",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,mxRubberband.prototype.defaultOpacity=30,mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,this.graph.background||"white","#cacaca")},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.getGraphBounds(),t=0<e.width?e.x/this.scale-this.translate.x:0,n=0<e.height?e.y/this.scale-this.translate.y:0,a=e.width/this.scale,i=e.height/this.scale,o=this.graph.pageFormat,s=this.graph.pageScale,r=o.width*s,l=o.height*s,d=Math.floor(Math.min(0,t)/r),c=Math.floor(Math.min(0,n)/l),m=Math.ceil(Math.max(1,t+a)/r)-d,u=Math.ceil(Math.max(1,n+i)/l)-c;return new mxRectangle(this.scale*(this.translate.x+d*r),this.scale*(this.translate.y+c*l),this.scale*m*r,this.scale*u*l)};var n=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(e,t){n.apply(this,arguments),this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=e+"px",this.view.backgroundPageShape.node.style.marginTop=t+"px")};var a=this;mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var t=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(t,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);if(this.graph.pageVisible){t=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(t),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(this.graph.container),this.graph.container.firstChild.style.position="absolute",this.graph.container.insertBefore(this.backgroundPageShape.node,this.graph.container.firstChild),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",this.backgroundPageShape.node.style.backgroundPosition="-1px -1px",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=t,this.backgroundPageShape.redraw()),this.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+a.gridImage+")":"none"}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraph.prototype.updatePageBreaks=function(e,t,n){var a=this.view.scale,i=this.view.translate,o=this.pageFormat,s=a*this.pageScale,r=this.view.getBackgroundPageBounds();t=r.width,n=r.height;var l=new mxRectangle(a*i.x,a*i.y,o.width*s,o.height*s),d=(e=e&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(t/l.width)-1:0,c=e?Math.ceil(n/l.height)-1:0,m=r.x+t,u=r.y+n;if(null==this.horizontalPageBreaks&&0<d&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(var p=0;p<=d;p++){var g=[new mxPoint(r.x+(p+1)*l.width,r.y),new mxPoint(r.x+(p+1)*l.width,u)];if(null!=this.horizontalPageBreaks[p])this.horizontalPageBreaks[p].scale=1,this.horizontalPageBreaks[p].points=g,this.horizontalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,this.scale)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.horizontalPageBreaks[p]=v}for(p=d;p<this.horizontalPageBreaks.length;p++)this.horizontalPageBreaks[p].destroy();this.horizontalPageBreaks.splice(d,this.horizontalPageBreaks.length-d)}if(null==this.verticalPageBreaks&&0<c&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(p=0;p<=c;p++){var v;g=[new mxPoint(r.x,r.y+(p+1)*l.height),new mxPoint(m,r.y+(p+1)*l.height)];if(null!=this.verticalPageBreaks[p])this.verticalPageBreaks[p].scale=1,this.verticalPageBreaks[p].points=g,this.verticalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,a)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.verticalPageBreaks[p]=v}for(p=c;p<this.verticalPageBreaks.length;p++)this.verticalPageBreaks[p].destroy();this.verticalPageBreaks.splice(c,this.verticalPageBreaks.length-c)}},mxEdgeHandler.prototype.snapToTerminals=!0,mxGraphHandler.prototype.guidesEnabled=!0;var o=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,t,n){for(var a=0;a<t.length;a++)if(this.graph.getModel().isVertex(t[a])){var i=this.graph.getCellGeometry(t[a]);if(null!=i&&i.relative)return!1}return o.apply(this,arguments)},mxGuide.prototype.isEnabledForEvent=function(e){return!mxEvent.isAltDown(e)};var r=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(e,t,n,a,i,o){var s=r.apply(this,arguments);return null==o||o||mxEvent.addListener(s,"mousedown",function(e){mxEvent.consume(e)}),s};var s=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(e){var t=this.graph.getModel(),n=t.getParent(this.graph.getSelectionCell()),a=s.apply(this,arguments),i=t.getParent(a);if(null==n||n!=a&&n!=i)for(;!this.graph.isCellSelected(a)&&!this.graph.isCellSelected(i)&&t.isVertex(i)&&!this.graph.isValidRoot(i);)a=i,i=this.graph.getModel().getParent(a);return a};var l=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(e){var t=l.apply(this,arguments),n=this.graph.getModel(),a=n.getParent(this.graph.getSelectionCell()),i=n.getParent(e);return(null==a||a!=e&&a!=i)&&(this.graph.isCellSelected(e)||!n.isVertex(i)||this.graph.isValidRoot(i)||(t=!0)),t},mxGraphHandler.prototype.selectDelayed=function(e){var t=e.getCell();null==t&&(t=this.cell);for(var n=this.graph.getModel(),a=n.getParent(t);this.graph.isCellSelected(t)&&n.isVertex(a)&&!this.graph.isValidRoot(a);)t=a,a=n.getParent(t);this.graph.selectCellForEvent(t,e.getEvent())},mxPanningHandler.prototype.getCellForPopupEvent=function(e){for(var t=e.getCell(),n=this.graph.getModel(),a=n.getParent(t);n.isVertex(a)&&!this.graph.isValidRoot(a);)this.graph.isCellSelected(a)&&(t=a),a=n.getParent(a);return t}},Editor.prototype.createUndoManager=function(){var o=this.graph,n=new mxUndoManager,e=function(e,t){n.undoableEditHappened(t.getProperty("edit"))};o.getModel().addListener(mxEvent.UNDO,e),o.getView().addListener(mxEvent.UNDO,e);var t=function(e,t){for(var n=o.getSelectionCellsForChanges(t.getProperty("edit").changes),a=[],i=1;i<n.length;i++)null!=o.view.getState(n[i])&&a.push(n[i]);o.setSelectionCells(a)};return n.addListener(mxEvent.UNDO,t),n.addListener(mxEvent.REDO,t),n},Editor.prototype.initStencilRegistry=function(){mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/general.xml")},mxStencilRegistry.libraries={},mxStencilRegistry.packages=[],mxStencilRegistry.getStencil=function(e){var t=mxStencilRegistry.stencils[e];if(null==t){var n=mxStencilRegistry.getBasenameForStencil(e);if(null!=n){var a=mxStencilRegistry.libraries[n];if(null!=a){if(null==mxStencilRegistry.packages[n]){mxStencilRegistry.packages[n]=1;for(var i=0;i<a.length;i++){var o=a[i];if(".xml"==o.toLowerCase().substring(o.length-4,o.length))mxStencilRegistry.loadStencilSet(o,null);else if(".js"==o.toLowerCase().substring(o.length-3,o.length)){var s=mxUtils.load(o);null!=s&&eval.call(window,s.getText())}}}}else mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+n+".xml",null);t=mxStencilRegistry.stencils[e]}}return t},mxStencilRegistry.getBasenameForStencil=function(e){var t=e.split("."),n=null;if(0<t.length&&"mxgraph"==t[0]){n=t[1];for(var a=2;a<t.length-1;a++)n+="/"+t[a]}return n},mxStencilRegistry.loadStencilSet=function(e,t,n){n=null!=n&&n;var a=mxStencilRegistry.packages[e];if(n||null==a){var i=!1;null==a&&(a=mxUtils.load(e).getXml(),mxStencilRegistry.packages[e]=a,i=!0),mxStencilRegistry.parseStencilSet(a,t,i)}},mxStencilRegistry.parseStencilSet=function(e,t,n){n=null==n||n;var a=e.documentElement,i=a.firstChild,o="",s=a.getAttribute("name");for(null!=s&&(o=s+".");null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=(s=i.getAttribute("name"))){o=o.toLowerCase();var r=s.replace(/ /g,"_");if(n&&mxStencilRegistry.addStencil(o+r.toLowerCase(),new mxStencil(i)),null!=t){var l=i.getAttribute("w"),d=i.getAttribute("h");t(o,r,s,l=null==l?80:parseInt(l,10),d=null==d?80:parseInt(d,10))}}i=i.nextSibling}},OpenFile=function(e){this.producer=null,this.consumer=null,this.done=e},OpenFile.prototype.setConsumer=function(e){this.consumer=e,this.execute()},OpenFile.prototype.setData=function(e,t){this.data=e,this.filename=t,this.execute()},OpenFile.prototype.error=function(e){this.cancel(),mxUtils.alert(e)},OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.data&&(this.consumer(this.data,this.filename),this.cancel())},OpenFile.prototype.cancel=function(){null!=this.done&&this.done()},Sidebar.prototype.init=function(){var e=STENCIL_PATH;this.addSearchPalette(!0),this.addImagePalette("entry",mxResources.get("entry"),e+"/entry/","_128x128.png",["start","finally","end"],[mxResources.get("start"),mxResources.get("finally"),mxResources.get("end")]),this.addImagePalette("call_management",mxResources.get("call_management"),e+"/call_management/","_128x128.png",["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[mxResources.get("answer"),mxResources.get("hangup"),mxResources.get("dial"),mxResources.get("ext_dial"),mxResources.get("queue"),mxResources.get("voicemail"),mxResources.get("callback")]),this.addImagePalette("agent_management",mxResources.get("agent_management"),e+"/agent_management/","_128x128.png",["login","pause","unpause","logout"],[mxResources.get("login"),mxResources.get("pause"),mxResources.get("unpause"),mxResources.get("logout")]),this.addImagePalette("variable",mxResources.get("variable"),e+"/variable/","_128x128.png",["set","math"],[mxResources.get("set"),mxResources.get("math")]),this.addImagePalette("playback",mxResources.get("playback"),e+"/playback/","_128x128.png",["playback","menu","saydigits","saynumber","sayphonetic","getdigits","getsecretdigits"],[mxResources.get("playback"),mxResources.get("menu"),mxResources.get("saydigits"),mxResources.get("saynumber"),mxResources.get("sayphonetic"),mxResources.get("getdigits"),mxResources.get("getsecretdigits")]),this.addImagePalette("recording",mxResources.get("recording"),e+"/recording/","_128x128.png",["record"],[mxResources.get("record")]),this.addImagePalette("tts","TTS",e+"/tts/","_128x128.png",["tts","ispeechtts","awspolly","lumenvoxtts"],["GoogleTTS","ISpeechTTS","AWSPolly","LumenvoxTTS"]),this.addImagePalette("asr","ASR",e+"/asr/","_128x128.png",["googleasr","ispeechasr","lumenvoxasr","tildeasr"],["GoogleASR","ISpeechASR","LumenvoxASR","TildeASR"]),this.addImagePalette("integrationServer",mxResources.get("integrationServer"),e+"/integration_server/","_128x128.png",["database","sendMail","sendSMS"],[mxResources.get("database"),mxResources.get("sendMail"),mxResources.get("sendSMS")]),this.addImagePalette("callflow",mxResources.get("callflow"),e+"/callflow/","_128x128.png",["gotoc","gotoif","gotoiftime","vswitch"],[mxResources.get("gotoc"),mxResources.get("gotoif"),mxResources.get("gotoiftime"),mxResources.get("vswitch")]),this.addImagePalette("stats",mxResources.get("stats"),e+"/stats/","_128x128.png",["goal"],[mxResources.get("goal")]),this.addImagePalette("general",mxResources.get("general"),e+"/general/","_128x128.png",["noop","system","agi","subproject","custom_app"],[mxResources.get("noop"),mxResources.get("system"),mxResources.get("agi"),mxResources.get("subproject"),mxResources.get("custom_app")])},Sidebar.prototype.collapsedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNUQyRTJFNjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNUQyRTJFNzZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MEUxNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MEUyNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhSMj6lrwAjcC1GyahV+dcZJgeIIFgA7":IMAGE_PATH+"/collapsed.gif",Sidebar.prototype.expandedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxREY3NzBERjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxREY3NzBFMDZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MERENkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MERFNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhGMj6nL3QAjVHIu6azbvPtWAAA7":IMAGE_PATH+"/expanded.gif",Sidebar.prototype.tooltipImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAbCAMAAAB7jU7LAAAACVBMVEX///+ZmZn///9Y2COLAAAAA3RSTlP//wDXyg1BAAAAOElEQVR42mXQMQ4AMAgDsWv//+iutcJmIQSk+9dJpVKpVCqVSqVSqZTdncWzF8/NeP7FkxWenPEDOnUBiL3jWx0AAAAASUVORK5CYII=":IMAGE_PATH+"/tooltip.png",Sidebar.prototype.searchImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAEaSURBVHjabNGxS5VxFIfxz71XaWuQUJCG/gCHhgTD9VpEETg4aMOlQRp0EoezObgcd220KQiXmpretTAHQRBdojlQEJyukPdt+b1ywfvAGc7wnHP4nlZd1yKijQW8xzNc4Su+ZOYfQ3T6/f4YNvEJYzjELXp4VVXVz263+7cR2niBxAFeZ2YPi3iHR/gYERPDwhpOsd6sz8x/mfkNG3iOlWFhFj8y89J9KvzGXER0GuEaD42mgwHqUtoljbcRsTBCeINpfM/MgZLKPpaxFxGbOCqDXmILN7hoJrTKH+axhxmcYRxP0MIDnOBDZv5q1XUNIuJxifJp+UNV7t7BFM6xeic0RMQ4Bpl5W/ol7GISx/eEUUTECrbx+f8A8xhiZht9zsgAAAAASUVORK5CYII=":IMAGE_PATH+"/search.png",Sidebar.prototype.enableTooltips=!0,Sidebar.prototype.tooltipBorder=16,Sidebar.prototype.tooltipDelay=300,Sidebar.prototype.dropTargetDelay=200,Sidebar.prototype.thumbWidth=36,Sidebar.prototype.thumbHeight=36,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2,Sidebar.prototype.sidebarTitleSize=9,Sidebar.prototype.sidebarTitles=!1,Sidebar.prototype.tooltipTitles=!0,Sidebar.prototype.maxTooltipWidth=400,Sidebar.prototype.maxTooltipHeight=400,Sidebar.prototype.addStencilsToIndex=!0,Sidebar.prototype.defaultImageWidth=80,Sidebar.prototype.defaultImageHeight=80,Sidebar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Sidebar.prototype.showTooltip=function(c,m,u,p,g,v){if(this.enableTooltips&&this.showTooltips&&this.currentElt!=c){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null);var e=mxUtils.bind(this,function(){null==this.tooltip&&(this.tooltip=document.createElement("div"),this.tooltip.className="geSidebarTooltip",this.tooltip.style.zIndex=mxPopupMenu.prototype.zIndex-1,document.body.appendChild(this.tooltip),this.graph2=new Graph(this.tooltip,null,null,this.editorUi.editor.graph.getStylesheet()),this.graph2.resetViewOnRootChange=!1,this.graph2.foldingEnabled=!1,this.graph2.gridEnabled=!1,this.graph2.autoScroll=!1,this.graph2.setTooltips(!1),this.graph2.setConnectable(!1),this.graph2.setEnabled(!1),mxClient.IS_SVG||(this.graph2.view.canvas.style.position="relative"),this.tooltipImage=mxUtils.createImage(this.tooltipImage),this.tooltipImage.className="geSidebarTooltipImage",this.tooltipImage.style.zIndex=mxPopupMenu.prototype.zIndex-1,this.tooltipImage.style.position="absolute",this.tooltipImage.style.width="14px",this.tooltipImage.style.height="27px",document.body.appendChild(this.tooltipImage)),this.graph2.model.clear(),this.graph2.view.setTranslate(this.tooltipBorder,this.tooltipBorder),u>this.maxTooltipWidth||p>this.maxTooltipHeight?this.graph2.view.scale=Math.round(100*Math.min(this.maxTooltipWidth/u,this.maxTooltipHeight/p))/100:this.graph2.view.scale=1,this.tooltip.style.display="block",this.graph2.labelsVisible=null==v||v,this.graph2.addCells(m);var e=this.graph2.getGraphBounds(),t=e.width+2*this.tooltipBorder+4,n=e.height+2*this.tooltipBorder;if(mxClient.IS_QUIRKS?(n+=4,this.tooltip.style.overflow="hidden"):this.tooltip.style.overflow="visible",this.tooltipImage.style.visibility="visible",this.tooltip.style.width=t+"px",this.tooltipTitles&&null!=g&&0<g.length){null==this.tooltipTitle?(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.style.borderTop="1px solid gray",this.tooltipTitle.style.textAlign="center",this.tooltipTitle.style.width="100%",this.tooltipTitle.style.overflow="hidden",mxClient.IS_SVG||(this.tooltipTitle.style.position="absolute"),this.tooltipTitle.style.paddingTop="6px",this.tooltip.appendChild(this.tooltipTitle)):this.tooltipTitle.innerHTML="",this.tooltipTitle.style.display="",mxUtils.write(this.tooltipTitle,g);var a=this.tooltipTitle.offsetHeight+10;n+=a,mxClient.IS_SVG?this.tooltipTitle.style.marginTop=2-a+"px":(n-=6,this.tooltipTitle.style.top=n-a+"px")}else null!=this.tooltipTitle&&null!=this.tooltipTitle.parentNode&&(this.tooltipTitle.style.display="none");this.tooltip.style.height=n+"px";var i=-Math.round(e.x-this.tooltipBorder),o=-Math.round(e.y-this.tooltipBorder),s=document.body,r=document.documentElement,l=(s.clientHeight||r.clientHeight,document.getElementById("vertical-navigation").offsetWidth+this.container.clientWidth),d=Math.max(0,this.getOffset(c).top-this.container.scrollTop-n/2+16);mxClient.IS_SVG?0!=i||0!=o?this.graph2.view.canvas.setAttribute("transform","translate("+i+","+o+")"):this.graph2.view.canvas.removeAttribute("transform"):(this.graph2.view.drawPane.style.left=i+"px",this.graph2.view.drawPane.style.top=o+"px"),this.tooltip.style.position="absolute",this.tooltip.style.left=l+"px",this.tooltip.style.top=d+"px",this.tooltipImage.style.left=l-13+"px",this.tooltipImage.style.top=d+n/2-13+"px"});null!=this.tooltip&&"none"!=this.tooltip.style.display?e():this.thread=window.setTimeout(e,this.tooltipDelay),this.currentElt=c}},Sidebar.prototype.hideTooltip=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null),null!=this.tooltip&&(this.tooltip.style.display="none",this.tooltipImage.style.visibility="hidden",this.currentElt=null)},Sidebar.prototype.addEntry=function(e,t){if(null!=this.taglist&&null!=e&&0<e.length)for(var n=e.toLowerCase().replace(/[\/\,\(\)]/g," ").split(" "),a=0;a<n.length;a++)if(n[a]=n[a].replace(/\.*\d*$/,""),1<n[a].length){var i=this.taglist[n[a]];null==i&&(i={entries:[],dict:new mxDictionary},this.taglist[n[a]]=i),null==i.dict.get(t)&&(i.dict.put(t,t),i.entries.push(t))}return t},Sidebar.prototype.searchEntries=function(e,t,n,a,i){if(null!=this.taglist&&null!=e){for(var o=e.toLowerCase().split(" "),s=new mxDictionary,r=(n+1)*t,l=[],d=0,c=0;c<o.length;c++)if(0<o[c].length){var m=this.taglist[o[c]],u=new mxDictionary;if(null!=m){var p=m.entries;l=[];for(var g=0;g<p.length;g++){m=p[g];if(0==d==(null==s.get(m))&&(u.put(m,m),l.push(m),c==o.length-1&&l.length==r))return void a(l.slice(n*t,r),r,!0)}}else l=[];s=u,d++}var v=l.length;a(l.slice(n*t,(n+1)*t),v,!1)}else a([])},Sidebar.prototype.filterTags=function(e){if(null!=e){for(var t=e.split(" "),n=[],a={},i=0;i<t.length;i++)null==a[t[i]]&&(a[t[i]]="1",n.push(t[i]));return n.join(" ")}return null},Sidebar.prototype.cloneCell=function(e,t){var n=e.clone();return null!=t&&(n.value=t),n},Sidebar.prototype.addSearchPalette=function(e){var t=document.createElement("div");t.style.visibility="hidden",this.container.appendChild(t);var r=document.createElement("div");r.className="geSidebar",r.style.boxSizing="border-box",r.style.overflow="hidden",r.style.width="100%",r.style.padding="8px",r.style.paddingTop="14px",r.style.paddingBottom="0px",e||(r.style.display="none");var n=document.createElement("div");n.style.whiteSpace="nowrap",n.style.textOverflow="clip",n.style.paddingBottom="8px",n.style.cursor="default";var a=document.createElement("input");a.setAttribute("placeholder",mxResources.get("searchShapes")),a.setAttribute("type","text"),a.style.fontSize="12px",a.style.overflow="hidden",a.style.boxSizing="border-box",a.style.border="solid 1px #d5d5d5",a.style.borderRadius="4px",a.style.width="100%",a.style.outline="none",a.style.padding="6px",n.appendChild(a);var i,o=document.createElement("img");o.setAttribute("src",Sidebar.prototype.searchImage),o.setAttribute("title",mxResources.get("search")),o.style.position="relative",o.style.left="-18px",mxClient.IS_QUIRKS?(a.style.height="28px",o.style.top="-4px"):o.style.top="2px",o.style.background="url('"+this.editorUi.editor.transparentImage+"')",n.appendChild(o),r.appendChild(n);var l=document.createElement("center"),d=mxUtils.button(mxResources.get("moreResults"),function(){i()});d.style.display="none",d.style.lineHeight="normal",d.style.marginTop="4px",d.style.marginBottom="8px",l.style.paddingTop="4px",l.style.paddingBottom="8px",l.appendChild(d),r.appendChild(l);var c="",m=!1,u=!1,p=0,g=new Object,v=12,h=mxUtils.bind(this,function(){m=!1,this.currentSearch=null;for(var e=r.firstChild;null!=e;){var t=e.nextSibling;e!=n&&e!=l&&e.parentNode.removeChild(e),e=t}});i=mxUtils.bind(this,function(){if(v=4*Math.max(1,Math.floor(this.container.clientWidth/(this.thumbWidth+10))),this.hideTooltip(),""!=a.value){if(null!=l.parentNode&&(c!=a.value&&(h(),c=a.value,g=new Object,u=!1,p=0),!m&&!u)){d.setAttribute("disabled","true"),d.style.display="",d.style.cursor="wait",d.innerHTML=mxResources.get("loading")+"...",m=!0;var s=new Object;this.currentSearch=s,this.searchEntries(c,v,p,mxUtils.bind(this,function(e,t,n){if(this.currentSearch==s){e=null!=e?e:[],m=!1,p++,l.parentNode.removeChild(l);for(var a=0;a<e.length;a++){var i=e[a]();null==g[i.innerHTML]&&(g[i.innerHTML]="1",r.appendChild(e[a]()))}if(n?(d.removeAttribute("disabled"),d.innerHTML=mxResources.get("moreResults")):(d.innerHTML=mxResources.get("reset"),d.style.display="none",u=!0),d.style.cursor="",0==e.length&&1==p){var o=document.createElement("div");o.className="geTitle",o.style.backgroundColor="transparent",o.style.borderColor="transparent",o.style.color="gray",o.style.padding="0px",o.style.margin="0px 8px 0px 8px",o.style.paddingTop="6px",o.style.textAlign="center",o.style.cursor="default",mxUtils.write(o,mxResources.get("noResultsFor",[c])),r.appendChild(o)}r.appendChild(l)}}),mxUtils.bind(this,function(){d.style.cursor=""}))}}else h(),a.value="",c="",g=new Object,d.style.display="none",u=!1,a.focus()}),mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(e){13==e.keyCode&&i()})),mxEvent.addListener(a,"focus",function(){a.style.paddingRight="",o.style.display="none"}),mxEvent.addListener(a,"blur",function(){a.style.paddingRight="20px",o.style.display=""}),a.style.paddingRight="20px",mxEvent.addListener(a,"keyup",mxUtils.bind(this,function(e){""==a.value?(u=!0,d.style.display="none"):a.value!=c?(d.style.display="none",u=!1):m||(d.style.display=u?"none":"")})),mxEvent.addListener(a,"mousedown",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0}),mxEvent.addListener(a,"selectstart",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0});var s=document.createElement("div");s.appendChild(r),this.container.appendChild(s),this.palettes.search=[t,s]},Sidebar.prototype.createTitle=function(e){var t=document.createElement("a");return t.setAttribute("href","javascript:void(0);"),t.setAttribute("title",mxResources.get("sidebarTooltip")),t.className="geTitle",mxUtils.write(t,e),t},Sidebar.prototype.createThumb=function(e,t,n,a,i,o,s,r,l){this.graph.labelsVisible=null==o||o;var d=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,this.graph.view.scaleAndTranslate(1,0,0),this.graph.addCells(e);var c=this.graph.getGraphBounds(),m=Math.floor(100*Math.min((t-2*this.thumbBorder)/c.width,(n-2*this.thumbBorder)/c.height))/100;this.graph.view.scaleAndTranslate(m,Math.floor((t-c.width*m)/2/m-c.x),Math.floor((n-c.height*m)/2/m-c.y));var u=null;if(this.graph.dialect!=mxConstants.DIALECT_SVG||mxClient.NO_FO?(u=this.graph.container.cloneNode(!1)).innerHTML=this.graph.container.innerHTML:u=this.graph.view.getCanvas().ownerSVGElement.cloneNode(!0),this.graph.getModel().clear(),mxClient.NO_FO=d,mxClient.IS_IE6&&(a.style.backgroundImage="url("+this.editorUi.editor.transparentImage+")"),u.style.position="relative",u.style.overflow="hidden",u.style.cursor="move",u.style.left=this.thumbBorder+"px",u.style.top=this.thumbBorder+"px",u.style.width=t+"px",u.style.height=n+"px",u.style.visibility="",u.style.minWidth="",u.style.minHeight="",a.appendChild(u),this.sidebarTitles&&null!=i&&0!=s){var p=mxClient.IS_QUIRKS?2*this.thumbPadding+2:0;a.style.height=this.thumbHeight+p+this.sidebarTitleSize+8+"px";var g=document.createElement("div");g.style.fontSize=this.sidebarTitleSize+"px",g.style.color="#303030",g.style.textAlign="center",g.style.whiteSpace="nowrap",mxClient.IS_IE&&(g.style.height=this.sidebarTitleSize+12+"px"),g.style.paddingTop="4px",mxUtils.write(g,i),a.appendChild(g)}return c},Sidebar.prototype.createItem=function(t,n,a,e,i,o,s){var r=document.createElement("a");r.setAttribute("href","javascript:void(0);"),r.className="geItem",r.style.overflow="hidden";var l=mxClient.IS_QUIRKS?8+2*this.thumbPadding:2*this.thumbBorder;r.style.width=this.thumbWidth+l+"px",r.style.height=this.thumbHeight+l+"px",r.style.padding=this.thumbPadding+"px",mxEvent.addListener(r,"click",function(e){mxEvent.consume(e)}),this.createThumb(t,this.thumbWidth,this.thumbHeight,r,n,a,e,i,o);var d=new mxRectangle(0,0,i,o);if(1<t.length||t[0].vertex){var c=this.createDragSource(r,this.createDropHandler(t,!0,s,d),this.createDragPreview(i,o),t,d);this.addClickHandler(r,c,t),c.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})}else if(null!=t[0]&&t[0].edge){c=this.createDragSource(r,this.createDropHandler(t,!1,s,d),this.createDragPreview(i,o),t,d);this.addClickHandler(r,c,t)}return mxClient.IS_IOS||mxEvent.addGestureListeners(r,null,mxUtils.bind(this,function(e){this.showTooltip(r,t,d.width,d.height,n,a)})),r},Sidebar.prototype.createDropHandler=function(g,v,h,b){return h=null==h||h,mxUtils.bind(this,function(e,t,n,a,i){if(e.isEnabled()){if(0<(g=e.getImportableCells(g)).length){e.stopEditing();var o=null!=n&&e.isValidDropTarget(n,g,t),s=null;if(null==n||o||(n=null),!e.isCellLocked(n||e.getDefaultParent())){e.model.beginUpdate();try{if(a=Math.round(a),i=Math.round(i),v&&e.isSplitTarget(n,g,t)){var r=e.cloneCells(g);e.splitEdge(n,r,null,a-b.width/2,i-b.height/2),s=r}else 0<g.length&&(s=e.importCells(g,a,i,n));if(null!=e.layoutManager){var l=e.layoutManager.getLayout(n);if(null!=l)for(var d=e.view.scale,c=e.view.translate,m=(a+c.x)*d,u=(i+c.y)*d,p=0;p<s.length;p++)l.moveCell(s[p],m,u)}h&&e.fireEvent(new mxEventObject("cellsInserted","cells",s))}finally{e.model.endUpdate()}null!=s&&0<s.length&&(e.scrollCellToVisible(s[0]),e.setSelectionCells(s))}}mxEvent.consume(t)}})},Sidebar.prototype.createDragPreview=function(e,t){var n=document.createElement("div");return n.style.border="1px dashed black",n.style.width=e+"px",n.style.height=t+"px",n},Sidebar.prototype.createDragSource=function(e,t,n){var a=mxUtils.makeDraggable(e,this.editorUi.editor.graph,t,n,0,0,this.editorUi.editor.graph.autoscroll,!0,!0);return a.getDropTarget=function(e,t,n){var a=mxDragSource.prototype.getDropTarget.apply(this,arguments);return e.isValidRoot(a)||(a=null),a},a},Sidebar.prototype.addClickHandler=function(e,a){var i=this.editorUi.editor.graph,o=null;mxEvent.addGestureListeners(e,function(e){o=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e))});var s=a.mouseUp;a.mouseUp=function(e){if(!mxEvent.isPopupTrigger(e)&&null==this.currentGraph&&null!=o){var t=i.tolerance;if(Math.abs(o.x-mxEvent.getClientX(e))<=t&&Math.abs(o.y-mxEvent.getClientY(e))<=t){var n=i.getGridSize();a.drop(i,e,null,n,n)}}s.apply(this,arguments),o=null}},Sidebar.prototype.createVertexTemplateEntry=function(e,t,n,a,i,o,s,r){return r=null!=r&&0<r.length?r:i.toLowerCase(),this.addEntry(r,mxUtils.bind(this,function(){return this.createVertexTemplate(e,t,n,a,i,o,s)}))},Sidebar.prototype.createXmlDocument=function(e,t,n,a){var i=mxUtils.createXmlDocument().createElement(e);return i.setAttribute("label",t),n.forEach(function(e,t){i.setAttribute(e,a[t]?a[t]:"")}),i},Sidebar.prototype.createVertexTemplate=function(e,t,n,a,i,o,s,r){var l=[],d=[];switch(a){case"answer":l=["timeout"],d=["0"];break;case"start":l=["answer"],d=["yes"];break;case"googleasr":l=["key","google_asr_language","timeout","intKey","beep"],d=["","it-IT","10","#","BEEP"];break;case"tildeasr":l=["uri","appid","appsecret","timeout","intKey","beep"],d=["wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE","","","10","#","BEEP"];break;case"ispeechasr":l=["key","model","ispeech_asr_language","timeout","intKey","beep"],d=["","","it-IT","10","#","BEEP"];break;case"playback":l=["file_id","opts"],d=["0"];break;case"background":l=["file_id","response","digit"],d=["0","5","1"];break;case"menu":l=["file_id","response","digit","retry","variable_id"],d=["0","5","1","1","0"];break;case"getdigits":l=["file_id","response","mindigit","maxdigit","retry","variable_id"],d=["0","5","1","10","1","0"];break;case"getsecretdigits":l=["file_id","response","mindigit","maxdigit","retry","hiddendigitsnum","hiddendigitspos","variable_id"],d=["0","5","1","10","1","0","first","0"];break;case"custom_app":l=["application","options"],d=["",""];break;case"set":l=["variable_id","variable_value"],d=["0",""];break;case"database":l=["odbc_id","query","variable_id"],d=["0","",""];break;case"noop":l=["output"],d=[];break;case"gotoc":l=["context","extension","priority"],d=["","","1"];break;case"system":l=["variable_id","command"],d=[];break;case"agi":l=["command","args"],d=[];break;case"gotoif":l=["condition"],d=[];break;case"gotoiftime":l=["interval_id"],d=["0"];break;case"vswitch":l=["variable_id"],d=["0"];break;case"saydigits":l=["digits","escape_digits"],d=["","#"];break;case"saynumber":l=["number","escape_digits"],d=["","#"];break;case"sayphonetic":l=["text","escape_digits"],d=["","#"];break;case"record":l=["file","recordingFormat","timeout","escape_digits"],d=["","wav","-1","#"];break;case"dial":l=["sip_id","timeout","opts","url"],d=["0","60"];break;case"ext_dial":l=["phone","trunk_name","timeout","opts","url"],d=["","-1","60"];break;case"tts":l=["text","google_tts_language"],d=["","it"];break;case"ispeechtts":l=["text","key","ispeech_tts_language","speed","intKey"],d=["","","euritalianfemale","0","#"];break;case"lumenvoxtts":l=["text","options"],d=["",""];break;case"lumenvoxasr":l=["grammar","options"],d=["",""];break;case"awspolly":l=["aws_access_key_id","aws_secret_access_key","aws_polly_region","aws_polly_voice","text"],d=["","","eu-west-1","Amy",""];break;case"queue":l=["queue_id","opts","url","file_id","timeout","agi","macro","gosub","position"],d=["-1","xX","","","300"];break;case"voicemail":l=["mailbox","options"],d=["",""];break;case"subproject":l=["project_id"],d=["0"];break;case"math":l=["operation","variable_id"],d=["","0"];break;case"queuelog":l=["queuename","agent","queue_event","data1","data2","data3","data4","data5"],d=[];break;case"goal":l=["goalname"],d=[];break;case"callback":l=["name","lastName","phone","list_id","delay","callback_priority"],d=["{CALLERID(name)}","","{CALLERID(num)}","-1","5","2"];break;case"sendSMS":l=["sms_account_id","to","sms_text"],d=["0"];break;case"sendMail":l=["account_id","to","cc","bcc","subject","text"],d=["0"];break;case"sendFax":l=["account_id","to","choose_attachment","attachment_name","attachment_type","attachment_path"],d=["0"];break;case"login":case"unpause":case"logout":l=["findBy"],d=["internal"];break;case"pause":l=["findBy","pause_id"],d=["internal",""];break;default:l=[],d=[]}var c=[new mxCell(this.createXmlDocument(a,i,l,d),new mxGeometry(0,0,t,n),e)];return c[0].vertex=!0,this.createVertexTemplateFromCells(c,t,n,i,o,s,r)},Sidebar.prototype.createVertexTemplateFromCells=function(e,t,n,a,i,o,s){return this.createItem(e,a,i,o,t,n,s)},Sidebar.prototype.createEdgeTemplate=function(e,t,n,a,i,o,s){var r=new mxCell(null!=a?a:"",new mxGeometry(0,0,t,n),e);return r.geometry.setTerminalPoint(new mxPoint(0,n),!0),r.geometry.setTerminalPoint(new mxPoint(t,0),!1),r.geometry.relative=!0,r.edge=!0,this.createEdgeTemplateFromCells([r],t,n,i,o,s)},Sidebar.prototype.createEdgeTemplateFromCells=function(e,t,n,a,i,o){return this.createItem(e,a,i,!0,t,n,o)},Sidebar.prototype.addPaletteFunctions=function(e,t,n,a){this.addPalette(e,t,n,mxUtils.bind(this,function(e){for(var t=0;t<a.length;t++)e.appendChild(a[t](e))}))},Sidebar.prototype.addPalette=function(e,t,n,a){var i=this.createTitle(t);this.container.appendChild(i);var o=document.createElement("div");o.className="geSidebar",mxClient.IS_POINTER&&(o.style.touchAction="none"),mxEvent.addListener(o,"mousemove",mxUtils.bind(this,function(e){mxEvent.getSource(e)==o?o.setAttribute("title",mxResources.get("sidebarTooltip")):o.removeAttribute("title")})),n?(a(o),a=null):o.style.display="none",this.addFoldingHandler(i,o,a);var s=document.createElement("div");return s.appendChild(o),this.container.appendChild(s),null!=e&&(this.palettes[e]=[i,s]),o},Sidebar.prototype.addFoldingHandler=function(n,a,i){var o=!1;(!mxClient.IS_IE||8<=document.documentMode)&&(n.style.backgroundImage="none"==a.style.display?"url('"+this.collapsedImage+"')":"url('"+this.expandedImage+"')"),n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="0% 50%",mxEvent.addListener(n,"click",mxUtils.bind(this,function(e){if("none"==a.style.display){if(o)a.style.display="block";else if(o=!0,null!=i){n.style.cursor="wait";var t=n.innerHTML;n.innerHTML=mxResources.get("loading")+"...",window.setTimeout(function(){var e=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,i(a),mxClient.NO_FO=e,a.style.display="block",n.style.cursor="",n.innerHTML=t},0)}else a.style.display="block";n.style.backgroundImage="url('"+this.expandedImage+"')"}else n.style.backgroundImage="url('"+this.collapsedImage+"')",a.style.display="none";mxEvent.consume(e)}))},Sidebar.prototype.addImagePalette=function(e,t,o,s,r,n,a){for(var l=[],d=0;d<r.length;d++)mxUtils.bind(this,function(e,t,n){if(null==n){var a=e.lastIndexOf("/"),i=e.lastIndexOf(".");n=e.substring(0<=a?a+1:0,0<=i?i:e.length).replace(/[-_]/g," ")}l.push(this.createVertexTemplateEntry("image;html=1;labelBackgroundColor=#ffffff;image="+o+e+s,this.defaultImageWidth,this.defaultImageHeight,r[d],t,!1,!0,this.filterTags(n)))})(r[d],null!=n?n[d]:null,null!=a?a[r[d]]:null);this.addPaletteFunctions(e,t,!1,l)},"undefined"!=typeof html4&&(html4.ATTRIBS["a::target"]=0),mxConstants.SHADOW_OPACITY=.25,mxConstants.SHADOWCOLOR="#000000",mxConstants.VML_SHADOWCOLOR="#d0d0d0",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,function(){try{if(null!=navigator&&null!=navigator.language){var e=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===e||"en-ca"===e||"es-mx"===e?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(e){}}(),mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,mxGraphModel.prototype.ignoreRelativeEdgeParent=!1,mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif",mxGraphView.prototype.gridSteps=4,mxGraphView.prototype.minGridSize=4,mxGraphView.prototype.gridColor="#e0e0e0",mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]",Graph=function(e,t,n,a){mxGraph.call(this,e,t,n,a),this.setConnectable(!0),this.setDropEnabled(!1),this.setPanning(!0),this.setTooltips(!mxClient.IS_TOUCH),this.setAllowLoops(!1),this.setMultigraph(!1),this.allowAutoPanning=!0,this.resetEdgesOnConnect=!1,this.constrainChildren=!1,this.connectionHandler.targetConnectImage=!0,this.setAllowDanglingEdges(!1),this.connectionHandler.setCreateTarget(!1),this.connectionHandler.isValidSource=function(){return mxConnectionHandler.prototype.isValidSource.apply(this,arguments)&&"2"!=urlParams.connect},this.alternateEdgeStyle="vertical",null==a&&this.loadStylesheet();var i=new mxRubberband(this);this.getRubberband=function(){return i},this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.container.style.cursor="pointer"})),this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.container.style.cursor="default"})),this.isHtmlLabel=function(e){var t=this.view.getState(e),n=null!=t?t.style:this.getCellStyle(e);return"1"==n.html||"wrap"==n.whiteSpace},this.cellRenderer.getLabelValue=function(e){var t=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);return"wrap"==e.style.whiteSpace&&1!=e.style.html&&(t=mxUtils.htmlEntities(t,!1)),t},this.isCellLocked=function(e){return!1},this.connectionHandler.tapAndHoldTolerance=16;var o=this.connectionHandler.tapAndHold;this.connectionHandler.tapAndHold=function(e,t){null==t?this.graph.panningHandler.active||(i.start(e.getGraphX(),e.getGraphY()),this.graph.panningHandler.panningTrigger=!1):tapAndHoldStartsConnection?o.apply(this,arguments):this.graph.isCellSelected(t.cell)&&1<this.graph.getSelectionCount()&&this.graph.removeSelectionCell(t.cell)},touchStyle&&this.initTouch()},mxUtils.extend(Graph,mxGraph),Graph.prototype.minFitScale=null,Graph.prototype.maxFitScale=null,Graph.prototype.loadStylesheet=function(){var e=mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement();new mxCodec(e.ownerDocument).decode(e,this.getStylesheet())},Graph.prototype.flipEdge=function(e){if(null!=e){var t=this.view.getState(e),n=null!=t?t.style:this.getCellStyle(e);if(null!=n){var a=mxUtils.getValue(n,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,a,[e])}}},Graph.prototype.setDefaultEdge=function(e){if(null!=e&&this.getModel().isEdge(e)){var t=this.getModel().cloneCells([e])[0];null!=t.geometry&&(t.geometry.points=null);var n=t.getStyle();n=mxUtils.setStyle(n,mxConstants.STYLE_ENTRY_X,null),n=mxUtils.setStyle(n,mxConstants.STYLE_ENTRY_Y,null),n=mxUtils.setStyle(n,mxConstants.STYLE_EXIT_X,null),n=mxUtils.setStyle(n,mxConstants.STYLE_EXIT_Y,null),t.setStyle(n),this.connectionHandler.createEdgeState=function(e){return this.graph.view.createState(t)},this.connectionHandler.factoryMethod=function(){return this.graph.cloneCells([t])[0]}}},Graph.prototype.isCellFoldable=function(e){return this.foldingEnabled&&this.isSwimlane(e)},Graph.prototype.isValidRoot=function(e){return this.isSwimlane(e)},Graph.prototype.createGroupCell=function(){var e=mxGraph.prototype.createGroupCell.apply(this,arguments);return e.setStyle("group"),e},Graph.prototype.getTooltipForCell=function(e){var t="";return this.getModel().isVertex(e)?t+=mxResources.get("description_"+e.value.nodeName)||"":this.getModel().isEdge(e)&&(t=mxGraph.prototype.getTooltipForCell.apply(this,arguments)),t},Graph.prototype.convertValueToString=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("label"):mxGraph.prototype.convertValueToString.apply(this,arguments)},Graph.prototype.cellLabelChanged=function(e,t,n){if(null!=e.value&&"object"==typeof e.value){var a=e.value.cloneNode(!0);a.setAttribute("label",t),t=a}mxGraph.prototype.cellLabelChanged.apply(this,arguments)},Graph.prototype.setLinkForCell=function(e,t){var n=null;null!=e.value&&"object"==typeof e.value?n=e.value.cloneNode(!0):(n=mxUtils.createXmlDocument().createElement("UserObject")).setAttribute("label",e.value);null!=t&&0<t.length?n.setAttribute("link",t):n.removeAttribute("link"),this.model.setValue(e,n)},Graph.prototype.getLinkForCell=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("link"):null},Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first},this.addListener(mxEvent.START_EDITING,function(e,t){this.panningHandler.hideMenu()});var o=!1,s=null;this.updateMouseEvent=function(e){if(mxGraph.prototype.updateMouseEvent.apply(this,arguments),null==e.getState()){var t=this.getCellAt(e.graphX,e.graphY);this.getModel().isEdge(t)&&(e.state=this.view.getState(t),null!=e.state&&null!=e.state.shape&&(this.container.style.cursor=e.state.shape.node.style.cursor))}null==e.getState()&&(this.container.style.cursor="default")},this.fireMouseEvent=function(e,t,n){if(e==mxEvent.MOUSE_DOWN)this.panningHandler.isMenuShowing()?(o=!1,s=null):(s=t.getCell(),o=null!=s?this.isCellSelected(s):this.isSelectionEmpty());else if(e==mxEvent.MOUSE_UP){if(o&&!this.isEditing()){if(!this.panningHandler.isMenuShowing()){var a=mxEvent.getClientX(t.getEvent()),i=mxEvent.getClientY(t.getEvent());this.panningHandler.popup(a+16,i,s,t.getEvent())}return o=!1,s=null,void t.consume()}o=!1,s=null}mxGraph.prototype.fireMouseEvent.apply(this,arguments),e==mxEvent.MOUSE_MOVE&&t.isConsumed()&&(o=!1,s=null)}},function(){if(mxVertexHandler.prototype.rotationEnabled=!0,mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,touchStyle){mxConstants.HANDLE_SIZE=16,mxConstants.LABEL_HANDLE_SIZE=7,mxClient.IS_TOUCH&&(mxVertexHandler.prototype.tolerance=4,mxEdgeHandler.prototype.tolerance=6,Graph.prototype.tolerance=14,Graph.prototype.gridSize=20,mxPanningHandler.prototype.selectOnPopup=!1,mxPanningHandler.prototype.useLeftButtonForPanning=!0,mxPanningHandler.prototype.isPanningTrigger=function(e){var t=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())||mxEvent.isControlDown(t)&&mxEvent.isShiftDown(t)||this.usePopupTrigger&&mxEvent.isPopupTrigger(t)});var n=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(e,t){n.apply(this,arguments),this.graph.isCellSelected(t.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)},Graph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxConnectionHandler.prototype.selectCells=function(e,t){touchStyle&&null!=t?this.graph.setSelectionCell(t):this.graph.setSelectionCell(e)};var a=mxGraph.prototype.dblClick;Graph.prototype.dblClick=function(e,t){if(null==t){var n=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e));t=this.getCellAt(n.x,n.y)}a.call(this,e,t)};var e=new mxImage(IMAGE_PATH+"/touch-handle.png",16,16);mxVertexHandler.prototype.handleImage=e,mxEdgeHandler.prototype.handleImage=e,mxOutline.prototype.sizerImage=e,(new Image).src=e.src;var t=IMAGE_PATH+"/touch-connector.png",i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(this.connectorImg=mxUtils.createImage(t),this.connectorImg.style.cursor="pointer",this.connectorImg.style.width="29px",this.connectorImg.style.height="29px",this.connectorImg.style.position="absolute",mxClient.IS_TOUCH||(this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state)),this.connectorImg.style.padding="2px",mxEvent.addGestureListeners(this.connectorImg,mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,t.x,t.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};var o=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){o.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+4+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};var s=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,t){s.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)},(new Image).src=t}else{var r=new mxImage(IMAGE_PATH+"/connector.png",15,15);if(mxConnectionHandler.prototype.connectImage=r,(new Image).src=r.src,"2"==urlParams.connect){r=new mxImage(IMAGE_PATH+"/connector.png",15,15),i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(mxClient.IS_IE&&!mxClient.IS_SVG?(this.connectorImg=document.createElement("div"),this.connectorImg.style.backgroundImage="url("+r.src+")",this.connectorImg.style.backgroundPosition="center",this.connectorImg.style.backgroundRepeat="no-repeat",this.connectorImg.style.width=r.width+4+"px",this.connectorImg.style.height=r.height+4+"px",this.connectorImg.style.display=mxClient.IS_QUIRKS?"inline":"inline-block"):(this.connectorImg=mxUtils.createImage(r.src),this.connectorImg.style.width=r.width+"px",this.connectorImg.style.height=r.height+"px"),this.connectorImg.style.cursor="pointer",this.connectorImg.style.position="absolute",this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state),this.connectorImg.style.padding="2px",mxEvent.addListener(this.connectorImg,"mousedown",mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,t.x,t.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};o=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){o.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+2+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};s=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,t){s.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)}}}}(),Actions.prototype.init=function(){var t=this.editorUi,l=t.editor,d=l.graph;this.addAction("new",function(){t.projectDesignController.newProject()}),this.addAction("open",function(){t.projectDesignController.openProject()}),this.addAction("save",function(){t.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml())),t.editor.modified=!1},null,null,"Ctrl+S"),this.addAction("saveAs",function(){t.projectDesignController.saveProjectAs(mxUtils.getPrettyXml(l.getGraphXml()))},null,null,"Ctrl+Shift+S"),this.addAction("publish",function(){t.editor.setStatus(""),null===t.validate()?(t.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml()),!0),t.editor.modified=!1):(t.editor.setStatus("...Error publishing! Please check the project and try again!"),setTimeout(function(){t.editor.setStatus("")},3e3))},null,null,"Ctrl+Shift+P"),this.addAction("variable",function(){t.projectDesignController.newVariable()}),this.addAction("import",function(){t.projectDesignController.importXML(function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})}),this.addAction("export",function(){t.exportXML(mxUtils.getPrettyXml(l.getGraphXml()))},null,null,"Ctrl+E"),this.addAction("editFile",function(){t.projectDesignController.editXML(mxUtils.getPrettyXml(l.getGraphXml()),function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})}),this.addAction("print",function(){mxUtils.printScreen(d)},null,"sprite-print","Ctrl+P"),this.addAction("preview",function(){mxUtils.show(d,null,10,10)}),this.addAction("undo",function(){l.undoManager.undo()},null,"sprite-undo","Ctrl+Z"),this.addAction("redo",function(){l.undoManager.redo()},null,"sprite-redo","Ctrl+Y"),this.addAction("cut",function(){mxClipboard.cut(d)},null,"sprite-cut","Ctrl+X"),this.addAction("copy",function(){mxClipboard.copy(d)},null,"sprite-copy","Ctrl+C"),this.addAction("paste",function(){mxClipboard.paste(d)},!1,"sprite-paste","Ctrl+V"),this.addAction("delete",function(){d.removeCells()},null,null,"Delete"),this.addAction("duplicate",function(){var e=d.gridSize;d.setSelectionCells(d.moveCells(d.getSelectionCells(),e,e,!0))},null,null,"Ctrl+D"),this.addAction("selectVertices",function(){d.selectVertices()},null,null,"Ctrl+Shift+V"),this.addAction("selectEdges",function(){d.selectEdges()},null,null,"Ctrl+Shift+E"),this.addAction("selectAll",function(){d.selectAll()},null,null,"Ctrl+A"),this.addAction("home",function(){d.home()},null,null,"Home"),this.addAction("exitGroup",function(){d.exitGroup()},null,null,"Page Up"),this.addAction("enterGroup",function(){d.enterGroup()},null,null,"Page Down"),this.addAction("expand",function(){d.foldCells(!1)},null,null,"Enter"),this.addAction("collapse",function(){d.foldCells(!0)},null,null,"Backspace"),this.addAction("toFront",function(){d.orderCells(!1)},null,null,"Ctrl+F"),this.addAction("toBack",function(){d.orderCells(!0)},null,null,"Ctrl+B"),this.addAction("group",function(){d.setSelectionCell(d.groupCells(null,0))},null,null,"Ctrl+G"),this.addAction("ungroup",function(){d.setSelectionCells(d.ungroupCells())},null,null,"Ctrl+U"),this.addAction("removeFromGroup",function(){d.removeCellsFromParent()}),this.addAction("editLink",function(){var e=d.getSelectionCell(),t=d.getLinkForCell(e);null==t&&(t=""),null!=(t=mxUtils.prompt(mxResources.get("enterValue"),t))&&d.setLinkForCell(e,t)}),this.addAction("openLink",function(){var e=d.getSelectionCell(),t=d.getLinkForCell(e);null!=t&&window.open(t)}),this.addAction("autosize",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var t=0;t<e.length;t++){var n=e[t];d.getModel().getChildCount(n)?d.updateGroupBounds([n],20):d.updateCellSize(n)}}finally{d.getModel().endUpdate()}}}),this.addAction("wordWrap",function(){var e=d.getView().getState(d.getSelectionCell()),t="wrap";null!=e&&"wrap"==e.style[mxConstants.STYLE_WHITE_SPACE]&&(t=null),d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,t)}),this.addAction("rotation",function(){var e="0",t=d.getView().getState(d.getSelectionCell());null!=t&&(e=t.style[mxConstants.STYLE_ROTATION]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)",e))&&d.setCellStyles(mxConstants.STYLE_ROTATION,e)}),this.addAction("tilt",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var t=0;t<e.length;t++){var n=e[t];if(d.getModel().isVertex(n)&&0==d.getModel().getChildCount(n)){var a=d.getCellGeometry(n);if(null!=a){(a=a.clone()).x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var i=a.width;a.width=a.height,a.height=i,d.getModel().setGeometry(n,a);var o=d.view.getState(n);if(null!=o){var s=o.style[mxConstants.STYLE_DIRECTION]||"east";"east"==s?s="south":"south"==s?s="west":"west"==s?s="north":"north"==s&&(s="east"),d.setCellStyles(mxConstants.STYLE_DIRECTION,s,[n])}}}}}finally{d.getModel().endUpdate()}}},null,null,"Ctrl+R"),this.addAction("actualSize",function(){d.zoomTo(1)}),this.addAction("zoomIn",function(){d.zoomIn()},null,null,"Add"),this.addAction("zoomOut",function(){d.zoomOut()},null,null,"Subtract"),this.addAction("fitWindow",function(){d.fit()}),this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,t=d.pageScale,n=d.container.clientWidth-20,a=d.container.clientHeight-20,i=Math.floor(100*Math.min(n/e.width/t,a/e.height/t))/100;d.zoomTo(i),d.container.scrollLeft=Math.round(d.view.translate.x*i-Math.max(10,(d.container.clientWidth-e.width*t*i)/2)),d.container.scrollTop=Math.round(d.view.translate.y*i-Math.max(10,(d.container.clientHeight-e.height*t*i)/2))})),this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,t=d.pageScale,n=d.container.clientWidth-20,a=Math.floor(100*n/e.width/t)/100;d.zoomTo(a),d.container.scrollLeft=Math.round(d.view.translate.x*a-Math.max(10,(d.container.clientWidth-e.width*t*a)/2)),d.container.scrollTop=Math.round(d.view.translate.y*a-Math.max(10,(d.container.clientHeight-e.height*t*a)/2))})),this.put("customZoom",new Action(mxResources.get("custom"),function(){var e=mxUtils.prompt(mxResources.get("enterValue")+" (%)",parseInt(100*d.getView().getScale()));null!=e&&0<e.length&&!isNaN(parseInt(e))&&d.zoomTo(parseInt(e)/100)}));var e=null;(e=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled()),l.updateGraphComponents()},null,null,"Ctrl+Shift+G")).setToggleAction(!0),e.setSelectedCallback(function(){return d.isGridEnabled()}),(e=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled})).setToggleAction(!0),e.setSelectedCallback(function(){return d.graphHandler.guidesEnabled}),(e=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()}),(e=this.addAction("navigation",function(){d.foldingEnabled=!d.foldingEnabled,d.view.revalidate()})).setToggleAction(!0),e.setSelectedCallback(function(){return d.foldingEnabled}),(e=this.addAction("scrollbars",function(){if(d.scrollbars=!d.scrollbars,l.updateGraphComponents(),d.scrollbars){var e=d.view.translate.x,t=d.view.translate.y;d.view.translate.x=0,d.view.translate.y=0,d.sizeDidChange(),d.container.scrollLeft-=Math.round(e*d.view.scale),d.container.scrollTop-=Math.round(t*d.view.scale)}else{var n=d.view.translate;d.view.setTranslate(n.x-d.container.scrollLeft/d.view.scale,n.y-d.container.scrollTop/d.view.scale),d.container.scrollLeft=0,d.container.scrollTop=0,d.sizeDidChange()}},!mxClient.IS_TOUCH)).setToggleAction(!0),e.setSelectedCallback(function(){return"auto"==d.container.style.overflow}),(e=this.addAction("pageView",mxUtils.bind(this,function(){d.pageVisible=!d.pageVisible,d.pageBreaksVisible=d.pageVisible,d.preferPageSize=d.pageBreaksVisible,d.view.validate(),d.sizeDidChange(),l.updateGraphComponents(),l.outline.update(),mxUtils.hasScrollbars(d.container)&&(d.pageVisible?(d.container.scrollLeft-=20,d.container.scrollTop-=20):(d.container.scrollLeft+=20,d.container.scrollTop+=20))}))).setToggleAction(!0),e.setSelectedCallback(function(){return d.pageVisible}),(e=this.addAction("connect",function(){d.setConnectable(!d.connectionHandler.isEnabled())},null,null,"Ctrl+Q")).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isEnabled()}),(e=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()}),this.addAction("help",function(){window.open("https://wiki.xcallymotion.com/display/XMV/Cally+Square")}),this.put("about",new Action(mxResources.get("about")+" Cally Square",function(){window.open("http://callysquare.com/")},null,null,null));var n=mxUtils.bind(this,function(e,t){this.addAction(e,function(){d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,t)})});n("bold",mxConstants.FONT_BOLD),n("italic",mxConstants.FONT_ITALIC),n("underline",mxConstants.FONT_UNDERLINE),this.addAction("shadow",function(){d.toggleCellStyles(mxConstants.STYLE_SHADOW)}),this.addAction("dashed",function(){d.toggleCellStyles(mxConstants.STYLE_DASHED)}),this.addAction("rounded",function(){d.toggleCellStyles(mxConstants.STYLE_ROUNDED)}),this.addAction("curved",function(){d.toggleCellStyles(mxConstants.STYLE_CURVED)}),this.addAction("style",function(){var e=d.getSelectionCells();if(null!=e&&0<e.length){var t=d.getModel(),n=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("style")+")",t.getStyle(e[0])||"");null!=n&&d.setCellStyle(n,e)}}),this.addAction("setAsDefaultEdge",function(){d.setDefaultEdge(d.getSelectionCell())}),this.addAction("addWaypoint",function(){var e=d.getSelectionCell();if(null!=e&&d.getModel().isEdge(e)){var t=l.graph.selectionCellsHandler.getHandler(e);if(t instanceof mxEdgeHandler){var n=d.view.translate,a=d.view.scale,i=n.x,o=n.y,s=d.getModel().getParent(e),r=d.getCellGeometry(s);d.getModel().isVertex(s)&&null!=r&&(i+=r.x,o+=r.y),t.addPointAt(t.state,d.panningHandler.triggerX/a-i,d.panningHandler.triggerY/a-o)}}}),this.addAction("removeWaypoint",function(){var e=t.actions.get("removeWaypoint");null!=e.handler&&e.handler.removePoint(e.handler.state,e.index)}),this.addAction("image",function(){var e="",t=d.getView().getState(d.getSelectionCell());if(null!=t&&(e=t.style[mxConstants.STYLE_IMAGE]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("url")+")",e))&&0<e.length){var n=new Image;n.onload=function(){!function(e,t,n){var a=null,i=d.getSelectionCells();d.getModel().beginUpdate();try{if(0==i.length){var o=d.getGridSize();a=i=[d.insertVertex(d.getDefaultParent(),null,"",o,o,t,n)]}if(d.setCellStyles(mxConstants.STYLE_IMAGE,e,i),d.setCellStyles(mxConstants.STYLE_SHAPE,"image",i),1==d.getSelectionCount()&&null!=t&&null!=n){var s=i[0],r=d.getModel().getGeometry(s);null!=r&&((r=r.clone()).width=t,r.height=n,d.getModel().setGeometry(s,r))}}finally{d.getModel().endUpdate()}null!=a&&(d.setSelectionCells(a),d.scrollCellToVisible(a[0]))}(e,n.width,n.height)},n.onerror=function(){mxUtils.alert(mxResources.get("fileNotFound"))},n.src=e}})},Actions.prototype.addAction=function(e,t,n,a,i){return this.put(e,new Action(mxResources.get(e),t,n,a,i))},Actions.prototype.put=function(e,t){return this.actions[e]=t},Actions.prototype.get=function(e){return this.actions[e]},mxUtils.extend(Action,mxEventSource),Action.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Action.prototype.setToggleAction=function(e){this.toggleAction=e},Action.prototype.setSelectedCallback=function(e){this.selectedCallback=e},Action.prototype.isSelected=function(){return this.selectedCallback()},Menus=function(e){this.editorUi=e,this.menus=new Object,this.init(),(new Image).src=IMAGE_PATH+"/checkmark.gif"},Menus.prototype.init=function(){var i=this.editorUi.editor.graph;this.put("fontFamily",new Menu(mxUtils.bind(this,function(e,t){for(var n=["Helvetica","Verdana","Times New Roman","Garamond","Comic Sans MS","Courier New","Georgia","Lucida Console","Tahoma"],a=0;a<n.length;a++){this.styleChange(e,n[a],[mxConstants.STYLE_FONTFAMILY],[n[a]],null,t).firstChild.nextSibling.style.fontFamily=n[a]}e.addSeparator(t),this.promptChange(e,mxResources.get("custom"),"",mxConstants.DEFAULT_FONTFAMILY,mxConstants.STYLE_FONTFAMILY,t)}))),this.put("fontSize",new Menu(mxUtils.bind(this,function(e,t){for(var n=[6,8,9,10,11,12,14,18,24,36,48,72],a=0;a<n.length;a++)this.styleChange(e,n[a],[mxConstants.STYLE_FONTSIZE],[n[a]],null,t);e.addSeparator(t),this.promptChange(e,mxResources.get("custom"),"(pt)","12",mxConstants.STYLE_FONTSIZE,t)}))),this.put("linewidth",new Menu(mxUtils.bind(this,function(e,t){for(var n=[1,2,3,4,8,12,16,24],a=0;a<n.length;a++)this.styleChange(e,n[a]+"px",[mxConstants.STYLE_STROKEWIDTH],[n[a]],null,t);e.addSeparator(t),this.promptChange(e,mxResources.get("custom"),"(px)","1",mxConstants.STYLE_STROKEWIDTH,t)}))),this.put("line",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("straight"),[mxConstants.STYLE_EDGE],[null],null,t),this.styleChange(e,mxResources.get("entityRelation"),[mxConstants.STYLE_EDGE],["entityRelationEdgeStyle"],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("horizontal"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","horizontal"],null,t),this.styleChange(e,mxResources.get("vertical"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","vertical"],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("manual"),[mxConstants.STYLE_EDGE],["segmentEdgeStyle"],null,t),this.styleChange(e,mxResources.get("automatic"),[mxConstants.STYLE_EDGE],["orthogonalEdgeStyle"],null,t)}))),this.put("lineend",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_CLASSIC],null,t),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OPEN],null,t),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_BLOCK],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OVAL],null,t),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND],null,t),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND_THIN],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_ENDARROW],[mxConstants.NONE],null,t),e.addSeparator(t),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("endFill",!0)},t,null,!0),e.addSeparator(t),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_ENDSIZE,t)}))),this.put("linestart",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_CLASSIC],null,t),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OPEN],null,t),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_BLOCK],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OVAL],null,t),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND],null,t),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND_THIN],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_STARTARROW],[mxConstants.NONE],null,t),e.addSeparator(t),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("startFill",!0)},t,null,!0),e.addSeparator(t),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_STARTSIZE,t)}))),this.put("spacing",new Menu(mxUtils.bind(this,function(e,t){var n=this.editorUi.actions.get("shadow").enabled,a=this.get("line").enabled;(n||e.showDisabled)&&(this.promptChange(e,mxResources.get("top"),"(px)","0",mxConstants.STYLE_SPACING_TOP,t,n),this.promptChange(e,mxResources.get("right"),"(px)","0",mxConstants.STYLE_SPACING_RIGHT,t,n),this.promptChange(e,mxResources.get("bottom"),"(px)","0",mxConstants.STYLE_SPACING_BOTTOM,t,n),this.promptChange(e,mxResources.get("left"),"(px)","0",mxConstants.STYLE_SPACING_LEFT,t,n),e.addSeparator(t),this.promptChange(e,mxResources.get("global"),"(px)","0",mxConstants.STYLE_SPACING,t,n),this.promptChange(e,mxResources.get("perimeter"),"(px)","0",mxConstants.STYLE_PERIMETER_SPACING,t,n)),(a||e.showDisabled)&&(e.addSeparator(t),this.promptChange(e,mxResources.get("sourceSpacing"),"(px)","0",mxConstants.STYLE_SOURCE_PERIMETER_SPACING,t,a),this.promptChange(e,mxResources.get("targetSpacing"),"(px)","0",mxConstants.STYLE_TARGET_PERIMETER_SPACING,t,a))}))),this.put("format",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItem(e,"style",t)}))),this.put("text",new Menu(mxUtils.bind(this,function(e,t){var n=this.get("text").enabled;e.addSeparator(t),this.addSubmenu("fontFamily",e,t),this.addSubmenu("fontSize",e,t),this.addMenuItems(e,["-","bold","italic","underline","-"],t),this.addSubmenu("alignment",e,t),this.addMenuItem(e,"wordWrap",t),e.addSeparator(t),this.promptChange(e,mxResources.get("textOpacity"),"(%)","100",mxConstants.STYLE_TEXT_OPACITY,t,n),e.addItem(mxResources.get("hide"),null,function(){i.toggleCellStyles(mxConstants.STYLE_NOLABEL,!1)},t,null,n)}))),this.put("alignment",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("leftAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT],null,t),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER],null,t),this.styleChange(e,mxResources.get("rightAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("topAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP],null,t),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE],null,t),this.styleChange(e,mxResources.get("bottomAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM],null,t),e.addSeparator(t),this.addSubmenu("position",e,t),this.addSubmenu("spacing",e,t),e.addSeparator(t);var n=this.get("text").enabled;e.addItem(mxResources.get("vertical"),null,function(){i.toggleCellStyles(mxConstants.STYLE_HORIZONTAL,!0)},t,null,n)}))),this.put("position",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("left"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_RIGHT],null,t),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_CENTER],null,t),this.styleChange(e,mxResources.get("right"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_LEFT],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("top"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP,mxConstants.ALIGN_BOTTOM],null,t),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_MIDDLE],null,t),this.styleChange(e,mxResources.get("bottom"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_TOP],null,t)}))),this.put("direction",new Menu(mxUtils.bind(this,function(e,t){e.addItem(mxResources.get("flipH"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPH,!1)},t),e.addItem(mxResources.get("flipV"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPV,!1)},t),this.addMenuItems(e,["-","tilt","rotation"],t)}))),this.put("align",new Menu(mxUtils.bind(this,function(e,t){e.addItem(mxResources.get("leftAlign"),null,function(){i.alignCells(mxConstants.ALIGN_LEFT)},t),e.addItem(mxResources.get("center"),null,function(){i.alignCells(mxConstants.ALIGN_CENTER)},t),e.addItem(mxResources.get("rightAlign"),null,function(){i.alignCells(mxConstants.ALIGN_RIGHT)},t),e.addSeparator(t),e.addItem(mxResources.get("topAlign"),null,function(){i.alignCells(mxConstants.ALIGN_TOP)},t),e.addItem(mxResources.get("middle"),null,function(){i.alignCells(mxConstants.ALIGN_MIDDLE)},t),e.addItem(mxResources.get("bottomAlign"),null,function(){i.alignCells(mxConstants.ALIGN_BOTTOM)},t)}))),this.put("layout",new Menu(mxUtils.bind(this,function(e,t){e.addItem(mxResources.get("horizontalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_WEST);this.editorUi.executeLayout(e,!0,!0)}),t),e.addItem(mxResources.get("verticalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_NORTH);this.editorUi.executeLayout(e,!0,!0)}),t)}))),this.put("navigation",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["home","-","exitGroup","enterGroup","-","expand","collapse"],t)}))),this.put("arrange",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["toFront","toBack","-"],t),this.addSubmenu("layout",e,t),e.addSeparator(t),this.addMenuItems(e,["-","group","ungroup","removeFromGroup"],t)}))),this.put("view",new Menu(mxUtils.bind(this,function(t,n){this.addMenuItems(t,["actualSize"],n),t.addSeparator();for(var e=[.25,.5,.75,1,2,4],a=0;a<e.length;a++)!function(e){t.addItem(100*e+"%",null,function(){i.zoomTo(e)},n)}(e[a]);this.addMenuItems(t,["-","zoomIn","zoomOut","-","fitWindow","customZoom","-","fitPage","fitPageWidth"],n)}))),this.put("file",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["new","open","-","save","saveAs","publish","-","variable","-","import","export","-","editFile","description","-","print"],t)}))),this.put("edit",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["undo","redo","-","cut","copy","paste","delete","-","duplicate","-","selectVertices","selectEdges","selectAll"])}))),this.put("help",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["help","-","about"])})))},Menus.prototype.put=function(e,t){this.menus[e]=t},Menus.prototype.get=function(e){return this.menus[e]},Menus.prototype.addSubmenu=function(e,t,n){var a=this.get(e).enabled;if(t.showDisabled||a){var i=t.addItem(mxResources.get(e),null,null,n,null,a);this.addMenu(e,t,i)}},Menus.prototype.addMenu=function(e,t,n){var a=this.get(e);null!=a&&(t.showDisabled||a.enabled)&&this.get(e).execute(t,n)},Menus.prototype.styleChange=function(e,t,n,a,i,o){return e.addItem(t,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph;e.getModel().beginUpdate();try{for(var t=0;t<n.length;t++)e.setCellStyles(n[t],a[t])}finally{e.getModel().endUpdate()}}),o,i)},Menus.prototype.promptChange=function(e,t,a,i,o,n,s){return e.addItem(t,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph,t=i,n=e.getView().getState(e.getSelectionCell());null!=n&&(t=n.style[o]||t),null!=(t=mxUtils.prompt(mxResources.get("enterValue")+(0<a.length?" "+a:""),t))&&0<t.length&&e.setCellStyles(o,t)}),n,null,s)},Menus.prototype.addMenuItem=function(e,t,n){var a=this.editorUi.actions.get(t);if(null!=a&&(e.showDisabled||a.enabled)){var i=e.addItem(a.label,null,a.funct,n,null,a.enabled);return a.toggleAction&&a.isSelected()&&this.addCheckmark(i),this.addShortcut(i,a),i}return null},Menus.prototype.addShortcut=function(e,t){if(null!=t.shortcut){var n=e.firstChild.nextSibling.nextSibling,a=document.createElement("span");a.style.color="gray",mxUtils.write(a,t.shortcut),n.appendChild(a)}},Menus.prototype.addCheckmark=function(e){var t=e.firstChild.nextSibling;t.style.backgroundImage="url("+IMAGE_PATH+"/checkmark.gif)",t.style.backgroundRepeat="no-repeat",t.style.backgroundPosition="2px 50%"},Menus.prototype.addMenuItems=function(e,t,n){for(var a=0;a<t.length;a++)"-"==t[a]?e.addSeparator(n):this.addMenuItem(e,t[a],n)},Menus.prototype.createPopupMenu=function(e,t,n){var a=this.editorUi.editor.graph;if(e.smartSeparators=!0,a.isSelectionEmpty()?this.addMenuItems(e,["undo","redo","-","paste","-"]):(this.addMenuItems(e,["delete","-","cut","copy","-","duplicate"]),1==a.getSelectionCount()&&a.getModel().isEdge(a.getSelectionCell())&&this.addMenuItems(e,["setAsDefaultEdge"]),e.addSeparator()),0<a.getSelectionCount()){if(this.addMenuItems(e,["toFront","toBack","-"]),a.getModel().isEdge(a.getSelectionCell())){var i=!1;if(null!=(t=a.getSelectionCell())&&a.getModel().isEdge(t)){var o=a.selectionCellsHandler.getHandler(t);if(o instanceof mxEdgeHandler&&null!=o.bends&&2<o.bends.length){var s=o.getHandleForEvent(new mxMouseEvent(n)),r=this.editorUi.actions.get("removeWaypoint");r.handler=o,i=0<(r.index=s)&&s<o.bends.length}}this.addMenuItems(e,["-",i?"removeWaypoint":"addWaypoint"])}else 1<a.getSelectionCount()&&(e.addSeparator(),this.addMenuItems(e,["group"]));if(e.addSeparator(),1==a.getSelectionCount())null!=a.getLinkForCell(a.getSelectionCell())&&this.addMenuItems(e,["openLink"])}else this.addMenuItems(e,["-","selectVertices","selectEdges","-","selectAll"])},Menus.prototype.createMenubar=function(e){for(var t=new Menubar(this.editorUi,e),n=["file","edit","view","format","text","arrange","help"],a=0;a<n.length;a++)t.addMenu(mxResources.get(n[a]),this.get(n[a]).funct);return t},Menubar.prototype.hideMenu=function(){null!=this.currentMenu&&this.currentMenu.hideMenu()},Menubar.prototype.addMenu=function(e,t){var n=document.createElement("a");return n.setAttribute("href","javascript:void(0);"),n.className="geItem",mxUtils.write(n,e),this.addMenuHandler(n,t),this.container.appendChild(n),n},Menubar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Menubar.prototype.addMenuHandler=function(i,o){if(null!=o){var s=!0,t=mxUtils.bind(this,function(e){if(s&&null==i.enabled||i.enabled){this.editorUi.editor.graph.panningHandler.hideMenu();var t=new mxPopupMenu(o);t.div.className+=" geMenubarMenu",t.smartSeparators=!0,t.showDisabled=!0,t.autoExpand=!0,t.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(t,arguments),t.destroy(),this.currentMenu=null,this.currentElt=null});var n=this.getOffset(i).left,a=this.getOffset(i).top+i.offsetHeight;t.popup(n,a,null,e),this.currentMenu=t,this.currentElt=i}s=!0,mxEvent.consume(e)});mxEvent.addListener(i,"mousemove",mxUtils.bind(this,function(e){null!=this.currentMenu&&this.currentElt!=i&&(this.hideMenu(),t(e))})),mxEvent.addListener(i,"mousedown",mxUtils.bind(this,function(){s=this.currentElt!=i})),mxEvent.addListener(i,"click",t)}},mxUtils.extend(Menu,mxEventSource),Menu.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Menu.prototype.execute=function(e,t){this.funct(e,t)},Toolbar.prototype.init=function(){this.addItems(["save","publish","-","print","undo","redo","-","copy","cut","paste","delete","-","duplicate","-","actualSize","zoomIn","zoomOut","-"]);this.editorUi.editor.graph},Toolbar.prototype.hideMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.currentMenu.destroy(),this.currentMenu=null)},Toolbar.prototype.addMenu=function(e,t,n,a){var i=this.editorUi.menus.get(a),o=this.addMenuFunction(e,t,n,i.funct);return i.addListener("stateChanged",function(){o.setEnabled(i.enabled)}),o},Toolbar.prototype.addMenuFunction=function(e,t,n,a){var i=n?this.createLabel(e):this.createButton(e);return this.initElement(i,t),this.addMenuHandler(i,n,a),this.container.appendChild(i),i},Toolbar.prototype.addSeparator=function(){var e=document.createElement("div");return e.className="geSeparator",this.container.appendChild(e),e},Toolbar.prototype.addItems=function(e){for(var t=0;t<e.length;t++){var n=e[t];"-"==n?this.addSeparator():this.addItem("geSprite-"+n.toLowerCase(),n)}},Toolbar.prototype.addItem=function(e,t){var n=this.editorUi.actions.get(t),a=null;return null!=n&&((a=this.addButton(e,n.label,n.funct)).setEnabled(n.enabled),n.addListener("stateChanged",function(){a.setEnabled(n.enabled)})),a},Toolbar.prototype.addButton=function(e,t,n){var a=this.createButton(e);return this.initElement(a,t),this.addClickHandler(a,n),this.container.appendChild(a),a},Toolbar.prototype.addSelectionHandler=function(n){var a=this.editorUi.editor.graph,e=function(){for(var e=!a.isSelectionEmpty(),t=0;t<n.length;t++)n[t].setEnabled(e)};a.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.addEdgeSelectionHandler=function(a){var i=this.editorUi.editor.graph,e=function(){var e=!1;if(!i.isSelectionEmpty())for(var t=i.getSelectionCells(),n=0;n<t.length;n++)if(i.getModel().isEdge(t[n])){e=!0;break}for(n=0;n<a.length;n++)a[n].setEnabled(e)};i.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.initElement=function(e,t){e.setAttribute("tabindex","0"),null!=t&&e.setAttribute("title",t),this.addEnabledState(e)},Toolbar.prototype.addEnabledState=function(t){var n=t.className;t.setEnabled=function(e){t.enabled=e,t.className=e?n:n+" geDisabled"},t.setEnabled(!0)},Toolbar.prototype.addClickHandler=function(t,n){null!=n&&mxEvent.addListener(t,"click",function(e){t.enabled&&n(e),mxEvent.consume(e)})},Toolbar.prototype.createButton=function(e){var t=document.createElement("a");t.setAttribute("href","javascript:void(0);"),t.className="geButton";var n=document.createElement("div");return n.className="geSprite "+e,t.appendChild(n),t},Toolbar.prototype.createLabel=function(e,t){var n=document.createElement("a");return n.setAttribute("href","javascript:void(0);"),n.className="geLabel",mxUtils.write(n,e),n},Toolbar.prototype.addMenuHandler=function(t,n,a,i){if(null!=a){var o=this.editorUi.editor.graph,s=null;mxEvent.addListener(t,"click",mxUtils.bind(this,function(e){(null==t.enabled||t.enabled)&&(o.panningHandler.hideMenu(),(s=new mxPopupMenu(a)).div.className+=" geToolbarMenu",s.showDisabled=i,s.labels=n,s.autoExpand=!0,s.popup(t.offsetLeft,t.offsetTop+t.offsetHeight+34,null,e),this.currentMenu=s),mxEvent.consume(e)}))}},Dialog.prototype.close=function(){null!=this.onDialogClose&&(this.onDialogClose(),this.onDialogClose=null),this.container.parentNode.removeChild(this.container),this.bg.parentNode.removeChild(this.bg)},angular.module("motion").run(["$templateCache",function(e){"use strict";e.put("app/core/directives/ms-card/templates/template-1/template-1.html",'<div class="template-1">\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="content pv-24 ph-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="text pt-16" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-10/template-10.html",'<div class="template-10 p-16">\n <div class="pb-16" layout="row" layout-align="space-between center">\n <div class="info">\n <div class="title secondary-text" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h2" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n\n <div class="media ml-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n </div>\n\n <div class="text">\n {{card.text}}\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-2/template-2.html",'<div class="template-2">\n <div class="header p-16" layout="row" layout-align="start center">\n <div ng-if="card.avatar">\n <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n </div>\n\n <div class="info">\n <div class="title" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="text p-16" ng-if="card.text">\n {{card.text}}\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-3/template-3.html",'<div class="template-3 p-16 teal-bg white-fg" layout="row" layout-align="space-between">\n <div layout="column" layout-align="space-between">\n <div class="info">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h3 secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n\n <div class="cta">\n <md-button class="m-0">{{card.cta}}</md-button>\n </div>\n </div>\n\n <div class="media pl-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-4/template-4.html",'<div class="template-4">\n <div class="info white-fg ph-16 pv-24">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="text" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-5/template-5.html",'<div class="template-5 p-16" layout="row" layout-align="space-between start">\n <div class="info">\n <div class="title secondary-text" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="event h2" ng-if="card.event">\n {{card.event}}\n </div>\n </div>\n\n <div class="media ml-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-6/template-6.html",'<div class="template-6">\n <div class="content pv-24 ph-16">\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="title h2" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="text pt-8" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-7/template-7.html",'<div class="template-7" layout="row" layout-align="space-between">\n <div class="info" layout="column" layout-align="space-between" layout-fill flex>\n <div class="p-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h4 secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="text h4 pt-8" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n\n <div>\n <md-divider></md-divider>\n <div class="p-8" layout="row">\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n </div>\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-8/template-8.html",'<div class="template-8">\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="content pv-24 ph-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="buttons pt-16">\n <md-button class="m-0">{{card.button1}}</md-button>\n <md-button class="m-0 md-accent">{{card.button2}}</md-button>\n </div>\n\n <div class="text pt-16" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-9/template-9.html",'<div class="template-9">\n <div class="header p-16" layout="row" layout-align="start center">\n <div ng-if="card.avatar">\n <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n </div>\n\n <div class="info">\n <div class="title" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n </div>\n </div>\n\n <div class="text ph-16 pb-16" ng-if="card.text">\n {{card.text}}\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="buttons m-8">\n <md-button class="md-icon-button mr-16" aria-label="Favorite">\n <md-icon md-font-icon="icon-heart-outline" class="s24"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Share">\n <md-icon md-font-icon="icon-share" class="s24"></md-icon>\n </md-button>\n </div>\n\n</div>'),e.put("app/core/directives/ms-click-to-call/ms-click-to-call.html",'<section ng-if="type !== \'button\'">\n <span ng-if="!showMenu()">{{target}}</span>\n\n <md-menu ng-if="showMenu()">\n <a aria-label="Target" ng-click="$mdOpenMenu($event)">\n <span ng-if="prefix">{{prefix}}-</span>{{target}}\n </a>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="call(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{prefix ? prefix + \'-\' + target : target}})\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="transfer(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} ({{prefix ? prefix + \'-\' + target : target}})\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n</section>\n\n<section ng-if="type === \'button\'">\n <md-button ng-if="!showMenu()" ng-disabled="true" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" aria-label="NEW CALL">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <md-menu ng-if="showMenu()">\n <md-button class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" ng-click="$mdOpenMenu($event)" aria-label="NEW CALL">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="call(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{prefix ? prefix + \'-\' + target : target}})\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="transfer(target)">\n'+" {{'DASHBOARDS.TRANSFER_NUMBER' | translate}} ({{prefix ? prefix + '-' + target : target}})\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n</section>"),e.put("app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html",'<div ng-cloak layout-gt-sm="row" layout="column">\n <div flex-gt-sm="50" flex="45">\n <md-input-container class="md-icon-float md-block margin-0">\n <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n <input ng-model="query" type="text" placeholder="Search...">\n </md-input-container>\n <md-content class="border h-300">\n <md-list class="md-dense" layout-fill layout-align="center center">\n <md-list-item class="md-3-line" ng-repeat="item in options.items | filter: query | orderBy: options.orderBy" ng-click="transfer(options.items, options.selectedItems, options.items.indexOf(item), false)">\n <div class="md-list-item-text" layout="column">\n <h3 ng-if="options.line1">{{getLine(item, options.line1)}}</h3>\n <h4 ng-if="options.line2">{{getLine(item, options.line2)}}</h4>\n <p ng-if="options.line3">{{getLine(item, options.line3)}}</p>\n </div>\n <md-icon md-font-icon="icon-arrow-right-bold" aria-label="swap"></md-icon>\n <md-divider></md-divider>\n </md-list-item>\n </md-list>\n </md-content>\n <div class="margin-10" layout="row">\n <span class="h4" flex>{{options.labelAll || \'All Items\'}} ({{options.items.length}})</span>\n <md-icon ng-show="options.showSelectAndDeselectAll" md-font-icon="icon-chevron-double-right" aria-label="swap" ng-click="transfer(options.items, options.selectedItems, -1, false)"></md-icon>\n </div>\n </div>\n\n <div flex="10" layout="row" layout-align="center center">\n <md-icon md-font-icon="icon-swap-horizontal" aria-label="swap"></md-icon>\n </div>\n\n <div flex-gt-sm="50" flex="45">\n <md-input-container class="md-icon-float md-block margin-0">\n <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n <input ng-model="selectedQuery" type="text" placeholder="Search...">\n </md-input-container>\n <md-content class="border h-300">\n <md-list class="md-dense" layout-fill layout-align="center center">\n <md-list-item class="md-3-line" ng-repeat="item in options.selectedItems | filter: selectedQuery | orderBy: options.orderBy" ng-click="transfer(options.selectedItems, options.items, options.selectedItems.indexOf(item), true)">\n <md-icon md-font-icon="icon-arrow-left-bold" aria-label="swap"></md-icon>\n <div class="md-list-item-text" layout="column">\n <h3 ng-if="options.line1">{{getLine(item, options.line1)}}</h3>\n <h4 ng-if="options.line2">{{getLine(item, options.line2)}}</h4>\n <p ng-if="options.line3">{{getLine(item, options.line3)}}</p>\n </div>\n <md-divider></md-divider>\n </md-list-item>\n </md-list>\n </md-content>\n <div class="margin-10" layout="row">\n <md-icon ng-show="options.showSelectAndDeselectAll" md-font-icon="icon-chevron-double-left" aria-label="swap" flex ng-click="transfer(options.selectedItems, options.items, -1, true)"></md-icon>\n <span class="h4">{{options.labelSelected || \'Selected Items\'}} ({{options.selectedItems.length}})</span>\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-font-family/ms-font-family.html",'<md-select ng-model="ngModel" class="no-margin">\n <md-option ng-repeat="font in fonts" ng-value="font.value" <span ng-style="{\'font-family\': font.value}">{{font.option}}</span>\n </md-option>\n</md-select>'),e.put("app/core/directives/ms-info-bar/ms-info-bar.html",'<div id="ms-info-bar" layout="row" layout-align="start center" flex>\n <div id="ms-info-bar-message" ng-transclude flex></div>\n <md-button id="ms-info-bar-close" class="md-icon-button" aria-label="Close" ng-click="removeInfoBar()">\n <md-icon md-font-icon="icon-close s20"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-material-color-picker/ms-material-color-picker.html",'<md-menu md-position-mode="target-right target">\n\n <div ng-click="$mdOpenMenu($event)">\n <ms-color-picker-button>\n <md-button aria-label="Row Color" md-menu-origin ng-click="$mdOpenMenu($event)" ng-class="vm.selectedColor.class">\n\n <span ng-show="vm.selectedColor.palette">\n {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n </span>\n <span ng-show="!vm.selectedColor.palette">\n Select Color\n </span>\n </md-button>\n </ms-color-picker-button>\n </div>\n\n <md-menu-content class="ms-material-color-picker-menu-content" layout-column>\n\n <header ng-class="vm.selectedColor.class || \'md-accent-bg\'" class="md-whiteframe-4dp" layout="row" layout-align="space-between center">\n <md-button md-prevent-menu-close ng-click="vm.activateHueSelection(false,false)" class="md-icon-button" ng-class="{\'hidden\':!vm.selectedPalette}" aria-label="Palette">\n <md-icon md-font-icon="icon-arrow-left" class="s20"></md-icon>\n </md-button>\n\n <span ng-if="vm.selectedColor.palette">\n {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n </span>\n\n <span ng-if="!vm.selectedColor.palette">\n Select Color\n </span>\n\n <md-button class="remove-color-button md-icon-button" ng-click="vm.removeColor()" aria-label="Remove Color">\n <md-icon md-font-icon="icon-delete" class="s20"></md-icon>\n </md-button>\n </header>\n\n <div class="colors" ms-scroll>\n <div ng-show="!vm.selectedPalette" layout="row" layout-wrap>\n <div class="color" ng-class="\'md-\'+palette+\'-500-bg\'" ng-repeat="(palette, hues) in vm.palettes" ng-click="vm.activateHueSelection(palette,hues)" layout="row" layout-align="start end" md-prevent-menu-close md-ink-ripple>\n <span class="label">\n {{palette}}\n </span>\n </div>\n </div>\n\n <div ng-show="vm.selectedPalette" layout="row" layout-wrap>\n <div class="color" ng-class="\'md-\'+vm.selectedPalette+\'-\'+hue+\'-bg\'" ng-repeat="(hue, values) in vm.selectedHues" ng-click="vm.selectColor(vm.selectedPalette,hue)" layout="row" layout-align="start end" md-ink-ripple>\n <span class="label">\n {{hue}}\n </span>\n <i ng-if="vm.selectedPalette == vm.selectedColor.palette && hue == vm.selectedColor.hue" class="s16 icon-check">\n </i>\n </div>\n </div>\n\n </div>\n\n </md-menu-content>\n</md-menu>'),e.put("app/core/directives/ms-navigation/templates/horizontal.html",'<div class="navigation-toggle" hide-gt-sm>\n <md-button class="md-icon-button" ng-click="vm.toggleHorizontalMobileMenu()" aria-label="Toggle Mobile Navigation">\n <md-icon md-font-icon="icon-menu"></md-icon>\n </md-button>\n</div>\n\n<ul class="horizontal">\n <li ng-repeat="node in vm.navigation" ms-navigation-horizontal-node="node" ng-class="{\'has-children\': vm.hasChildren}" ng-include="\'navigation-horizontal-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested horizontal navigation template --\x3e\n<script type="text/ng-template" id="navigation-horizontal-nested.html">\n\n <div ms-navigation-horizontal-item layout="row" ng-if="!vm.isHidden()">\n\n <div class="ms-navigation-horizontal-button" ng-if="!node.uisref && node.title" ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}">\n <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n </div>\n\n <a class="ms-navigation-horizontal-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg" ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}" ng-if="node.uisref && node.title">\n <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n </a>\n\n </div>\n\n <ul ng-if="vm.hasChildren && !vm.isHidden()">\n <li ng-repeat="node in node.children" ms-navigation-horizontal-node="node" ng-class="{\'has-children\': vm.hasChildren}" ng-include="\'navigation-horizontal-nested.html\'"></li>\n </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("app/core/directives/ms-navigation/templates/vertical.html",'<ul>\n <li ng-repeat="node in vm.navigation" ms-navigation-node="node" ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}" ng-include="\'navigation-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested navigation template --\x3e\n<script type="text/ng-template" id="navigation-nested.html">\n\n <div ms-navigation-item layout="row" ng-if="!vm.isHidden()">\n\n <div class="ms-navigation-button" ng-if="!node.uisref && node.title">\n <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n </div>\n\n <a class="ms-navigation-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg" ng-if="node.uisref && node.title">\n <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n </a>\n\n </div>\n\n <ul ng-if="vm.hasChildren && !vm.isHidden()">\n <li ng-repeat="node in node.children" ms-navigation-node="node" ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}" ng-include="\'navigation-nested.html\'"></li>\n </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-dialpad.html",'\x3c!-- Dialpad --\x3e\n<md-content ng-if="vm_pb.showDialpad" class="num-pad" layout="column">\n <section layout="row" layout-align="start center">\n <span><img class="num-pad-logo" layout-padding src="/api/settings/1/logo" alt="logo" /></span>\n <span class="md-subhead">Dialpad</span>\n <div layout="row" layout-align="end center" flex>\n <md-button class="md-icon-button" ng-click="vm_pb.closeDialpad()">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </section>\n <md-divider></md-divider>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 1, l: []}, {n: 2, l: [\'a\', \'b\', \'c\']}, {n: 3, l: [\'d\', \'e\', \'f\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 4, l: [\'g\', \'h\', \'i\']}, {n: 5, l: [\'j\', \'k\', \'l\']}, {n: 6, l: [\'m\', \'n\', \'o\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 7, l: [\'p\', \'q\', \'r\', \'s\']}, {n: 8, l: [\'t\', \'u\', \'v\']}, {n: 9, l: [\'w\', \'x\', \'y\', \'z\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: \'*\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num" layout="column" layout-align="center center">\n <div class="txt" layout="column" layout-align="center center">\n {{item.n}}\n </div>\n </div>\n </div>\n <div class="span4" ng-repeat="item in ::[{n: 0, l: [\'+\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n <div class="span4" ng-repeat="item in ::[{n: \'#\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num" layout="column" layout-align="center center">\n <div class="txt" layout="column" layout-align="center center">\n {{item.n}}\n </div>\n </div>\n </div>\n </section>\n</md-content>\n\x3c!-- Dialpad --\x3e\n\n\x3c!-- Input Area --\x3e\n<div layout="row" layout-align="start center">\n <div layout="row" layout-align="center center">\n \x3c!-- START Ringing Tone--\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Ringing" ng-click="vm_pb.toggleVolume(\'ringing\')" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.ringingMute ? \'icon-bell-off\' : \'icon-bell-ring\'}}" class="icon s14" ng-class="vm_pb.conf.ringingMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.RINGING">Ringing</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Ringing Tone --\x3e\n\n \x3c!-- START Speaker --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Speaker" ng-click="vm_pb.toggleVolume(\'speaker\')" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.speakerMute ? \'icon-volume-off\' : \'icon-volume\'}}" class="icon s14" ng-class="vm_pb.conf.speakerMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.SPEAKER">Speaker</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Speaker --\x3e\n\n \x3c!-- START Microphone --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Microphone" ng-click="vm_pb.toggleVolume(\'microphone\')" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.microphoneMute ? \'icon-microphone-off\' : \'icon-microphone\'}}" class="icon s14" ng-class="vm_pb.conf.microphoneMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.MICROPHONE">Microphone</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Microphone --\x3e\n\n \x3c!-- START Registered --\x3e\n <span>\n <span class="quantity-indicator md-red-500-bg" ng-class="vm_pb.registered ? \'md-green-500-bg\' : \'md-red-500-bg\'"></span>\n <md-tooltip><span>{{vm_pb.conf.license ? (vm_pb.registered ? \'TOOLBAR.REGISTERED\' : \'TOOLBAR.NOT_REGISTERED\') : \'TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD\' | translate}} <timer ng-if="vm_pb.registered" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span></span>\n </md-tooltip>\n </span>\n \x3c!-- END Registered --\x3e\n </div>\n <div layout="column" layout-align="center start">\n <div layout="row" layout-align="start center">\n \x3c!-- START Target --\x3e\n <angucomplete-alt id="ms-target-wrap" pause="10" local-data="vm_pb.calls" search-fields="target" title-field="target" minlength="0" input-class="input-number" disable-input="!vm_pb.registered" match-class="highlight" template-url="assets/ms-phonebar/ms-phonebar-input.html"\n input-changed="vm_pb.targetChanged" selected-object="vm_pb.targetSelected" clear-selected="true" ng-keypress="vm_pb.typeWrapper($event)" focus-first="true" />\n \x3c!-- END Target --\x3e\n\n \x3c!-- Auto Answer --\x3e\n <div ng-if="vm_pb.conf.autoAnswer" class="red-fg" style="padding-left: 10px;">\n <span class="font-size-20">A<span class="font-size-16">A</span></span>\n </div>\n \x3c!-- Auto Answer --\x3e\n\n <md-button class="md-fab md-mini white-bg width-30 height-30" aria-label="Dialpad" ng-click="vm_pb.toggleDialpad()" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="icon-apps" class="icon grey-fg s16"></md-icon>\n </md-button>\n <md-button ng-if="vm_pb.target" class="md-fab md-mini white-bg width-25 height-25" aria-label="Call" style="margin-left: 0px;" ng-click="vm_pb.call()">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n </md-button>\n </div>\n </div>\n</div>\n\x3c!-- Input Area --\x3e\n\n<div class="toolbar-separator"></div>\n\n\x3c!-- Sessions Area --\x3e\n<div class="sessions" layout="row" layout-align="start center" flex>\n <div layout="row" layout-align="center center" ng-if="!vm_pb.conf.license">\n <md-icon md-font-icon="icon-account-alert" class="icon s36 red-fg"></md-icon>\n <span layout-margin translate="TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"></span>\n </div>\n\n <div ng-repeat="session in vm_pb.sessions" class="session" layout="row" ng-click="(vm_pb.sessions.length > 1) && vm_pb.selectSession(session)">\n <md-button ng-if="vm_pb.conf.recording && session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Record" ng-click="vm_pb.record(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-radiobox-marked" class="icon s14" ng-class="session.monitor ? \'red-fg\' : \'grey-fg\'"></md-icon>\n </md-button>\n <div layout="column" layout-align="center start">\n <span class="session-info">{{ (session.user == session.name) ? session.user : (session.name + \' \' + session.user) }}</span>\n <span class="session-info" layout="row" layout="start center"><timer interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span>\n </div>\n\n \x3c!-- START Answer --\x3e\n <md-button ng-if="session.incoming && !session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Hold" ng-click="vm_pb.answer(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Answer --\x3e\n\n \x3c!-- START Hangup --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Terminate" ng-click="vm_pb.terminate(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-hangup" class="icon red-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Hangup --\x3e\n\n \x3c!-- START Hold/Unhold --\x3e\n <md-button ng-if="session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Hold" ng-click="(session.localHold ? vm_pb.unhold(session) : vm_pb.hold(session)); $event.stopPropagation();">\n <md-icon md-font-icon="{{session.localHold ? \'icon-play\' : \'icon-pause\'}}" class="icon grey-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Hold/Unhold --\x3e\n\n \x3c!-- START Transfer --\x3e\n <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length == 1" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer" ng-click="vm_pb.refer(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n </md-button>\n \x3c!-- END transfer --\x3e\n\n \x3c!-- START Attended Transfer --\x3e\n <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length > 1" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer Attended" ng-click="vm_pb.referAttended(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Attended Transfer --\x3e\n </div>\n</div>\n\x3c!-- Sessions Area --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-input.html",'<div class="angucomplete-holder" ng-class="{\'angucomplete-dropdown-visible\': showDropdown}">\n <input id="ms-target" ng-model="searchStr" ng-disabled="disableInput" type="text" placeholder="{{placeholder}}" ng-focus="onFocusHandler()" class="{{inputClass}}" ng-focus="resetHideResults()" ng-blur="hideResults($event)" autocapitalize="off" autocorrect="off"\n autocomplete="off" ng-change="inputChangeHandler(searchStr)" />\n <div class="angucomplete-dropdown" ng-show="showDropdown && !(!searching && (!results || results.length == 0))">\n <div class="angucomplete-row" ng-repeat="result in results" ng-click="selectResult(result)" ng-mouseenter="hoverRow($index)" ng-class="{\'angucomplete-selected-row\': $index == currentIndex}">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="{{result.originalObject.inbound ? \'icon-arrow-bottom-left\' : \'icon-arrow-top-right\'}}" class="icon no-margin s22"></md-icon>\n <span style="margin-left: 8px;">({{result.originalObject.time}}) - <span class="angucomplete-title" ng-if="matchClass" ng-bind-html="result.title"></span></span>\n </div>\n </div>\n </div>\n</div>'),e.put("assets/ms-phonebar/ms-phonebar.html",'<div layout="row" layout-align="start center" flex>\n \x3c!-- Audio stream --\x3e\n <audio id="remote-audio" autoplay hidden=true></audio>\n \x3c!-- Audio stream --\x3e\n\n \x3c!-- WebRtc PhoneBar --\x3e\n <div class="phonebar-container" ng-include="\'assets/ms-phonebar/ms-phonebar-dialpad.html\'" layout="row" layout-align="start center" flex></div>\n \x3c!-- WebRtc PhoneBar --\x3e\n</div>'),e.put("assets/ms-phonebar/record/dialog.html",'<md-dialog aria-label="Recording" ng-init="vm.onInit()">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.RECORDING">Recording</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding">\n <md-icon class="no-margin" md-font-icon="icon-plus" aria-label="Add" ng-click="vm.addRecording()"></md-icon>\n </md-button>\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-table-container>\n <table md-table layout-padding>\n <thead md-head>\n <tr md-row>\n <th md-column><span translate="TOOLBAR.FILENAME">File name</span></th>\n <th md-column><span translate="TOOLBAR.STATUS">Status</span></th>\n <th md-column><span translate="TOOLBAR.ACTIONS">Actions</span></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.session.monitors.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLBAR.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="monitor in vm.session.monitors">\n <td md-cell>{{monitor.filename}}</td>\n <td md-cell class="no-padding">\n <md-icon md-font-icon="icon-radiobox-marked" class="icon s16" ng-class="(monitor.status == \'rec\') ? \'red-fg ms-blink\' : \'grey-fg\'"></md-icon>\n </td>\n <td md-cell class="no-padding">\n <md-button class="md-fab md-mini white-bg width-35 height-35 margin-5" aria-label="Record" ng-click="(monitor.status == \'rec\') ? vm.stop(monitor) : vm.start(monitor)">\n'+" <md-icon md-font-icon=\"{{monitor.status == 'rec' ? 'icon-stop' : 'icon-play'}}\" class=\"icon s16\" ng-class=\"monitor.status == 'rec' ? 'grey-fg' : 'red-fg'\"></md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n </form>\n</md-dialog>"),e.put("assets/ms-phonebar/referAttended/dialog.html",'<md-dialog aria-label="Transfer">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.ATTENDED_TRANSFER">Transfer</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <label translate="TOOLBAR.TARGET">Target</label>\n <md-input-container class="md-block">\n <md-select ng-model="vm.target">\n <md-option ng-repeat="session in vm.sessions" ng-value="session.user">\n {{ session.name }}\n </md-option>\n </md-select>\n </md-input-container>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button ng-click="vm.transfer()" class="send-button md-accent md-raised" aria-label="transfer" ng-disabled="!vm.target && !vm.sessionId">\n <span translate="TOOLBAR.TRANSFER">TRANSFER</span>\n </md-button>\n <md-button ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="cancel">\n <span translate="TOOLBAR.CANCEL">Cancel</span>\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("assets/ms-phonebar/settings/settings.html",'<md-dialog class="md-phonebar-dialog" aria-label="{{vm.name}}">\n <form name="settingsForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="TOOLBAR.SETTINGS">Settings</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content class="no-padding" ms-scroll>\n <md-tabs md-no-pagination md-stretch-tabs="always">\n <md-tab label="{{ \'TOOLBAR.PROFILE\' | translate}}">\n <md-content layout-padding layout="column">\n <span><span translate="TOOLBAR.FULLNAME">Fullname</span>: {{vm.conf.fullname}}</span>\n <span><span translate="TOOLBAR.NAME">Name</span>: {{vm.conf.name}}</span>\n <span><span translate="TOOLBAR.INTERNAL">Internal</span>: {{vm.conf.internal}}</span>\n <span><span translate="TOOLBAR.BROWSER">Browser</span>: {{vm.conf.browserName}} {{vm.conf.browserVersion}}</span>\n <span><span translate="TOOLBAR.OS">OS</span>: {{vm.conf.osName}} {{vm.conf.osVersion}}</span>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.SERVICES\' | translate}}">\n <md-content layout-padding>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.conf.autoAnswer" aria-label="Auto Answer">\n <span translate="TOOLBAR.AUTOANSWER">Auto Answer</span>\n <span>{{ vm.conf.autoAnswerDelay }} [s]</span>\n </md-switch>\n </md-input-container>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.AUDIO\' | translate}}">\n <md-content layout-padding>\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\', deviceId: \'!default\' }).length">\n <label translate="TOOLBAR.RINGINGDEVICE">Ringing Device</label>\n <md-select name="ringingDevice" ng-model="vm.conf.ringingId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\', deviceId: \'!default\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'ringingDevice\'].$error" ng-show="settingsForm[\'ringingDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.conf.ringingMute" aria-label="Mute">\n Mute\n </md-switch>\n\n <md-slider-container flex="80">\n <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.ringingVolume" aria-label="volume"></md-slider>\n </md-slider-container>\n </div>\n </div>\n\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\', deviceId: \'!default\' }).length">\n <label translate="TOOLBAR.SPEAKERDEVICE">Speaker Device</label>\n <md-select name="speakerDevice" ng-model="vm.conf.speakerId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\', deviceId: \'!default\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'speakerDevice\'].$error" ng-show="settingsForm[\'speakerDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between cetner">\n <md-switch ng-model="vm.conf.speakerMute" aria-label="Mute">\n Mute\n </md-switch>\n\n <md-slider-container flex="80">\n <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.speakerVolume" aria-label="volume"></md-slider>\n </md-slider-container>\n </div>\n </div>\n\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audioinput\', deviceId: \'!default\' }).length">\n <label translate="TOOLBAR.MICROPHONEDEVICE">Microphone Device</label>\n <md-select name="microphoneDevice" ng-model="vm.conf.microphoneId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audioinput\', deviceId: \'!default\' }">{{ device.label || (\'Microphone \' + ($index + 1))}}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'microphoneDevice\'].$error" ng-show="settingsForm[\'microphoneDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.conf.microphoneMute" aria-label="Mute">\n Mute\n </md-switch>\n </div>\n </div>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.REQUIREMENTS\' | translate}}">\n <md-content layout-padding>\n <md-list>\n <md-list-item>\n <h3 translate="TOOLBAR.LICENSE">License</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.license ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.license ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.BROWSER_COMPATIBILITY">Browser Compatibility</h3>\n <md-icon class="md-secondary" ng-class="vm.isCompatibleBrowser() ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.isCompatibleBrowser() ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.HTTPS">HTTPS</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.protocol === \'https\' ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.protocol === \'https\' ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.WEBRTCSUPPORT">WebRTC Support</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.isWebRTCSupported ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.isWebRTCSupported ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.MICROPHONE">Microphone</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.hasMicrophone ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasMicrophone ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.SPEAKER">Speaker</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.hasSpeakers ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasSpeakers ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n </md-list>\n </md-content>\n </md-tab>\n </md-tabs>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSettings()" class="send-button md-accent md-raised" ng-disabled="settingsForm.$invalid || settingsForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/core/directives/ms-search-bar/ms-search-bar.html",'<div flex layout="row" layout-align="start center">\n <label for="ms-search-bar-input">\n <md-button class="ms-search-bar-expander md-icon-button" aria-label="Expand Search Bar"\n ng-click="MsSearchBar.expand()"\n ng-if="!MsSearchBar.resultsLoading || MsSearchBar.collapsed">\n <md-icon md-font-icon="icon-magnify" class="icon s24"></md-icon>\n </md-button>\n <div class="ms-search-bar-loader" layout="row" layout-align="center center"\n ng-if="MsSearchBar.resultsLoading && !MsSearchBar.collapsed">\n <md-progress-circular class="md-accent" md-diameter="32" md-mode="indeterminate"></md-progress-circular>\n </div>\n </label>\n <input id="ms-search-bar-input" type="text" placeholder="Search" flex ng-model="MsSearchBar.query" ng-model-options="MsSearchBar.queryOptions" ng-blur="MsSearchBar.blurCollapse()" ng-keydown="MsSearchBar.handleKeydown($event)">\n <md-button class="ms-search-bar-collapser md-icon-button" ng-click="MsSearchBar.collapse()" aria-label="Collapse Search Bar">\n <md-icon md-font-icon="icon-close" class="icon s24"></md-icon>\n </md-button>\n\n <div class="ms-search-bar-results" ng-if="MsSearchBar.results" ms-scroll>\n <div class="no-results" ng-if="MsSearchBar.results.length === 0">No Results!</div>\n\n <div class="result" ng-repeat="result in MsSearchBar.results" ng-click="MsSearchBar.handleResultClick(result)" ng-mouseenter="MsSearchBar.handleMouseenter($index)" ng-mousedown="MsSearchBar.absorbEvent($event)" ng-class="{\'selected\': $index == MsSearchBar.selectedResultIndex}"\n md-ink-ripple>\n <div layout="row" layout-align="start center">\n <div class="icon-container" layout="row" layout-align="center center">\n <i ng-if="result.icon" class="icon {{result.icon}}"></i>\n <div ng-if="!result.icon" class="square md-accent-bg"></div>\n </div>\n <div>\n <div class="title">{{result.title}}</div>\n <div class="description" ng-if="result.description">{{result.description}}</div>\n </div>\n </div>\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-shortcuts/ms-shortcuts.html",'<div class="shortcuts-container" layout="row" layout-align="space-between center" flex ng-class="{\'mobile-bar-active\': MsShortcuts.mobileBarActive}">\n\n <div class="flex-noshrink" layout="row" layout-align="start center" flex>\n <div class="shortcuts hide show-gt-xs" layout="row" layout-align="start center" ms-scroll ng-if="MsShortcuts.shortcuts.length > 0" ng-sortable="MsShortcuts.sortableOptions">\n <div ng-repeat="shortcut in MsShortcuts.shortcuts" layout="row" layout-align="center center">\n <md-button class="md-icon-button shortcut" aria-label="{{shortcut.title}}" ui-sref="{{shortcut.uisref}}">\n <md-icon ng-if="shortcut.icon" md-font-icon="{{shortcut.icon}}" class="icon s24"></md-icon>\n <div ng-if="!shortcut.icon" class="first-letter">{{shortcut.title.charAt(0)}}</div>\n <md-tooltip md-direction="bottom">{{shortcut.title}}</md-tooltip>\n </md-button>\n </div>\n </div>\n\n \x3c!-- <md-menu md-offset="8 56" class="shortcut-menu hide show-gt-xs">\n <md-button class="md-icon-button add-shortcut-button" aria-label="Add shortcut"\n ng-click="$mdOpenMenu($event)">\n <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24"></md-icon>\n <md-tooltip md-direction="bottom">Click to add/remove shortcut</md-tooltip>\n </md-button>\n\n <md-menu-content>\n <div id="ms-shortcut-add-menu">\n <div class="shortcut-search" layout="row" layout-align="start center">\n <div class="search-icon" layout="row" layout-align="center center"\n ng-if="!MsShortcuts.resultsLoading">\n <md-icon md-menu-align-target md-font-icon="icon-magnify" class="icon s24"></md-icon>\n </div>\n <div class="shortcut-loader" layout="row" layout-align="center center"\n ng-if="MsShortcuts.resultsLoading">\n <md-progress-circular class="md-accent" md-diameter="20" md-mode="indeterminate">\n </md-progress-circular>\n </div>\n\n <input type="text" placeholder="Search" flex\n ng-model="MsShortcuts.query"\n ng-model-options="MsShortcuts.queryOptions"\n ng-keydown="MsShortcuts.handleKeydown($event)">\n </div>\n\n <div class="results" ng-if="MsShortcuts.results" ms-scroll>\n <div class="no-results" ng-if="MsShortcuts.results.length === 0">No Results!</div>\n\n <div class="result" ng-repeat="result in MsShortcuts.results"\n ng-click="MsShortcuts.handleResultClick(result)"\n ng-mouseenter="MsShortcuts.handleMouseenter($index)"\n ng-mousedown="MsShortcuts.absorbEvent($event)"\n ng-class="{\'selected\': $index == MsShortcuts.selectedResultIndex}"\n md-prevent-menu-close="md-prevent-menu-close"\n md-ink-ripple>\n <div layout="row" layout-align="start space-between">\n <div layout="row" layout-align="start center" flex>\n <div class="icon icon-container" layout="row" layout-align="center center">\n <i ng-if="result.icon" class="{{result.icon}}"></i>\n <div ng-if="!result.icon" class="square md-accent-bg"></div>\n </div>\n <div>\n <div class="title">{{result.title}}</div>\n </div>\n </div>\n <md-icon md-font-icon="icon-pin" class="icon s18"\n ng-class="{\'fade-text\': !result.hasShortcut}"></md-icon>\n </div>\n </div>\n </div>\n </div>\n </md-menu-content>\n </md-menu> --\x3e\n </div>\n\n <md-button class="md-icon-button toggle-mobile-menu hide-gt-xs" aria-label="Add shortcut" ng-click="MsShortcuts.toggleMobileBar()">\n <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24" ng-hide="MsShortcuts.mobileBarActive"></md-icon>\n <md-icon md-menu-origin md-font-icon="icon-close" class="icon s24" ng-hide="!MsShortcuts.mobileBarActive"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/horizontal/horizontal.html",'<div class="ms-stepper-horizontal">\n <div class="ms-stepper-navigation-wrapper">\n <div class="ms-stepper-navigation" layout="row" layout-align="center center">\n <md-button class="ms-stepper-navigation-item" ng-class="{\'current\': MsStepper.isStepCurrent(step.stepNumber), \'valid\': MsStepper.isStepValid(step.stepNumber), \'disabled\': MsStepper.isStepDisabled(step.stepNumber), \'optional\': MsStepper.isStepOptional(step.stepNumber)}"\n ng-click="MsStepper.gotoStep(step.stepNumber)" ng-disabled="MsStepper.isStepDisabled(step.stepNumber)" ng-repeat="step in MsStepper.steps | filter:MsStepper.filterHiddenStep" layout="row" layout-align="start center">\n\n <div class="step md-accent-bg" layout="row" layout-align="center center">\n <span ng-if="!MsStepper.isStepValid(step.stepNumber) || MsStepper.isStepOptional(step.stepNumber)">\n {{$index + 1}}\n </span>\n <span ng-if="MsStepper.isStepValid(step.stepNumber) && !MsStepper.isStepOptional(step.stepNumber)">\n <i class="icon icon-check s18"></i>\n </span>\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="title" translate="{{step.stepTitleTranslate}}">{{step.stepTitle}}</div>\n <div class="subtitle" ng-if="MsStepper.isStepOptional(step.stepNumber)">Optional</div>\n </div>\n </md-button>\n </div>\n </div>\n\n <div class="ms-stepper-steps" ng-transclude></div>\n\n <div class="ms-stepper-controls" layout="row" layout-align="center center">\n <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n Back\n </md-button>\n\n <div class="ms-stepper-dots">\n <span ng-repeat="step in MsStepper.steps" ng-hide="MsStepper.isStepHidden(step.stepNumber)" ng-class="{\'selected md-accent-bg\':MsStepper.currentStepNumber === $index + 1}">\n </span>\n </div>\n\n <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n Next\n </md-button>\n\n <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n Submit\n </md-button>\n </div>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html","<md-button class=\"ms-stepper-navigation-item\" ng-class=\"{'current': MsStepper.isStepCurrent(stepInfo.stepNumber), 'valid': MsStepper.isStepValid(stepInfo.stepNumber), 'disabled': MsStepper.isStepDisabled(stepInfo.stepNumber), 'optional': MsStepper.isStepOptional(stepInfo.stepNumber)}\"\n"+' ng-click="MsStepper.gotoStep(stepInfo.stepNumber)" ng-disabled="MsStepper.isStepDisabled(stepInfo.stepNumber)" ng-hide="MsStepper.isStepHidden(stepInfo.stepNumber)" aria-label="Stepper navigation button" layout="row" layout-align="start center">\n\n <div class="step" layout="row" layout-align="center center">\n <span ng-if="!MsStepper.isStepValid(stepInfo.stepNumber) || MsStepper.isStepOptional(stepInfo.stepNumber)">\n <i class="icon icon-checkbox-blank-circle-outline s18 md-accent-fg"></i>\n </span>\n <span ng-if="MsStepper.isStepValid(stepInfo.stepNumber) && !MsStepper.isStepOptional(stepInfo.stepNumber)">\n <i class="icon icon-check-circle s18 md-accent-fg"></i>\n </span>\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="title" ng-if="stepInfo.stepTitleTranslate">{{stepInfo.stepTitleTranslate | translate }}</div>\n <div class="title" ng-if="!stepInfo.stepTitleTranslate">{{stepInfo.stepTitle}}</div>\n <div class="subtitle" ng-if="MsStepper.isStepOptional(stepInfo.stepNumber)">Optional</div>\n </div>\n</md-button>\n\n<div class="ms-stepper-step-content" ng-transclude></div>\n\n<div class="ms-stepper-controls" layout="row" layout-align="start center" ng-show="MsStepper.isStepCurrent(stepInfo.stepNumber)">\n <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n Back\n </md-button>\n\n <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n Next\n </md-button>\n\n <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n Submit\n </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/vertical.html",'<div class="ms-stepper-vertical">\n <div class="ms-stepper-vertical-line"></div>\n <div class="ms-stepper-steps" ng-transclude></div>\n</div>'),e.put("app/core/directives/ms-timezone/ms-timezone.html",'<md-select ng-model="ngModel" class="no-margin">\n <md-option ng-value="null">NONE</md-option>\n <md-option ng-repeat="t in timezone | orderBy:\'utcOffset\'" value="{{t.name}}">{{t.name}} ({{t.offsetStr}})</md-option>\n</md-select>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-counter/ms-widget-engine.counter.html",'<div class="pt-8 pb-32" layout="column" layout-align="center center" layout-fill ng-controller="MsWidgetEngineCounterController as vm">\n <div ng-class="\'font-size-\' + (vm.fontSize * 3)" ng-style="{\'color\': widget.foreground}">\n {{ vm.getCount(widget) }}\n </div>\n <div ng-class="\'font-size-\' + vm.fontSize" ng-style="{\'color\': widget.foreground}">{{ \'TOOLS.\' + widget.attrs[0].value | uppercase | translate }}<span ng-if="vm.filtered">*</span></div>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-multibar-chart/ms-widget-engine.multibar-chart.html",'<div ng-controller="MsWidgetEngineMultibarChartController as vm" ng-init="vm.getMultiBarChart(widget)" layout="column" layout-fill>\n\n <span ng-show="false">{{ vm.getMultiBarChart(widget)}}</span>\n\n <canvas style="overflow:scroll" id="bar" class="chart-horizontal-bar" chart-data="vm.multiBarChart.data" chart-options="vm.multiBarChart.options" chart-series="vm.multiBarChart.series" chart-labels="vm.multiBarChart.labels">\n </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-pie-chart/ms-widget-engine.pie-chart.html",'<div ng-controller="MsWidgetEnginePieChartController as vm" ng-init="vm.getPieChart(widget)" layout="column" layout-fill>\n\n <span ng-show="false">{{ vm.getPieChart(widget)}}</span>\n\n <canvas style="overflow:scroll" id="pie" class="chart-pie" chart-data="vm.pieChart.data" chart-labels="vm.pieChart.labels" chart-options="vm.pieChart.options">\n </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-web-report/ms-widget-engine.web-report.html",'<div ng-controller="MsWidgetEngineWebReportController as vm" ng-init="vm.onInit(widget)">\n <dl ng-if="vm.error">\n <dt class="text-bold">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt>Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.title}}</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm.onInit(widget)" aria-label="refresh">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <span ng-if="vm.refresh && vm.countDown" class="md-subhead blue-fg">{{vm.countDown}}</span>\n </div>\n </md-toolbar>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.results.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.results.rows.length">\n <td md-cell colspan="{{vm.columns.length}}">\n <div layout="row" layout-align="center center">\n <span>No Data</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine.html",'<div gridster="vm.config">\n <ul>\n <li gridster-item="widget" ng-repeat="widget in vm.config.widgets">\n <md-card layout-fill>\n <md-toolbar class="height-40" ng-style="{\'background-color\': widget.background, \'color\': widget.foreground }">\n <div class="md-toolbar-tools height-40 no-margin" layout="row" layout-align="start center">\n <a ng-href="{{widget.link ? widget.link : \'javascript:void(0)\'}}" ng-style="{\'color\': widget.foreground}" class="text-truncate" flex>\n {{ widget.title || \'No Title\' }}\n </a>\n <md-button ng-if="!vm.config.preview" class="draggable md-icon-button width-30 no-margin no-padding" aria-label="Move">\n <md-tooltip><span translate="TOOLS.MOVE_WIDGET">Move</span></md-tooltip>\n <md-icon md-font-icon="icon-cursor-move" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n </md-button>\n <md-menu ng-if="!vm.config.preview">\n <md-button ng-click="$mdOpenMenu($event)" class="md-icon-button width-30 no-margin no-padding" aria-label="More">\n <md-icon md-font-icon="icon-dots-vertical" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-click="vm.onEdit({widget: widget})" translate="TOOLS.EDIT_WIDGET">Edit</md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.onDelete({widget: widget})" translate="TOOLS.DELETE_WIDGET">Delete</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n\n </div>\n </md-toolbar>\n <md-card-content class="resizable" layout="column" layout-align="center center" flex ng-style="{\'background-color\': widget.background, \'color\': widget.foreground}">\n <div ng-switch="widget.type" layout-fill>\n <iframe ng-switch-when="iframe|custom" ng-switch-when-separator="|" ng-src="{{vm.getTrustedURL(widget.attrs[0].value)}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n <ds-widget-clock ng-class="\'font-size-\' + (widget.attrs[2].value || 12)" ng-switch-when="clock" digital-format="widget.attrs[0].value" gmt-offset="widget.attrs[1].value" data-show-digital show-gmt-info></ds-widget-clock>\n <div ng-switch-default layout-fill>\n <div ng-include="widget.templateUrl" layout-fill></div>\n </div>\n </div>\n </md-card-content>\n </md-card>\n </li>\n </ul>\n</div>'),e.put("app/core/layouts/content-only.html",'<div id="layout-content-only" class="template-layout" layout="column" flex>\n <md-content id="content" class="animate-slide-up md-hue-2" ui-view="content" flex></md-content>\n</div>'),e.put("app/core/layouts/content-with-toolbar.html",'<div id="layout-content-with-toolbar" class="template-layout" layout="column" flex>\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n <md-content id="content" class="animate-slide-up md-hue-2" ui-view="content" flex></md-content>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n</div>'),e.put("app/core/layouts/horizontal-navigation.html",'<div id="layout-horizontal-navigation" class="template-layout" layout="column" flex>\n\n <div id="toolbar-navigation-container" class="md-whiteframe-1dp" layout="column" layout-align="space-between start">\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n <div id="horizontal-navigation" ui-view="navigation" layout="row" layout-align="start end" flex></div>\n </div>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",'<div id="layout-vertical-navigation-fullwidth-toolbar-2" class="template-layout" layout="column" flex>\n\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n <div id="main-container" layout="row" flex>\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ms-scroll ui-view="navigation"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar.html",'<div id="layout-vertical-navigation-fullwidth-toolbar" class="template-layout" layout="column" flex>\n\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n <div id="main-container" layout="row" flex>\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ms-scroll ui-view="navigation"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation.html",'<div id="header" ui-view="header"></div>\n\n<div id="layout-vertical-navigation" class="template-layout" layout="row" flex>\n\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ms-scroll ui-view="navigation" ng-if="!vm.isAgent()"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n\n</div>\n\n<div id="footer" ui-view="footer"></div>'),e.put("app/core/theme-options/theme-options.html",'<div class="ms-theme-options-button md-primary-bg" ng-click="toggleOptionsSidenav()">\n <md-icon md-font-icon="icon-cog" class="white-text"></md-icon>\n</div>\n\n<md-sidenav md-component-id="motion-theme-options" class="md-sidenav-right">\n\n <div class="ms-theme-options-list" layout="column">\n <div class="theme-option layout-options">\n <div class="option-title">Layout Style:</div>\n <md-radio-group layout="row" layout-align="start start" layout-wrap ng-model="vm.layoutStyle" ng-change="vm.updateLayoutStyle()">\n <md-radio-button ng-repeat="layoutStyle in vm.layoutStyles" ng-value="layoutStyle.value">\n <div layout="column" layout-align="center center">\n <img ng-src="{{layoutStyle.figure}}">\n <span class="text-center font-size-12 mt-8">{{layoutStyle.label}}</span>\n </div>\n </md-radio-button>\n </md-radio-group>\n </div>\n\n <md-divider></md-divider>\n\n <div class="theme-option">\n <div class="option-title">Layout Mode:</div>\n <md-radio-group layout="row" layout-align="start center" ng-model="vm.layoutMode" ng-change="vm.updateLayoutMode()">\n <md-radio-button ng-repeat="layoutMode in vm.layoutModes" ng-value="layoutMode.value">\n {{layoutMode.label}}\n </md-radio-button>\n </md-radio-group>\n </div>\n\n <md-divider></md-divider>\n\n <div class="theme-option color-palettes">\n <div class="option-title">Color Palette:</div>\n <div layout="row" layout-align="start start" layout-wrap>\n <md-button ng-repeat="(themeName, theme) in vm.themes.list" class="md-raised theme-button" layout="row" layout-align="center center" aria-label="{{themeName}}" ng-click="vm.setActiveTheme(themeName)" ng-style="{\'background-color\': theme.primary.color,\'border-color\': theme.accent.color,\'color\': theme.primary.contrast1}"\n ng-class="{active: vm.getActiveTheme().name === themeName}">\n <md-icon ng-style="{\'color\': theme.primary.contrast1}" md-font-icon="icon-palette" class="icon s32"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n</md-sidenav>'),e.put("app/errors/404/error-404.html",'<div id="error-404" layout="column" layout-align="center center">\n <div class="content" layout="column" layout-align="center center">\n <div class="error-code" translate="ERROR404.CODE">404</div>\n\n <div class="message" translate="ERROR404.MESSAGE">Sorry but we couldn’t find the page you are looking for</div>\n <ms-search-bar on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300">Search for anything</ms-search-bar>\n\n \x3c!-- <div class="search md-whiteframe-1dp" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-magnify" class="icon s24"></md-icon>\n <input ng-model="vm.search" type="text" placeholder="Search for anything" translate translate-attr-placeholder="ERROR404.SEARCH" flex>\n </div> --\x3e\n\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR404.GO_BACK">Go back to dashboard</a>\n </div>\n</div>'),e.put("app/errors/500/error-500.html",'<div id="error-500" layout="column" layout-align="center center">\n <div ng-if="!vm.send" class="content" layout="column" layout-align="center center">\n <div class="error-code" translate="ERROR500.CODE">500</div>\n <div class="message" translate="ERROR500.MESSAGE">Well, you broke the internet!</div>\n <div class="sub-message" translate="ERROR500.SUBMESSAGE">Just kidding, looks like we have an internal issue, please try again in couple minutes\n </div>\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n <md-button class="md-raised md-warn" ng-click="vm.sendReport()" translate="ERROR500.REPORT">Report this problem</md-button>\n </div>\n <pre ng-if="!vm.send">\n {{vm.error}}\n </pre>\n <div ng-if="vm.send" class="content" layout="column" layout-align="center center">\n <div class="error-code">#{{vm.code}}</div>\n <div class="message" translate="ERROR500.JIRA_MESSAGE">Your request has been received and will be processed shortly.</div>\n <div class="sub-message" translate="ERROR500.JIRA_SUBMESSAGE">Sorry for the inconvenience. If you have any questions or concerns, please do not hesitate to contact us.</div>\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n </div>\n</div>'),e.put("app/footer/layouts/vertical-navigation/footer.html",'<div layout="row" layout-align="start center">\n <ms-info-bar ng-if="!vm.cookieAlertHide" on-close="vm.cookieAlertOnClose()" class="grey-100-bg">\n <div layout="row" layout-align="start center">\n <span translate="FOOTER.COOKIE_LAW" flex class="text-center grey-600-fg"></span>\n </div>\n </ms-info-bar>\n</div>'),e.put("app/forgot/forgot.html",'<div id="forgot-password" class="flex-scrollable" layout="column" ms-scroll ng-init="vm.onInit()">\n <div id="forgot-password-form-wrapper" layout="column" layout-align="center center">\n <div id="forgot-password-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n <div class="title" translate="FORGOTPASSWORD.TITLE">Recover your password</div>\n\n <form name="forgotPasswordForm" novalidate>\n <md-input-container class="md-block" md-no-float>\n <input type="email" name="email" ng-model="vm.form.email" placeholder="Email address" translate translate-attr-placeholder="FORGOTPASSWORD.EMAIL_ADRESS" ng-pattern="/^.+@.+\\..+$/" required>\n <div ng-messages="forgotPasswordForm.email.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="FORGOTPASSWORD.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FORGOTPASSWORD.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n\n <md-button type="button" ng-click="vm.forgotPassword()" class="md-raised md-accent submit-button" aria-label="RESET MY PASSWORD" ng-disabled="forgotPasswordForm.$invalid || forgotPasswordForm.$pristine" translate="FORGOTPASSWORD.SEND_RESET_LINK" translate-attr-aria-label="FORGOTPASSWORD.SEND_RESET_LINK">\n SEND RESET LINK\n </md-button>\n </form>\n\n <div class="login" layout="row" layout-align="center center">\n <a class="link" ui-sref="app.login" translate="FORGOTPASSWORD.GO_BACK">Go back to login</a>\n </div>\n </div>\n </div>\n</div>'),e.put("app/header/layouts/vertical-navigation/header.html",'\x3c!-- <div layout="row" layout-align="start center">\n <ms-info-bar ng-if="vm.currentUser.role == \'admin\' && !vm.newsAlertHide" on-close="vm.newsAlertOnClose()" class="green-600-bg white-fg">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-message-text-outline" class="icon margin-right-10 s20"></md-icon>\n <div flex hide-xs translate="HEADER.NEWS"></div>\n </div>\n </ms-info-bar>\n</div> --\x3e'),e.put("app/login/login.html",'<div id="login" class="flex-scrollable" layout="column" ms-scroll>\n <div id="login-form-wrapper" layout="column" layout-align="center center">\n <div id="login-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n \x3c!-- <img src="assets/images/logos/login.png" alt="motion_logo_login" /> --\x3e\n\n <div class="md-subhead padding-top-45" translate="LOGIN.TITLE">Log in to your account</div>\n\n <form name="loginForm" novalidate ng-if="!vm.progressLogin">\n <md-input-container class="md-block" md-no-float>\n <input type="input" name="name" ng-model="vm.form.name" autofocus aria-label="username" translate translate-attr-placeholder="LOGIN.USERNAME" required>\n <div ng-messages="loginForm.name.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="LOGIN.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="password" ng-model="vm.form.password" aria-label="password" translate translate-attr-placeholder="LOGIN.PASSWORD" required>\n <div ng-messages="loginForm.password.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="LOGIN.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="remember-forgot-password" layout="row" layout-xs="column" layout-align="end center">\n \x3c!-- <md-checkbox class="remember-me" ng-model="data.cb1" aria-label="Remember Me">\n <span translate="LOGIN.REMEMBER_ME">Remember Me</span>\n </md-checkbox> --\x3e\n <a ui-sref="app.forgot" class="forgot-password md-accent-color" style="cursor:pointer;" translate="LOGIN.FORGOT_PASSWORD">Forgot Password?</a>\n </div>\n\n <b layout="row" layout-align="center center" class="md-padding" ng-if="vm.message"><font color="red">{{vm.message}}</font></b>\n <md-button type="submit" ng-click="vm.login()" class="md-raised md-accent submit-button" aria-label="LOGIN" translate="LOGIN.LOG_IN" translate-attr-aria-label="LOGIN.LOG_IN">\n LOG IN\n </md-button>\n </form>\n\n <md-progress-circular ng-if="vm.progressLogin" md-diameter="96"></md-progress-circular>\n\n <div class="separator">\n <span class="text" translate="LOGIN.OR">OR</span>\n </div>\n\n <md-button ng-click="vm.loginOauth(\'google\')" class="md-raised google">\n <div layout="row" layout-align="center center">\n <span>\n <md-icon md-font-icon="icon-google-plus" class="s16"></md-icon>\n <span translate="LOGIN.WITH_GOOGLE">Log in with Google</span>\n </span>\n </div>\n </md-button>\n </div>\n </div>\n</div>'),e.put("app/main/apps/analytics/views/extractedReports/create/dialog.html",'<md-dialog class="extractedReport-dialog" aria-label="New ExtractedReport">\n <form name="extractedReportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.REPORTNAME">ReportName</label>\n <input type="" name="name" ng-model="vm.extractedReport.name" ng-required="true" autofocus>\n <div ng-messages="extractedReportForm[\'name\'].$error" ng-show="extractedReportForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.REPORTNAME_REQUIRED">ReportName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="" name="basename" ng-model="vm.extractedReport.basename" ng-required="true">\n <div ng-messages="extractedReportForm[\'basename\'].$error" ng-show="extractedReportForm[\'basename\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newExtractedReport" ng-click="vm.saveExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid || extractedReportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE"\n translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newExtractedReport" ng-click="vm.addNewExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_EXTRACTEDREPORT" translate-attr-aria-label="ANALYTICS.ADD_EXTRACTEDREPORT">\n ADD EXTRACTEDREPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newExtractedReport" ng-click="vm.deleteExtractedReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/extractedReports/extractedReports.html",'<div id="extractedReports" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.EXTRACTEDREPORTS">ExtractedReports</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedExtractedReports.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedExtractedReports =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-extractedReports-count">\n <span>{{vm.selectedExtractedReports.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="EXTRACTEDREPORTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllExtractedReports()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectExtractedReports()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedExtractedReports" csv-label="true" filename="extractedReports.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedExtractedReports($event)" aria-label="delete selected" translate translate-attr-label="EXTRACTEDREPORTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- EXTRACTEDREPORT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedExtractedReports" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getExtractedReports">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.REPORTNAME\' | translate }}</th>\n <th md-column md-order-by="basename">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'ANALYTICS.TYPE\' | translate }}</th>\n <th md-column md-order-by="startDate">{{ \'ANALYTICS.DATE_RANGE_FROM\' | translate }}</th>\n <th md-column md-order-by="endDate">{{ \'ANALYTICS.DATE_RANGE_TO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'ANALYTICS.GENERATED_AT\' | translate }}</th>\n <th md-column md-order-by="status">{{ \'ANALYTICS.STATUS\' | translate }}</th>\n <th md-column md-order-by="output">{{ \'ANALYTICS.OUTPUT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.extractedReports.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="extractedReport" md-select-id="id" ng-repeat="extractedReport in vm.extractedReports.rows">\n <td md-cell ng-if="extractedReport.userpic"><img class="avatar" alt="{{extractedReport.name}}" ng-src="api/users/{{extractedReport.id}}/avatar" /></td>\n <td md-cell ng-if="!extractedReport.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{extractedReport.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="id ">{{extractedReport.id}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="name ">{{extractedReport.name}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="basename ">{{extractedReport.basename}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="type ">{{extractedReport.type}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="startDate ">{{extractedReport.startDate | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="endDate ">{{extractedReport.endDate | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="createdAt ">{{extractedReport.createdAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="status ">{{extractedReport.status}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="output ">{{extractedReport.output}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(extractedReport, $event)" translate="ANALYTICS.EDIT_EXTRACTEDREPORT">\n Edit ExtractedReport\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="extractedReport.status == \'Completed\'">\n <md-button ng-click="vm.downloadfile2(extractedReport, $event)" translate="ANALYTICS.DOWNLOAD_EXTRACTEDREPORT">\n Download ExtractedReport\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(extractedReport, $event)" translate="ANALYTICS.DELETE_EXTRACTEDREPORT">\n Delete ExtractedReport\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.extractedReports.count}}" md-on-paginate="vm.getExtractedReports" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / EXTRACTEDREPORT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/metrics/create/dialog.html",'<md-dialog class="metric-dialog" aria-label="New Metric">\n <form name="metricForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.metric.name" ng-required="true" autofocus>\n <div ng-messages="metricForm[\'name\'].$error" ng-show="metricForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.TABLE">Table</label>\n <md-select name="table" ng-model="vm.metric.table" required>\n <md-option ng-value="\'report_agent\'">Agent Report</md-option>\n <md-option ng-value="\'report_call\'">Call Report</md-option>\n <md-option ng-value="\'cm_contacts\'">Contacts</md-option>\n <md-option ng-value="\'report_square\'">CSquare Report</md-option>\n <md-option ng-value="\'report_square_details\'">CSquare Details Report</md-option>\n <md-option ng-value="\'cm_hopper\'">Dialer Hopper Processing</md-option>\n <md-option ng-value="\'cm_hopper_history\'">Dialer Hopper Logs</md-option>\n <md-option ng-value="\'cm_hopper_final\'">Dialer Hopper Final</md-option>\n <md-option ng-value="\'report_integration\'">Integration Report</md-option>\n <md-option ng-value="\'report_jscripty_sessions\'">Jscripty Sessions</md-option>\n <md-option ng-value="\'report_jscripty_questions\'">Jscripty Questions</md-option>\n <md-option ng-value="\'report_jscripty_answers\'">Jscripty Answers</md-option>\n <md-option ng-value="\'report_member\'">Member Report</md-option>\n <md-option ng-value="\'report_queue\'">Queue Report</md-option>\n <md-option ng-value="\'users\'">Users</md-option>\n <md-option ng-value="\'voice_recordings\'">Voice Recordings</md-option>\n </md-select>\n <div ng-messages="metricForm[\'table\'].$error" ng-show="metricForm[\'table\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.METRIC">Metric</label>\n <input type="text" name="metric" ng-model="vm.metric.metric" ng-required="true">\n <div ng-messages="metricForm[\'metric\'].$error" ng-show="metricForm[\'metric\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.metric.description">\n <div ng-messages="metricForm[\'description\'].$error" ng-show="metricForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMetric" ng-click="vm.saveMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid || metricForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMetric" ng-click="vm.addNewMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_METRIC" translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n ADD METRIC\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMetric" ng-click="vm.deleteMetric($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/metrics/metrics.html",'<div id="metrics" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.METRICS">Metrics</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMetrics.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMetrics =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-metrics-count">\n <span>{{vm.selectedMetrics.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="METRICS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMetrics()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMetrics()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMetrics" csv-label="true" filename="metrics.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedMetrics($event)" aria-label="delete selected" translate translate-attr-label="METRICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- METRIC TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMetrics" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMetrics">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="table">{{ \'ANALYTICS.TABLE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.metrics.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="metric" md-select-id="id" ng-repeat="metric in vm.metrics.rows">\n <td md-cell ng-if="metric.userpic"><img class="avatar" alt="{{metric.name}}" ng-src="api/users/{{metric.id}}/avatar" /></td>\n <td md-cell ng-if="!metric.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{metric.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="id ">{{metric.id}}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="name ">{{metric.name}}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="table ">{{ vm.arraytable[metric.table].option }}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="description ">{{metric.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(metric, $event)" translate="ANALYTICS.EDIT_METRIC">\n Edit Metric\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(metric, $event)" translate="ANALYTICS.DELETE_METRIC">\n Delete Metric\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.metrics.count}}" md-on-paginate="vm.getMetrics" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / METRIC TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD METRIC BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-metric-button" ng-click="vm.createOrEditMetric($event)" aria-label="add metric" translate translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD METRIC BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/copy/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.COPY_REPORT">Copy Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input name="name" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label translate="ANALYTICS.SELECT_NODE">Select Node</label>\n <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.copyReport()" class="send-button md-accent md-raised" ng-disabled="!vm.currentNode" aria-label="COPY" translate="ANALYTICS.COPY_REPORT" translate-attr-aria-label="ANALYTICS.COPY_REPORT">\n COPY REPORT\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/create/dialog.html",'<md-dialog class="report-dialog" aria-label="New Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newReport">\n <label translate="ANALYTICS.TABLE">Table</label>\n <md-select ng-model="vm.report.table" required>\n <md-option ng-repeat="table in vm.tables | orderBy:\'name\'" ng-value="table.name">{{table.name}}</md-option>\n </md-select>\n <div ng-messages="reportForm.table.$error" ng-show="reportForm.table.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.report.description">\n <div ng-messages="reportForm.description.$error" ng-show="reportForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-autocomplete ng-if="vm.newReport" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="table in vm.tables | filter:vm.searchText" md-item-text="table.name" md-min-length="0" md-selected-item-change="vm.selectedTableChange(table)"\n placeholder="Select the table to Join">\n <md-item-template>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{table.name}}</span>\n </md-item-template>\n <md-not-found>\n No states matching "{{vm.searchText}}" were found.\n </md-not-found>\n </md-autocomplete>\n\n <md-card ng-if="vm.newReport" md-theme="default" md-theme-watch ng-repeat="table in vm.joinTables">\n <md-card-title>\n <md-card-title-text layout="row">\n <div layout="row" flex="50">\n <span class="md-subhead">{{table.name}}</span>\n </div>\n <div layout="row" layout-align="end center" flex>\n <md-button class="md-icon-button" ng-click="vm.removeJoin($index)">\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n <md-select ng-model="table.parentKey" placeholder="Select the parent key" ng-init="table.parentFields = []; vm.getFields(table, \'parentFields\', vm.report.table)" required>\n <md-option ng-repeat="field in table.parentFields" ng-value="field">{{field}}</md-option>\n </md-select>\n <md-select ng-model="table.foreignKey" placeholder="Select the foreign key" ng-init="table.foreignFields = []; vm.getFields(table, \'foreignFields\', table.name)" required>\n <md-option ng-repeat="field in table.foreignFields" ng-value="field">{{field}}</md-option>\n </md-select>\n <md-select ng-model="table.type" placeholder="Select join type" required>\n <md-option ng-repeat="join in vm.joinTypes" ng-value="join.key">{{join.value}}</md-option>\n </md-select>\n </md-card-content>\n </md-card>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newReport" ng-click="vm.saveReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newReport" ng-click="vm.addNewReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORT" translate-attr-aria-label="ANALYTICS.ADD_REPORT">\n ADD REPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newReport" ng-click="vm.deleteReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/condition/group.html",'<md-card class="padding-horizontal-15 padding-top-15">\n <div layout="row">\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.OPERATOR">Operator</label>\n <md-select ng-model="group.operator" required>\n <md-option value="AND">AND</md-option>\n <md-option value="OR">OR</md-option>\n </md-select>\n <div ng-messages="conditionsForm.operator.$error" ng-show="conditionsForm.operator.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-button class="md-raised md-accent" ng-click="vm_rc.addCondition(group.rules)">\n <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.CONDITION\' | translate}}</md-button>\n </md-input-container>\n <md-input-container class="md-block">\n <md-button class="md-raised md-accent" ng-click="vm_rc.addGroup(group.rules)">\n <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}</md-button>\n </md-input-container>\n <div flex></div>\n <md-input-container class="md-block" ng-if="parent">\n <md-button class="md-raised md-warn" ng-click="vm_rc.deleteConfirm(parent, index, $event)">\n <md-icon md-font-icon="icon-delete"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}</md-button>\n </md-input-container>\n </div>\n <div layout="column" ng-repeat="rule in group.rules track by $index">\n <div layout="row" ng-if="!rule.group">\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.COLUMN">COLUMN</label>\n <md-select name="field" ng-model="rule.field" required>\n <md-optgroup label="{{vm_rc.report.table}}">\n <md-option ng-repeat="column in vm_rc.columns" value="{{vm_rc.report.table}}.{{column}}">{{column}}</md-option>\n </md-optgroup>\n <md-optgroup ng-if="vm_rc.report.joins" ng-repeat="join in vm_rc.report.joins" label="{{join.foreignTable}}">\n <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="conditionsForm.field.$error" ng-show="conditionsForm.field.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.CONDITION">CONDITION</label>\n <md-select name="condition" ng-model="rule.condition" required>\n <md-option ng-repeat="condition in vm_rc.conditions" ng-value="condition">{{condition}}</md-option>\n </md-select>\n <div ng-messages="conditionsForm.condition.$error" ng-show="conditionsForm.condition.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm_rc.isValueByCondition(rule.condition)" class="md-block" flex>\n <label translate="ANALYTICS.VALUE">VALUE</label>\n <input type="text" name="value" ng-model="rule.value" required md-autofocus>\n <div ng-messages="conditionsForm.value.$error" ng-show="conditionsForm.value.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <md-button class="md-fab md-mini md-warn" aria-label="Delete row" ng-click="vm_rc.deleteConfirm(group.rules, $index, $event)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </md-input-container>\n </div>\n <div ng-if="rule.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="parent=group.rules;index=$index;group=rule.group"></div>\n </div>\n</md-card>'),e.put("app/main/apps/analytics/views/reports/edit/field/dialog.html",'<md-dialog class="reportField-dialog" aria-label="New Report Field">\n <form name="reportFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{vm.title}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <pre></pre>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.reportField.type" ng-change="vm.reportField.field = undefined" required>\n <md-option value="column">Select a column</md-option>\n <md-option value="metric">Select an existing metric</md-option>\n <md-option value="custom">Write a custom metric</md-option>\n </md-select>\n <div ng-messages="reportForm.type.$error" ng-show="reportForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-switch on="vm.reportField.type">\n <md-input-container class="md-block" ng-switch-when="column">\n <label translate="ANALYTICS.COLUMN">Column Name</label>\n <md-select name="column" ng-model="vm.reportField.field" required>\n <md-optgroup label="{{vm.report.table}}">\n <md-option ng-repeat="column in vm.columns" value="{{vm.report.table}}.{{column}}">{{column}}</md-option>\n \x3c!-- <md-option ng-repeat="column in vm.columns" ng-value="">{{column}}</md-option> --\x3e\n </md-optgroup>\n <md-optgroup ng-if="vm.report.joins" ng-repeat="join in vm.report.joins" label="{{join.foreignTable}}">\n <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="reportForm.column.$error" ng-show="reportForm.column.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-switch-when="metric">\n <label translate="ANALYTICS.METRIC_NAME">Metric Name</label>\n <md-select name="metric" ng-model="vm.reportField.MetricId" required>\n <md-option ng-repeat="metric in vm.metrics" ng-value="metric.id">{{metric.name}}</md-option>\n </md-select>\n <div ng-messages="reportForm.metric.$error" ng-show="reportForm.metric.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-switch-when="custom">\n <label translate="ANALYTICS.CUSTOM_METRIC">Custom Metric</label>\n <input type="text" name="field" ng-model="vm.reportField.field" required md-autofocus>\n <div ng-messages="reportFieldForm.field.$error" ng-show="reportFieldForm.field.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.CUSTOM_METRIC_REQUIRED">Custom Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.reportField.alias" ng-required="vm.reportField.type === \'custom\' || vm.reportField.type === \'metric\'">\n <div ng-messages="reportFieldForm.alias.$error" ng-show="reportFieldForm.alias.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n <label translate="ANALYTICS.FUNCTION">Function</label>\n <md-select name="function" ng-model="vm.reportField.function">\n <md-option ng-value="null">No Function</md-option>\n <md-option ng-repeat="function in vm.sqlUtil.getFunctions" ng-value="function.value">{{function.value}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n <label translate="ANALYTICS.FORMAT">Format</label>\n <md-select name="format" ng-model="vm.reportField.format">\n <md-option ng-value="null">No Format</md-option>\n <md-option ng-repeat="format in vm.sqlUtil.getFormats" ng-value="format.value">{{format.value}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.GROUP_BY">Group By</label>\n <md-select name="groupBy" ng-model="vm.reportField.groupBy">\n <md-option ng-repeat="gb in vm.sqlUtil.getGroupBy" ng-value="gb.value">{{gb.value ? \'Yes\' : \'No\'}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.ORDER_BY">Order By</label>\n <md-select name="orderBy" ng-model="vm.reportField.orderBy">\n <md-option ng-value="null">No Order</md-option>\n <md-option ng-repeat="ob in vm.sqlUtil.getOrderBy" ng-value="ob.value">{{ob.value}}</md-option>\n </md-select>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newReportField" ng-click="vm.saveReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newReportField" ng-click="vm.addNewReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORTFIELD" translate-attr-aria-label="ANALYTICS.ADD_REPORTFIELD">\n ADD REPORT FIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newReportField" ng-click="vm.deleteReportField($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/view.html",'<div id="analytics-report" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-reports-button md-icon-button" aria-label="Go to reports" ng-click="vm.gotoReports()" translate translate-attr-aria-label="ANALYTICS.GO_TO_ANALYTICSQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="report-image" hide-xs>\n <img ng-src="assets/images/business/reports.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.report.id}} {{vm.report.name}}\n </div>\n <div class="subtitle secondary-text">\n <span translate="ANALYTICS.CREATED_AT"></span> <span>{{vm.report.createdAt | date:\'medium\'}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span>{{vm.report.description}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveReport()" ng-disabled="generalForm.$pristine && conditionsForm.$pristine" class="send-button md-accent md-raised" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="ANALYTICS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="generalForm.name.$error" ng-show="generalForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.report.description">\n <div ng-messages="generalForm.description.$error" ng-show="generalForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.FIELDS">FIELDS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container fields md-background-bg md-whiteframe-1dp">\n <div ng-controller="ReportFieldsController as vm_rf" ng-init="vm_rf.init(vm.report)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_rf.selectedReportFields.length">\n <div class="md-toolbar-tools">\n <div layout="row" layout-align="start center">\n <div layout="column" layout-align="start start">\n <div class="md-subhead" translate="ANALYTICS.FIELDS">\n <span translate="ANALYTICS.FIELDS">FIELDS</span>\n </div>\n <div class="h4">\n <span translate="ANALYTICS.TABLE">TABLE</span> <span class="text-bold">{{vm.report.table}}</span>\n </div>\n <div class="h4" ng-if="vm.report.joins && vm.report.joins.length && vm.isArray(vm.report.joins)">\n <span>Join</span> <span class="text-bold">{{ vm.mapArray(vm.report.joins, \'foreignTable\') }}</span>\n </div>\n </div>\n </div>\n <div flex></div>\n <ms-search-bar on-search="vm_rf.query.filter = query" on-collapse="vm_rf.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_rf.createOrEditReportField($event)" aria-label="add field" translate translate-attr-label="ANALYTICS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_rf.selectedReportFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_rf.selectedReportFields.length}} {{vm_rf.selectedReportFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_rf.deleteSelectedReportFields($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_rf.selectedReportFields" md-progress="vm_rf.promise">\n <thead md-head md-order="vm_rf.query.sort" md-on-reorder="vm_rf.getReportFields">\n <tr md-row>\n <th md-column width="10px">\n <md-icon md-font-icon="icon-drag-vertical"></md-icon>\n </th>\n <th md-column>Type</th>\n <th md-column>Column or Metric</th>\n <th md-column>Alias</th>\n <th md-column>Function</th>\n <th md-column>Format</th>\n <th md-column>Group By</th>\n <th md-column>Order By</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_rf.sortableTable">\n <tr md-row md-select="reportField" md-select-id="id" ng-repeat="reportField in vm_rf.reportFields.rows">\n <td md-cell class="handle">\n <md-icon md-font-icon="icon-drag-vertical" class="s16">\n </td>\n <td md-cell>\n <div ng-if="reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-shape-plus s16"></div>\n <div ng-if="!reportField.MetricId && reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-pencil-box-outline s16"></div>\n <div ng-if="!reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-view-column s16"></div>\n </td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.MetricId ? vm_rf.getMetricName(reportField.MetricId) : reportField.field}}</td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.alias}}</td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.function">{{reportField.function}}</span><span ng-if="!reportField.function">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.format">{{reportField.format}}</span><span ng-if="!reportField.format">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.groupBy">YES</span><span ng-if="!reportField.groupBy">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.orderBy">{{reportField.orderBy}}</span><span ng-if="!reportField.orderBy">--</span></td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_rf.createOrEditReportField($event, reportField)" translate="ANALYTICS.EDIT_REPORTFIELD">\n Edit Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_rf.deleteConfirm(reportField, $event)" translate="ANALYTICS.DELETE_REPORTFIELD">\n Delete Report\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.CONDITIONS">CONDITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container conditions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ReportConditionsController as vm_rc" ng-init="vm_rc.init(vm.report)">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="ANALYTICS.CONDITION">CONDITION</div>\n </div>\n <form name="conditionsForm" novalidate>\n <div ng-if="vm_rc.report.condition.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="group=vm_rc.report.condition.group"></div>\n </form>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab md-on-select="vm.previewReport()">\n <md-tab-label>\n <span translate="ANALYTICS.PREVIEW">PREVIEW</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.rows.length">\n <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab md-on-select="vm.queryReport()">\n <md-tab-label>\n <span>Query</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text">SQL</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <div ng-if="!vm.error">\n {{vm.queryResult}}\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/analytics/views/reports/preview/dialog.html",'<md-dialog aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.PREVIEW_REPORT">Preview Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.rows.length">\n <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div flex></div>\n <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/reports.html",'<div id="reports" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.REPORTS">Reports</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedReports.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedReports =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-reports-count">\n <span>{{vm.selectedReports.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllReports()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectReports()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedReports" csv-label="true" filename="reports.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.currentNode.custom && (vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\')" class="md-icon-button" ng-click="vm.deleteSelectedReports($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div layout="column" flex="30">\n <md-card class="padding-top-5 padding-horizontal-10 padding-bottom-0">\n \x3c!-- SEARCH --\x3e\n <div layout="row" layout-align="start center">\n <label for="searchFolder" class="m-0">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="margin-horizontal-0 margin-bottom-0 margin-top-10" flex>\n <input id="searchFolder" placeholder="Search folder" type="text" ng-model="vm.search" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_FOLDER">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </md-card>\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeDefaultConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n </md-card>\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </md-card>\n </div>\n <md-card flex="70">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n <p ng-if="vm.currentPath">\n <span class="text-boxed">{{vm.currentPath}}</span>\n </p>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flow-init flow-file-added="vm.importReport($file, $event, $flow)">\n <md-button ng-if="vm.currentNode.custom" class="md-icon-button" aria-label="import report" translate translate-attr-label="ANALYTICS.IMPORT_REPORT" flow-btn>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n </div>\n <md-button ng-if="vm.currentNode.custom" class="md-icon-button" ng-click="vm.createOrEditReport($event)" aria-label="add report" translate translate-attr-label="ANALYTICS.ADD_REPORT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedReports" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n <tr md-row>\n <th md-column md-order-by="id" width="10px">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'ANALYTICS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.reports.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n <td ng-click="vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="id">{{report.id}}</td>\n <td ng-click="vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="name">{{report.name}}</td>\n <td ng-click="vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="description">{{report.description}}</td>\n <td ng-click="vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="createdAt">{{report.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.copydialog(report, $event)" translate="ANALYTICS.COPY_REPORT">\n Copy Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.previewdialog(report, $event)" translate="ANALYTICS.PREVIEW_REPORT">\n Preview Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.rundialog(report, $event)" translate="ANALYTICS.RUN_REPORT">\n Run Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadfile(report, $event)" translate="ANALYTICS.DOWNLOAD_JSON_REPORT">\n Download Json Report\n </md-button>\n </md-menu-item>\n <md-menu-divider ng-if="vm.currentNode.custom"></md-menu-divider>\n <md-menu-item ng-if="vm.currentNode.custom">\n <md-button ng-click="vm.editstate(report, $event)" translate="ANALYTICS.EDIT_REPORT">\n Edit Report\n </md-button>\n </md-menu-item>\n\n <md-menu-item ng-if="vm.currentNode.custom && (vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\')">\n <md-button ng-click="vm.deleteconfirm(report, $event)" translate="ANALYTICS.DELETE_REPORT">\n Delete Report\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.reports.count}}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/run/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.RUN_REPORT">Run Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input name="name" ng-model="vm.export.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.FORMAT">FORMAT</label>\n <md-select name="format" ng-model="vm.export.output" required>\n <md-option value="csv">CSV</md-option>\n <md-option value="xlsx">Excel (XLSX)</md-option>\n <md-option value="pdf">PDF</md-option>\n <md-option value="web">Web</md-option>\n </md-select>\n <div ng-messages="reportForm.format.$error" ng-show="reportForm.format.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n </div>\n </div>\n </md-input-container>\n <div layout="row">\n <div class="md-block" flex>\n <mdp-date-picker mdp-open-on-click required name="dateRangeFrom" mdp-placeholder="Date Range From" mdp-format="YYYY-MM-DD" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startDate">\n <div ng-messages="reportForm.dateRangeFrom.$error" ng-show="reportForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_REQUIRED">Date Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_INVALID">Date Range From field is invalid</span>\n </div>\n <div ng-message="maxDate">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MAX_INVALID">Date Range From Max field is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div class="md-block" flex>\n <mdp-date-picker mdp-open-on-click required name="dateRangeTo" mdp-placeholder="Date Range To" mdp-format="YYYY-MM-DD" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endDate">\n <div ng-messages="reportForm.dateRangeTo.$error" ng-show="reportForm.dateRangeTo.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_REQUIRED">Date Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_INVALID">Date Range From field is invalid</span>\n </div>\n <div ng-message="minDate">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MIN_INVALID">Date Range From Min field is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n </div>\n <div layout="row">\n <div class="md-block" flex>\n <mdp-time-picker required name="timeRangeFrom" mdp-placeholder="Time Range From" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startDate">\n <div ng-messages="reportForm.timeRangeFrom.$error" ng-show="reportForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_REQUIRED">Time Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex>\n <mdp-time-picker required name="timeRangeTo" mdp-placeholder="Time Range To" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endDate">\n <div ng-messages="reportForm.timeRangeTo.$error" ng-show="reportForm.timeRangeTo.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.runReport($event)" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid" aria-label="RUN" translate="ANALYTICS.RUN_REPORT" translate-attr-aria-label="ANALYTICS.RUN_REPORT">\n RUN REPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-click="vm.refreshDate()" aria-label="REFRESH" translate translate-attr-aria-label="ANALYTICS.REFRESH">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <md-tooltip><span translate="ANALYTICS.REFRESH">REFRESH</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/run/web/dialog.html",'<md-dialog class="web-dialog" aria-label="Show Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.PREVIEW_REPORT">Web Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.results.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.results.rows.length">\n <td md-cell colspan="{{vm.columns.length}}">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_DATA">NO DATA</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div flex></div>\n <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/create/dialog.html",'<md-dialog class="odbc-dialog" aria-label="New Odbc">\n <form name="odbcForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.odbc.name" ng-required="true" autofocus>\n <div ng-messages="odbcForm[\'name\'].$error" ng-show="odbcForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DSN">DSN</label>\n <input type="text" name="dsn" ng-model="vm.odbc.dsn" ng-required="true">\n <div class="hint"><span translate="CALLYSQUARE.HELP.DSN"></span></div>\n <div ng-messages="odbcForm[\'dsn\'].$error" ng-show="odbcForm[\'dsn\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DSN_REQUIRED">DSN field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.odbc.description">\n <div ng-messages="odbcForm[\'description\'].$error" ng-show="odbcForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newOdbc" ng-click="vm.saveOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid || odbcForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newOdbc" ng-click="vm.addNewOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_ODBC" translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n ADD ODBC\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newOdbc" ng-click="vm.deleteOdbc($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/odbcs.html",'<div id="odbcs" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.ODBC">ODBC</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedODBC.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedODBC =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-odbcs-count">\n <span>{{vm.selectedODBC.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ODBC.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllODBC()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectODBC()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedODBC" csv-label="true" filename="odbcs.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedODBC($event)" aria-label="delete selected" translate translate-attr-label="ODBC.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- ODBC TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedODBC" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getODBC">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n <th md-column md-order-by="dsn">{{ \'CALLYSQUARE.DSN\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.odbcs.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="odbc" md-select-id="id" ng-repeat="odbc in vm.odbcs.rows">\n <td md-cell ng-if="odbc.userpic"><img class="avatar" alt="{{odbc.name}}" ng-src="api/users/{{odbc.id}}/avatar" /></td>\n <td md-cell ng-if="!odbc.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{odbc.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="id ">{{odbc.id}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="name ">{{odbc.name}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="dsn ">{{odbc.dsn}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="description ">{{odbc.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(odbc, $event)" translate="CALLYSQUARE.EDIT_ODBC">\n Edit Odbc\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestOdbc(odbc, $event)" translate="CALLYSQUARE.TEST_ODBC">\n Test Odbc\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(odbc, $event)" translate="CALLYSQUARE.DELETE_ODBC">\n Delete Odbc\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.odbcs.count}}" md-on-paginate="vm.getODBC" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ODBC TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ODBC BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-odbc-button" ng-click="vm.createOrEditOdbc($event)" aria-label="add odbc" translate translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ODBC BUTTON --\x3e\n</div>'),e.put("app/main/apps/callysquare/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{vm.title | translate}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input name="name" ng-model="vm.project.name" required md-autofocus ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-disabled="!vm.newProject">\n <div ng-messages="projectForm.name.$error" ng-show="projectForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input name="description" ng-model="vm.project.description">\n <div ng-messages="projectForm.description.$error" ng-show="projectForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.openFromEditor" class="md-block">\n \x3c!-- Added to check if I\'m opening the dialog directly from the square editor --\x3e\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="ADD" translate="CALLYSQUARE.ADD_PROJECT" translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n ADD PROJECT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="dialogForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.EDIT"></span> <span translate="CALLYSQUARE.{{vm.cellName | uppercase}}"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <md-input-container class="md-block" ng-repeat="attribute in vm.attributes" ng-switch="attribute.name">\n <label translate="CALLYSQUARE.{{attribute.name | uppercase}}">{{attribute.name | ucfirst }}</label>\n\n \x3c!-- START SELECT INPUT --\x3e\n <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-switch-when-separator="|" ng-switch-when="answer|trunk_name|trunk_id|queue_id|file_id|variable_id|google_tts_language|ispeech_tts_language|ispeech_asr_language|google_asr_language|hiddendigitspos|odbc_id|project_id|beep|account_id|interval_id|template_id|list_id|recordingFormat|callback_priority|aws_polly_voice|aws_polly_region|sms_account_id|findBy|pause_id"\n ng-required="attribute.required">\n <md-option ng-if="attribute.defaultValue" ng-value="\'\'"> - None - </md-option>\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]">{{v.option}}</md-option>\n <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n </md-select>\n \x3c!-- END SELECT INPUT --\x3e\n\n \x3c!-- START SELECT INPUT --\x3e\n <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-switch-when-separator="|" ng-switch-when="sip_id" ng-required="attribute.required">\n <md-optgroup label="{{\'CALLYSQUARE.AGENTS\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'agent\'">{{v.option}}</md-option>\n </md-optgroup>\n <md-optgroup label="{{\'CALLYSQUARE.TELEPHONES\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'telephone\'">{{v.option}}</md-option>\n </md-optgroup>\n <md-optgroup label="{{\'CALLYSQUARE.USERS\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'admin\' || v.group === \'user\'">{{v.option}}</md-option>\n </md-optgroup>\n <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n </md-select>\n \x3c!-- END SELECT INPUT --\x3e\n\n \x3c!-- START NUMBER INPUT --\x3e\n <div ng-switch-when="timeout">\n <div ng-switch="vm.cellName">\n <input ng-switch-when-separator="|" ng-switch-when="answer|ext_dial|dial|queue" type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="record|ispeechasr|googleasr" type="number" step="any" name="{{attribute.name}}" min="-1" ng-model="attribute.value" ng-required="attribute.required" string-to-number>\n <input ng-switch-default type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" string-to-number>\n </div>\n </div>\n <input ng-switch-when-separator="|" ng-switch-when="speed" type="number" step="any" name="{{attribute.name}}" min="-10" max="-10" ng-model="attribute.value" ng-required="attribute.required" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="maxdigit|mindigit|digit" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="retry|response|hiddendigitsnum|priority|delay" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" string-to-number>\n \x3c!-- END NUMBER INPUT --\x3e\n\n \x3c!-- START TEXTAREA INPUT --\x3e\n <textarea name="{{attribute.name}}" ng-model="attribute.value" ng-switch-when-separator="|" ng-switch-when="query|sms_text|condition|text" ng-required="attribute.required"></textarea>\n \x3c!-- END TEXTAREA INPUT --\x3e\n\n \x3c!-- START TEXT INPUT --\x3e\n <input ng-switch-default name="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required">\n \x3c!-- END TEXT INPUT--\x3e\n\n <div class="hint" ng-if="attribute.help">\n <span translate="CALLYSQUARE.HELP.{{attribute.name | uppercase}}"></span>\n </div>\n <div ng-messages="dialogForm[attribute.name].$error" ng-show="dialogForm[attribute.name].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.FIELD_REQUIRED">The field is required</span>\n </div>\n </div>\n </md-input-container>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="dialogForm.$invalid || dialogForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/edit/edit.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="editForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.EDIT_XML"></span></span>\n </span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label>XML</label>\n <textarea name="preproduction" ng-model="vm.project.preproduction"></textarea>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="editForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/import/import.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="importForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.IMPORT_XML"></span></span>\n </span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="xml-uploader" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-file-added="vm.fileAdded($file)" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="CALLYSQUARE.DROP_TO_UPLOAD_MESSAGE">You can also drop files here to upload. Only XML - Max. 5MB</span>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" ng-disabled="importForm.$invalid" aria-label="CLOSE" translate="CALLYSQUARE.CLOSE" translate-attr-aria-label="CALLYSQUARE.CLOSE">\n CLOSE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/info/info.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="descriptionFrom" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.UPDATE_INFO"></span></span>\n </span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input name="description" ng-model="vm.project.description" md-autofocus>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NOTES">Description</label>\n <textarea name="notes" ng-model="vm.project.notes"></textarea>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="descriptionFrom.$invalid" aria-label="SAVE" translate="CALLYSQUARE.UPDATE_INFO" translate-attr-aria-label="CALLYSQUARE.UPDATE">\n UPDATE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/open/open.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="openForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.OPEN_PROJECT"></span></span>\n </span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.PROJECT">Project</label>\n <md-select name="id" ng-model="vm.id" required>\n <md-option value="{{p.id}}" ng-repeat="p in vm.projects">{{p.name}}</md-option>\n </md-select>\n <div ng-messages="openForm.id.$error" ng-show="openForm.id.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.PROJECT_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="openForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.OPEN_PROJECT" translate-attr-aria-label="CALLYSQUARE.OPEN">\n OPEN\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="newForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.COPY_PROJECT"></span></span>\n </span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input name="name" ng-model="vm.project.name" required md-autofocus>\n <div ng-messages="newForm.name.$error" ng-show="newForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="newForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.COPY_PROJECT" translate-attr-aria-label="CALLYSQUARE.COPY">\n COPY\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/view.html",'<div id="callysquare-project" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="CALLYSQUARE.GO_TO_PROJECTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="project-image" hide-xs>\n <img ng-src="assets/images/business/cprojects.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.project.id}} {{vm.project.name}}\n </div>\n <div class="subtitle secondary-text text-truncate">\n <span ng-if="vm.project.description">{{vm.project.description}} - </span><span translate="CALLYSQUARE.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.updateInfo($event)" class="md-fab md-yellow-700-bg md-icon-button" aria-label="edit">\n <md-icon md-font-icon="icon-tooltip-edit"></md-icon>\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content class="callysquare-content">\n\n <div id="geEditor" class="geEditor"></div>\n\n </md-content>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-vector-square" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.PROJECTS">Projects</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-projects-count">\n <span>{{vm.selectedProjects.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllProjects()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectProjects()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- PROJECT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="notes">{{ \'CALLYSQUARE.NOTES\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.projects.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n <td md-cell ng-if="project.userpic"><img class="avatar" alt="{{project.name}}" ng-src="api/users/{{project.id}}/avatar" /></td>\n <td md-cell ng-if="!project.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{project.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="notes ">{{project.notes}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(project, ev)" translate="CALLYSQUARE.EDIT_PROJECT">\n Edit Project\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(project, ev)" translate="CALLYSQUARE.DELETE_PROJECT">\n Delete Project\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PROJECT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PROJECT BUTTON --\x3e\n <md-button class="md-fab md-accent md-icon-button" id="add-project-button" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PROJECT BUTTON --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/squareRecordings/create/dialog.html",'<md-dialog class="squareRecording-dialog" aria-label="New SquareRecording">\n <form name="squareRecordingForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.FILENAME">Filename</label>\n <input type="" name="filename" ng-model="vm.squareRecording.filename" ng-required="true" autofocus>\n <div ng-messages="squareRecordingForm[\'filename\'].$error" ng-show="squareRecordingForm[\'filename\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.FILENAME_REQUIRED">Filename field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSquareRecording" ng-click="vm.saveSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid || squareRecordingForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE"\n translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSquareRecording" ng-click="vm.addNewSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_SQUARERECORDING" translate-attr-aria-label="CALLYSQUARE.ADD_SQUARERECORDING">\n ADD SQUARERECORDING\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSquareRecording" ng-click="vm.deleteSquareRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",'<div id="squareRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.SQUARERECORDINGS">SquareRecordings</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSquareRecordings.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSquareRecordings =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-squareRecordings-count">\n <span>{{vm.selectedSquareRecordings.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SQUARERECORDINGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSquareRecordings()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSquareRecordings()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSquareRecordings" csv-label="true" filename="squareRecordings.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedSquareRecordings($event)" aria-label="delete selected" translate translate-attr-label="SQUARERECORDINGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- SQUARERECORDING TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSquareRecordings" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSquareRecordings">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="filename">{{ \'CALLYSQUARE.FILENAME\' | translate }}</th>\n <th md-column md-order-by="projectName">{{ \'CALLYSQUARE.PROJECT\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'CALLYSQUARE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="callerid">{{ \'CALLYSQUARE.PHONE\' | translate }}</th>\n <th md-column md-order-by="extension">{{ \'CALLYSQUARE.EXTEN\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'CALLYSQUARE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CALLYSQUARE.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.squareRecordings.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="squareRecording" md-select-id="id" ng-repeat="squareRecording in vm.squareRecordings.rows">\n <td md-cell ng-if="squareRecording.userpic"><img class="avatar" alt="{{squareRecording.name}}" ng-src="api/users/{{squareRecording.id}}/avatar" /></td>\n <td md-cell ng-if="!squareRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{squareRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="filename ">{{squareRecording.filename}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="projectName ">{{squareRecording.projectName}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="uniqueid ">{{squareRecording.uniqueid}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="callerid ">{{squareRecording.callerid}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="extension ">{{squareRecording.extension}}</td>\n <td md-cell class="audio ">\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="squareRecording.id" model="\'squareRecording\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="createdAt ">{{squareRecording.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(squareRecording, $event)" translate="CALLYSQUARE.DOWNLOAD_SQUARERECORDING">\n Download SquareRecording\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(squareRecording, $event)" translate="CALLYSQUARE.DELETE_SQUARERECORDING">\n Delete SquareRecording\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.squareRecordings.count}}" md-on-paginate="vm.getSquareRecordings" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SQUARERECORDING TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/chatQueues.html",'<div id="chatQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CHAT.CHATQUEUES">ChatQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChatQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChatQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CHAT.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chatQueues-count">\n <span>{{vm.selectedChatQueues.length}}</span>\n <span translate="CHAT.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHATQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChatQueues()" translate="CHAT.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChatQueues()" translate="CHAT.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChatQueues" csv-label="true" filename="chatQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedChatQueues($event)" aria-label="delete selected" translate translate-attr-label="CHATQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- CHATQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChatQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'CHAT.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chatQueue" md-select-id="id" ng-repeat="chatQueue in vm.chatQueues.rows">\n <td md-cell ng-if="chatQueue.userpic"><img class="avatar" alt="{{chatQueue.name}}" ng-src="api/users/{{chatQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!chatQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditChatQueue($event, chatQueue)" md-cell class="id ">{{chatQueue.id}}</td>\n <td ng-click="vm.createOrEditChatQueue($event, chatQueue)" md-cell class="name ">{{chatQueue.name}}</td>\n <td ng-click="vm.createOrEditChatQueue($event, chatQueue)" md-cell class="strategy ">{{ vm.arraystrategy[chatQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(chatQueue, $event)" translate="CHAT.EDIT_CHATQUEUE">\n Edit ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(chatQueue, $event)" translate="CHAT.TEAMADD_CHATQUEUE">\n teamadd ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(chatQueue, $event)" translate="CHAT.AGENTADD_CHATQUEUE">\n agentadd ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(chatQueue, $event)" translate="CHAT.DELETE_CHATQUEUE">\n Delete ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(chatQueue, $event)" translate="CHAT.GOTOREALTIME_CHATQUEUE">\n goToRealtime ChatQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.chatQueues.count}}" md-on-paginate="vm.getChatQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHATQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHATQUEUE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-chatQueue-button" ng-click="vm.createOrEditChatQueue($event)" aria-label="add chatQueue" translate translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHATQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/create/dialog.html",'<md-dialog class="chatQueue-dialog" aria-label="New ChatQueue">\n <form name="chatQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newChatQueue">\n <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n <div ng-messages="chatQueueForm[\'name\'].$error" ng-show="chatQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.chatQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="chatQueueForm[\'strategy\'].$error" ng-show="chatQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="chatQueueForm[\'timeout\'].$error" ng-show="chatQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatQueue.description">\n <div ng-messages="chatQueueForm[\'description\'].$error" ng-show="chatQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newChatQueue" ng-click="vm.saveChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid || chatQueueForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newChatQueue" ng-click="vm.addNewChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATQUEUE" translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n ADD CHATQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newChatQueue" ng-click="vm.deleteChatQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue">\n <form name="chatQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.AGENTADD_CHATQUEUE">Add Agent to chatQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue">\n <form name="chatQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.TEAMADD_CHATQUEUE">Add Team in CHATQUEUE</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/view.html",'<div id="chat-chatQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-chatQueues-button md-icon-button" aria-label="Go to chatQueues" ng-click="vm.gotoChatQueues()" translate translate-attr-aria-label="CHAT.GO_TO_CHATQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="chatQueue-image" hide-xs>\n <img ng-src="assets/images/business/chatQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.chatQueue.id}}\n <span ng-if="vm.chatQueue.name">{{vm.chatQueue.name}}</span>\n <span ng-if="vm.chatQueue.exten">{{vm.chatQueue.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.chatQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="CHAT.TEAMADD_CHATQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.chatQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CHAT.AGENTADD_CHATQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveChatQueue()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.chatQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatQueue.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/chatWebsites.html",'<div id="chatWebsites" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CHAT.CHATWEBSITES">ChatWebsites</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChatWebsites.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChatWebsites =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CHAT.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chatWebsites-count">\n <span>{{vm.selectedChatWebsites.length}}</span>\n <span translate="CHAT.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHATWEBSITES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChatWebsites()" translate="CHAT.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChatWebsites()" translate="CHAT.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChatWebsites" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedChatWebsites($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- CHATWEBSITE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChatWebsites" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatWebsites">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'CHAT.KEY\' | translate }}</th>\n <th md-column md-order-by="address">{{ \'CHAT.MOTIONADDRESS\' | translate }}</th>\n <th md-column md-order-by="remote">{{ \'CHAT.MOTIONPROXY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatWebsites.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chatWebsite" md-select-id="id" ng-repeat="chatWebsite in vm.chatWebsites.rows">\n <td md-cell ng-if="chatWebsite.userpic"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="api/users/{{chatWebsite.id}}/avatar" /></td>\n <td md-cell ng-if="!chatWebsite.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="id ">{{chatWebsite.id}}</td>\n <td ng-click="vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="name ">{{chatWebsite.name}}</td>\n <td ng-click="vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="key ">{{chatWebsite.key}}</td>\n <td ng-click="vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="address ">{{chatWebsite.address}}</td>\n <td ng-click="vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="remote ">{{chatWebsite.remote}}</td>\n <td ng-click="vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="description ">{{chatWebsite.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(chatWebsite, $event)" translate="CHAT.EDIT_CHATWEBSITE">\n Edit ChatWebsite\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(chatWebsite, $event)" translate="CHAT.INTERACTIONS_CHATWEBSITE">\n Interactions ChatWebsite\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.offlinemessagesgoto(chatWebsite, $event)" translate="CHAT.OFFLINEMESSAGES_CHATWEBSITE">\n OfflineMessages ChatWebsite\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(chatWebsite, $event)" translate="CHAT.DELETE_CHATWEBSITE">\n Delete ChatWebsite\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.chatWebsites.count}}" md-on-paginate="vm.getChatWebsites" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHATWEBSITE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHATWEBSITE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-chatWebsite-button" ng-click="vm.createOrEditChatWebsite($event)" aria-label="add chatWebsite" translate translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHATWEBSITE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/create/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus ng-disabled="!vm.newChatWebsite">\n <div ng-messages="chatWebsiteForm[\'name\'].$error" ng-show="chatWebsiteForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">key</label>\n <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true">\n <div ng-messages="chatWebsiteForm[\'key\'].$error" ng-show="chatWebsiteForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true">\n <div ng-messages="chatWebsiteForm[\'address\'].$error" ng-show="chatWebsiteForm[\'address\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.chatWebsite.remote" md-maxlength="255" ng-required="true">\n <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="chatWebsiteForm[\'remote\'].$error" ng-show="chatWebsiteForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LIST">List</label>\n <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n <div ng-messages="chatWebsiteForm[\'ListId\'].$error" ng-show="chatWebsiteForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId">\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval">{{ IntervalId.name }}</md-option>\n <md-option ng-value="null">Always</md-option>\n </md-select>\n <div ng-messages="chatWebsiteForm[\'IntervalId\'].$error" ng-show="chatWebsiteForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatWebsite.description">\n <div ng-messages="chatWebsiteForm[\'description\'].$error" ng-show="chatWebsiteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newChatWebsite" ng-click="vm.saveChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid || chatWebsiteForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newChatWebsite" ng-click="vm.addNewChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATWEBSITE" translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n ADD CHATWEBSITE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newChatWebsite" ng-click="vm.deleteChatWebsite($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/agent/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" required autofocus>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'agent\'].$error" ng-show="chatWebsiteFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/autoreply/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" required autofocus>\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'times\'].$error" ng-show="chatWebsiteFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" md-maxlength="255" required></textarea>\n\n <div ng-messages="chatWebsiteFormApp[\'text\'].$error" ng-show="chatWebsiteFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.TEXT_MAX_LENGTH" translate-values=\'{max: 255}\'>Text must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/close/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus>\n <div ng-messages="chatWebsiteFormApp[\'disposition\'].$error" ng-show="chatWebsiteFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotoif/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus>\n <div ng-messages="chatWebsiteFormApp[\'condition\'].$error" ng-show="chatWebsiteFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true">\n <div ng-messages="chatWebsiteFormApp[\'truepriority\'].$error" ng-show="chatWebsiteFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true">\n <div ng-messages="chatWebsiteFormApp[\'falsepriority\'].$error" ng-show="chatWebsiteFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus>\n <div ng-messages="chatWebsiteFormApp[\'priority\'].$error" ng-show="chatWebsiteFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/noop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus>\n <div ng-messages="chatWebsiteFormApp[\'value\'].$error" ng-show="chatWebsiteFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/queue/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" required autofocus>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'queue\'].$error" ng-show="chatWebsiteFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/system/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus>\n <div ng-messages="chatWebsiteFormApp[\'command\'].$error" ng-show="chatWebsiteFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable">\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables">{{ variable.name }}</md-option>\n <md-option ng-value="\'\'">None</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'variable\'].$error" ng-show="chatWebsiteFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",'<md-dialog class="chatCannedAnswer-dialog" aria-label="New ChatCannedAnswer">\n <form name="chatCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">Key</label>\n <input type="" name="key" ng-model="vm.chatCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n <div ng-messages="chatCannedAnswerForm[\'key\'].$error" ng-show="chatCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.VALUE">Value</label>\n <textarea name="value" ng-model="vm.chatCannedAnswer.value" required></textarea>\n\n <div ng-messages="chatCannedAnswerForm[\'value\'].$error" ng-show="chatCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatCannedAnswer.description">\n <div ng-messages="chatCannedAnswerForm[\'description\'].$error" ng-show="chatCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newChatCannedAnswer" ng-click="vm.saveChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid || chatCannedAnswerForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE"\n translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newChatCannedAnswer" ng-click="vm.addNewChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATCANNEDANSWER" translate-attr-aria-label="CHAT.ADD_CHATCANNEDANSWER">\n ADD CHATCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newChatCannedAnswer" ng-click="vm.deleteChatCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/chatDispositions/dialog.html",'<md-dialog class="chatDisposition-dialog" aria-label="New ChatDisposition">\n <form name="chatDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="" name="name" ng-model="vm.chatDisposition.name" md-maxlength="255" ng-required="true" autofocus>\n <div ng-messages="chatDispositionForm[\'name\'].$error" ng-show="chatDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newChatDisposition" ng-click="vm.saveChatDisposition()" class="send-button md-accent md-raised" ng-disabled="chatDispositionForm.$invalid || chatDispositionForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newChatDisposition" ng-click="vm.addNewChatDisposition()" class="send-button md-accent md-raised" ng-disabled="chatDispositionForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATDISPOSITION" translate-attr-aria-label="CHAT.ADD_CHATDISPOSITION">\n ADD CHATDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newChatDisposition" ng-click="vm.deleteChatDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",'<md-dialog class="offlineMessage-dialog" aria-label="New OfflineMessage">\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-content flex layout-padding>\n <pre>{{vm.message.body}}</pre>\n </md-content>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",'<md-dialog class="chatProactiveAction-dialog" aria-label="New ChatProactiveAction">\n <form name="chatProactiveActionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="" name="name" ng-model="vm.chatProactiveAction.name" ng-required="true" autofocus>\n <div ng-messages="chatProactiveActionForm[\'name\'].$error" ng-show="chatProactiveActionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TYPE">Type</label>\n <md-select name="type" ng-model="vm.chatProactiveAction.type">\n\n <md-option ng-value="\'mouseOver\'"> {{ \'CHAT.MOUSEOVER\' | translate }}</md-option>\n\n <md-option ng-value="\'timeout\'"> {{ \'CHAT.TIMEOUT\' | translate }}</md-option>\n </md-select>\n <div ng-messages="chatProactiveActionForm[\'type\'].$error" ng-show="chatProactiveActionForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatProactiveAction.type === \'mouseOver\'" class="md-block">\n <label translate="CHAT.SELECTOR">Selector</label>\n <input type="" name="selector" ng-model="vm.chatProactiveAction.selector" ng-required="true">\n <div ng-messages="chatProactiveActionForm[\'selector\'].$error" ng-show="chatProactiveActionForm[\'selector\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SELECTOR_REQUIRED">Selector field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatProactiveAction.type === \'timeout\'" class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatProactiveAction.timeout" min="1" ng-required="true">\n <div ng-messages="chatProactiveActionForm[\'timeout\'].$error" ng-show="chatProactiveActionForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newChatProactiveAction" ng-click="vm.saveChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid || chatProactiveActionForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE"\n translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newChatProactiveAction" ng-click="vm.addNewChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATPROACTIVEACTION" translate-attr-aria-label="CHAT.ADD_CHATPROACTIVEACTION">\n ADD CHATPROACTIVEACTION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newChatProactiveAction" ng-click="vm.deleteChatProactiveAction($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/view.html",'<div id="chat-chatWebsite" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-chatWebsites-button md-icon-button" aria-label="Go to chatWebsites" ng-click="vm.gotoChatWebsites()" translate translate-attr-aria-label="CHAT.GO_TO_CHATWEBSITES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="chatWebsite-image" hide-xs>\n <img ng-src="assets/images/business/chatWebsites.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.chatWebsite.id}}\n <span ng-if="vm.chatWebsite.name">{{vm.chatWebsite.name}}</span>\n <span ng-if="vm.chatWebsite.exten">{{vm.chatWebsite.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatWebsite.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveChatWebsite()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (scriptForm.$invalid) || (intervalForm.$invalid) || (appearanceForm.$invalid) || (onlinestatusForm.$invalid) || (offlinestatusForm.$invalid) || (closingformForm.$invalid) || (unmanagedstatusForm.$invalid) || (interactionForm.$invalid) || (whitelabelForm.$invalid) || (logoForm.$invalid) || (agentAvatarForm.$invalid) || (chatFormOnlineForm.$invalid) || (chatFormOfflineForm.$invalid) || (proactiveForm.$invalid) || (chatDispositionsForm.$invalid) || (chatCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid) || (offlineMessagesForm.$invalid)"\n translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus ng-disabled="true">\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">key</label>\n <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true">\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true">\n <div ng-messages="generalForm[\'address\'].$error" ng-show="generalForm[\'address\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LIST">List</label>\n <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.fidelity" class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatWebsite.timeout" ng-required="true">\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.chatWebsite.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatWebsite.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.notificationSound" aria-label="notificationSound"><span translate="CHAT.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.notificationShake" aria-label="notificationShake"><span translate="CHAT.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="CHAT.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.chatWebsite.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container script md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteScriptController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite)" class="content" md-background-bg>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.SCRIPT">SCRIPT</div>\n </div>\n\n <form name="scriptForm" flex="100" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm_ac.chatWebsite.token" autofocus ng-disabled="true">\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm_ac.chatWebsite.remote" required>\n <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="scriptForm[\'remote\'].$error" ng-show="scriptForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">Motion Proxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">Motion Proxy must be a valid url e.g.: http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WEBSITESCRIPT">WebsiteScript</label>\n <div>\n <pre style="font-size: 13px;">\n {{vm_ac.start}} {{vm_ac.script}} {{vm_ac.end}}\n </pre>\n </div>\n <div class="hint"><span translate="CHAT.HELP.COPYSCRIPTTOCLIPBOARD"></span></div>\n </md-input-container>\n </form>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container interval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.INTERVAL">INTERVAL</div>\n </div>\n <form name="intervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId" autofocus>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval">{{ IntervalId.name }}</md-option>\n <md-option ng-value="null">Always</md-option>\n </md-select>\n <div ng-messages="intervalForm[\'IntervalId\'].$error" ng-show="intervalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEZONE">Timezone</label>\n <ms-timezone name="timezone" ng-model="vm.chatWebsite.timezone">\n < <div class="hint"><span translate="CHAT.HELP.TIMEZONE"></span></div>\n <div ng-messages="intervalForm[\'timezone\'].$error" ng-show="intervalForm[timezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SNIPPET">SNIPPET</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container appearance md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.APPEARANCE">APPEARANCE</div>\n </div>\n <form name="appearanceForm" novalidate>\n <div flex md-color-picker ng-model="vm.chatWebsite.color" label="{{\'CHAT.MAINCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false"\n open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.color_button" label="{{\'CHAT.BUTTONCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false"\n open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.textColor" label="{{\'CHAT.TEXTCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false"\n open-on-input="true"></div>\n <md-input-container class="md-block">\n <label translate="CHAT.FONTSIZE">fontSize</label>\n <input type="number" name="fontSize" ng-model="vm.chatWebsite.fontSize" min="0" ng-required="true">\n <div ng-messages="appearanceForm[\'fontSize\'].$error" ng-show="appearanceForm[\'fontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FONTSIZE_REQUIRED">fontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">fontSize must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADERSHAPE">headershape</label>\n <md-select name="header_shape" ng-model="vm.chatWebsite.header_shape">\n\n <md-option ng-value="\'rounded\'"> {{ \'CHAT.ROUNDED\' | translate }}</md-option>\n\n <md-option ng-value="\'squared\'"> {{ \'CHAT.SQUARED\' | translate }}</md-option>\n </md-select>\n <div ng-messages="appearanceForm[\'header_shape\'].$error" ng-show="appearanceForm[\'header_shape\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADERSHAPE_REQUIRED">headershape field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.showAgentAvatar" aria-label="ShowAgentAvatar"><span translate="CHAT.SHOWAGENTAVATAR">ShowAgentAvatar</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container onlinestatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.ONLINESTATUS">ONLINESTATUS</div>\n </div>\n <form name="onlinestatusForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADER_ONLINE">header_online</label>\n <input type="text" name="header_online" ng-model="vm.chatWebsite.header_online" md-maxlength="255" autofocus>\n <div ng-messages="onlinestatusForm[\'header_online\'].$error" ng-show="onlinestatusForm[\'header_online\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADER_ONLINE_REQUIRED">header_online field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.HEADER_ONLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_online must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.START_CHAT_BUTTON">start_chat_button</label>\n <input type="text" name="start_chat_button" ng-model="vm.chatWebsite.start_chat_button" md-maxlength="255">\n <div ng-messages="onlinestatusForm[\'start_chat_button\'].$error" ng-show="onlinestatusForm[\'start_chat_button\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.START_CHAT_BUTTON_REQUIRED">start_chat_button field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.START_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>start_chat_button must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container offlinestatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.OFFLINESTATUS">OFFLINESTATUS</div>\n </div>\n <form name="offlinestatusForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.hideWhenOffline" aria-label="hideWhenOffline"><span translate="CHAT.HIDEWHENOFFLINE">hideWhenOffline</span></md-switch>\n <div class="hint"><span translate="CHAT.HELP.HIDEWHENOFFLINE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADER_OFFLINE">header_offline</label>\n <input type="text" name="header_offline" ng-model="vm.chatWebsite.header_offline" md-maxlength="255">\n <div ng-messages="offlinestatusForm[\'header_offline\'].$error" ng-show="offlinestatusForm[\'header_offline\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADER_OFFLINE_REQUIRED">header_offline field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.HEADER_OFFLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_offline must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINE_CHAT_BUTTON">offline_chat_button</label>\n <input type="text" name="offline_chat_button" ng-model="vm.chatWebsite.offline_chat_button" md-maxlength="255">\n <div ng-messages="offlinestatusForm[\'offline_chat_button\'].$error" ng-show="offlinestatusForm[\'offline_chat_button\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_REQUIRED">offline_chat_button field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>offline_chat_button must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINEMESSAGESUBJECT">offlineMessageSubject</label>\n <input type="text" name="offlineMessageSubject" ng-model="vm.chatWebsite.offlineMessageSubject" md-maxlength="255">\n <div ng-messages="offlinestatusForm[\'offlineMessageSubject\'].$error" ng-show="offlinestatusForm[\'offlineMessageSubject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_REQUIRED">offlineMessageSubject field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageSubject must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINEMESSAGEBODY">offlineMessageBody</label>\n <input type="text" name="offlineMessageBody" ng-model="vm.chatWebsite.offlineMessageBody" md-maxlength="255">\n <div ng-messages="offlinestatusForm[\'offlineMessageBody\'].$error" ng-show="offlinestatusForm[\'offlineMessageBody\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_REQUIRED">offlineMessageBody field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageBody must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container closingform md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.CLOSINGFORM">CLOSINGFORM</div>\n </div>\n <form name="closingformForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGMESSAGE">closingMessage</label>\n <textarea name="closingMessage" ng-model="vm.chatWebsite.closingMessage" md-maxlength="255" required autofocus></textarea>\n\n <div ng-messages="closingformForm[\'closingMessage\'].$error" ng-show="closingformForm[\'closingMessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGE_REQUIRED">closingMessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SKIPMESSAGEBUTTON">skipMessageButton</label>\n <input type="text" name="skipMessageButton" ng-model="vm.chatWebsite.skipMessageButton" md-maxlength="255">\n <div ng-messages="closingformForm[\'skipMessageButton\'].$error" ng-show="closingformForm[\'skipMessageButton\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_REQUIRED">skipMessageButton field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>skipMessageButton must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableRating" aria-label="enableRating"><span translate="CHAT.ENABLERATING">enableRating</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableRating" class="md-block">\n <label translate="CHAT.RATINGTYPE">ratingType</label>\n <md-select name="ratingType" ng-model="vm.chatWebsite.ratingType">\n <md-option ng-value="\'star\'">Star</md-option>\n <md-option ng-value="\'thumb\'">Thumb</md-option>\n </md-select>\n <div ng-messages="closingformForm[\'ratingType\'].$error" ng-show="closingformForm[\'ratingType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.RATINGTYPE_REQUIRED">ratingType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableRating && vm.chatWebsite.ratingType === \'star\'" class="md-block">\n <label translate="CHAT.RATINGSTARSNUMBER">ratingStarsNumber</label>\n <input type="number" name="ratingStarsNumber" ng-model="vm.chatWebsite.ratingStarsNumber" min="2" max="5" ng-required="true">\n <div ng-messages="closingformForm[\'ratingStarsNumber\'].$error" ng-show="closingformForm[\'ratingStarsNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_REQUIRED">ratingStarsNumber field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>2</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableFeedback" aria-label="enableFeedback"><span translate="CHAT.ENABLEFEEDBACK">enableFeedback</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.forwardTranscript" aria-label="forwardTranscript"><span translate="CHAT.FORWARDTRANSCRIPT">forwardTranscript</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.forwardTranscript" class="md-block">\n <label translate="CHAT.FORWARDTRANSCRIPTMESSAGE">forwardTranscriptMessage</label>\n <input type="text" name="forwardTranscriptMessage" ng-model="vm.chatWebsite.forwardTranscriptMessage" md-maxlength="255">\n <div ng-messages="closingformForm[\'forwardTranscriptMessage\'].$error" ng-show="closingformForm[\'forwardTranscriptMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_REQUIRED">forwardTranscriptMessage field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>forwardTranscriptMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGMESSAGEBUTTON">closingMessageButton</label>\n <input type="text" name="closingMessageButton" ng-model="vm.chatWebsite.closingMessageButton" md-maxlength="255" ng-required="true">\n <div ng-messages="closingformForm[\'closingMessageButton\'].$error" ng-show="closingformForm[\'closingMessageButton\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_REQUIRED">closingMessageButton field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessageButton must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container unmanagedstatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.UNMANAGEDSTATUS">UNMANAGEDSTATUS</div>\n </div>\n <form name="unmanagedstatusForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.autoclose" aria-label="autoclose"><span translate="CHAT.AUTOCLOSE">autoclose</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableUnmanagedNote" aria-label="enableUnmanagedNote"><span translate="CHAT.ENABLEUNMANAGEDNOTE">enableUnmanagedNote</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.UNMANAGEDMESSAGE">unmanagedMessage</label>\n <input type="text" name="unmanagedMessage" ng-model="vm.chatWebsite.unmanagedMessage" md-maxlength="255">\n <div ng-messages="unmanagedstatusForm[\'unmanagedMessage\'].$error" ng-show="unmanagedstatusForm[\'unmanagedMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_REQUIRED">unmanagedMessage field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>unmanagedMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SKIPUNMANAGED">skipUnmanaged</label>\n <input type="text" name="skipUnmanaged" ng-model="vm.chatWebsite.skipUnmanaged" md-maxlength="255">\n <div ng-messages="unmanagedstatusForm[\'skipUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'skipUnmanaged\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SKIPUNMANAGED_REQUIRED">skipUnmanaged field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SKIPUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>skipUnmanaged must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableUnmanagedNote" class="md-block">\n <label translate="CHAT.SENDUNMANAGED">sendUnmanaged</label>\n <input type="text" name="sendUnmanaged" ng-model="vm.chatWebsite.sendUnmanaged" md-maxlength="255" ng-required="true">\n <div ng-messages="unmanagedstatusForm[\'sendUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'sendUnmanaged\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SENDUNMANAGED_REQUIRED">sendUnmanaged field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SENDUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>sendUnmanaged must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container interaction md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.INTERACTION">INTERACTION</div>\n </div>\n <form name="interactionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENTIDENTIFIER">agentIdentifier</label>\n <md-select name="agentIdentifier" ng-model="vm.chatWebsite.agentIdentifier" autofocus>\n\n <md-option ng-value="\'website_alias\'"> {{ \'CHAT.WEBSITEALIAS\' | translate }}</md-option>\n\n <md-option ng-value="\'agent_alias\'"> {{ \'CHAT.AGENTALIAS\' | translate }}</md-option>\n\n <md-option ng-value="\'agent_fullname\'"> {{ \'CHAT.AGENTFULLNAME\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.AGENTIDENTIFIER"></span></div>\n <div ng-messages="interactionForm[\'agentIdentifier\'].$error" ng-show="interactionForm[\'agentIdentifier\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENTIDENTIFIER_REQUIRED">agentIdentifier field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.agentIdentifier === \'website_alias\'" class="md-block">\n <label translate="CHAT.WEBSITEALIAS">WebsiteAlias</label>\n <input type="text" name="agentAlias" ng-model="vm.chatWebsite.agentAlias" md-maxlength="255">\n <div class="hint"><span translate="CHAT.HELP.WEBSITEALIAS"></span></div>\n <div ng-messages="interactionForm[\'agentAlias\'].$error" ng-show="interactionForm[\'agentAlias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WEBSITEALIAS_REQUIRED">WebsiteAlias field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WEBSITEALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>WebsiteAlias must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGQUESTION">closingQuestion</label>\n <input type="text" name="closingQuestion" ng-model="vm.chatWebsite.closingQuestion" md-maxlength="255">\n <div ng-messages="interactionForm[\'closingQuestion\'].$error" ng-show="interactionForm[\'closingQuestion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGQUESTION_REQUIRED">closingQuestion field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGQUESTION_MAX_LENGTH" translate-values=\'{max: 255}\'>closingQuestion must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FORMSUBMITSUCCESSMESSAGE">formSubmitSuccessMessage</label>\n <input type="text" name="formSubmitSuccessMessage" ng-model="vm.chatWebsite.formSubmitSuccessMessage" md-maxlength="255">\n <div ng-messages="interactionForm[\'formSubmitSuccessMessage\'].$error" ng-show="interactionForm[\'formSubmitSuccessMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_REQUIRED">formSubmitSuccessMessage field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitSuccessMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FORMSUBMITFAILUREMESSAGE">formSubmitFailureMessage</label>\n <input type="text" name="formSubmitFailureMessage" ng-model="vm.chatWebsite.formSubmitFailureMessage" md-maxlength="255">\n <div ng-messages="interactionForm[\'formSubmitFailureMessage\'].$error" ng-show="interactionForm[\'formSubmitFailureMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_REQUIRED">formSubmitFailureMessage field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitFailureMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerWriting" aria-label="enableCustomerWriting"><span translate="CHAT.ENABLECUSTOMERWRITING">enableCustomerWriting</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n <label translate="CHAT.WAITINGTITLE">waitingTitle</label>\n <input type="text" name="waitingTitle" ng-model="vm.chatWebsite.waitingTitle" md-maxlength="255" ng-required="true">\n <div ng-messages="interactionForm[\'waitingTitle\'].$error" ng-show="interactionForm[\'waitingTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITINGTITLE_REQUIRED">waitingTitle field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WAITINGTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingTitle must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n <label translate="CHAT.WAITINGMESSAGE">waitingMessage</label>\n <textarea name="waitingMessage" ng-model="vm.chatWebsite.waitingMessage" md-maxlength="255" required></textarea>\n\n <div ng-messages="interactionForm[\'waitingMessage\'].$error" ng-show="interactionForm[\'waitingMessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITINGMESSAGE_REQUIRED">waitingMessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WAITINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.NOTETITLE">noteTitle</label>\n <input type="text" name="noteTitle" ng-model="vm.chatWebsite.noteTitle" md-maxlength="255">\n <div ng-messages="interactionForm[\'noteTitle\'].$error" ng-show="interactionForm[\'noteTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NOTETITLE_REQUIRED">noteTitle field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.NOTETITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>noteTitle must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.PLACEHOLDERMESSAGE">placeholderMessage</label>\n <input type="text" name="placeholderMessage" ng-model="vm.chatWebsite.placeholderMessage" md-maxlength="255">\n <div ng-messages="interactionForm[\'placeholderMessage\'].$error" ng-show="interactionForm[\'placeholderMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_REQUIRED">placeholderMessage field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>placeholderMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.download_transcript" aria-label="downloadTranscript"><span translate="CHAT.DOWNLOADTRANSCRIPT">downloadTranscript</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerAttachment" aria-label="enableCustomerAttachment"><span translate="CHAT.ENABLECUSTOMERATTACHMENT">enableCustomerAttachment</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container whitelabel md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.WHITELABEL">WHITELABEL</div>\n </div>\n <form name="whitelabelForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.defaultWhiteLabel" aria-label="default"><span translate="CHAT.DEFAULT">default</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.defaultWhiteLabel" class="md-block">\n <label translate="CHAT.WHITELABEL">whiteLabel</label>\n <textarea name="whiteLabel" ng-model="vm.chatWebsite.whiteLabel" md-maxlength="255" required></textarea>\n\n <div ng-messages="whitelabelForm[\'whiteLabel\'].$error" ng-show="whitelabelForm[\'whiteLabel\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WHITELABEL_REQUIRED">whiteLabel field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WHITELABEL_MAX_LENGTH" translate-values=\'{max: 255}\'>whiteLabel must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container logo md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.LOGO">LOGO</div>\n </div>\n <div ng-controller="ChatWebsitelogoController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()"\n flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logoimage in vm_ca.chatWebsite.images" ng-switch="logoimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logoimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logoimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container agentavatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.AGENTAVATAR">AGENTAVATAR</div>\n </div>\n <div ng-controller="ChatWebsiteagentAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()"\n flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="agentAvatarimage in vm_ca.chatWebsite.images" ng-switch="agentAvatarimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{agentAvatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="agentAvatarimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{agentAvatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ONLINE">ONLINE</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatformonline md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteonlineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n <div flex>\n \x3c!-- START Buttons --\x3e\n <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n <md-icon md-font-icon="{{button.icon}}"></md-icon>\n </md-button>\n \x3c!-- END Buttons --\x3e\n </div>\n\n <div layout="row" flex>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n\n <form name="onlineForm" novalidate>\n\n \x3c!-- START MapKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.mapKey">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END MapKey --\x3e\n\n \x3c!-- START FromKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.onlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.onlineForm.fromKey != null ? vm_fonc.chatWebsite.onlineForm.items[vm_fonc.chatWebsite.onlineForm.fromKey].props.title : \'None\'">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n </md-select>\n </md-input-container>\n \x3c!-- END FromKey --\x3e\n\n \x3c!-- START EXPANSION PANELS --\x3e\n <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items track by $index" md-component-id="{{\'onlinePanel\' + $index}}">\n <md-expansion-panel-collapsed md-no-sticky="true">\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-down"></md-icon>\n </md-button>\n </md-expansion-panel-collapsed>\n\n <md-expansion-panel-expanded>\n <md-expansion-panel-header>\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n\n <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-up"></md-icon>\n </md-button>\n </md-expansion-panel-header>\n\n <md-expansion-panel-content>\n <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n <md-input-container class="md-block">\n <label translate="CHAT.VARIABLE">Variable</label>\n <md-select ng-model="item.variable">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="variable in vm_fonc.variables" ng-value="variable.name">{{ variable.name }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n <md-select ng-model="item.cmField">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-expansion-panel-content>\n\n </md-expansion-panel-expanded>\n </md-expansion-panel>\n \x3c!-- END EXPANSION PANELS --\x3e\n </form>\n\n </md-card-content>\n </md-card>\n </div>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content flex>\n <form-view form="vm_fonc.chatWebsite.onlineForm" flex="100"></form-view>\n </md-card-content>\n </md-card>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.OFFLINE">OFFLINE</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatformoffline md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteofflineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n <div flex>\n \x3c!-- START Buttons --\x3e\n <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n <md-icon md-font-icon="{{button.icon}}"></md-icon>\n </md-button>\n \x3c!-- END Buttons --\x3e\n </div>\n\n <div layout="row" flex>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n\n <form name="offlineForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm_fonc.chatWebsite.forwardOffline" aria-label="forwardOffline"><span translate="CHAT.FORWARD_OFFLINE">forwardOffline</span></md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.forwardOffline">\n <label translate="CHAT.FORWARD_OFFLINE_ADDRESS">FORWARD OFFLINE ADDRESS</label>\n <input type="text" name="forwardOfflineAddress" ng-model="vm_fonc.chatWebsite.forwardOfflineAddress">\n <div class="hint"><span translate="CHAT.HELP.FORWARD_OFFLINE"></span></div>\n <div ng-messages="offlineForm[\'forwardOfflineAddress\'].$error" ng-show="offlineForm[\'forwardOfflineAddress\'].$touched" role="alert">\n <div ng-message="email">\n <span translate="CHAT.ERRORS.EMAIL_MUST_BE_VALID">forwardOffline must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- START MapKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.mapKeyOffline">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END MapKey --\x3e\n\n \x3c!-- START FromKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.offlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.offlineForm.fromKey != null ? vm_fonc.chatWebsite.offlineForm.items[vm_fonc.chatWebsite.offlineForm.fromKey].props.title : \'None\'">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n </md-select>\n </md-input-container>\n \x3c!-- END FromKey --\x3e\n\n \x3c!-- START EXPANSION PANELS --\x3e\n <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items track by $index" md-component-id="{{\'offlinePanel\' + $index}}">\n <md-expansion-panel-collapsed md-no-sticky="true">\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-down"></md-icon>\n </md-button>\n </md-expansion-panel-collapsed>\n\n <md-expansion-panel-expanded>\n <md-expansion-panel-header>\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n\n <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-up"></md-icon>\n </md-button>\n </md-expansion-panel-header>\n\n <md-expansion-panel-content>\n <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n\n <md-input-container class="md-block">\n <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n <md-select ng-model="item.cmField">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-expansion-panel-content>\n\n </md-expansion-panel-expanded>\n </md-expansion-panel>\n \x3c!-- END EXPANSION PANELS --\x3e\n </form>\n\n </md-card-content>\n </md-card>\n </div>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content flex>\n <form-view form="vm_fonc.chatWebsite.offlineForm" flex="100"></form-view>\n </md-card-content>\n </md-card>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.PROACTIVEACTIONS">PROACTIVEACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container proactive md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteProactiveActionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteProactiveActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.PROACTIVEACTIONS">ProactiveActions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event)" aria-label="add chatProactiveAction" translate translate-attr-label="CHAT.ADD_CHATPROACTIVEACTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteProactiveActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteProactiveActions.length}} {{vm_dc.selectedChatWebsiteProactiveActions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteProactiveActions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteProactiveActions($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteProactiveActions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteProactiveActions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'CHAT.TYPE\' | translate }}</th>\n <th md-column md-order-by="selector">{{ \'CHAT.SELECTOR\' | translate }}</th>\n <th md-column md-order-by="timeout">{{ \'CHAT.TIMEOUT\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatProactiveAction" md-select-id="id" ng-repeat="chatProactiveAction in vm_dc.chatWebsiteProactiveActions.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.id}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.name}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{ \'CHAT.\' + vm_dc.arraytype[chatProactiveAction.type].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.selector}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.timeout}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" translate="CHAT.EDIT_CHATPROACTIVEACTION">\n Edit ChatProactiveAction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(chatProactiveAction, $event)" translate="CHAT.DELETE_CHATPROACTIVEACTION">\n Delete ChatProactiveAction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteProactiveActions.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="CHAT.NO_CHATPROACTIVEACTION_AVAILABLE">No chatproactiveaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.chatWebsiteProactiveActions.count}}" md-on-paginate="vm_dc.getChatWebsiteProactiveActions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatdispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteChatDispositionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteChatDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.CHATDISPOSITIONS">ChatDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event)" aria-label="add chatDisposition" translate translate-attr-label="CHAT.ADD_CHATDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteChatDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteChatDispositions.length}} {{vm_dc.selectedChatWebsiteChatDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteChatDispositions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteChatDispositions($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteChatDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteChatDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatDisposition" md-select-id="id" ng-repeat="chatDisposition in vm_dc.chatWebsiteChatDispositions.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" md-cell>{{chatDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" md-cell>{{chatDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" md-cell>{{chatDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" translate="CHAT.EDIT_CHATDISPOSITION">\n Edit ChatDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(chatDisposition, $event)" translate="CHAT.DELETE_CHATDISPOSITION">\n Delete ChatDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteChatDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="CHAT.NO_CHATDISPOSITION_AVAILABLE">No chatdisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.chatWebsiteChatDispositions.count}}" md-on-paginate="vm_dc.getChatWebsiteChatDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteChatCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.CHATCANNEDANSWERS">ChatCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event)" aria-label="add chatCannedAnswer" translate translate-attr-label="CHAT.ADD_CHATCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteChatCannedAnswers.length}} {{vm_dc.selectedChatWebsiteChatCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteChatCannedAnswers" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteChatCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteChatCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteChatCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'CHAT.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'CHAT.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatCannedAnswer" md-select-id="id" ng-repeat="chatCannedAnswer in vm_dc.chatWebsiteChatCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.value}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" translate="CHAT.EDIT_CHATCANNEDANSWER">\n Edit ChatCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(chatCannedAnswer, $event)" translate="CHAT.DELETE_CHATCANNEDANSWER">\n Delete ChatCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteChatCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="CHAT.NO_CHATCANNEDANSWER_AVAILABLE">No chatcannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.chatWebsiteChatCannedAnswers.count}}" md-on-paginate="vm_dc.getChatWebsiteChatCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteActionsController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="CHAT.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedChatWebsiteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedChatWebsiteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedChatWebsiteApps.length}} {{vm_ac.selectedChatWebsiteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedChatWebsiteApps($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedChatWebsiteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.chatWebsiteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editChatWebsiteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.chatWebsiteApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteInteractionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getChatWebsiteInteractions()" aria-label="refresh Interactions" translate translate-attr-label="CHAT.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteInteractions.length}} {{vm_dc.selectedChatWebsiteInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteInteractions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteInteractions($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.STARTEDAT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'CHAT.CLOSEDAT\' | translate }}</th>\n <th md-column>{{ \'CHAT.CONTACT\' | translate }}</th>\n <th md-column>{{ \'CHAT.AGENT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'CHAT.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="ratingValue">{{ \'CHAT.RATING\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'CHAT.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'CHAT.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.chatWebsiteInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="interaction.ratingValue != null && (!interaction.ratingType || interaction.ratingType == \'star\')" ng-repeat="ratingValue in [1,2,3,4,5] | limitTo:interaction.ratingValue"></md-icon>\n <md-icon md-font-icon="icon-thumb-up" style="color:green" ng-show="interaction.ratingValue != null && interaction.ratingType && interaction.ratingType == \'thumb\' && interaction.ratingValue == 1"></md-icon>\n <md-icon md-font-icon="icon-thumb-down" style="color:red" ng-show="interaction.ratingValue != null && interaction.ratingType && interaction.ratingType == \'thumb\' && interaction.ratingValue == 0"></md-icon><span ng-show="interaction.ratingValue == null" translate="CHAT.NO_RATINGVALUE">No ratingValue</span></td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spychatInteraction($event, interaction)" translate="CHAT.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="CHAT.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteInteractions.rows.length">\n <td md-cell colspan="15">\n <span class="text-boxed-ligth" translate="CHAT.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.chatWebsiteInteractions.count}}" md-on-paginate="vm_dc.getChatWebsiteInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.OFFLINEMESSAGES">OFFLINEMESSAGES</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="chatWebsite-detail-form-container offlinemessages md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteOfflineMessagesController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteOfflineMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.OFFLINEMESSAGES">OfflineMessages</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteOfflineMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteOfflineMessages.length}} {{vm_dc.selectedChatWebsiteOfflineMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteOfflineMessages" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteOfflineMessages($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteOfflineMessages" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteOfflineMessages">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'CHAT.CONTACT\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="offlineMessage" md-select-id="id" ng-repeat="offlineMessage in vm_dc.chatWebsiteOfflineMessages.rows">\n <td md-cell>{{offlineMessage.id}}</td>\n <td md-cell>{{ ContactId = vm_dc.contacts[offlineMessage.ContactId]; ContactId.firstName }}</td>\n <td md-cell>{{offlineMessage.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.showOfflineMessageChatWebsiteOfflineMessage($event, offlineMessage)" translate="CHAT.SHOW_OFFLINEMESSAGE">\n SHOW OfflineMessage\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(offlineMessage, $event)" translate="CHAT.DELETE_OFFLINEMESSAGE">\n Delete OfflineMessage\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteOfflineMessages.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="CHAT.NO_OFFLINEMESSAGE_AVAILABLE">No offlinemessage available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.chatWebsiteOfflineMessages.count}}" md-on-paginate="vm_dc.getChatWebsiteOfflineMessages" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n</div>\n\x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'CHAT.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'CHAT.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'CHAT.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'CHAT.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'CHAT.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="3">{{ \'CHAT.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n \x3c!-- <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSE\' | translate }}</th>\n <th md-column width="10px"></th> --\x3e\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'CHAT.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'CHAT.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatusTime">{{ \'CHAT.TIMER\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'CHAT.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'busy\':\'indigo-100-bg\',\'*pause\':\'amber-50-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].globalStatus]">{{ vm.isPause(vm.agents[value].globalStatus) ? \'\' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? \'*\'+vm.agents[value].pauseType || \'DEFAULT PAUSE\' : vm.agents[value].pauseType || \'DEFAULT PAUSE\') : \'\'}}</span>\n </td>\n <td class="bt custom-column">\n <timer start-time="vm.agents[value].globalStatusTime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class="bt bl">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'talking\':\'indigo-100-bg\',\'ringing\':\'orange-400-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt bl">\n <div layout="column">\n <span ng-if="vm.agents[value].queue" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].queue }}</span>\n <span ng-if="vm.agents[value].destconnectedlinenum" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class="padding-5" ng-if="vm.agents[value].queue || vm.agents[value].destconnectedlinenum">\n <timer start-time="vm.agents[value].voiceStatusTime" interval="1000" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n \x3c!-- <td class="bt">--</td>\n <td class="bt">--</td> --\x3e\n <td class="bt bl" ng-if="vm.license.chat">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n \x3c!-- <td class="bt padding-5 text-center">{{ agent.chatCurrentCapacity }}/{{ agent.chatCapacity > 0 ? agent.chatCapacity : \'∞\' }}</td> --\x3e\n <td md-number class="bt text-center font-size-20" ng-if="vm.license.chat" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.mail">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.mail" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.messaging">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.messaging" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.openchannel">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">4</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">89</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.openchannel" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.fax">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">7</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">2</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.fax" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class="bl bt padding-5 text-center">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.logout(vm.agents[value], $event)" translate="CHAT.LOGOUT">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.queueAdd(vm.agents[value], $event)" translate="CHAT.AGENTADD_QUEUE">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="CHAT.PAUSE">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=" vm.agents[value].voicePause && \'DEFAULT PAUSE\' === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value])"><em translate="CHAT.DEFAULT_PAUSE">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.pauses.rows.length" ng-repeat="pause in vm.pauses.rows">\n <md-button ng-disabled="vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value], pause.name)">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="vm.isPause(vm.agents[value].globalStatus)">\n <md-button ng-click="vm.unPause(vm.agents[value])" translate="CHAT.UNPAUSE">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.filteredAgents.length}}" md-on-paginate="vm.onInit" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/chat/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column>{{ \'CHAT.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'CHAT.PAUSED\' | translate }}</th>\n <th md-column>{{ \'CHAT.READY\' | translate }}</th>\n <th md-column>{{ \'CHAT.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditChatQueue($event, vm.queues[value])" translate="CHAT.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="CHAT.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/chat/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/companies.html",'<div id="companies" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.COMPANIES">Companies</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCompanies.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCompanies =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-companies-count">\n <span>{{vm.selectedCompanies.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="COMPANIES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCompanies()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCompanies()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCompanies" csv-label="true" filename="companies.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedCompanies($event)" aria-label="delete selected" translate translate-attr-label="COMPANIES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- COMPANY TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCompanies" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCompanies">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.companies.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="company" md-select-id="id" ng-repeat="company in vm.companies.rows">\n <td md-cell ng-if="company.userpic"><img class="avatar" alt="{{company.name}}" ng-src="api/users/{{company.id}}/avatar" /></td>\n <td md-cell ng-if="!company.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{company.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditCompany($event, company)" md-cell class="id ">{{company.id}}</td>\n <td ng-click="vm.createOrEditCompany($event, company)" md-cell class="name ">{{company.name}}</td>\n <td ng-click="vm.createOrEditCompany($event, company)" md-cell class="description ">{{company.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(company, $event)" translate="CONTACTMANAGER.EDIT_COMPANY">\n Edit Company\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotocontactsgoto(company, $event)" translate="CONTACTMANAGER.GOTOCONTACTS_COMPANY">\n goToContacts Company\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(company, $event)" translate="CONTACTMANAGER.DELETE_COMPANY">\n Delete Company\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.companies.count}}" md-on-paginate="vm.getCompanies" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / COMPANY TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD COMPANY BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-company-button" ng-click="vm.createOrEditCompany($event)" aria-label="add company" translate translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD COMPANY BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/create/dialog.html",'<md-dialog class="company-dialog" aria-label="New Company">\n <form name="companyForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus>\n <div ng-messages="companyForm[\'name\'].$error" ng-show="companyForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.company.phone">\n <div ng-messages="companyForm[\'phone\'].$error" ng-show="companyForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.VAT">Vat</label>\n <input type="text" name="vat" ng-model="vm.company.vat">\n <div ng-messages="companyForm[\'vat\'].$error" ng-show="companyForm[\'vat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.company.fax">\n <div ng-messages="companyForm[\'fax\'].$error" ng-show="companyForm[\'fax\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n <input type="text" name="companyId" ng-model="vm.company.companyId">\n <div ng-messages="companyForm[\'companyId\'].$error" ng-show="companyForm[\'companyId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.company.type">\n <div ng-messages="companyForm[\'type\'].$error" ng-show="companyForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255">\n <div ng-messages="companyForm[\'website\'].$error" ng-show="companyForm[\'website\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n <input type="text" name="emailDomain" ng-model="vm.company.emailDomain">\n <div ng-messages="companyForm[\'emailDomain\'].$error" ng-show="companyForm[\'emailDomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.company.email">\n <div ng-messages="companyForm[\'email\'].$error" ng-show="companyForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.company.description">\n <div ng-messages="companyForm[\'description\'].$error" ng-show="companyForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newCompany" ng-click="vm.saveCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid || companyForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newCompany" ng-click="vm.addNewCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_COMPANY" translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n ADD COMPANY\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newCompany" ng-click="vm.deleteCompany($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/companies/edit/view.html",'<div id="contactmanager-company" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-companies-button md-icon-button" aria-label="Go to companies" ng-click="vm.gotoCompanies()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_COMPANIES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="company-image" hide-xs>\n <img ng-src="assets/images/business/companies.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.company.id}}\n <span ng-if="vm.company.name">{{vm.company.name}}</span>\n <span ng-if="vm.company.exten">{{vm.company.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.company.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.company, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="CONTACTMANAGER.GOTO_COMPANY"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveCompany()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (addressForm.$invalid) || (shipmentAddressForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.GENERAL">GENERAL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="company-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.company.phone">\n <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.VAT">Vat</label>\n <input type="text" name="vat" ng-model="vm.company.vat">\n <div ng-messages="generalForm[\'vat\'].$error" ng-show="generalForm[\'vat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.company.fax">\n <div ng-messages="generalForm[\'fax\'].$error" ng-show="generalForm[\'fax\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n <input type="text" name="companyId" ng-model="vm.company.companyId">\n <div ng-messages="generalForm[\'companyId\'].$error" ng-show="generalForm[\'companyId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.company.type">\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255">\n <div ng-messages="generalForm[\'website\'].$error" ng-show="generalForm[\'website\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n <input type="text" name="emailDomain" ng-model="vm.company.emailDomain">\n <div ng-messages="generalForm[\'emailDomain\'].$error" ng-show="generalForm[\'emailDomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.company.email">\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.company.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.ADDRESS">ADDRESS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="company-detail-form-container address md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.ADDRESS">ADDRESS</div>\n </div>\n <form name="addressForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.company.street" autofocus>\n <div ng-messages="addressForm[\'street\'].$error" ng-show="addressForm[\'street\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n <input type="text" name="postalCode" ng-model="vm.company.postalCode">\n <div ng-messages="addressForm[\'postalCode\'].$error" ng-show="addressForm[\'postalCode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.company.city">\n <div ng-messages="addressForm[\'city\'].$error" ng-show="addressForm[\'city\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="country" ng-model="vm.company.country">\n <div ng-messages="addressForm[\'country\'].$error" ng-show="addressForm[\'country\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="company-detail-form-container shipmentaddress md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</div>\n </div>\n <form name="shipmentAddressForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="sStreet" ng-model="vm.company.sStreet" autofocus>\n <div ng-messages="shipmentAddressForm[\'sStreet\'].$error" ng-show="shipmentAddressForm[\'sStreet\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n <input type="text" name="sPostalCode" ng-model="vm.company.sPostalCode">\n <div ng-messages="shipmentAddressForm[\'sPostalCode\'].$error" ng-show="shipmentAddressForm[\'sPostalCode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="sCity" ng-model="vm.company.sCity">\n <div ng-messages="shipmentAddressForm[\'sCity\'].$error" ng-show="shipmentAddressForm[\'sCity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="sCountry" ng-model="vm.company.sCountry">\n <div ng-messages="shipmentAddressForm[\'sCountry\'].$error" ng-show="shipmentAddressForm[\'sCountry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/contacts.html",'<div id="contacts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.CONTACTS">Contacts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedContacts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedContacts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-contacts-count">\n <span>{{vm.selectedContacts.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllContacts()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectContacts()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedContacts" csv-label="true" filename="contacts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm.deleteSelectedContacts($event)" aria-label="delete selected" translate translate-attr-label="CONTACTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n <div layout="row">\n <div class="column" flex="20">\n <md-card>\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm.selectedList = null; vm.selectedCompany = null; vm.selectedTags = []"><md-icon md-font-icon="icon-refresh"></md-icon>{{ \'CONTACTMANAGER.ALL_CONTACTS\' | translate }}</button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_LIST">Select a list</label>\n <md-select placeholder="Select a list" ng-model="vm.selectedList">\n <md-optgroup label="Lists">\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_COMPANY">Select a company</label>\n <md-select placeholder="Select a companie" flex="100" ng-model="vm.selectedCompany">\n <md-optgroup label="Companies">\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_TAGS">Select one or more tags</label>\n <md-select placeholder="Select one or more tags" flex="100" ng-model="vm.selectedTags" multiple>\n <md-optgroup label="Tags">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags.rows">{{tag.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n\n\n \x3c!-- USER TABLE --\x3e\n <md-card flex="80">\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedContacts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="firstName">{{\'CONTACTMANAGER.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'CONTACTMANAGER.PHONE\' | translate}}</th>\n <th md-column md-order-by="email">{{\'CONTACTMANAGER.EMAIL\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'CONTACTMANAGER.LIST\' | translate}}</th>\n <th md-column md-order-by="CompanyId">{{\'CONTACTMANAGER.COMPANY\' | translate}}</th>\n <th md-column md-order-by="tags">{{\'CONTACTMANAGER.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="contact" md-select-id="id" ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.createOrEditContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.createOrEditContact($event, contact)" md-cell class="firstName">{{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.createOrEditContact($event, contact)" md-cell class="phone">{{contact.phone}}</td>\n <td ng-click="vm.createOrEditContact($event, contact)" md-cell class="email">{{contact.email}}</td>\n <td ng-click="vm.createOrEditContact($event, contact)" md-cell class="list">{{vm.listsMap[contact.ListId]}}</td>\n <td ng-click="vm.createOrEditContact($event, contact)" md-cell class="company">{{vm.companiesMap[contact.CompanyId]}}</td>\n <td md-cell class="tags">\n <div ng-if="contact.tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.tags">{{tag}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(contact, ev)" translate="CONTACTMANAGER.EDIT_CONTACT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.mergeContact(ev, contact)" translate="CONTACTMANAGER.MERGE_CONTACT">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.duplicateContact(ev, contact)" translate="CONTACTMANAGER.DUPLICATE_CONTACT">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n <md-menu-divider></md-menu-divider>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(contact, ev)" translate="CONTACTMANAGER.DELETE_CONTACT">\n Delete Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USER TABLE --\x3e\n </div>\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USER BUTTON --\x3e\n <md-fab-speed-dial id="add-contact-button" ng-hide="vm.options.hidden" md-direction="up" md-open="vm.options.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm.options.hover }" ng-mouseenter="vm.options.isOpen=true" ng-mouseleave="vm.options.isOpen=false">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-accent">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n \x3c!-- OLD IMPORT --\x3e\n \x3c!-- <md-button class="md-fab md-mini md-warn" ng-click="vm.uploadContacts($event)" aria-label="add contact" translate translate-attr-aria-label="CONTACTMANAGER.UPLOAD_CSV">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.UPLOAD_CSV\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button> --\x3e\n \x3c!-- NEW IMPORT --\x3e\n <md-button class="md-fab md-mini md-warn" flow-btn flow-init="vm.ngFlowOptions" flow-files-submitted="$flow.upload()" flow-file-success="vm.importContacts($file, $message, $flow)" flow-file-added="!!{csv:1}[$file.getExtension()]" aria-label="Select File"\n translate translate-attr-aria-label="CONTACTMANAGER.IMPORT_CONTACTS">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.IMPORT_CONTACTS\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n <md-button class="md-fab md-mini md-accent" ng-click="vm.createOrEditContact($event)" aria-label="add contact" translate translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.ADD_CONTACT\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </md-fab-actions>\n </md-fab-speed-dial>\n \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/create/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="New Contact">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FIRSTNAME">First name</label>\n <input name="firstName" ng-model="vm.contact.firstName" required md-autofocus>\n\n <div ng-messages="contactForm.firstName.$error" ng-show="contactForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LASTNAME">Last name</label>\n <input name="lastName" ng-model="vm.contact.lastName">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input name="phone" ng-model="vm.contact.phone" required>\n\n <div ng-messages="contactForm.phone.$error" ng-show="contactForm.phone.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input name="email" type="email" ng-model="vm.contact.email">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n <input name="mobile" ng-model="vm.contact.mobile">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input name="fax" ng-model="vm.contact.fax">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" ng-disabled="vm.contact.id && vm.contact.ListId" ng-init="vm.getCustomFields(vm.contact.ListId)" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n\n <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div ng-repeat="customField in vm.customFields.rows" class="md-block" ng-switch="customField.type">\n <div ng-switch-when="datetime">\n <label>{{customField.alias}}</label>\n\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-time-picker>\n </div>\n </div>\n\n <div ng-switch-when="select">\n <label>{{customField.alias}}</label>\n\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </div>\n\n <div ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}\n </md-switch>\n </div>\n\n <md-input-container ng-switch-default>\n <label>{{customField.alias}}</label>\n\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n </md-input-container>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.contact.CompanyId">\n <md-optgroup label="Companies">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n\n <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All Fields</md-button>\n </div>\n\n <md-input-container class="md-block" ng-if="vm.allFields" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth"></mdp-date-picker>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="country" ng-model="vm.contact.country">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.NOTES">Notes</label>\n <input type="text" name="description" ng-model="vm.contact.description">\n </md-input-container>\n\n <div ng-if="vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer Fields</md-button>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newContact" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newContact" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n ADD CONTACT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newContact" ng-click="vm.deleteContact($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="{{ \'CONTACTMANAGER.DUPLICATE_CONTACT\' | translate }}">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId">\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-optgroup>\n </md-select>\n\n <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n ADD CONTACT\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="CONTACTMANAGER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="CONTACTMANAGER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_HOPPER" translate-attr-aria-label="CONTACTMANAGER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/view.html",'<div id="cm-contact" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-contacts-button md-icon-button" aria-label="Go to contacts" ng-click="vm.gotoContacts()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_CONTACTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="contact-image" hide-xs>\n <img ng-src="assets/images/business/contacts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.contact.id}} {{vm.contact.firstName}} {{vm.contact.lastName}}\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-if="vm.contact.role && vm.contact.role !== \'admin\'" ng-controller="ContactQueueAddButtonController as vm_contact_qa" ng-cloak>\n <md-fab-speed-dial ng-hide="vm_contact_qa.hidden" md-direction="left" md-open="vm_contact_qa.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm_contact_qa.hover }" ng-mouseenter="vm_contact_qa.isOpen=true" ng-mouseleave="vm_contact_qa.isOpen=false">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n <md-tooltip md-direction="top" md-visible="tooltipVisible">Channels</md-tooltip>\n <md-icon md-font-icon="icon-eye" aria-label="channels"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <div ng-repeat="channel in vm_contact_qa.channels">\n <md-button aria-label="{{channel.name}}" class="md-fab md-raised md-icon-button md-mini" ng-click="vm_contact_qa.openDialog($event, vm.contact, channel)">\n <md-tooltip md-direction="{{channel.direction}}" md-visible="tooltipVisible" md-autohide="false">\n {{channel.name}}\n </md-tooltip>\n <md-icon md-font-icon="{{channel.icon}}" aria-label="{{channel.name}}"></md-icon>\n </md-button>\n </div>\n </md-fab-actions>\n </md-fab-speed-dial>\n </div>\n\n <div>\n <md-button ng-click="vm.duplicateContact($event)" class="md-fab md-warn md-icon-button" aria-label="DUPLICATE">\n <md-icon md-font-icon="icon-file-multiple"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="detailForm.$pristine && customFieldsForm.$pristine" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.DETAIL">DETAIL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div layout="column" flex="70">\n <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="detailForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- fistName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.FIRSTNAME">First Name</label>\n <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required>\n\n <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- lastName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.LASTNAME">Last Name</label>\n <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate">\n </md-input-container>\n\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- phone --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <md-icon md-font-icon="icon-phone"></md-icon>\n <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate" required>\n\n <div ng-messages="detailForm.phone.$error" ng-show="detailForm.phone.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- mobile --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- email --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <md-icon md-font-icon="icon-email" class="email"></md-icon>\n <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate">\n <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- fax --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <input type="text" name="fax" ng-model="vm.contact.fax">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- date of birdth --\x3e\n \x3c!-- <md-input-container class="md-block" flex-gt-sm="">\n <mdp-date-picker mdp-open-on-click name="dateOfBirth" mdp-placeholder="Date Of Birth" mdp-format="YYYY-MM-DD" ng-model="vm.contact.dateOfBirth">\n <div ng-messages="detailForm.dateOfBirth.$error" ng-show="reportForm.dateOfBirth.$touched" role="alert">\n <div ng-message="format">\n <span translate="CONTACTMANAGER.ERRORS.DATE_OF_RANGE_FROM_INVALID">Date Range From field is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </md-input-container> --\x3e\n\n <md-input-container class="md-block" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth"></mdp-date-picker>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container ng-if="vm.companies.rows.length" class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-icon md-font-icon="icon-domain"></md-icon>\n <md-select name="company" ng-model="vm.contact.CompanyId">\n <md-optgroup label="Companies">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n <md-icon class="pointer" ng-show="vm.contact.CompanyId" md-font-icon="icon-information-outline" ng-click="vm.editCompany($event, vm.contact.CompanyId)"></md-icon>\n </md-input-container>\n <section ng-if="!vm.companies.rows.length" flex-gt-sm="">\n <md-icon md-font-icon="icon-briefcase"></md-icon>\n <label translate="CONTACTMANAGER.NO_COMPANIES">No Companies</label>\n <md-button class="md-accent" translate="CONTACTMANAGER.ADD_COMPANY">Add Company</md-button>\n </section>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container ng-if="vm.tags.rows.length" class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.TAGS">Tags</label>\n <md-icon md-font-icon="icon-tag"></md-icon>\n <md-select ng-model="vm.contact.tags" multiple>\n <md-optgroup label="Tags">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags.rows">{{tag.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <section ng-if="!vm.tags.rows.length" flex-gt-sm="">\n <md-icon md-font-icon="icon-tag"></md-icon>\n <label translate="CONTACTMANAGER.NO_TAGS">No Tags</label>\n <md-button class="md-accent" translate="CONTACTMANAGER.ADD_TAG">Add Tag</md-button>\n </section>\n </div>\n\n <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All Fields</md-button>\n </div>\n\n <div ng-if="vm.allFields">\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- country --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <md-icon md-font-icon="icon-home" class="country"></md-icon>\n <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- city --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div flex="5"></div>\n \x3c!-- street --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- postalCode --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.POSTALCODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate translate-attr-placeholder="CONTACTMANAGER.NOTES">Notes</label>\n <md-icon md-font-icon="icon-note"></md-icon>\n <textarea ng-model="vm.contact.description" type="text" max-rows="4"></textarea>\n </md-input-container>\n </div>\n\n <div layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer Fields\n </md-button>\n </div>\n\n </div>\n </form>\n </md-card>\n <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.SOCIAL">Social</div>\n </div>\n <form name="socialForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- fistName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Facebook</label>\n <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- lastName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Twitter</label>\n <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate">\n </md-input-container>\n\n </div>\n </form>\n </md-card>\n </div>\n\n <div flex></div>\n\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex="25">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.CUSTOM_FIELDS">CUSTOM FIELDS</div>\n </div>\n <form name="customFieldsForm" novalidate>\n <md-input-container class="md-block">\n <label translate translate-attr-placeholder="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" md-on-close="vm.onSelectList($event)" ng-disabled="vm.contact.ListId">\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">#{{list.id}} - {{list.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <div ng-repeat="customField in vm.customFields.rows" ng-switch="customField.type">\n <md-input-container class="md-block" ng-switch-when="datetime">\n <label>{{customField.alias}}</label>\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-time-picker>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="select">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}\n </md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-default>\n <label>{{customField.alias}}</label>\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n </md-input-container>\n </div>\n </form>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab ng-if="vm.license.dialer">\n <md-tab-label>\n <span translate="CONTACTMANAGER.MOTION_BULL">MOTION BULL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.HOPPER">Hopper</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryHopper.filter = query;" on-collapse="vm.queryHopper.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getHoppers()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryHopper.sort" md-on-reorder="vm.getHoppers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="VoiceQueueId">{{ \'CONTACTMANAGER.VOICEQUEUEID\' | translate }}</th>\n <th md-column md-order-by="CampaignId">{{ \'CONTACTMANAGER.CAMPAIGNID\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.hoppers.count">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, hopper) in vm.hoppers.rows">\n <td md-cell>{{hopper.id}}</td>\n <td md-cell>{{hopper.phone}}</td>\n <td md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{ vm.arraypriority[hopper.priority].option }}</td>\n <td md-cell class="recallme ">\n <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell>{{hopper.VoiceQueueId}}</td>\n <td md-cell>{{hopper.CampaignId}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-if="hopper.VoiceQueueId" ng-click="vm.editHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n <md-button ng-if="hopper.CampaignId" ng-click="vm.createOrEditIvrCampaignHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(hopper, $event)" translate="CONTACTMANAGER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.FINAL">Final</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryFinal.filter = query;" on-collapse="vm.queryFinal.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getFinals()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryFinal.sort" md-on-reorder="vm.getFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'CONTACTMANAGER.DISPOSITION\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.finals.count">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, final) in vm.finals.rows">\n <td md-cell>{{final.uniqueid}}</td>\n <td md-cell>{{final.calleridnum}}</td>\n <td md-cell>{{final.statedesc}}</td>\n <td md-cell>{{final.starttime | date:\'medium\'}}</td>\n <td md-cell>{{final.disposition}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryFinal.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.queryFinal.page" md-total="{{vm.finals.count}}" md-on-paginate="vm.getFinals" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.HISTORY">History</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryHistory.filter = query;" on-collapse="vm.queryHistory.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getHistories()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryHistory.sort" md-on-reorder="vm.getHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.histories.count">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, history) in vm.histories.rows">\n <td md-cell>{{history.uniqueid}}</td>\n <td md-cell>{{history.calleridnum}}</td>\n <td md-cell>{{history.statedesc}}</td>\n <td md-cell>{{history.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{history.starttime | date:\'medium\'}}</td>\n <td md-cell>{{history.endtime | date:\'medium\'}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHistory.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.queryHistory.page" md-total="{{vm.histories.count}}" md-on-paginate="vm.getHistories" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab ng-if="vm.license.jscripty">\n <md-tab-label>\n <span translate="CONTACTMANAGER.JSCRIPTY">JSCRIPTY</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.SESSIONS">Sessions</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryJscriptySession.filter = query;" on-collapse="vm.queryJscriptySession.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n\n \x3c!-- SESSION TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryJscriptySession.sort" md-on-reorder="vm.getJscriptySessions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="agent">{{ \'CONTACTMANAGER.AGENT\' | translate }}</th>\n <th md-column md-order-by="project">{{ \'CONTACTMANAGER.PROJECT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.jscriptySessions.count">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, session) in vm.jscriptySessions.rows">\n <td md-cell>{{session.id}}</td>\n <td md-cell>{{session.starttime | date:\'medium\'}}</td>\n <td md-cell>{{session.endtime | date:\'medium\'}}</td>\n <td md-cell>{{session.membername}}</td>\n <td md-cell>{{session.projectname}}</td>\n <td md-cell class="actions">\n \x3c!-- <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical" ></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.editHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(hopper, $event)" translate="CONTACTMANAGER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu> --\x3e\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n \x3c!-- / SESSION TABLE --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.CUSTOMER_JOURNEY">CUSTOMER JOURNEY</span>\n </md-tab-label>\n\n <md-tab-body>\n <md-content class="md-padding" id="interaction-content">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'"></div>\n </md-content>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/import/import.html",'<md-dialog class="import-dialog" aria-label="Import contact">\n <form name="importForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="CONTACTMANAGER.IMPORT_CONTACTS">Import Contacts</span>\n <md-button ng-if="vm.result.finish || !vm.processing" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear ng-disabled="!vm.processing || vm.result.finish" md-mode="indeterminate" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div>\n <md-content ng-show="!vm.processing">\n <div class="form-title" translate="CONTACTMANAGER.CONTACTMANAGER">CONTACT MANAGER</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="contactField in vm.contactFields">\n <label>{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</label>\n <md-select name="{{contactField.key}}" ng-model="vm.binding[contactField.key]" placeholder="{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}" ng-required="contactField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.ListId" placeholder="Select a list" ng-change="vm.onChangeList()" required>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="customField in vm.customFields.rows">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.binding[\'cf_\' + customField.id]" placeholder="{{customField.alias}}" ng-required="customField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="customField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.CompanyId" placeholder="Select a company">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null">\n <em translate="CONTACTMANAGER.NONE">None</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <md-select ng-model="vm.duplicates" placeholder="{{ \'CONTACTMANAGER.CHECK_DUPLICATES\' | translate}}" multiple>\n <md-option ng-value="contactField.key" ng-repeat="contactField in vm.contactFields">{{ \'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</md-option>\n </md-select>\n </md-input-container>\n\n <div ng-if="vm.license.dialer">\n <div class="form-title" translate="CONTACTMANAGER.MOTIONDIALER">MOTION BULL</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="motionBullField in vm.motionBullFields">\n <label>{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}</label>\n <md-select name="{{motionBullField.key}}" ng-model="vm.binding[motionBullField.key]" placeholder="{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}" ng-required="motionBullField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n\n </md-content>\n\n <div class="error-list" ng-if="vm.result.finish">\n <div class="info" layout="row" layout-align="space-between center">\n <div>\n <div class="message">{{\'CONTACTMANAGER.UPLOAD_COMPLETED\' | translate | uppercase}} ({{vm.result.elapsed}}s)</div>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row" ng-if="vm.processing">\n \x3c!-- WIDGET PROCESSING --\x3e\n <ms-widget ng-if="!vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.rows"></span>\n </div>\n <div ng-if="vm.processing" class="font-weight-500 secondary-text">Please wait, we are processing your contacts...</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET PROCESSING --\x3e\n \x3c!-- WIDGET SUCCESS --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 green-fg">\n <span ng-bind="vm.result.affectedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.SUCCESS">Success</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET SUCCESS --\x3e\n\n \x3c!-- WIDGET FAILURE --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 red-fg">\n <span ng-bind="vm.result.failedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.FAILURE">Failure</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET FAILURE --\x3e\n\n \x3c!-- WIDGET DUPLICATES --\x3e\n <ms-widget ng-if="vm.result.duplicatedRows && vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.duplicatedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.DUPLICATES">Duplicates</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET DUPLICATES --\x3e\n </div>\n\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.processing" ng-disabled="importForm.$invalid || importForm.$pristine" ng-click="vm.uploadCsv()" class="md-accent md-raised" aria-label="UPLOAD" translate="CONTACTMANAGER.UPLOAD" translate-attr-aria-label="CONTACTMANAGER.IMPORT">\n IMPORT\n </md-button>\n <md-button ng-if="vm.processing && !vm.result.finish && !vm.stopping" ng-click="vm.stopUpload()" class="md-accent md-raised" aria-label="Stop Upload" translate="CONTACTMANAGER.STOP" translate-attr-aria-label="CONTACTMANAGER.STOP">\n STOP\n </md-button>\n <md-button ng-if="vm.result.finish && vm.result.errors.length" ng-csv="vm.getArrayErrors()" csv-header="vm.getHeaderErrors()" class="md-accent md-raised" aria-label="Export Errors" filename="contacts_import_errors.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon> {{\'CONTACTMANAGER.EXPORT_ERRORS\' | translate}}\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/merge/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="Merge Contact">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block" flex-gt-sm>\n <label>Filter</label>\n <input ng-model="vm.searchTerm" name="searchTerm" ng-model-options="{ debounce: 300 }" ng-change="vm.change()">\n </md-input-container>\n\n <md-list flex>\n <md-subheader class="md-no-sticky" ng-hide="vm.contacts.length"><em>Filter doesn\'t match any contact</em></md-subheader>\n <md-list-item class="md-3-line" ng-repeat="contact in vm.contacts | filter:{ id: \'!\' + vm.contact.id}" ng-click="vm.showConfirm($event, vm.contact, contact)">\n <img ng-src="assets/images/avatars/profile.png" class="md-avatar" alt="{{contact.who}}" />\n <div class="md-list-item-text" layout="column">\n <h3>#{{ contact.id }} - {{ contact.firstName }} {{ contact.lastName }}</h3>\n <h4>{{ contact.email }}</h4>\n <p>{{ contact.phone }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/upload/upload.html",'<md-dialog class="upload-dialog" aria-label="Upload contact">\n <form name="uploadForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="CONTACTMANAGER.UPLOAD_CONTACTS">Upload Contacts</span>\n <md-button ng-if="vm.finished || !vm.uploading" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear ng-disabled="!vm.uploading" md-mode="indeterminate" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row" layout-align="center center" ng-show="!vm.fileSelected">\n <md-button flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-btn flow-file-added="vm.fileAdded($event, $file, $flow)" flow-file-success="vm.fileSuccess($file, $message, $flow)" class="md-accent md-raised md-warn" aria-label="Select File" translate\n translate-attr-aria-label="CONTACTMANAGER.SELECT_FILE">\n <span translate="CONTACTMANAGER.SELECT_FILE">Select File</span>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n </div>\n\n <div>\n <md-content ng-show="!vm.uploading && !vm.finished && vm.fileSelected">\n <md-input-container class="md-icon-float md-block" ng-repeat="contactField in vm.contactFields">\n <label>{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</label>\n <md-select name="{{contactField.key}}" ng-model="vm.binding[contactField.key]" placeholder="{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}" ng-required="contactField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required"><em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.ListId" placeholder="Select a list" ng-change="vm.onChangeList()" required>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="customField in vm.customFields.rows">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.binding[\'cf_\' + customField.id]" placeholder="{{customField.alias}}" ng-required="customField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="customField.required"><em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.CompanyId" placeholder="Select a company">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <md-select ng-model="vm.duplicates" placeholder="{{ \'CONTACTMANAGER.CHECK_DUPLICATES\' | translate}}" multiple>\n <md-option ng-value="contactField.key" ng-repeat="contactField in vm.contactFields">{{ \'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</md-option>\n </md-select>\n </md-input-container>\n </md-content>\n\n <div layout="row" ng-if="vm.uploading || vm.finished">\n \x3c!-- WIDGET SUCCESS --\x3e\n <ms-widget class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 green-fg"><span ng-bind="vm.success"></span></div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.SUCCESS">Success</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET SUCCESS --\x3e\n\n \x3c!-- WIDGET FAILURE --\x3e\n <ms-widget class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 red-fg"><span ng-bind="vm.errors"></span></div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.FAILURE">Failure</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET FAILURE --\x3e\n\n \x3c!-- WIDGET DUPLICATES --\x3e\n <ms-widget class="h-140" flex ng-if="vm.duplicate">\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg"><span ng-bind="vm.duplicate"></span></div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.DUPLICATES">Duplicates</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET DUPLICATES --\x3e\n </div>\n\n <div class="error-list" ng-if="vm.finished">\n <div class="info" layout="row" layout-align="space-between center">\n <div>\n <div class="message">{{\'CONTACTMANAGER.UPLOAD_COMPLETED\' | translate | uppercase}}</div>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-disabled="uploadForm.$invalid || uploadForm.$pristine || vm.uploading || vm.finished || !vm.fileSelected" ng-click="vm.uploadCsv()" class="md-accent md-raised" aria-label="UPLOAD" translate="CONTACTMANAGER.UPLOAD" translate-attr-aria-label="CONTACTMANAGER.UPLOAD">\n UPLOAD\n </md-button>\n <md-button ng-if="vm.showStopButton && !vm.finished" ng-disabled="vm.disableStopButton" ng-click="vm.stopUpload()" class="md-accent md-raised" aria-label="Stop Upload" translate="CONTACTMANAGER.STOP" translate-attr-aria-label="CONTACTMANAGER.STOP">\n STOP\n </md-button>\n <md-button ng-if="vm.rows.length" ng-csv="vm.exportErrors()" class="md-accent md-raised" aria-label="Export Errors" filename="contacts_upload_errors.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon> {{\'CONTACTMANAGER.EXPORT_ERRORS\' | translate}}\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",'<md-dialog class="globalCustomField-dialog" aria-label="New GlobalCustomField">\n <form name="globalCustomFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n <input type="" name="alias" ng-model="vm.globalCustomField.alias" ng-required="true" autofocus>\n <div ng-messages="globalCustomFieldForm[\'alias\'].$error" ng-show="globalCustomFieldForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <md-select name="type" ng-model="vm.globalCustomField.type" required ng-disabled="!vm.newGlobalCustomField">\n <md-option ng-value="\'text\'">Text</md-option>\n <md-option ng-value="\'select\'">Select</md-option>\n <md-option ng-value="\'number\'">Number</md-option>\n <md-option ng-value="\'switch\'">Switch</md-option>\n <md-option ng-value="\'datetime\'">Datetime</md-option>\n </md-select>\n <div ng-messages="globalCustomFieldForm[\'type\'].$error" ng-show="globalCustomFieldForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.globalCustomField.type == \'select\'" class="md-block">\n <md-list>\n <md-list-item layout-margin>\n <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.globalCustomField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n </md-button>\n <md-button ng-if="vm.globalCustomField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.globalCustomField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list ng-sortable="vm.sortable">\n <md-list-item ng-repeat="item in vm.globalCustomField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n <div>\n <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n <input type="text" ng-model="item.value" flex>\n </div>\n <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.globalCustomField.values, $index);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list>\n <md-list-item ng-if="!vm.globalCustomField.values.length" layout="row" layout-align="center center">\n <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n </md-list-item>\n </md-list>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.globalCustomField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newGlobalCustomField" ng-click="vm.saveGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid || globalCustomFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE"\n translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newGlobalCustomField" ng-click="vm.addNewGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n ADD GLOBALCUSTOMFIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newGlobalCustomField" ng-click="vm.deleteGlobalCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",'<div id="globalCustomFields" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.GLOBALCUSTOMFIELDS">GlobalCustomFields</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedGlobalCustomFields.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedGlobalCustomFields =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-globalCustomFields-count">\n <span>{{vm.selectedGlobalCustomFields.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="GLOBALCUSTOMFIELDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedGlobalCustomFields" csv-label="true" filename="globalCustomFields.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedGlobalCustomFields($event)" aria-label="delete selected" translate translate-attr-label="GLOBALCUSTOMFIELDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- GLOBALCUSTOMFIELD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedGlobalCustomFields" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getGlobalCustomFields">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="alias">{{ \'CONTACTMANAGER.ALIAS\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'CONTACTMANAGER.TYPE\' | translate }}</th>\n <th md-column md-order-by="required">{{ \'CONTACTMANAGER.REQUIRED\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.globalCustomFields.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="globalCustomField" md-select-id="id" ng-repeat="globalCustomField in vm.globalCustomFields.rows">\n <td md-cell ng-if="globalCustomField.userpic"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="api/users/{{globalCustomField.id}}/avatar" /></td>\n <td md-cell ng-if="!globalCustomField.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="id ">{{globalCustomField.id}}</td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="alias ">{{globalCustomField.alias}}</td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="type ">{{ vm.arraytype[globalCustomField.type].option }}</td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="required ">\n <md-icon md-colors="{color: {{globalCustomField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{globalCustomField.required ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(globalCustomField, $event)" translate="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD">\n Edit GlobalCustomField\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(globalCustomField, $event)" translate="CONTACTMANAGER.DELETE_GLOBALCUSTOMFIELD">\n Delete GlobalCustomField\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.globalCustomFields.count}}" md-on-paginate="vm.getGlobalCustomFields" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / GLOBALCUSTOMFIELD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-globalCustomField-button" ng-click="vm.createOrEditGlobalCustomField($event)" aria-label="add globalCustomField" translate translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/lists/create/dialog.html",'<md-dialog class="list-dialog" aria-label="New List">\n <form name="listForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus>\n <div ng-messages="listForm[\'name\'].$error" ng-show="listForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.list.description">\n <div ng-messages="listForm[\'description\'].$error" ng-show="listForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newList" ng-click="vm.saveList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid || listForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newList" ng-click="vm.addNewList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_LIST" translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n ADD LIST\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newList" ng-click="vm.deleteList($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",'<md-dialog class="list-dialog" aria-label="list">\n <form name="listForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CONTACTMANAGER.AGENTADD_LIST">Add Agent to list</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",'<md-dialog class="customField-dialog" aria-label="New CustomField">\n <form name="customFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n <input type="" name="alias" ng-model="vm.customField.alias" ng-required="true" autofocus>\n <div ng-messages="customFieldForm[\'alias\'].$error" ng-show="customFieldForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <md-select name="type" ng-model="vm.customField.type" required ng-disabled="!vm.newCustomField">\n <md-option ng-value="\'text\'">Text</md-option>\n <md-option ng-value="\'select\'">Select</md-option>\n <md-option ng-value="\'number\'">Number</md-option>\n <md-option ng-value="\'switch\'">Switch</md-option>\n <md-option ng-value="\'datetime\'">Datetime</md-option>\n </md-select>\n <div ng-messages="customFieldForm[\'type\'].$error" ng-show="customFieldForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.customField.type == \'select\'" class="md-block">\n <md-list>\n <md-list-item layout-margin>\n <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.customField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n </md-button>\n <md-button ng-if="vm.customField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.customField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list ng-sortable="vm.sortable">\n <md-list-item ng-repeat="item in vm.customField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n <div>\n <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n <input type="text" ng-model="item.value" flex>\n </div>\n <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.customField.values, $index);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list>\n <md-list-item ng-if="!vm.customField.values.length" layout="row" layout-align="center center">\n <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n </md-list-item>\n </md-list>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newCustomField" ng-click="vm.saveCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid || customFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newCustomField" ng-click="vm.addNewCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n ADD CUSTOMFIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newCustomField" ng-click="vm.deleteCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/view.html",'<div id="contactmanager-list" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-lists-button md-icon-button" aria-label="Go to lists" ng-click="vm.gotoLists()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_LISTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="list-image" hide-xs>\n <img ng-src="assets/images/business/lists.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.list.id}}\n <span ng-if="vm.list.name">{{vm.list.name}}</span>\n <span ng-if="vm.list.exten">{{vm.list.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.list.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="CONTACTMANAGER.GOTO_LIST"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CONTACTMANAGER.AGENTADD_LIST"></span></md-tooltip>\n <md-icon md-font-icon="icon-eye"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveList()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (customFieldsForm.$invalid) || (voiceDispositionsForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="list-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.list.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.list.dialPrefix">\n <div ng-messages="generalForm[\'dialPrefix\'].$error" ng-show="generalForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.CUSTOMFIELDS">CUSTOMFIELDS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="list-detail-form-container customfields md-background-bg md-whiteframe-1dp">\n <div ng-controller="ListCustomFieldsController as vm_dc" ng-init="vm_dc.init(vm.list)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListCustomFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.CUSTOMFIELDS">CustomFields</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditListCustomField($event)" aria-label="add customField" translate translate-attr-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedListCustomFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedListCustomFields.length}} {{vm_dc.selectedListCustomFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedListCustomFields" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedListCustomFields($event)" aria-label="delete selected" translate translate-attr-label="LISTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedListCustomFields" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getListCustomFields">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="alias">{{ \'CONTACTMANAGER.ALIAS\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'CONTACTMANAGER.TYPE\' | translate }}</th>\n <th md-column md-order-by="required">{{ \'CONTACTMANAGER.REQUIRED\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="customField" md-select-id="id" ng-repeat="customField in vm_dc.listCustomFields.rows">\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>{{customField.id}}</td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>{{customField.alias}}</td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>{{ vm_dc.arraytype[customField.type].option }}</td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell class="required ">\n <md-icon md-colors="{color: {{customField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{customField.required? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditListCustomField($event, customField)" translate="CONTACTMANAGER.EDIT_CUSTOMFIELD">\n Edit CustomField\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(customField, $event)" translate="CONTACTMANAGER.DELETE_CUSTOMFIELD">\n Delete CustomField\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.listCustomFields.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="CONTACTMANAGER.NO_CUSTOMFIELD_AVAILABLE">No customfield available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.listCustomFields.count}}" md-on-paginate="vm_dc.getListCustomFields" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="list-detail-form-container voicedispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ListVoiceDispositionsController as vm_dc" ng-init="vm_dc.init(vm.list)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListVoiceDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.VOICEDISPOSITIONS">VoiceDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditListVoiceDisposition($event)" aria-label="add voiceDisposition" translate translate-attr-label="CONTACTMANAGER.ADD_VOICEDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedListVoiceDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedListVoiceDispositions.length}} {{vm_dc.selectedListVoiceDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedListVoiceDispositions" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedListVoiceDispositions($event)" aria-label="delete selected" translate translate-attr-label="LISTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedListVoiceDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getListVoiceDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CONTACTMANAGER.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="voiceDisposition" md-select-id="id" ng-repeat="voiceDisposition in vm_dc.listVoiceDispositions.rows">\n <td ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" md-cell>{{voiceDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" md-cell>{{voiceDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" md-cell>{{voiceDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" translate="CONTACTMANAGER.EDIT_VOICEDISPOSITION">\n Edit VoiceDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(voiceDisposition, $event)" translate="CONTACTMANAGER.DELETE_VOICEDISPOSITION">\n Delete VoiceDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.listVoiceDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="CONTACTMANAGER.NO_VOICEDISPOSITION_AVAILABLE">No voicedisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.listVoiceDispositions.count}}" md-on-paginate="vm_dc.getListVoiceDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/lists/edit/voiceDispositions/dialog.html",'<md-dialog class="voiceDisposition-dialog" aria-label="New VoiceDisposition">\n <form name="voiceDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="" name="name" ng-model="vm.voiceDisposition.name" ng-required="true" autofocus>\n <div ng-messages="voiceDispositionForm[\'name\'].$error" ng-show="voiceDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newVoiceDisposition" ng-click="vm.saveVoiceDisposition()" class="send-button md-accent md-raised" ng-disabled="voiceDispositionForm.$invalid || voiceDispositionForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE"\n translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newVoiceDisposition" ng-click="vm.addNewVoiceDisposition()" class="send-button md-accent md-raised" ng-disabled="voiceDispositionForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_VOICEDISPOSITION" translate-attr-aria-label="CONTACTMANAGER.ADD_VOICEDISPOSITION">\n ADD VOICEDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newVoiceDisposition" ng-click="vm.deleteVoiceDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/lists.html",'<div id="lists" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.LISTS">Lists</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedLists.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedLists =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-lists-count">\n <span>{{vm.selectedLists.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="LISTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllLists()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectLists()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedLists" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedLists($event)" aria-label="delete selected" translate translate-attr-label="LISTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- LIST TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedLists" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getLists">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.lists.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="list" md-select-id="id" ng-repeat="list in vm.lists.rows">\n <td md-cell ng-if="list.userpic"><img class="avatar" alt="{{list.name}}" ng-src="api/users/{{list.id}}/avatar" /></td>\n <td md-cell ng-if="!list.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{list.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditList($event, list)" md-cell class="id ">{{list.id}}</td>\n <td ng-click="vm.createOrEditList($event, list)" md-cell class="name ">{{list.name}}</td>\n <td ng-click="vm.createOrEditList($event, list)" md-cell class="description ">{{list.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(list, $event)" translate="CONTACTMANAGER.EDIT_LIST">\n Edit List\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotocontactsgoto(list, $event)" translate="CONTACTMANAGER.GOTOCONTACTS_LIST">\n goToContacts List\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.exportcsvcontactsexport(list, $event)" translate="CONTACTMANAGER.EXPORTCSVCONTACTS_LIST">\n exportCsvContacts List\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(list, $event)" translate="CONTACTMANAGER.AGENTADD_LIST">\n AgentAdd List\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(list, $event)" translate="CONTACTMANAGER.DELETE_LIST">\n Delete List\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.lists.count}}" md-on-paginate="vm.getLists" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / LIST TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD LIST BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-list-button" ng-click="vm.createOrEditList($event)" aria-label="add list" translate translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD LIST BUTTON --\x3e\n</div>'),e.put("app/main/apps/dashboards/views/custom/custom.html",'<div ng-if="!vm.customDashboard">\n <p>Custom Dashboard not available...</p>\n</div>\n<div id="dashboard-custom" ng-if="vm.customDashboard" ng-cloak layout-fill>\n <md-content>\n <md-toolbar class="md-default md-accent filter-header">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.customDashboard.name}}</span>\n <div flex></div>\n <div layout="column">\n <span class="font-size-10" translate="DASHBOARDS.FILTER_VOICE_QUEUES">Filter Voice Queues</span>\n <md-select placeholder="Select one or more queues" class="font-size-12 no-margin w-200" md-on-close="vm.onChangeVoiceQueues()" ng-model="vm.voiceQueuesSelected" multiple aria-label="voiceQueues">\n <md-option ng-value="voiceQueue.id" ng-repeat="voiceQueue in vm.voiceQueues.rows">{{ voiceQueue.name }}</md-option>\n </md-select>\n </div>\n <md-button ng-if="vm.currentUser.role == \'admin\'" class="md-icon-button" ng-click="vm.goToEdit()" aria-label="goToEdit">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.EDIT"></span></md-tooltip>\n <md-icon md-font-icon="icon-table-edit"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <ms-widget-engine config="vm.customDashboard"></ms-widget-engine>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/agent.general.html",'<div id="agent-general" layout="column">\n <div layout="row" layout-align="start center" class="md-primary-bg">\n <md-button class="md-raised no-margin width-50" style="border-radius: 0px" ng-class="{\'md-primary\': !vm.isActiveTab(0)}" ng-click="vm.onClickTab(0)" aria-label="home">\n <md-tooltip md-direction="bottom" md-delay="500">Home</md-tooltip>\n <md-icon md-font-icon="icon-home" class="icon"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center" ms-scroll>\n <div style="height: 36px" layout="column" ng-repeat="(key, tab) in vm.tabs" ng-click="vm.onClickTab(tab.id)" ng-class="{\'grey-50-bg\': vm.isActiveTab(tab.id)}">\n <div style="height: 34px" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="{{tab.icon}}" class="icon s16 margin-horizontal-5" ng-class="tab.color + \'-fg\'"></md-icon>\n <span class="text-truncate font-size-12" ng-class="vm.isActiveTab(tab.id) ? \'black-fg\' : \'grey-300-fg\'"> {{tab.title}} <span ng-if="tab.badges" class="badge md-white-fg md-red-bg">{{tab.badges}}</span></span>\n <md-button class="md-icon-button md-mini no-margin" ng-class="vm.isActiveTab(tab.id) ? \'md-primary\' : \'grey-300-fg\'" aria-label="close" ng-click="vm.closeTab(tab)">\n <md-icon md-font-icon="icon-close-circle-outline" class="icon s16"></md-icon>\n </md-button>\n </div>\n <div style="height: 2px" ng-class="vm.isActiveTab(tab.id) ? tab.color + \'-bg\' : \'\'"></div>\n </div>\n </div>\n </div>\n <div layout="row" class="agent-content" ng-if="vm.isActiveTab(0)" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.html\'" ng-controller="AgentGeneralHomeController as vm_home"\n ng-init="vm_home.init(vm.license)"></div>\n <div ng-if="!vm.isActiveTab(0)" ng-repeat="(key, tab) in vm.tabs" ng-switch="tab.type">\n <div ng-switch-when="contact">\n <div class="agent-content" ms-scroll ng-if="vm.isActiveTab(tab.id)" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html\'" ng-controller="AgentGeneralContactController as vm"\n ng-init="vm.init(tab,$parent.vm.license)"></div>\n </div>\n <div ng-switch-when="popup">\n <div ng-if="vm.isActiveTab(tab.id)" ms-scroll ng-include="\'app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html\'" ng-controller="AgentGeneralPopupController as vm" ng-init="vm.init(tab)"></div>\n </div>\n <div ng-switch-when="jscripty">\n <div class="agent-content" ms-scroll ng-if="vm.isActiveTab(tab.id)" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html\'" ng-controller="AgentGeneralJscriptyController as vm"\n ng-init="vm.init(tab)"></div>\n </div>\n <div ng-switch-when="interaction">\n <div id="interaction-app" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'"\n ng-controller="AgentGeneralInteractionController as vm" ng-init="vm.init(tab)"></div>\n </div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html",'<md-tabs md-selected="vm.currentTab" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.DETAIL">Detail</span>\n </md-tab-label>\n <md-tab-body>\n <md-content>\n <div layout="row">\n \x3c!-- MS-CARD --\x3e\n <md-card class="template-7" layout="row" layout-align="space-between" ng-repeat="call in vm.tab.calls track by call.uniqueid">\n <div class="info" layout="column" layout-align="space-between" layout-fill flex>\n <div layout="row">\n <span ng-if="call.answeredAt" class="text-boxed indigo-100-bg"><timer start-time="call.answeredAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span>\n <div flex></div>\n <span ng-if="call.disposedAt" class="text-boxed amber-200-bg"><timer start-time="call.disposedAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span>\n </div>\n <div class="p-16">\n <div class="title h1">\n <md-icon ng-if="!call.routeId" md-font-icon="icon-phone-incoming"></md-icon>\n <md-icon ng-if="call.routeId" md-font-icon="icon-phone-outgoing"></md-icon>\n {{ call.routeId ? call.destcalleridnum : call.calleridnum }}\n </div>\n\n <div class="subtitle h4 secondary-text" ng-if="call.calleridname && call.calleridname != \'<unknown>\' && !call.routeId">\n <md-icon md-font-icon="icon-account"></md-icon>\n Name: {{ call.calleridname }}\n </div>\n\n <div class="text h4 pt-8" ng-if="call.queue">\n <md-icon md-font-icon="icon-stackoverflow"></md-icon>\n Queue: {{call.queue}}\n </div>\n <div class="text h4 pt-8" ng-if="call.variables.extravar">\n <md-icon md-font-icon="icon-minus"></md-icon>\n Extra: {{call.variables.extravar}}\n </div>\n </div>\n <div layout="row" layout-align="end center">\n <md-button ng-if="call.disposedAt" type="submit" ng-click="vm.disposeCall($event, call)" class="send-button md-accent md-raised">\n {{ \'DASHBOARDS.DISPOSE\' | translate}}\n </md-button>\n </div>\n </div>\n </md-card>\n \x3c!-- / MS-CARD --\x3e\n <div flex layout="row" layout-align="end center">\n <md-button type="submit" ng-click="vm.mergeContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid" aria-label="merge">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.MERGE"></span></md-tooltip>\n <md-icon md-font-icon="icon-source-fork"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.duplicateContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid" aria-label="duplicate">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.DUPLICATE"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.addNewContact($event)" class="send-button md-accent md-raised" ng-if="vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid" aria-label="add">\n {{ \'DASHBOARDS.ADD\'| translate }}\n </md-button>\n <md-button type="submit" ng-click="vm.saveContact($event)" class="send-button md-accent md-raised" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid" aria-label="save">\n {{ \'DASHBOARDS.SAVE\' | translate }}\n </md-button>\n </div>\n </div>\n <div layout="row">\n <div layout="column" flex="75">\n <md-card layout-padding>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.PERSONAL_INFO">PERSONAL_INFO</div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n </div>\n\n <form name="vm.detailForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.FIRSTNAME">First Name</label>\n <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required>\n <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.jscripty" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="JSCRIPTY PROJECTS" ng-click="$mdOpenMenu($event)" aria-label="jscripty">\n <md-icon md-font-icon="icon-script"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.jscriptyProjects && vm.jscriptyProjects.rows.length" ng-repeat="project in vm.jscriptyProjects.rows">\n <md-button ng-click="vm.addJscriptyTab(project, $event)">\n <md-icon md-font-icon="icon-script"></md-icon> {{project.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.jscriptyProjects || !vm.jscriptyProjects.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_JSCRIPTY_PROJECTS_AVAILABLE">\n <md-icon md-font-icon="icon-script"></md-icon> No jscripty projects available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.LASTNAME">Last Name</label>\n <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.PHONE">Phone</label>\n <md-icon md-font-icon="icon-phone"></md-icon>\n <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate" required>\n <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.phone" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n <div ng-messages="vm.detailForm.phone.$error" ng-show="vm.detailForm.phone.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.PHONE_REQUIRED">Phone name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div>\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="vm.contact.phone" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </div>\n </div>\n <div flex="5"></div>\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.MOBILE">Mobile</label>\n <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate">\n <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.mobile" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n </md-input-container>\n <div>\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="vm.contact.mobile" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </div>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.messaging || !vm.hasPermission(107) || !vm.contact.mobile" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW SMS" ng-click="$mdOpenMenu($event)" aria-label="sms">\n <md-icon md-font-icon="icon-message-text"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.smsAccounts && vm.smsAccounts.rows.length" ng-repeat="account in vm.smsAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Sms\', account, vm.contact.mobile)">\n <md-icon md-font-icon="icon-message-text"></md-icon> {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.smsAccounts || !vm.smsAccounts.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_SMS_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-message-text"></md-icon> No sms accounts available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.EMAIL">Email</label>\n <md-icon md-font-icon="icon-email" class="email"></md-icon>\n <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate">\n <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n <div ng-message="email">\n <span translate="DASHBOARDS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.mail || !vm.hasPermission(106) || !vm.contact.email" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW EMAIL" ng-click="$mdOpenMenu($event)" aria-label="email">\n <md-icon md-font-icon="icon-email"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.mailAccounts && vm.mailAccounts.rows.length" ng-repeat="account in vm.mailAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Mail\', account, vm.contact.email)">\n <md-icon md-font-icon="icon-email"></md-icon> {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.mailAccounts || !vm.mailAccounts.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_MAIL_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-email"></md-icon> No email accounts available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n <div flex="5"></div>\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.FAX">Fax</label>\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <input type="text" name="fax" ng-model="vm.contact.fax">\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.fax || !vm.hasPermission(109) || !vm.contact.fax" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW FAX" ng-click="$mdOpenMenu($event)" aria-label="fax">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.faxAccounts && vm.faxAccounts.rows.length" ng-repeat="account in vm.faxAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Fax\', account, vm.contact.fax)">\n <md-icon md-font-icon="icon-deskphone"></md-icon> {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.faxAccounts || !vm.faxAccounts.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_FAX_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-deskphone"></md-icon> No fax accounts available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="DASHBOARDS.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth"></mdp-date-picker>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.COMPANY">Company</label>\n <md-icon md-font-icon="icon-domain" class="email"></md-icon>\n <md-select name="company" ng-model="vm.contact.CompanyId">\n <md-option ng-value="company.id" ng-repeat="company in vm.tab.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null"><em translate="DASHBOARDS.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.TAG">TAG</label>\n <md-icon md-font-icon="icon-tag"></md-icon>\n <md-select ng-model="vm.contact.tags" multiple>\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tab.tags.rows">{{tag.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.COUNTRY">Country</label>\n <md-icon md-font-icon="icon-home" class="country"></md-icon>\n <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.POSTALCODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate translate-attr-placeholder="DASHBOARDS.NOTES">Notes</label>\n <md-icon md-font-icon="icon-note"></md-icon>\n <textarea ng-model="vm.contact.description" type="text" max-rows="4"></textarea>\n </md-input-container>\n </div>\n </form>\n </md-card>\n <md-card>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.SOCIAL">Social</div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Facebook</label>\n <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Twitter</label>\n <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate">\n </md-input-container>\n </div>\n </md-card>\n </div>\n <div flex="25" layout="column" layout-padding>\n <md-card flex="100">\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.CUSTOM_FIELDS">CUSTOM FIELDS</div>\n <form name="vm.customFieldsForm" novalidate>\n\n \x3c!-- START INPUT LIST --\x3e\n <md-input-container class="md-block" ng-if="!vm.contact.ListId">\n <label translate translate-attr-placeholder="DASHBOARDS.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.tab.userLists.rows">#{{list.id}} - {{list.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.contact.ListId">\n <label translate translate-attr-placeholder="DASHBOARDS.LIST">List</label>\n <md-select ng-disabled="!vm.newContact" name="list" ng-model="vm.contact.ListId" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.tab.lists.rows">#{{list.id}} - {{list.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END INPUT LIST --\x3e\n\n <div ng-repeat="customField in vm.tab.customFields.rows" ng-switch="customField.type">\n <md-input-container class="md-block" ng-switch-when="datetime">\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-time-picker>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="select">\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}<span ng-if="customField.required">*</span>\n </md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-default>\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n </md-input-container>\n </div>\n </form>\n </md-card>\n </div>\n </div>\n </md-content>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.CUSTOMER_JOURNEY">Customer Journey</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding" id="interaction-content">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'"></div>\n </md-content>\n </md-tab-body>\n </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",'<md-dialog class="agent-dialog" aria-label="agent dispose">\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.DISPOSE"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div ng-if="!vm.isReschedule">\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.DISPOSITIONS">Dispositions</label>\n <md-select name="disposition" ng-model="vm.choice" required>\n <md-optgroup ng-if="vm.dispositions.rows.length" label="Custom">\n <md-option ng-value="disposition.name" ng-repeat="disposition in vm.dispositions.rows">{{ disposition.name }}</md-option>\n </md-optgroup>\n <md-optgroup label="Default">\n <md-option ng-value="null">NONE</md-option>\n <md-option value="fax"><span translate="DASHBOARDS.FAX">Fax</span></md-option>\n <md-option value="amd"><span translate="DASHBOARDS.ANSWER_MACHINE">Answer Machine</span></md-option>\n <md-option value="interested"><span translate="DASHBOARDS.INTERESTED">Interested</span></md-option>\n <md-option value="notinterested"><span translate="DASHBOARDS.NOT_INTERESTED">Not Interested</span></md-option>\n <md-option value="sold"><span translate="DASHBOARDS.SOLD">Sold</span></md-option>\n <md-option value="special"><span translate="DASHBOARDS.SPECIAL">Special</span></md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.NOTE">Note</label>\n <textarea ng-model="vm.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n </md-input-container>\n </div>\n <div ng-if="vm.isReschedule" layout="row">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.date.$error" ng-show="dateTime.date.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.time.$error" ng-show="dateTime.time.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-if="!vm.isReschedule" layout="row">\n <md-button ng-disabled="!(vm.choice || vm.note)" class="send-button md-raised md-accent" ng-click="vm.saveDisposition()">\n {{(vm.choice ? \'DASHBOARDS.DISPOSE\' : \'DASHBOARDS.SAVE\') | translate}}\n </md-button>\n <md-button ng-if="vm.dialerCall" class="send-button md-raised md-primary" translate="DASHBOARDS.RESCHEDULE" ng-click="vm.saveDisposition(\'reschedule\')">\n Reschedule\n </md-button>\n <md-button ng-if="vm.dialerCall" class="send-button md-accent md-raised" translate="DASHBOARDS.RECALLME" ng-click="vm.saveDisposition(\'recallme\')">\n Recall Me\n </md-button>\n <span flex></span>\n <md-button ng-if="vm.dialerCall" class="md-raised md-warn" translate="DASHBOARDS.BLACKLIST" ng-click="vm.saveDisposition(\'blacklist\')">\n Blacklist\n </md-button>\n </md-dialog-actions>\n <md-dialog-actions ng-if="vm.isReschedule" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-disabled="vm.disable" ng-click="vm.saveReschedule()" class="send-button md-accent md-raised" ng-disabled="dateTime.$invalid || dateTime.$pristine" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/contact/reschedule/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n <form name="dateTime" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.date.$error" ng-show="dateTime.date.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.time.$error" ng-show="dateTime.time.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-disabled="vm.disable" ng-click="vm.saveDialog()" class="send-button md-accent md-raised" ng-disabled="dateTime.$invalid || dateTime.$pristine" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html",'<div ng-cloak>\n <md-content>\n <md-tabs md-selected="vm.selectedTab" md-dynamic-height md-border-bottom>\n <md-tab ng-if="vm_home.hasPermission(110)" label="Voice">\n <div ng-controller="AgentHomeAbandonedVoiceController as vm_voice">\n <md-content ng-if="vm.selectedTab==0" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html\'" class="md-padding">\n </md-content>\n </div>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="Bull">\n <div ng-controller="AgentHomeAbandonedBullController as vm_bull">\n <md-content ng-if="vm.selectedTab==1" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html\'" class="md-padding">\n </md-content>\n </div>\n </md-tab>\n </md-tabs>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header blue-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm_bull.query.filter = query" on-collapse="vm_bull.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm_bull.pickerModel.dateStart" ng-click="vm_bull.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm_bull.localizationMap" ng-model="vm_bull.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_bull.getContacts()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_bull.query.lastAssignedTo" ng-change="vm_bull.getContacts()">\n <md-option ng-value="vm_bull.currentUser.name" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div ng-if="vm_bull.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_bull.query.queue" ng-change="vm_bull.getContacts()">\n <md-option ng-value="vm_bull.defaultQueues" ng-if="vm_bull.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm_bull.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm_bull.refresh && vm_bull.refreshContacts($event)" aria-label="refresh Contacts" translate translate-attr-label="DASHBOARDS.REFRESH_CONTACTS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm_bull.showTooltip" md-visible="vm_bull.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_bull.promise">\n <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm_bull.contacts.rows">\n <td md-cell class="id">{{contact.id}}</td>\n <td md-cell class="firstName">{{contact.calleridname}}</td>\n <td md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.calleridnum" license="vm_home.license" disabled="contact.lastAssignedTo !== vm_bull.currentUser.name"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="list">{{vm_bull.queuesMap[contact.queue]}}</td>\n <td md-cell class="list">{{contact.queuecallerabandonAt ? (contact.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.queuecallerexitAt ? (contact.queuecallerexitAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.queuecallerexitreason}}</td>\n <td md-cell class="list">{{contact.disposition}}</td>\n <td md-cell class="actions">\n <md-switch no-margin ng-if="contact.lastAssignedTo === vm_bull.currentUser.name || !contact.lastAssignedTo" ng-disabled="vm_bull.disable[contact.id]" ng-model="contact.assigned" aria-label="reserved" ng-change="vm_bull.reserved(contact, contact.disposition)">\n \x3c!-- <span>{{ contact.assigned ? \'DASHBOARDS.RESERVED\' : \'DASHBOARDS.FREE\' | translate }}</span> --\x3e\n </md-switch>\n </td>\n <td md-cell class="list">{{contact.lastAssignedTo}}</td>\n <td md-cell class="actions">\n <md-menu ng-if="contact.lastAssignedTo === vm_bull.currentUser.name">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="1">\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-click="vm_bull.reserved(contact, null)"><em translate="DASHBOARDS.NONE">NONE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_bull.reserved(contact, \'fax\')"><em translate="DASHBOARDS.FAX">FAX</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_bull.reserved(contact, \'Answer Machine\')"><em translate="DASHBOARDS.ANSWER_MACHINE">ANSWER_MACHINE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_bull.reserved(contact, \'Interested\')"><em translate="DASHBOARDS.INTERESTED">INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_bull.reserved(contact, \'Not Interested\')"><em translate="DASHBOARDS.NOT_INTERESTED">NOT_INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_bull.reserved(contact, \'Sold\')"><em translate="DASHBOARDS.SOLD">SOLD</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_bull.reserved(contact, \'Special\')"><em translate="DASHBOARDS.SPECIAL">SPECIAL</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_bull.disposition.length" ng-repeat="disposition in vm_bull.disposition">\n <md-button ng-click="vm_bull.reserved(contact, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.contacts.count}}" md-on-paginate="vm_bull.getContacts" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header blue-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm_voice.query.filter = query" on-collapse="vm_voice.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm_voice.pickerModel.dateStart" ng-click="vm_voice.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm_voice.localizationMap" ng-model="vm_voice.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_voice.getContacts()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_voice.query.lastAssignedTo" ng-change="vm_voice.getContacts()">\n <md-option ng-value="vm_voice.currentUser.name" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div ng-if="vm_voice.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_voice.query.queue" ng-change="vm_voice.getContacts()">\n <md-option ng-value="vm_voice.defaultQueues" ng-if="vm_voice.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm_voice.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm_voice.refresh && vm_voice.refreshContacts($event)" aria-label="refresh Contacts" translate translate-attr-label="DASHBOARDS.REFRESH_CONTACTS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm_voice.showTooltip" md-visible="vm_voice.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_voice.promise">\n <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm_voice.contacts.rows">\n <td md-cell class="id">{{contact.id}}</td>\n <td md-cell class="firstName">{{contact.calleridname}}</td>\n <td md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.calleridnum" license="vm_home.license" disabled="contact.lastAssignedTo !== vm_voice.currentUser.name"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="list">{{vm_voice.queuesMap[contact.queue]}}</td>\n <td md-cell class="list">{{contact.queuecallerabandonAt ? (contact.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.disposition}}</td>\n <td md-cell class="actions">\n <md-switch no-margin ng-if="contact.lastAssignedTo === vm_voice.currentUser.name || !contact.lastAssignedTo" ng-disabled="vm_voice.disable[contact.id]" ng-model="contact.assigned" aria-label="reserved" ng-change="vm_voice.reserved(contact, contact.disposition)">\n \x3c!-- <span>{{ contact.assigned ? \'DASHBOARDS.RESERVED\' : \'DASHBOARDS.FREE\' | translate }}</span> --\x3e\n </md-switch>\n </td>\n <td md-cell class="list">{{contact.lastAssignedTo}}</td>\n <td md-cell class="actions">\n <md-menu ng-if="contact.lastAssignedTo === vm_voice.currentUser.name">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="1">\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-click="vm_voice.reserved(contact, null)"><em translate="DASHBOARDS.NONE">NONE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_voice.reserved(contact, \'fax\')"><em translate="DASHBOARDS.FAX">FAX</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_voice.reserved(contact, \'Answer Machine\')"><em translate="DASHBOARDS.ANSWER_MACHINE">ANSWER_MACHINE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_voice.reserved(contact, \'Interested\')"><em translate="DASHBOARDS.INTERESTED">INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_voice.reserved(contact, \'Not Interested\')"><em translate="DASHBOARDS.NOT_INTERESTED">NOT_INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_voice.reserved(contact, \'Sold\')"><em translate="DASHBOARDS.SOLD">SOLD</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_voice.reserved(contact, \'Special\')"><em translate="DASHBOARDS.SPECIAL">SPECIAL</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_voice.disposition.length" ng-repeat="disposition in vm_voice.disposition">\n <md-button ng-click="vm_voice.reserved(contact, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.contacts.count}}" md-on-paginate="vm_voice.getContacts" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/agent.general.home.html",'<div layout="column" layout-align="start center" class="md-primary-bg width-50">\n <div ng-repeat="node in vm_home.navigation">\n <div ng-repeat="home in node.children">\n <md-button ng-repeat="button in home.children" ng-if="!button.hidden()" class="md-raised width-50 height-50 no-margin" style="border-radius: 0px" aria-label="{{button.state}}" ng-click="vm_home.changeSidebarTab(button.state)" ng-class="{\'md-primary\': vm_home.sidebar != button.state}">\n <md-tooltip md-direction="right" md-delay="500"><span translate="{{button.translate}}"></span></md-tooltip>\n <md-icon md-font-icon="{{button.icon}}" ng-class="button.iconClass"></md-icon>\n </md-button>\n </div>\n </div>\n</div>\n<div ng-switch="vm_home.sidebar" style="overflow-y: auto" flex>\n <div ng-switch-when="contacts">\n <div ng-if="vm_home.hasPermission(102)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html\'" ng-controller="AgentHomeContactsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(102)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="mycontacts">\n <div ng-if="vm_home.hasPermission(103) && vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html\'" ng-controller="AgentHomeMyContactsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(103) || !vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="voice">\n <div ng-if="vm_home.hasPermission(110)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html\'" ng-controller="AgentHomeVoiceController as vm"></div>\n <div ng-if="!vm_home.hasPermission(110)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="abandoned">\n <div ng-if="vm_home.hasPermission(111)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html\'" ng-controller="AgentHomeAbandonedController as vm"></div>\n <div ng-if="!vm_home.hasPermission(111)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="recordings">\n <div ng-if="vm_home.hasPermission(104)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html\'" ng-controller="AgentHomeRecordingsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(104)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="chat">\n <div ng-if="vm_home.hasPermission(105) && vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html\'" ng-controller="AgentHomeChatController as vm"></div>\n <div ng-if="!vm_home.hasPermission(105) || !vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="mail">\n <div ng-if="vm_home.hasPermission(106) && vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html\'" ng-controller="AgentHomeMailController as vm"></div>\n <div ng-if="!vm_home.hasPermission(106) || !vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="sms">\n <div ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html\'" ng-controller="AgentHomeSmsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(107) || !vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="openchannel">\n <div ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html\'" ng-controller="AgentHomeOpenchannelController as vm"></div>\n <div ng-if="!vm_home.hasPermission(108) || !vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="fax">\n <div ng-if="vm_home.hasPermission(109) && vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html\'" ng-controller="AgentHomeFaxController as vm"></div>\n <div ng-if="!vm_home.hasPermission(109) || !vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-default>\n <div ng-if="vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html\'" ng-controller=" AgentHomeDashboardController as vm"></div>\n <div ng-if="!vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getChatInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getChatInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getChatInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_WEBSITE">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.ChatWebsiteId" ng-change="vm.getChatInteractions()">\n <md-option ng-value="chatAccount.id" ng-repeat="chatAccount in vm.chatAccounts.rows">{{chatAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getChatInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getChatInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getChatInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.WEBSITE\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatInteractions.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="chatInteraction in vm.chatInteractions.rows" ng-class="{\'text-bold text-italic\': chatInteraction.unread}">\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{chatInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!chatInteraction.closed && chatInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in chatInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!chatInteraction.closed && chatInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'chat\')" layout-margin>{{chatInteraction.unread}}</span>\n <md-icon ng-if="chatInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(chatInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{chatInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <div layout="row" ng-if="chatInteraction.lastMsgAt">\n <span><md-icon md-font-icon="{{chatInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon></span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{chatInteraction.lastMsgAt | formatdate }}</span>\n </div </div>\n <span ng-if="!chatInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <span ng-if="chatInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="chatInteraction.disposition">- {{chatInteraction.disposition}}</span></span>\n <md-tooltip ng-if="chatInteraction.closed">{{chatInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!chatInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="chatInteraction.substatus"> - {{chatInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(chatInteraction)}}</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell class="chatAccount">\n {{ vm.getChatWebsiteLabel(chatInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="chatInteraction.Tags.length">\n <div ng-if="chatInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': chatInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{chatInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="chatInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in chatInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showChatInteraction($event, chatInteraction)" translate="DASHBOARDS.SHOW">\n Show Chat\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.chatInteractions.count}}" md-on-paginate="vm.getChatInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html",'<md-card>\n <md-toolbar class="md-table-toolbar md-default table-header red-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.CONTACTS">Contacts</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div layout="column">\n <span class="font-size-10" translate="CONTACTMANAGER.SELECT_LIST">Select a list</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.ListId" ng-change="vm.getContacts()">\n <md-option ng-value="vm.defaultLists" ng-if="vm.lists.count > 1"><em translate="CONTACTMANAGER.ALL_CONTACTS">All</em></md-option>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm.refreshContacts($event)" aria-label="refresh Contacts" translate translate-attr-label="DASHBOARDS.REFRESH_CONTACTS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n <md-button class="md-icon-button" ng-click="vm.openContact($event)" aria-label="add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.openContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="firstName">{{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="mobile">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="fax">{{contact.fax}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="email">{{contact.email}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="list">{{vm.listsMap[contact.ListId].name}}</td>\n <td md-cell class="tags">\n <div ng-if="contact.tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.tags">{{tag}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.openContact($event, contact)" translate="DASHBOARDS.EDIT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html",'<div ng-cloak>\n <md-content>\n <md-tabs md-dynamic-height md-border-bottom>\n <md-tab ng-if="vm_home.hasPermission(110)" label="Voice">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html\'" ng-controller="AgentHomeDashboardVoiceController as vm_voice" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="Bull">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html\'" ng-controller="AgentHomeDashboardBullController as vm_bull" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(105) && vm_home.license.chat" label="Chat">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html\'" ng-controller="AgentHomeDashboardMultiChannelChatController as vm_chat" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(106) && vm_home.license.mail" label="Email">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html\'" ng-controller="AgentHomeDashboardMultiChannelMailController as vm_mail" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" label="Sms">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html\'" ng-controller="AgentHomeDashboardMultiChannelSmsController as vm_sms" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" label="Open Channel">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html\'" ng-controller="AgentHomeDashboardMultiChannelOpenchannelController as vm_openchannel" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(109) && vm_home.license.fax" label="Fax">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html\'" ng-controller="AgentHomeDashboardMultiChannelFaxController as vm_fax" class="md-padding">\n </md-content>\n </md-tab>\n </md-tabs>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_bull.promise">\n <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getVoiceQueues">\n <tr md-row>\n <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.getSize(vm_bull.voiceQueues)">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, voiceQueue) in vm_bull.voiceQueues">\n <td md-cell class="name">{{voiceQueue.name}}</td>\n <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.voiceQueuesTotal}}" md-on-paginate="vm_bull.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm_bull.rpcVoiceQueuesChannels | limitObjectFromTo: vm_bull.queryChannels.limit:(vm_bull.queryChannels.page - 1) * vm_bull.queryChannels.limit">\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.queryChannels.limit" md-page="vm_bull.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_chat.promise">\n <thead md-head md-order="vm_chat.query.sort" md-on-reorder="vm_chat.getChatQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_chat.getSize(vm_chat.chatQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_chat.chatQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_chat.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_chat.query.page" md-total="{{vm_chat.chatQueuesTotal}}" md-on-paginate="vm_chat.getChatQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_chat.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_chat.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_chat.queryChannels.limit" md-page="vm_chat.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_chat.paginatedInteractions.length}}" md-on-paginate="vm_chat.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_fax.promise">\n <thead md-head md-order="vm_fax.query.sort" md-on-reorder="vm_fax.getFaxQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_fax.getSize(vm_fax.faxQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_fax.faxQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_fax.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_fax.query.page" md-total="{{vm_fax.faxQueuesTotal}}" md-on-paginate="vm_fax.getFaxQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_fax.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_fax.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_fax.queryChannels.limit" md-page="vm_fax.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_fax.paginatedInteractions.length}}" md-on-paginate="vm_fax.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_mail.promise">\n <thead md-head md-order="vm_mail.query.sort" md-on-reorder="vm_mail.getMailQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_mail.getSize(vm_mail.mailQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_mail.mailQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_mail.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_mail.query.page" md-total="{{vm_mail.mailQueuesTotal}}" md-on-paginate="vm_mail.getMailQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_mail.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_mail.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_mail.queryChannels.limit" md-page="vm_mail.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_mail.paginatedInteractions.length}}" md-on-paginate="vm_mail.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_openchannel.promise">\n <thead md-head md-order="vm_openchannel.query.sort" md-on-reorder="vm_openchannel.getOpenchannelQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_openchannel.getSize(vm_openchannel.openchannelQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_openchannel.openchannelQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_openchannel.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_openchannel.query.page" md-total="{{vm_openchannel.openchannelQueuesTotal}}" md-on-paginate="vm_openchannel.getOpenchannelQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_openchannel.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_openchannel.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_openchannel.queryChannels.limit" md-page="vm_openchannel.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_openchannel.paginatedInteractions.length}}" md-on-paginate="vm_openchannel.paginate"\n md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_sms.promise">\n <thead md-head md-order="vm_sms.query.sort" md-on-reorder="vm_sms.getSmsQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_sms.getSize(vm_sms.smsQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_sms.smsQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_sms.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_sms.query.page" md-total="{{vm_sms.smsQueuesTotal}}" md-on-paginate="vm_sms.getSmsQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_sms.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_sms.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_sms.queryChannels.limit" md-page="vm_sms.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_sms.paginatedInteractions.length}}" md-on-paginate="vm_sms.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_voice.promise">\n <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getVoiceQueues">\n <tr md-row>\n <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.getSize(vm_voice.voiceQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, voiceQueue) in vm_voice.voiceQueues">\n <td md-cell class="name">{{voiceQueue.name}}</td>\n <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.voiceQueuesTotal}}" md-on-paginate="vm_voice.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm_voice.rpcVoiceQueuesChannels | limitObjectFromTo: vm_voice.queryChannels.limit:(vm_voice.queryChannels.page - 1) * vm_voice.queryChannels.limit">\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.queryChannels.limit" md-page="vm_voice.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getFaxInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getFaxInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getFaxInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.FaxAccountId" ng-change="vm.getFaxInteractions()">\n <md-option ng-value="faxAccount.id" ng-repeat="faxAccount in vm.faxAccounts.rows">{{faxAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getFaxInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getFaxInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getFaxInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n <md-menu ng-if="vm.faxAccounts.rows && vm.faxAccounts.rows.length">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="faxAccount in vm.faxAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeFaxInteraction($event, faxAccount)">{{ faxAccount.name }} ({{ faxAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxInteractions.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="faxInteraction in vm.faxInteractions.rows" ng-class="{\'text-bold text-italic\': faxInteraction.unread}">\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{faxInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!faxInteraction.closed && faxInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in faxInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!faxInteraction.closed && faxInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'fax\')" layout-margin>{{faxInteraction.unread}}</span>\n <md-icon ng-if="faxInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(faxInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{faxInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <div layout="row" ng-if="faxInteraction.lastMsgAt">\n <span><md-icon md-font-icon="{{faxInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon></span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{faxInteraction.lastMsgAt | formatdate }}</span>\n </div </div>\n <span ng-if="!faxInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <span ng-if="faxInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="faxInteraction.disposition">- {{faxInteraction.disposition}}</span></span>\n <md-tooltip ng-if="faxInteraction.closed">{{faxInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!faxInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="faxInteraction.substatus"> - {{faxInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(faxInteraction)}}</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell class="faxAccount">\n {{ vm.getFaxAccountLabel(faxInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="faxInteraction.Tags.length">\n <div ng-if="faxInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': faxInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{faxInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="faxInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in faxInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showFaxInteraction($event, faxInteraction)" translate="DASHBOARDS.SHOW">\n Show Fax\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.faxInteractions.count}}" md-on-paginate="vm.getFaxInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getMailInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getMailInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getMailInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column" ng-if="vm.query.closed == 0">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_SUBSTATUS">Select a sub status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.substatus" ng-change="vm.getMailInteractions()">\n <md-option ng-repeat="subStatus in vm.subStatuses.rows" ng-value="subStatus.name">{{subStatus.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.MailAccountId" ng-change="vm.getMailInteractions()">\n <md-option ng-value="mailAccount.id" ng-repeat="mailAccount in vm.mailAccounts.rows">{{mailAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getMailInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getMailInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getMailInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n <md-menu ng-if="vm.mailAccounts.rows && vm.mailAccounts.rows.length">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="mailAccount in vm.mailAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeMailInteraction($event, mailAccount)">{{ mailAccount.name }} ({{ mailAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="subject" style="width:200px">{{\'DASHBOARDS.SUBJECT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailInteractions.rows.length">\n <td md-cell colspan="9">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="mailInteraction in vm.mailInteractions.rows" ng-class="{\'text-bold text-italic\': mailInteraction.unread}">\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{mailInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!mailInteraction.closed && mailInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in mailInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!mailInteraction.closed && mailInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'mail\')" layout-margin>{{mailInteraction.unread}}</span>\n <md-icon ng-if="mailInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(mailInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <span class="text-truncate font-size-12" style="width:200px">{{mailInteraction.subject}}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{mailInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <div layout="row" ng-if="mailInteraction.lastMsgAt">\n <span><md-icon md-font-icon="{{mailInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon></span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{mailInteraction.lastMsgAt | formatdate }}</span>\n </div </div>\n <span ng-if="!mailInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <span ng-if="mailInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="mailInteraction.disposition">- {{mailInteraction.disposition}}</span></span>\n <md-tooltip ng-if="mailInteraction.closed">{{mailInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!mailInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="mailInteraction.substatus"> - {{mailInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(mailInteraction)}}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell class="mailAccount">\n {{ vm.getMailAccountLabel(mailInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="mailInteraction.Tags.length">\n <div ng-if="mailInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': mailInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{mailInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="mailInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in mailInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showMailInteraction($event, mailInteraction)" translate="DASHBOARDS.SHOW">\n Show Mail\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.mailInteractions.count}}" md-on-paginate="vm.getMailInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header red-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.MYCONTACTS">My Contacts</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div layout="column">\n <span class="font-size-10" translate="CONTACTMANAGER.SELECT_LIST">Select a list</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.ListId" ng-change="vm.getContacts()">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n <md-option ng-value="vm.defaultLists" ng-if="vm.lists.count > 1"><em translate="CONTACTMANAGER.ALL_CONTACTS">All</em></md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm.refreshContacts($event)" aria-label="refresh Contacts" translate translate-attr-label="DASHBOARDS.REFRESH_CONTACTS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n <md-button class="md-icon-button" ng-click="vm.openContact($event)" aria-label="add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.openContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="firstName">{{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="mobile">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="fax">{{contact.fax}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="email">{{contact.email}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="list">{{vm.listsMap[contact.ListId].name}}</td>\n <td md-cell class="tags">\n <div ng-if="contact.tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.tags">{{tag}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.openContact($event, contact)" translate="DASHBOARDS.EDIT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getOpenchannelInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getOpenchannelInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getOpenchannelInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.OpenchannelAccountId" ng-change="vm.getOpenchannelInteractions()">\n <md-option ng-value="openchannelAccount.id" ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">{{openchannelAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getOpenchannelInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getOpenchannelInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getOpenchannelInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelInteractions.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="openchannelInteraction in vm.openchannelInteractions.rows" ng-class="{\'text-bold text-italic\': openchannelInteraction.unread}">\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{openchannelInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!openchannelInteraction.closed && openchannelInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in openchannelInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!openchannelInteraction.closed && openchannelInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'openchannel\')" layout-margin>{{openchannelInteraction.unread}}</span>\n <md-icon ng-if="openchannelInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(openchannelInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{openchannelInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <div layout="row" ng-if="openchannelInteraction.lastMsgAt">\n <span><md-icon md-font-icon="{{openchannelInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon></span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{openchannelInteraction.lastMsgAt | formatdate }}</span>\n </div </div>\n <span ng-if="!openchannelInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <span ng-if="openchannelInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="openchannelInteraction.disposition">- {{openchannelInteraction.disposition}}</span></span>\n <md-tooltip ng-if="openchannelInteraction.closed">{{openchannelInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!openchannelInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="openchannelInteraction.substatus"> - {{openchannelInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(openchannelInteraction)}}</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell class="openchannelAccount">\n {{ vm.getOpenchannelAccountLabel(openchannelInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="openchannelInteraction.Tags.length">\n <div ng-if="openchannelInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': openchannelInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{openchannelInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="openchannelInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in openchannelInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" translate="DASHBOARDS.SHOW">\n Show Openchannel\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.openchannelInteractions.count}}" md-on-paginate="vm.getOpenchannelInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header indigo-A100-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.RECORDINGS">Recordings</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="VOICE.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'VOICE.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getVoiceRecordings()" placeholder="{{ \'VOICE.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="VOICE.SELECT_TYPE">Select a type</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.type" ng-change="vm.getVoiceRecordings()">\n <md-option value="internal" translate="VOICE.INTERNAL">Internal</md-option>\n <md-option value="inbound">Inbound</md-option>\n <md-option value="outbound">Outbound</md-option>\n <md-option ng-value="null" translate="VOICE.ALL">All</md-option>\n </md-select>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n <tr md-row>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n <th md-column>{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n <td md-cell class="type">{{voiceRecording.type}}</td>\n <td md-cell class="uniqueid">{{voiceRecording.uniqueid}}</td>\n <td md-cell class="calleridnum">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.calleridnum" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="exten">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.exten" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="connectedlinenum">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.connectedlinenum" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="queue">{{voiceRecording.queue}}</td>\n <td md-cell class="rating">\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span></td>\n <td md-cell class="audio" ng-switch="voiceRecording.format">\n \x3c!-- audio recording directive --\x3e\n <ms-recording ng-switch-when=".wav" id="voiceRecording.id"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n <span ng-switch-when=".gsm">\n <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n </span>\n </td>\n <td md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.downloadfile(voiceRecording, $event)" translate="VOICE.DOWNLOAD_VOICERECORDING">\n Download VoiceRecording\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getSmsInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getSmsInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getSmsInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.SmsAccountId" ng-change="vm.getSmsInteractions()">\n <md-option ng-value="smsAccount.id" ng-repeat="smsAccount in vm.smsAccounts.rows">{{smsAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getSmsInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getSmsInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getSmsInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n <md-menu ng-if="vm.smsAccounts.rows && vm.smsAccounts.rows.length">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="smsAccount in vm.smsAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeSmsInteraction($event, smsAccount)">{{ smsAccount.name }} ({{ smsAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsInteractions.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="smsInteraction in vm.smsInteractions.rows" ng-class="{\'text-bold text-italic\': smsInteraction.unread}">\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{smsInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!smsInteraction.closed && smsInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in smsInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!smsInteraction.closed && smsInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'sms\')" layout-margin>{{smsInteraction.unread}}</span>\n <md-icon ng-if="smsInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(smsInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{smsInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <div layout="row" ng-if="smsInteraction.lastMsgAt">\n <span><md-icon md-font-icon="{{smsInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon></span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{smsInteraction.lastMsgAt | formatdate }}</span>\n </div </div>\n <span ng-if="!smsInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <span ng-if="smsInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="smsInteraction.disposition">- {{smsInteraction.disposition}}</span></span>\n <md-tooltip ng-if="smsInteraction.closed">{{smsInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!smsInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="smsInteraction.substatus"> - {{smsInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(smsInteraction)}}</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell class="smsAccount">\n {{ vm.getSmsAccountLabel(smsInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="smsInteraction.Tags.length">\n <div ng-if="smsInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': smsInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{smsInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="smsInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in smsInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showSmsInteraction($event, smsInteraction)" translate="DASHBOARDS.SHOW">\n Show Sms\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.smsInteractions.count}}" md-on-paginate="vm.getSmsInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.CALLS">Calls</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="VOICE.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'VOICE.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getVoiceCalls()" placeholder="{{ \'VOICE.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="VOICE.SELECT_TYPE">Select a type</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.type" ng-change="vm.getVoiceCalls()">\n <md-option value="internal" translate="VOICE.INTERNAL">Internal</md-option>\n <md-option value="inbound">Inbound</md-option>\n <md-option value="outbound">Outbound</md-option>\n <md-option ng-value="null" translate="VOICE.ALL">All</md-option>\n </md-select>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceCalls">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="source">{{ \'VOICE.SOURCE\' | translate }}</th>\n <th md-column md-order-by="destination">{{ \'VOICE.DESTINATION\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'VOICE.STARTEDAT\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'VOICE.ENDEDAT\' | translate }}</th>\n <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n <th md-column>{{ \'VOICE.NOTE\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceCalls.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="voiceCall in vm.voiceCalls.rows" ng-click="vm.showDetails(voiceCall, $event)">\n <td md-cell class="type">{{voiceCall.id}}</td>\n <td md-cell class="type">{{voiceCall.type}}</td>\n <td md-cell class="source">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceCall.source" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="destination">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceCall.destination" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="starttime">{{voiceCall.starttime | date:\'medium\' }}</td>\n <td md-cell class="endtime">{{voiceCall.endtime | date:\'medium\' }}</td>\n <td md-cell class="disposition">{{voiceCall.userDisposition}}</td>\n <td md-cell class="note">\n <md-icon ng-if="voiceCall.note" md-font-icon="icon-clipboard-outline"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showDetails(voiceCall, $event)" translate="VOICE.DETAILS">\n Show Details\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceCalls.count}}" md-on-paginate="vm.getVoiceCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",'<md-dialog class="details-dialog" aria-label="details">\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="!vm.interaction.closed" class="title" translate="VOICE.DETAILS"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-list flex>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.UNIQUEID">Uniqueid</p>\n <h4>{{vm.call.uniqueid}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.TYPE">Type</p>\n <h4>{{vm.call.type ? vm.call.type : \'no type\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.SOURCE">Source</p>\n <h4>{{vm.call.source ? vm.call.source : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DESTINATION">Destination</p>\n <h4>{{vm.call.destination ? vm.call.destination : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.STARTEDAT">Started At</p>\n <h4>{{vm.call.starttime | date:\'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.ANSWEREDAT">Answered At</p>\n <h4>{{vm.call.answertime ? (vm.call.answertime | date:\'medium\') : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.ENDEDAT">Ended At</p>\n <h4>{{vm.call.endtime ? (vm.call.endtime | date:\'medium\') : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DURATION">Duration</p>\n <h4>{{vm.call.duration ? vm.call.duration : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.BILLABLESECONDS">Billable Seconds</p>\n <h4>{{vm.call.billableseconds ? vm.call.billableseconds : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DISPOSITION">Disposition</p>\n <h4>{{vm.call.userDisposition ? vm.call.userDisposition : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.NOTE">Note</p>\n <h4>{{vm.call.note ? vm.call.note : \'--\'}}</h4>\n </div>\n </md-list-item>\n </md-list>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="button" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="DISPOSE" translate="VOICE.CLOSE" translate-attr-aria-label="VOICE.DISPOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",'<md-dialog id="agent-general-dialog" aria-label="Spy Dialog">\n <div id="interaction-app" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'"></div>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html",'\x3c!-- CONTENT CARD --\x3e\n<md-content class="content-card" layout="row" layout-fill>\n\n <div ng-if="!vm.showInteraction" class="start-point" flex layout="column" layout-align="center center" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html\'"></div>\n\n <div ng-if="vm.showInteraction" flex layout="row">\n\n <md-card flex="75" class="interaction">\n\n <md-content class="interaction-agents" layout="row" layout-align="start center" ng-if="!vm.interaction.closed && vm.interaction.Users.length">\n <strong layout-margin translate="DASHBOARDS.CURRENTLY_IN_USE_BY">Currently in use by </strong>\n\n <div ng-repeat="u in vm.interaction.Users">\n <img class="avatar-small" ng-src="api/users/{{u.id}}/avatar">\n <md-tooltip> {{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersMap[u.id] | translate }} </md-tooltip>\n </div>\n </md-content>\n\n \x3c!-- TOOLBAR --\x3e\n <md-toolbar class="interaction-toolbar" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html\'"></md-toolbar>\n \x3c!-- / TOOLBAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content id="interaction-content" name="{{\'interaction-content-\' + vm.tab.id}}" flex ms-scroll layout-wrap>\n <div class="interaction-messages" ng-switch="vm.tab.channel">\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html\'"></div>\n </div>\n <div ng-switch-default>\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html\'"></div>\n </div>\n </div>\n </md-content>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- FOOTER --\x3e\n <div ng-if="!vm.interaction.closed && vm.tab.channel != \'mail\' && vm.tab.channel !== \'fax\' && (vm.tab.channel != \'sms\' || !vm.tab.spy)" class="interaction-footer flex-noshrink" layout="row" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html\'"></div>\n \x3c!-- / FOOTER--\x3e\n </md-card>\n\n <md-card layout="column" flex class="info" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html\'"></md-card>\n </div>\n</md-content>\n\x3c!-- / CONTENT CARD --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/composeFax/dialog.html",'<md-dialog class="compose-dialog-fax" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="FAX.SEND">SEND</span>\n </md-button>\n <md-button ng-disabled="vm.message.attachments.length === 1" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions"\n flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n </md-button>\n </div>\n <span class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="FAX.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <md-input-container class="md-block to">\n <label translate="FAX.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n \x3c!-- <input ng-model="vm.message.subject" type="text"> --\x3e\n <md-autocomplete ng-hide="vm.message.to.length === 1" md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.fax" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" ng-if="composeForm.$dirty">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n <div ng-message="md-max-chips">You reached the maximum amount of chips</div>\n </div>\n </md-input-container>\n\n <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n <div>\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n <span class="filename">{{attachment.name}}</span>\n <span class="size">({{attachment.size | byteFmt: 0}})</span>\n </div>\n\n <md-button class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="FAX.DELETE_ATTACHMENT">\n \x3c!-- <md-icon md-font-icon="icon-close" class="s16"></md-icon> --\x3e\n </md-button>\n </div>\n </div>\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/composeMail/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message" ng-style="{\n \'max-width\': {true: \'620px\', false: \'90%\'}[ vm.secret ],\n \'width\': {true: \'620px\', false: \'100%\'}[ vm.secret ],\n \'max-height\': {true: undefined, false: \'97%\'}[ vm.secret ]\n }">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar ng-class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <div ng-if="!vm.secret" class="md-button md-raised blue-bg no-padding">\n <button class="white-fg margin-horizontal-10" aria-label="Send message" ng-disabled="!vm.verifySmtp" ng-click="vm.send($event, false, null)">\n <span>{{ \'MAIL.SEND\' | translate | uppercase }}</span>\n </button>\n <span class="white-fg secondary-text vertical-divider"></span>\n <md-menu>\n <button ng-disabled="!vm.verifySmtp" class="white-fg margin-left-0" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-menu-down" class="icon s24"></md-icon>\n </button>\n\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.subStatuses.rows.length">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="MAIL.SEND_AS">\n Send as\n </md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n <md-button ng-click="vm.send($event, false, subStatus.name)">\n {{subStatus.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.send($event, true, null)" translate="MAIL.SEND_AND_CLOSE">\n Send and Close\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="MAIL.ADD_NOTE">Add note</span>\n </md-button>\n <md-button ng-disabled="!vm.verifySmtp" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload($files)" flow-init="vm.ngFlowOptions"\n flow-file-success="vm.fileSuccess($file, $message)">\n <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="MAIL.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container ng-if="!vm.secret" class="md-block to" ng-class="{\'hidden-cc\': vm.hiddenCC, \'hidden-bcc\': vm.hiddenBCC}">\n <label translate="MAIL.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n\n <div class="cc-bcc" layout="row" layout-align="start center">\n <div class="show-cc" ng-show="vm.hiddenCC" ng-click="vm.hiddenCC = false">CC</div>\n <div class="show-bcc" ng-show="vm.hiddenBCC" ng-click="vm.hiddenBCC = false">BCC</div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenCC">\n <label translate="MAIL.CC">Cc</label>\n <md-chips name="cc" ng-model="vm.message.cc" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchCc" md-items="contact in vm.contactSearch(vm.searchCc)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n </md-input-container>\n\n <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenBCC">\n <label translate="MAIL.BCC">Bcc</label>\n <md-chips name="bcc" ng-model="vm.message.bcc" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchBcc" md-items="contact in vm.contactSearch(vm.searchBcc)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n </md-input-container>\n\n <md-input-container ng-if="!vm.secret" class="md-block no-margin">\n <label translate="MAIL.SUBJECT">Subject</label>\n <input ng-model="vm.message.subject" type="text">\n </md-input-container>\n\n <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n <div>\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n <span class="filename">{{attachment.name}}</span>\n <span class="size" ng-if="attachment.size">({{attachment.size | byteFmt: 0}})</span>\n </div>\n\n <md-button ng-click="vm.deleteAttachment(attachment)" class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="MAIL.DELETE_ATTACHMENT">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div class="padding-top-5">\n <textarea ckeditor="vm.ckeditor" id="html-area" ng-model="vm.message.body" md-select-on-focus="" ready="vm.onReadyEditor()"></textarea>\n </div>\n\n <md-switch ng-if="!vm.message.showLastMessage && !vm.secret" ng-model="vm.message.showLastMessage" ng-change="vm.loadLastMessage()" aria-label="load last message"><span translate="MAIL.SHOW_ORIGINAL_MESSAGE">Show original message</span></md-switch>\n\n <md-autocomplete ng-if="!vm.secret" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1"\n md-floating-label="{{ \'MAIL.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.MailAccountId" md-font-icon="icon-earth" aria-label="alert email" class="s16"></md-icon>\n <md-icon ng-if="item.MailAccountId" md-font-icon="icon-email" aria-label="alert email" class="s16 teal-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="MAIL.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/composeSms/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="SMS.SEND">SEND</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n <span translate="SMS.ADD_NOTE">Add note</span>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="SMS.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container ng-if="!vm.secret" class="md-block to">\n <label translate="SMS.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- msEmojyArea directive --\x3e\n <ms-emoji-area ng-if="vm.tab.channel != \'fax\'" on-reply="vm.reply(event, body)" set-text="vm.setTextWrapper(dirFn)" get-text="vm.getTextWrapper(dirFn)" picker-position="\'bottom\'" search="false" recent-emojis="false" placeholder="\'SMS.INSERT_MESSAGE_HERE\'"></ms-emoji-area>\n \x3c!-- / msEmojyArea directive --\x3e\n\n <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value"\n md-min-length="1" md-floating-label="{{ \'SMS.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.SmsAccountId" md-font-icon="icon-earth" aria-label="alert sms" class="s16"></md-icon>\n <md-icon ng-if="item.SmsAccountId" md-font-icon="icon-message-text" aria-label="alert sms" class="s16 orange-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="SMS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",'<md-dialog class="disposition-dialog" aria-label="disposition">\n <form name="dispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="!vm.interaction.closed" class="title" translate="DASHBOARDS.DISPOSE"></span>\n <span ng-if="vm.interaction.closed" class="title" translate="DASHBOARDS.INFO"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.DISPOSITIONS">Dispositions</label>\n <md-select name="disposition" ng-model="vm.interaction.disposition" required>\n \x3c!-- <md-select ng-disabled="vm.interaction.closed && vm.interaction.disposition" name="disposition" ng-model="vm.interaction.disposition" required> --\x3e\n <md-option ng-value="null">NONE</md-option>\n <md-option ng-value="disposition.name" ng-repeat="disposition in vm.dispositions.rows">{{ disposition.name }}</md-option>\n </md-select>\n <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.NOTE">Note</label>\n \x3c!-- <textarea ng-disabled="vm.interaction.closed && vm.interaction.disposition" ng-model="vm.interaction.note" md-maxlength="255" max-rows="5" autofocus></textarea> --\x3e\n <textarea ng-model="vm.interaction.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n \x3c!-- <md-dialog-actions ng-if="!vm.interaction.closed || !vm.interaction.disposition" layout="row" layout-align="space-between center"> --\x3e\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveDisposition(true)" class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && vm.interaction.disposition" aria-label="CLOSE_AND_DISPOSE" translate="DASHBOARDS.CLOSE_AND_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_AND_DISPOSE">\n CLOSE AND DISPOSE\n </md-button>\n <md-button type="submit" ng-click="vm.saveDisposition(false)" class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && !vm.interaction.disposition" aria-label="CLOSE_WITHOUT_DISPOSE" translate="DASHBOARDS.CLOSE_WITHOUT_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_WITHOUT_DISPOSE">\n CLOSE WITHOUT DISPOSE\n </md-button>\n <md-button type="submit" ng-click="vm.saveDisposition(false)" class="send-button md-accent md-raised" ng-if="vm.interaction.closed" aria-label="DISPOSE" translate="DASHBOARDS.DISPOSE" translate-attr-aria-label="DASHBOARDS.DISPOSE">\n DISPOSE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",'<md-dialog class="tag-dialog" aria-label="tag">\n <form name="tagForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.TAGS"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <md-chips ng-model="vm.interaction.Tags" md-autocomplete-snap md-require-match="vm.autocompleteRequireMatch">\n <md-autocomplete ng-blur="vm.searchText = \'\'" md-min-length="0" md-selected-item-change="vm.selectedItemChange" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="item in vm.tags.rows | filter:{ name: vm.searchText }" md-item-text="item.name"\n placeholder="Search for a tag">\n <span md-highlight-text="vm.searchText">{{item.name}}</span>\n </md-autocomplete>\n <md-chip-template>\n <span>\n <strong>{{$chip.name}}</strong>\n </span>\n </md-chip-template>\n </md-chips>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveTag(false)" ng-disabled="tagForm.$pristine" class="send-button md-accent md-raised" aria-label="TAG" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html",'\x3c!-- REPLY FORM --\x3e\n<div ng-show="vm.showFooter" layout="column" layout-align "center center" flex>\n <div layout="row" layout-align="center center" flex>\n \x3c!-- msEmojyArea directive --\x3e\n <ms-emoji-area ng-if="vm.tab.channel != \'fax\'" on-reply="vm.reply(event, body)" set-text="vm.setTextWrapper(dirFn)" get-text="vm.getTextWrapper(dirFn)" placeholder="vm.tab.channel.toUpperCase() + \'.INSERT_MESSAGE_HERE\'"></ms-emoji-area>\n \x3c!-- / msEmojyArea directive --\x3e\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm.tab.channel != \'fax\'" style="margin:1px;" class="md-icon-button md-mini" ng-click="vm.changeDisplayCannedAnswerInputValue()" aria-label="Search canned answer" translate translate-attr-aria-label="DASHBOARDS.SEND_MESSAGE">\n <md-icon md-font-icon="icon-auto-fix" class="green-fg"></md-icon>\n </md-button>\n\n <md-button ng-if="vm.tab.channel == \'openchannel\' || vm.tab.channel == \'chat\' || vm.tab.channel == \'fax\'" style="margin:1px;" class="md-icon-button md-warn md-mini" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow"\n flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n <md-icon md-font-icon="icon-paperclip"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-autocomplete ng-hide="!vm.displayCannedAnswerInput" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value"\n md-min-length="1" placeholder="{{ \'DASHBOARDS.CANNED_ANSWER_SEARCH\' | translate}}" class="cannedarea input-show-hide">\n <md-item-template>\n <md-icon ng-if="!item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="icon-earth" aria-label="alert channel" class="s16"></md-icon>\n <md-icon ng-if="item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" aria-label="alert channel" class="s16" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="DASHBOARDS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n</div>\n\x3c!-- / REPLY FORM --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line" ng-if="item.browserName">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.BROWSER_NAME">Browser Name</p>\n <h4>{{item.browserName}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.osName">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.OS_NAME">OS Name</p>\n <h4>{{item.osName}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.deviceModel">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DEVICE_MODEL">Device Model</p>\n <h4>{{item.deviceModel}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.referer">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.REFERER">Referer</p>\n <h4>{{item.referer}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.customerIp">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CUSTOMER_IP">Customer IP</p>\n <h4>{{item.customerIp}}</h4>\n </div>\n </md-list-item>\n <md-divider></md-divider>\n <md-list-item class="md-2-line" ng-if="item.closed && item.ratingValue != null">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.RATING">Rating</p>\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="!item.ratingType || item.ratingType == \'star\'" ng-repeat="ratingValue in [1,2,3,4,5] | limitTo:item.ratingValue"></md-icon>\n <md-icon md-font-icon="icon-thumb-up" style="color:green" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 1"></md-icon>\n <md-icon md-font-icon="icon-thumb-down" style="color:red" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 0"></md-icon>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.ratingMessage">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.FEEDBACK">Feedback</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{item.ratingMessage}}</h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html",'<md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.CONTACT">Contact</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-account"></md-icon>\n <label translate="DASHBOARDS.NAME">Name</label>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" disabled>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-email"></md-icon>\n <label translate="DASHBOARDS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.contact.email" disabled>\n </md-input-container>\n\n <md-input-container ng-if="vm.tab.channel != \'fax\'" class="md-block">\n <md-icon md-font-icon="icon-phone"></md-icon>\n <label translate="DASHBOARDS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.contact.phone" disabled>\n </md-input-container>\n\n <md-input-container ng-if="vm.tab.channel == \'fax\'" class="md-block">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <label translate="DASHBOARDS.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.contact.fax" disabled>\n </md-input-container>\n\n <div ng-if="!vm.tab.spy" layout="row" layout-align="center center">\n <md-button class="md-raised md-accent" ng-click="vm.openContact(ev)" translate="DASHBOARDS.MORE">\n More\n </md-button>\n </div>\n </form>\n </md-content>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.INTERACTION">Interaction</span>\n </md-tab-label>\n <md-tab-body>\n <div layout="column" layout-align="space-between center" class="md-padding">\n <md-icon class="s42" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <span ng-if="vm.interaction.closed" class="md-background-bg red-fg font-size-14">#{{vm.interaction.id}} - <span translate="DASHBOARDS.CLOSED"></span></span>\n <span ng-if="!vm.interaction.closed" class="md-background-bg green-fg font-size-14">#{{vm.interaction.id}} - <span translate="DASHBOARDS.OPENED"></span></span>\n <span ng-if="!vm.interaction.closed && vm.interaction.substatus" class="md-background-bg green-fg font-size-14">{{ \'DASHBOARDS.\' + vm.interaction.substatus.toUpperCase() | translate }}</span>\n </div>\n <md-divider></md-divider>\n <md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.WEBSITE" ng-if="vm.tab.channel == \'chat\'">Website</p>\n <p translate="DASHBOARDS.ACCOUNT" ng-if="vm.tab.channel != \'chat\'">Account</p>\n <h4>{{vm.account.name}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.AGENT">Agent</p>\n <h4>{{vm.agent.fullname || vm.usersMap[vm.interaction.UserId]}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.externalUrl">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n <a href="{{vm.interaction.externalUrl}}" target="_blank">\n <h4>{{vm.interaction.externalUrl}}</h4>\n </a>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n <h4>{{vm.interaction.createdAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <div ng-switch="vm.tab.channel">\n <div ng-switch-when="chat">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'"></div>\n </div>\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'"></div>\n </div>\n </div>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.Tags.length">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.TAGS">Tags</p>\n <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </div>\n </md-list-item>\n\n <md-divider ng-if="vm.interaction.closed"></md-divider>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n <h4>{{vm.interaction.closedAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.disposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n <h4>{{ vm.interaction.disposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-3-line md-long-text" ng-if="vm.interaction.closed && vm.interaction.note">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">NOTE</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{ vm.interaction.note }}</h4>\n </div>\n </md-list-item>\n </md-list>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span>Journey (beta)</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'"></div>\n </md-content>\n </md-tab-body>\n </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html",'<md-divider></md-divider>\n\n<md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.AGENT">Agent</p>\n <h4>{{vm.agent.fullname || vm.usersMap[item.UserId] || \'DASHBOARDS.NOT_ASSIGNED\' | translate}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line" ng-if="item.externalUrl">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n <a href="{{item.externalUrl}}" target="_blank">\n <h4>{{item.externalUrl}}</h4>\n </a>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n <h4>{{item.createdAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <div ng-if="item.ChatWebsiteId">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'"></div>\n </div>\n <div ng-if="item.MailAccountId">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'"></div>\n </div>\n\n <md-divider ng-if="item.closed"></md-divider>\n <md-list-item class="md-2-line" ng-if="item.closed">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n <h4>{{item.closedAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.closed && item.disposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n <h4>{{ item.disposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-3-line md-long-text" ng-if="item.closed && item.note">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">NOTE</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{ item.note }}</h4>\n </div>\n </md-list-item>\n\n <p class="padding-horizontal-15 grey-fg">Tags</p>\n <md-list-item ng-if="item.Tags.length">\n <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in item.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html",'<div id="timeline" ms-timeline="vm.timelineOptions" layout="column" ng-if="vm.journey && vm.journey.length">\n \x3c!-- TIMELINE ITEM --\x3e\n <div class="ms-timeline-item" layout-align="center center" ng-repeat="item in vm.journey | orderBy:\'-createdAt\'">\n <div class="timeline-card">\n <md-card class="channel" ng-class="{\'md-grey-200-bg\': item.id == vm.interaction.id}">\n <div class="header p-6" layout="row" layout-align="space-between center">\n\n <md-button class="md-fab md-mini" aria-label="icon-channel" ng-class="vm.getColorByItem(item) + \'-bg\'">\n <md-icon ng-if="item.FaxAccountId" md-font-icon="icon-deskphone"></md-icon>\n <md-icon ng-if="item.OpenchannelAccountId" md-font-icon="icon-google-earth"></md-icon>\n <md-icon ng-if="item.SmsAccountId" md-font-icon="icon-message-text"></md-icon>\n <md-icon ng-if="item.MailAccountId" md-font-icon="icon-email"></md-icon>\n <md-icon ng-if="item.ChatWebsiteId" md-font-icon="icon-hangouts"></md-icon>\n <md-icon ng-if="item.amaflags" md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <div class="info" layout="column" ng-init="item.showMore = false">\n <span class="font-size-12 text-truncate">#{{item.id}} - {{ item.Account.key || item.destination }}</span>\n <span class="font-size-10">{{item.createdAt | date: \'medium\'}}</span>\n <span>\n <a class="toggle-details md-accent-color" ng-hide="item.showMore" ng-click="item.showMore = !item.showMore" translate="DASHBOARDS.SHOW_DETAILS">\n Show Details\n </a>\n <a class="toggle-details md-accent-color" ng-show="item.showMore" ng-click="item.showMore = !item.showMore" translate="DASHBOARDS.HIDE_DETAILS">\n Hide Details\n </a>\n </span>\n </div>\n\n <span>\n <img ng-if="item.UserId" class="avatar" ng-src="api/users/{{item.UserId}}/avatar">\n <md-tooltip md-direction="left">{{item.Owner.fullname || item.User.fullname}}</md-tooltip>\n </span>\n\n </div>\n\n <div ng-if="item.showMore">\n <div ng-if="!item.amaflags" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html\'"></div>\n <div ng-if="item.amaflags" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html\'"></div>\n </div>\n\n <md-divider></md-divider>\n\n <div ng-if="item.id != vm.interaction.id" layout="row" layout-align="space-around center">\n <div ng-if="item.closed && !amaflags" class="text-truncate white-fg">\n <span class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.CLOSED\' | translate}} {{ item.disposition }}">{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.CLOSED\' | translate}} {{ item.disposition }}</span>\n </div>\n <span class="text-boxed md-background-bg green-fg" ng-if="!item.closed && !item.amaflags" title="{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.OPENED\' | translate}}">{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.OPENED\' | translate}}<span ng-if="item.substatus"> - {{ \'DASHBOARDS.\' + item.substatus.toUpperCase() | translate }}</span></span>\n <span ng-if="item.amaflags" class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.DISPOSITION\' | translate}}: {{ item.userDisposition || \'No Dispose\'}}">{{ \'DASHBOARDS.DISPOSITION\' | translate}}: {{ item.userDisposition || \'No Dispose\'}}</span>\n <div flex></div>\n <md-button ng-if="!vm.tab.spy && vm.user.role === \'agent\'" ng-disabled="item.amaflags" class="md-icon-button" aria-label="go" ng-click="vm.openInteraction($event, item)">\n <md-icon md-font-icon="icon-open-in-new" class="s20"></md-icon>\n </md-button>\n\n </div>\n </md-card>\n </div>\n </div>\n \x3c!-- / TIMELINE ITEM --\x3e\n</div>\n<div ng-if="!vm.journey || !vm.journey.length" layout="row" layout-align="center center">\n <em translate="DASHBOARDS.NO_DATA_AVAILABLE">No data available</em>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html",'<md-divider></md-divider>\n\n<md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.TYPE">Type</p>\n <h4>{{item.type ? item.type : \'no type\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SOURCE">Source</p>\n <h4>{{item.source ? item.source : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DESTINATION">Destination</p>\n <h4>{{item.destination ? item.destination : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CALLERID">Caller Id</p>\n <h4>{{item.callerid ? item.callerid : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.STARTEDAT">Started At</p>\n <h4>{{item.starttime | date:\'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.END_AT">End At</p>\n <h4>{{item.endtime | date:\'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DURATION">Duration</p>\n <h4>{{item.duration ? item.duration : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">Note</p>\n <h4>{{item.note ? item.note : \'--\'}}</h4>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line" ng-if="item.subject">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SUBJECT">Subject</p>\n <h4>{{item.subject}}</h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html",'\x3c!-- MESSAGES --\x3e\n<div layout="row" ng-repeat="message in vm.messages.rows" class="md-padding message-row" ng-class="message.secret && vm.user.id != message.UserId ? \'in\' : message.direction">\n <img ng-if="message.direction ===\'in\'" src="assets/images/avatars/customer.png" class="avatar" />\n <img ng-if="message.direction ===\'out\' && message.UserId && !message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n <img ng-if="message.direction ===\'out\' && message.UserId && message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n\n <div class="bubble" ng-class="{\'md-yellow-200-bg\': message.secret}" ng-switch="message.direction">\n <div ng-if="message.secret">\n <div class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n {{ vm.getLabelByMessage(message) }} - {{message.createdAt | date: \'medium\'}}\n </div>\n <div ng-if="message.id">\n <md-icon class="s18" md-font-icon="icon-lock"></md-icon>\n </div>\n </div>\n </div>\n <div ng-if="!message.secret">\n <div ng-switch-when="in" class="time secondary-text" ng-click="message.Contact && vm.openContact(ev, message.Contact)">{{ vm.getLabelByMessage(message) }} - {{message.createdAt | date: \'medium\'}}</div>\n <div ng-switch-when="out" class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n {{ vm.getLabelByMessage(message) }} - {{message.createdAt | date: \'medium\'}}\n </div>\n <div ng-if="message.id && vm.tab.channel !== \'fax\'">\n <md-icon ng-if="!message.read" class="s18" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n </div>\n <div ng-if="message.id && vm.tab.channel === \'fax\'">\n <md-icon ng-if="!message.read && !(message.failMessage )" class="s18" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n <span ng-if="!message.read && message.failMessage" class="s18 red-900-fg"> {{ message.failMessage }}</span>\n <md-icon ng-if="!message.read && message.failMessage" class="s18 red-900-fg" md-font-icon="icon-close md-accent"></md-icon>\n </div>\n </div>\n </div>\n <div ng-if="message.AttachmentId" layout="row" layout-align="end center">\n <md-button class="md-raised md-accent" ng-click="vm.getAttachment({id: message.AttachmentId, name: vm.htmlToPlaintext(message.body)})">\n <span>{{vm.htmlToPlaintext(message.body)}}</span>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n </div>\n <div ng-if="!message.AttachmentId" ng-bind-html="message.body | embed:vm.emojiOptions" class="message" layout="row" layout-align="end center"></div>\n </div>\n</div>\n\x3c!-- / MESSAGES --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html",'<div ms-timeline="vm.timelineOptions" ms-timeline-load-more="vm.loadNextPage()">\n <div ng-repeat="message in vm.messages.rows track by message.id" ng-init="vm.selectedMailShowSystemMessage[message.id] = false">\n <md-card ng-if="message.secret" class="md-padding md-yellow-100-bg" layout="column">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n <div layout="column">\n <span class="grey-fg">{{vm.agent.fullname || vm.usersMap[message.UserId]}}</span>\n <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n <div layout="row" layout-align="center center" layout-fill ng-if="message.attach">\n <div flex>\n <md-divider></md-divider>\n </div>\n <md-menu>\n <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span></md-tooltip>\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon><span>{{message.attach}}</span>\n </div>\n </md-button>\n <md-menu-content width="4">\n <div layout="column" layout-align="center center" ng-if="!message.attachments">\n <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n <span translate="MAIL.ATTACHMENTS">Attachments</span>\n </div>\n <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n <md-button ng-click="vm.getAttachment(attachment)">{{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n <div flex>\n <md-divider></md-divider>\n </div>\n </div>\n <div class="padding-top-5" ng-bind-html-unsafe="message.body"></div>\n </md-card>\n <div ng-if="!message.secret">\n <div layout="row" layout-align="center center" ng-if="message.direction == \'out\' && !message.UserId && !vm.selectedMailShowSystemMessage[message.id]">\n <md-button class="md-raised blue-grey-300-bg white-fg" ng-click="vm.selectedMailShowSystemMessage[message.id] = !vm.selectedMailShowSystemMessage[message.id]">[{{message.createdAt | date: \'medium\'}}] {{ \'MAIL.SHOW_AUTOREPLY\' | translate }}</md-button>\n </div>\n <md-card layout="column" class="md-padding message-row" ng-if="message.direction == \'in\' || (message.direction == \'out\' && (message.UserId || vm.selectedMailShowSystemMessage[message.id]))">\n <md-content class="mail-content">\n <div class="info" layout="row" layout-align="space-between start">\n\n <div layout="column" layout-align="start start">\n <div layout="row" layout-align="start start">\n \x3c!-- <div>\n <img ng-if="message.direction ===\'in\'" ng-src="assets/images/avatars/customer.png" class="avatar" alt="customer" />\n\n <img ng-if="message.direction ===\'out\' && message.UserId" class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n </div> --\x3e\n\n <div layout="column" layout-align="start start">\n <div class="name" ng-click="message.Contact && vm.openContact(ev, message.Contact)"><strong>{{message.from}}</strong>\n <md-icon ng-if="message.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <div class="name">\n <div>{{message.subject}}</div>\n </div>\n <div class="name" layout="row" layout-align="start center"><span translate="MAIL.TO">To</span>: <span class="padding-left-5 subject text-truncate">{{message.to}}</span></div>\n </div>\n </div>\n\n <a class="toggle-details md-accent-color" ng-hide="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.SHOW_DETAILS">\n Show Details\n </a>\n <a class="toggle-details md-accent-color" ng-show="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.HIDE_DETAILS">\n Hide Details\n </a>\n\n <div ng-show="vm.selectedMailShowDetails[message.id]" class="details" layout="row" layout-align="start start">\n <div layout="column">\n <span class="title" translate="MAIL.DATE">Date:</span>\n <span class="title" translate="MAIL.FROM">From:</span>\n <span class="title" translate="MAIL.TO">To:</span>\n <span class="title" translate="MAIL.CC" ng-if="message.cc">Cc:</span>\n <span class="title" translate="MAIL.ACCEPTED" ng-if="message.UserId && message.direction ===\'in\'">Accepted:</span>\n </div>\n\n <div layout="column">\n <span class="detail">{{message.createdAt | date:\'medium\'}}</span>\n <span class="detail">{{message.from}}</span>\n <span class="detail">{{message.to}}</span>\n <span class="detail" ng-if="message.cc">{{message.cc}}</span>\n <span class="detail" ng-if="message.UserId && message.direction ===\'in\'">{{vm.usersMap[message.UserId]}}</span>\n </div>\n </div>\n </div>\n\n <div layout="row" layout-align="center center">\n <div layout="column" layout-align="center end" class="md-padding">\n <span class="grey-fg" ng-if="message.direction ===\'in\'">{{message.from.indexOf(vm.contact.email) >= 0 ? vm.contact.firstName + \' \' + vm.contact.lastName : \'*\' + message.from}}</span>\n\n <span class="grey-fg" ng-if="message.direction ===\'out\' && message.UserId">{{vm.agent.fullname || vm.usersMap[message.UserId]}}</span>\n <span class="grey-fg" ng-if="message.direction ===\'out\' && !message.UserId">System</span>\n\n <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n </div>\n <img ng-if="message.direction ===\'in\'" ng-src="assets/images/avatars/customer.png" class="avatar" alt="customer" />\n\n <img ng-if="message.direction ===\'out\' && message.UserId" class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n\n\n \x3c!-- <md-menu>\n <md-button aria-label="More" class="md-icon-button"\n ng-click="$mdOpenMenu($event)"\n translate translate-aria-label="MAIL.MORE">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button aria-label="Print" translate-aria-label="MAIL.PRINT">\n <md-icon md-font-icon="icon-printer"></md-icon>\n <span translate="MAIL.PRINT">Print</span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu> --\x3e\n </div>\n\n\n </div>\n\n <div layout="row" layout-align="center center" layout-fill>\n <div flex>\n <md-divider></md-divider>\n </div>\n <div>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span></md-tooltip>\n <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span></md-tooltip>\n <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n </md-button>\n <md-menu ng-if="message.attach">\n <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span></md-tooltip>\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon><span>{{message.attach}}</span>\n </div>\n </md-button>\n <md-menu-content width="4">\n <div layout="column" layout-align="center center" ng-if="!message.attachments">\n <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n <span translate="MAIL.ATTACHMENTS">Attachments</span>\n </div>\n <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n <md-button ng-click="vm.getAttachment(attachment)">{{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div flex>\n <md-divider></md-divider>\n </div>\n </div>\n\n <md-content ng-bind-html-unsafe="message.body"></md-content>\n </md-content>\n </md-card>\n </div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html",'<div class="big-circle md-whiteframe-4dp">\n <md-icon class="s128 md-accent" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n</div>\n<span class="app-title" translate="DASHBOARDS.WAITING">Waiting</span>\n<span class="hide show-gt-md secondary-text" translate="DASHBOARDS.LOADING_INTERACTION">We are loading the interaction...</span>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html",'<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeFaxInteraction(\'new\')">\n <md-tooltip md-direction="bottom"><span translate="FAX.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html",'<div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" class="s20" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <div class="padding-left-10" layout="column" layout-align="center start" flex>\n <div class="font-size-14" layout="row" layout-align="start center" layout-fill>\n <span>#{{vm.interaction.id}} - {{vm.account.key}}</span>\n <div layout="row" layout-align="center center">\n <md-icon ng-if="vm.interaction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="red-fg padding-left-25" ng-if="vm.interaction.closed" translate="DASHBOARDS.CLOSED">CLOSED</span>\n <span class="green-fg padding-left-25" ng-if="!vm.interaction.closed"><span translate="DASHBOARDS.OPENED">OPENED</span><span ng-if="vm.interaction.substatus"> - {{vm.interaction.substatus}}</span></span>\n <div layout="row" layout-align="center center" class="blue-grey-300-fg padding-left-40" ng-if="!vm.interaction.closed">\n <timer start-time="vm.interaction.createdAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <md-icon md-font-icon="icon-timelapse" class="s16 padding-left-5"></md-icon>\n </div>\n </div>\n <div class="tags" layout="row" layout-align="start center" ng-if="vm.interaction.Tags.length" ng-class="{\'padding-top-5\': vm.interaction.Tags.length}">\n <div class="tag margin-right-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </div>\n <div layout="row" layout-align="end center">\n <div ng-switch="vm.tab.channel">\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html\'"></div>\n </div>\n <div ng-switch-when="fax">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html\'"></div>\n </div>\n <div ng-switch-when="sms">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html\'"></div>\n </div>\n </div>\n <md-menu class="no-margin" ng-if="!vm.interaction.disposition" md-position-mode="target-right target">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.tagInteraction()" translate="DASHBOARDS.TAG">\n Tag\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && (vm.subStatuses.rows.length || vm.interaction.substatus != null)">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.SET_AS">\n Set as\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.interaction.substatus != null">\n <md-button ng-click="vm.setAs(null)" translate="DASHBOARDS.NONE">\n None\n </md-button>\n </md-menu-item>\n <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n <md-button ng-click="vm.setAs(subStatus.name)">\n {{subStatus.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && vm.account.markAsUnread">\n <md-button ng-click="vm.markAsUnread()" translate="DASHBOARDS.MARK_AS_UNREAD">\n Unread\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.tab.spy && !vm.interaction.closed">\n <md-button ng-click="vm.disposeInteraction()" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.tab.spy && vm.interaction.closed && !vm.interaction.disposition">\n <md-button ng-click="vm.disposeInteraction(ev)" translate="DASHBOARDS.DISPOSE">\n Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html",'<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span></md-tooltip>\n <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span></md-tooltip>\n <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeMailInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeSmsInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="SMS.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html",'<md-content class="md-padding" layout="column" layout-align="center center">\n <div layout="row" layout-align="center center">\n <span ng-if="!vm.tab.saved" class="text-boxed md-green-bg"><timer start-time="vm.starttime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span>\n <span ng-if="vm.contact" class="text-boxed md-gray-bg font-weight-900">{{vm.contact.firstName}} {{vm.contact.lastName}} {{vm.contact.phone}}</span>\n <md-button ng-if="vm.showResetButton" ng-click="vm.resetViewer()" md-no-ink class="md-raised md-accent orange-bg">\n <md-icon md-font-icon="icon-rotate-left" class="icon s16"></md-icon> {{\'JSCRIPTY.RESET_SESSION\' | translate}}</md-button>\n <md-button ng-if="vm.contact" ng-click="vm.openContact($event, vm.contact)" md-no-ink class="md-raised md-accent" translate="JSCRIPTY.OPEN_CONTACT"></md-button>\n <md-button ng-if="vm.showIncompleteSubmitButton" ng-click="vm.onSubmit($event, true)" md-no-ink class="md-raised md-accent green-bg" translate="JSCRIPTY.SUBMIT"></md-button>\n </div>\n <h1 ng-if="!vm.project.formData"><span translate="JSCRIPTY.PROJECT_NOT_AVAILABLE">Project is not available. Please contact the administrator</span></h1>\n <mw-form-viewer ng-if="vm.project.formData" form-data="vm.project.formData" response-data="vm.project.responseData" on-submit="vm.onSubmit($event)" template-data="call" api="vm.formViewer"></mw-form-viewer>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/notification/dialog.html",'\x3c!-- <md-toast> --\x3e\n<div class="md-padding" layout="column" layout-align="center center">\n <span class="md-title">#{{vm.notification.id}} {{vm.notification.title}}</span>\n <span class="md-subhead" ng-if="vm.notification.queue">{{vm.notification.queue}}</span>\n <div class="padding-top-5" layout="row">\n <md-button class="md-raised md-accent" ng-click="vm.accept($event)" translate="DASHBOARDS.ACCEPT">\n ACCEPT\n </md-button>\n <md-button class="md-raised md-warn" ng-click="vm.reject($event)" translate="DASHBOARDS.REJECT">\n REJECT\n </md-button>\n </div>\n</div>\n\x3c!-- </md-toast> --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html",'<md-content class="md-padding" flex>\n <div ng-if="vm.html" ng-bind-html="vm.html"></div>\n <h1 ng-if="!vm.html">Template is empty. Please contact the administrator</h1>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_MOTION_BULL_STATS">Today Motion Bull STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timelapse"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{(vm.inbound.talking || 0) + (vm.inbound.pTalking || 0)}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TALKING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.TALKING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TALKING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.INBOUND_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.INBOUND_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.INBOUND_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-missed"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.outboundDropCallsDayCallersExit || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDONED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.outboundDropCallsDayTimeout || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROPPED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.DROPPED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.DROPPED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.originated || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.ORIGINATED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ORIGINATED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_TALK_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_TALK_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundanswerRate || 0 |number : 1}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.INBOUND_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.INBOUND_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.INBOUND_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundAbandonRate || 0}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDON_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundDropRate }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROP_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.DROP_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.DROP_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e\n\n\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_IVR_CAMPAIGNS_STATS">Today IVR campaigns stats</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.ivr.originated || 0}}/{{vm.ivr.limitCalls || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}/{{\'DASHBOARDS.LIMITED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.LIMITED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ORIGINATEDLIMITED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET IVR --\x3e'),e.put("app/main/apps/dashboards/views/general/user/user.general.html",'<div id="dashboard-general" class="page-layout simple right-sidenav" layout="row">\n \x3c!-- CENTER --\x3e\n <div class="center" flex ms-scroll>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n \x3c!-- NOTE: aggoiungere nel controller ng-if="vm.hasPermission()" --\x3e\n <md-tabs md-selected="vm.currentTab" ng-if="vm.hasPermission()" md-dynamic-height>\n <md-tab label="{{\'DASHBOARDS.VOICE\' | translate}}" ui-sref="app.dashboards.general.voice">\n <div ui-view="voice"></div>\n </md-tab>\n <md-tab ng-if="vm.license.dialer" label="{{\'DASHBOARDS.MOTIONDIALER\' | translate}}" ui-sref="app.dashboards.general.dialer">\n <div ui-view="dialer"></div>\n </md-tab>\n </md-tabs>\n </div>\n \x3c!-- END CONTENT --\x3e\n\n <md-content ng-if="!vm.hasPermission()" layout="row" layout-align="space-around center" flex layout-padding layout-wrap>\n <div layout="column" layout-align="space-around center" flex="50">\n <span class="font-size-40 text-center">{{ \'DASHBOARDS.WELCOME_TO_MOTION\' | translate }}!</span>\n <span class="font-size-30 text-center" translate="DASHBOARDS.WELCOME_MESSAGE">Use the left sidebar to navigate through available sections.</span>\n </div>\n\n <div layout="column" flex="50">\n <img src="assets/images/avatars/permissions.png" alt="permissions">\n </div>\n </md-content>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-incoming" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INBOUND_STATS">Today Inbound STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timelapse"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TALKING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.TALKING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TALKING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.INBOUND_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.INBOUND_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.INBOUND_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-missed"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.abandoned || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDONED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-incoming"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timer-sand"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_TALK_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_TALK_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.INBOUND_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.INBOUND_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.INBOUND_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDON_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e\n\n\x3c!-- WIDGET OUTBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_OUTBOUND_STATS">Today Outbound STATS</div>\n </div>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.outbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.outbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OUTBOUND_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-clock"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{vm.outbound.sumDuration || 0 | secToTime | date:\'HH:mm:ss\'}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOT_DURATION\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.TOT_DURATION_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOT_DURATION\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-division"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{vm.outbound.total ? ((vm.outbound.sumDuration / vm.outbound.total) | number: 0) : 0 | secToTime | date:\'HH:mm:ss\'}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_DURATION\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_DURATION_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_DURATION\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-42 line-height-72">\n {{vm.outbound.total ? (vm.outbound.answered / vm.outbound.total * 100) : 0 | number: 1}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OUTBOUND_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e'),e.put("app/main/apps/fax/views/faxAccounts/create/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus>\n <div ng-messages="faxAccountForm[\'name\'].$error" ng-show="faxAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.KEY">key</label>\n <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="faxAccountForm[\'key\'].$error" ng-show="faxAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUNK">trunk</label>\n <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountForm[\'TrunkId\'].$error" ng-show="faxAccountForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LOCALSTATIONID">localstationid</label>\n <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true">\n <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n <div ng-messages="faxAccountForm[\'localstationid\'].$error" ng-show="faxAccountForm[\'localstationid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LIST">List</label>\n <md-select name="ListId" ng-model="vm.faxAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountForm[\'ListId\'].$error" ng-show="faxAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxAccount.description">\n <div ng-messages="faxAccountForm[\'description\'].$error" ng-show="faxAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newFaxAccount" ng-click="vm.saveFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid || faxAccountForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newFaxAccount" ng-click="vm.addNewFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXACCOUNT" translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n ADD FAXACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newFaxAccount" ng-click="vm.deleteFaxAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/agent/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" required autofocus>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'agent\'].$error" ng-show="faxAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/close/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus>\n <div ng-messages="faxAccountFormApp[\'disposition\'].$error" ng-show="faxAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus>\n <div ng-messages="faxAccountFormApp[\'condition\'].$error" ng-show="faxAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true">\n <div ng-messages="faxAccountFormApp[\'truepriority\'].$error" ng-show="faxAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true">\n <div ng-messages="faxAccountFormApp[\'falsepriority\'].$error" ng-show="faxAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus>\n <div ng-messages="faxAccountFormApp[\'priority\'].$error" ng-show="faxAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/noop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus>\n <div ng-messages="faxAccountFormApp[\'value\'].$error" ng-show="faxAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/queue/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" required autofocus>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'queue\'].$error" ng-show="faxAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/system/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus>\n <div ng-messages="faxAccountFormApp[\'command\'].$error" ng-show="faxAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable">\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables">{{ variable.name }}</md-option>\n <md-option ng-value="\'\'">None</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'variable\'].$error" ng-show="faxAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/faxDispositions/dialog.html",'<md-dialog class="faxDisposition-dialog" aria-label="New FaxDisposition">\n <form name="faxDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="" name="name" ng-model="vm.faxDisposition.name" ng-required="true" autofocus>\n <div ng-messages="faxDispositionForm[\'name\'].$error" ng-show="faxDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newFaxDisposition" ng-click="vm.saveFaxDisposition()" class="send-button md-accent md-raised" ng-disabled="faxDispositionForm.$invalid || faxDispositionForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newFaxDisposition" ng-click="vm.addNewFaxDisposition()" class="send-button md-accent md-raised" ng-disabled="faxDispositionForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXDISPOSITION" translate-attr-aria-label="FAX.ADD_FAXDISPOSITION">\n ADD FAXDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newFaxDisposition" ng-click="vm.deleteFaxDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/view.html",'<div id="fax-faxAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-faxAccounts-button md-icon-button" aria-label="Go to faxAccounts" ng-click="vm.gotoFaxAccounts()" translate translate-attr-aria-label="FAX.GO_TO_FAXACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="faxAccount-image" hide-xs>\n <img ng-src="assets/images/business/faxAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.faxAccount.id}}\n <span ng-if="vm.faxAccount.name">{{vm.faxAccount.name}}</span>\n <span ng-if="vm.faxAccount.exten">{{vm.faxAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.faxAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="FAX.GOTO_FAXACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFaxAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (advancedForm.$invalid) || (faxDispositionsForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)"\n translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="faxAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.KEY">key</label>\n <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.HEADERINFO">headerinfo</label>\n <input type="text" name="headerinfo" ng-model="vm.faxAccount.headerinfo" ng-required="true">\n <div class="hint"><span translate="FAX.HELP.HEADERINFO"></span></div>\n <div ng-messages="generalForm[\'headerinfo\'].$error" ng-show="generalForm[\'headerinfo\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.HEADERINFO_REQUIRED">headerinfo field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUNK">trunk</label>\n <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LOCALSTATIONID">localstationid</label>\n <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true">\n <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n <div ng-messages="generalForm[\'localstationid\'].$error" ng-show="generalForm[\'localstationid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LIST">List</label>\n <md-select name="ListId" ng-model="vm.faxAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.faxAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="faxAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.notificationSound" aria-label="notificationSound"><span translate="FAX.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.notificationShake" aria-label="notificationShake"><span translate="FAX.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="FAX.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.faxAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="faxAccount-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.ECM">ECM</label>\n <md-select name="ecm" ng-model="vm.faxAccount.ecm" required autofocus>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.ECM"></span></div>\n <div ng-messages="advancedForm[\'ecm\'].$error" ng-show="advancedForm[\'ecm\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.ECM_REQUIRED">ECM field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MINRATE">minrate</label>\n <md-select name="minrate" ng-model="vm.faxAccount.minrate" required>\n <md-option ng-value="\'2400\'">2400</md-option>\n <md-option ng-value="\'4800\'">4800</md-option>\n <md-option ng-value="\'7200\'">7200</md-option>\n <md-option ng-value="\'9600\'">9600</md-option>\n <md-option ng-value="\'12000\'">12000</md-option>\n <md-option ng-value="\'14400\'">14400</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MINRATE"></span></div>\n <div ng-messages="advancedForm[\'minrate\'].$error" ng-show="advancedForm[\'minrate\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MINRATE_REQUIRED">minrate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MAXRATE">maxrate</label>\n <md-select name="maxrate" ng-model="vm.faxAccount.maxrate" required>\n <md-option ng-value="\'2400\'">2400</md-option>\n <md-option ng-value="\'4800\'">4800</md-option>\n <md-option ng-value="\'7200\'">7200</md-option>\n <md-option ng-value="\'9600\'">9600</md-option>\n <md-option ng-value="\'12000\'">12000</md-option>\n <md-option ng-value="\'14400\'">14400</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MAXRATE"></span></div>\n <div ng-messages="advancedForm[\'maxrate\'].$error" ng-show="advancedForm[\'maxrate\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MAXRATE_REQUIRED">maxrate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MODEM">modem</label>\n <input type="text" name="modem" ng-model="vm.faxAccount.modem" ng-required="true">\n <div class="hint"><span translate="FAX.HELP.MODEM"></span></div>\n <div ng-messages="advancedForm[\'modem\'].$error" ng-show="advancedForm[\'modem\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MODEM_REQUIRED">modem field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.GATEWAY">gateway</label>\n <input type="text" name="gateway" ng-model="vm.faxAccount.gateway" ng-required="true">\n <div class="hint"><span translate="FAX.HELP.GATEWAY"></span></div>\n <div ng-messages="advancedForm[\'gateway\'].$error" ng-show="advancedForm[\'gateway\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.GATEWAY_REQUIRED">gateway field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.FAXDETECT">faxdetect</label>\n <input type="text" name="faxdetect" ng-model="vm.faxAccount.faxdetect" ng-required="true">\n <div class="hint"><span translate="FAX.HELP.FAXDETECT"></span></div>\n <div ng-messages="advancedForm[\'faxdetect\'].$error" ng-show="advancedForm[\'faxdetect\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.FAXDETECT_REQUIRED">faxdetect field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.T38TIMEOUT">t38timeout</label>\n <input type="number" name="t38timeout" ng-model="vm.faxAccount.t38timeout" ng-required="true">\n <div class="hint"><span translate="FAX.HELP.T38TIMEOUT"></span></div>\n <div ng-messages="advancedForm[\'t38timeout\'].$error" ng-show="advancedForm[\'t38timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.T38TIMEOUT_REQUIRED">t38timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.SIP">SIP</label>\n <md-select name="tech" ng-model="vm.faxAccount.tech" required>\n <md-option ng-value="\'SIP\'">SIP</md-option>\n <md-option ng-value="\'IAX\'">IAX</md-option>\n <md-option ng-value="\'DADHI\'">DADHI</md-option>\n <md-option ng-value="\'KHOMP\'">KHOMP</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'tech\'].$error" ng-show="advancedForm[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.SIP_REQUIRED">SIP field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="faxAccount-detail-form-container faxdispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountFaxDispositionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountFaxDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.FAXDISPOSITIONS">FaxDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event)" aria-label="add faxDisposition" translate translate-attr-label="FAX.ADD_FAXDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedFaxAccountFaxDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedFaxAccountFaxDispositions.length}} {{vm_dc.selectedFaxAccountFaxDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedFaxAccountFaxDispositions" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedFaxAccountFaxDispositions($event)" aria-label="delete selected" translate translate-attr-label="FAXACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedFaxAccountFaxDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getFaxAccountFaxDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'FAX.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="faxDisposition" md-select-id="id" ng-repeat="faxDisposition in vm_dc.faxAccountFaxDispositions.rows">\n <td ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" md-cell>{{faxDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" md-cell>{{faxDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" md-cell>{{faxDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" translate="FAX.EDIT_FAXDISPOSITION">\n Edit FaxDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(faxDisposition, $event)" translate="FAX.DELETE_FAXDISPOSITION">\n Delete FaxDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.faxAccountFaxDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="FAX.NO_FAXDISPOSITION_AVAILABLE">No faxdisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.faxAccountFaxDispositions.count}}" md-on-paginate="vm_dc.getFaxAccountFaxDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="faxAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.faxAccount)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="FAX.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedFaxAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedFaxAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedFaxAccountApps.length}} {{vm_ac.selectedFaxAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedFaxAccountApps($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedFaxAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.faxAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editFaxAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.faxAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="faxAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getFaxAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="FAX.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedFaxAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedFaxAccountInteractions.length}} {{vm_dc.selectedFaxAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedFaxAccountInteractions" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedFaxAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="FAXACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedFaxAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getFaxAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'FAX.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'FAX.CONTACT\' | translate }}</th>\n <th md-column>{{ \'FAX.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'FAX.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'FAX.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'FAX.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'FAX.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.faxAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spyfaxInteraction($event, interaction)" translate="FAX.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="FAX.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.faxAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="FAX.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.faxAccountInteractions.count}}" md-on-paginate="vm_dc.getFaxAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxAccounts/faxAccounts.html",'<div id="faxAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="FAX.FAXACCOUNTS">FaxAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFaxAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFaxAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="FAX.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-faxAccounts-count">\n <span>{{vm.selectedFaxAccounts.length}}</span>\n <span translate="FAX.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAXACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFaxAccounts()" translate="FAX.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFaxAccounts()" translate="FAX.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFaxAccounts" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedFaxAccounts($event)" aria-label="delete selected" translate translate-attr-label="FAXACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- FAXACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFaxAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'FAX.KEY\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'FAX.TRUNK\' | translate }}</th>\n <th md-column md-order-by="localstationid">{{ \'FAX.LOCALSTATIONID\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'FAX.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="faxAccount" md-select-id="id" ng-repeat="faxAccount in vm.faxAccounts.rows">\n <td md-cell ng-if="faxAccount.userpic"><img class="avatar" alt="{{faxAccount.name}}" ng-src="api/users/{{faxAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!faxAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="id ">{{faxAccount.id}}</td>\n <td ng-click="vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="name ">{{faxAccount.name}}</td>\n <td ng-click="vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="key ">{{faxAccount.key}}</td>\n <td ng-click="vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="TrunkId ">{{ TrunkId = vm.trunks[faxAccount.TrunkId]; TrunkId.name }}</td>\n <td ng-click="vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="localstationid ">{{faxAccount.localstationid}}</td>\n <td ng-click="vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="description ">{{faxAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(faxAccount, $event)" translate="FAX.EDIT_FAXACCOUNT">\n Edit FaxAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(faxAccount, $event)" translate="FAX.INTERACTIONS_FAXACCOUNT">\n Interactions FaxAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(faxAccount, $event)" translate="FAX.GOTOREALTIME_FAXACCOUNT">\n goToRealtime FaxAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(faxAccount, $event)" translate="FAX.DELETE_FAXACCOUNT">\n Delete FaxAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxAccounts.count}}"\n md-on-paginate="vm.getFaxAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FAXACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FAXACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-faxAccount-button" ng-click="vm.createOrEditFaxAccount($event)" aria-label="add faxAccount" translate translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FAXACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/faxQueues/create/dialog.html",'<md-dialog class="faxQueue-dialog" aria-label="New FaxQueue">\n <form name="faxQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newFaxQueue">\n <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n <div ng-messages="faxQueueForm[\'name\'].$error" ng-show="faxQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.faxQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="faxQueueForm[\'strategy\'].$error" ng-show="faxQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="faxQueueForm[\'timeout\'].$error" ng-show="faxQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxQueue.description">\n <div ng-messages="faxQueueForm[\'description\'].$error" ng-show="faxQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newFaxQueue" ng-click="vm.saveFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid || faxQueueForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newFaxQueue" ng-click="vm.addNewFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXQUEUE" translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n ADD FAXQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newFaxQueue" ng-click="vm.deleteFaxQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue">\n <form name="faxQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.AGENTADD_FAXQUEUE">Add Agent to faxQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue">\n <form name="faxQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.TEAMADD_FAXQUEUE">Add Team in FAXQUEUE</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/view.html",'<div id="fax-faxQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-faxQueues-button md-icon-button" aria-label="Go to faxQueues" ng-click="vm.gotoFaxQueues()" translate translate-attr-aria-label="FAX.GO_TO_FAXQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="faxQueue-image" hide-xs>\n <img ng-src="assets/images/business/faxQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.faxQueue.id}}\n <span ng-if="vm.faxQueue.name">{{vm.faxQueue.name}}</span>\n <span ng-if="vm.faxQueue.exten">{{vm.faxQueue.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.faxQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="FAX.TEAMADD_FAXQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.faxQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="FAX.AGENTADD_FAXQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFaxQueue()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="faxQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.faxQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxQueue.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxQueues/faxQueues.html",'<div id="faxQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="FAX.FAXQUEUES">FaxQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFaxQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFaxQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="FAX.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-faxQueues-count">\n <span>{{vm.selectedFaxQueues.length}}</span>\n <span translate="FAX.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAXQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFaxQueues()" translate="FAX.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFaxQueues()" translate="FAX.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFaxQueues" csv-label="true" filename="faxQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedFaxQueues($event)" aria-label="delete selected" translate translate-attr-label="FAXQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- FAXQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFaxQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'FAX.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="faxQueue" md-select-id="id" ng-repeat="faxQueue in vm.faxQueues.rows">\n <td md-cell ng-if="faxQueue.userpic"><img class="avatar" alt="{{faxQueue.name}}" ng-src="api/users/{{faxQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!faxQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="id ">{{faxQueue.id}}</td>\n <td ng-click="vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="name ">{{faxQueue.name}}</td>\n <td ng-click="vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="strategy ">{{ vm.arraystrategy[faxQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(faxQueue, $event)" translate="FAX.EDIT_FAXQUEUE">\n Edit FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(faxQueue, $event)" translate="FAX.TEAMADD_FAXQUEUE">\n teamadd FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(faxQueue, $event)" translate="FAX.AGENTADD_FAXQUEUE">\n agentadd FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(faxQueue, $event)" translate="FAX.DELETE_FAXQUEUE">\n Delete FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(faxQueue, $event)" translate="FAX.GOTOREALTIME_FAXQUEUE">\n goToRealtime FaxQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxQueues.count}}"\n md-on-paginate="vm.getFaxQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FAXQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FAXQUEUE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-faxQueue-button" ng-click="vm.createOrEditFaxQueue($event)" aria-label="add faxQueue" translate translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FAXQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.ACCOUNTS">Accounts</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column>{{ \'FAX.KEY\' | translate }}</th>\n <th md-column>{{ \'FAX.TOTAL\' | translate }}</th>\n <th md-column>{{ \'FAX.IN\' | translate }}</th>\n <th md-column>{{ \'FAX.OUT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxAccounts">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.faxAccounts[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.faxAccounts[value].name}}</td>\n <td md-cell>{{vm.faxAccounts[value].key}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(vm.faxAccounts[value].in || 0) + (vm.faxAccounts[value].out || 0)}}</span>\n </td>\n <td md-cell>\n <div layout="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">{{vm.faxAccounts[value].in || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.in">{{vm.faxAccounts[value].lastIn ? (vm.faxAccounts[value].lastIn | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">{{vm.faxAccounts[value].out || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.out">{{vm.faxAccounts[value].lastOut ? (vm.faxAccounts[value].lastOut | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToFaxAccount($event, vm.faxAccounts[value])" translate="FAX.EDIT_ACCOUNT">\n Edit Account\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}"\n md-on-paginate="vm.getfaxAccounts" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/fax/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'FAX.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'FAX.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'FAX.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'FAX.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'FAX.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="3">{{ \'FAX.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n \x3c!-- <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSE\' | translate }}</th>\n <th md-column width="10px"></th> --\x3e\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'FAX.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'FAX.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatusTime">{{ \'FAX.TIMER\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'FAX.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'busy\':\'indigo-100-bg\',\'*pause\':\'amber-50-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].globalStatus]">{{ vm.isPause(vm.agents[value].globalStatus) ? \'\' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? \'*\'+vm.agents[value].pauseType || \'DEFAULT PAUSE\' : vm.agents[value].pauseType || \'DEFAULT PAUSE\') : \'\'}}</span>\n </td>\n <td class="bt custom-column">\n <timer start-time="vm.agents[value].globalStatusTime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class="bt bl">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'talking\':\'indigo-100-bg\',\'ringing\':\'orange-400-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt bl">\n <div layout="column">\n <span ng-if="vm.agents[value].queue" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].queue }}</span>\n <span ng-if="vm.agents[value].destconnectedlinenum" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class="padding-5" ng-if="vm.agents[value].queue || vm.agents[value].destconnectedlinenum">\n <timer start-time="vm.agents[value].voiceStatusTime" interval="1000" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n \x3c!-- <td class="bt">--</td>\n <td class="bt">--</td> --\x3e\n <td class="bt bl" ng-if="vm.license.chat">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n \x3c!-- <td class="bt padding-5 text-center">{{ agent.chatCurrentCapacity }}/{{ agent.chatCapacity > 0 ? agent.chatCapacity : \'∞\' }}</td> --\x3e\n <td md-number class="bt text-center font-size-20" ng-if="vm.license.chat" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.mail">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.mail" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.messaging">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.messaging" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.openchannel">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">4</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">89</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.openchannel" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.fax">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">7</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">2</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.fax" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class="bl bt padding-5 text-center">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.logout(vm.agents[value], $event)" translate="FAX.LOGOUT">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.queueAdd(vm.agents[value], $event)" translate="FAX.AGENTADD_QUEUE">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="FAX.PAUSE">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=" vm.agents[value].voicePause && \'DEFAULT PAUSE\' === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value])"><em translate="FAX.DEFAULT_PAUSE">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.pauses.rows.length" ng-repeat="pause in vm.pauses.rows">\n <md-button ng-disabled="vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value], pause.name)">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="vm.isPause(vm.agents[value].globalStatus)">\n <md-button ng-click="vm.unPause(vm.agents[value])" translate="FAX.UNPAUSE">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.filteredAgents.length}}"\n md-on-paginate="vm.onInit" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/fax/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column>{{ \'FAX.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'FAX.PAUSED\' | translate }}</th>\n <th md-column>{{ \'FAX.READY\' | translate }}</th>\n <th md-column>{{ \'FAX.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditFaxQueue($event, vm.queues[value])" translate="FAX.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="FAX.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}"\n md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/fax/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.TRUNKS">Trunks</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ACCOUNTS">Accounts</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.TRUNKS">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'FAX.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head>\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column>{{ \'FAX.TRUNK_STATUS\' | translate }}</th>\n <th md-column>{{ \'FAX.REGISTRY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n <td md-cell>{{trunk.name}}</td>\n <td md-cell>\n <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n <md-tooltip>{{\'FAX.\' + trunk.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n </td>\n <td md-cell>\n <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n <md-tooltip>{{\'FAX.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n <span ng-if="!trunk.registry" translate="FAX.NO_REGISTRY">\n No Registry\n </span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToTrunk($event, trunk)" translate="FAX.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}"\n md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/help/views/about/about.html",'<div id="maintenance" class="flex-scrollable" layout="column" ms-scroll>\n <div id="maintenance-form-wrapper" layout="column" layout-align="center center">\n <div id="maintenance-form" class="md-whiteframe-8dp">\n <div>\n <img src="/api/settings/1/logo_login" alt="logo_login" />\n </div>\n\n <br>\n\n <div>\n <div class="info-line">\n <div class="title">Useful pages</div>\n </div>\n <section layout="row" flex layout-sm="column" layout-align="center center" layout-wrap>\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button grey-bg" href="https://wiki.xcallymotion.com/display/XMV" target="_blank">\n <md-icon md-font-icon="icon-wikipedia"></md-icon>\n </a>\n <div class="info"><a href="https://wiki.xcallymotion.com/display/XMV" target="_blank">Wiki</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button md-accent" href="/apidoc" target="_blank">\n <md-icon md-font-icon="icon-apple-mobileme"></md-icon>\n </a>\n <div class="info"><a href="/apidoc" target="_blank">Motion API</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button orange-bg" href="http://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">\n <md-icon md-font-icon="icon-headphones"></md-icon>\n </a>\n <div class="info"><a href="http://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">Phonebar Download</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button green-bg" href="/demo" target="_blank">\n <md-icon md-font-icon="icon-console"></md-icon>\n </a>\n <div class="info"><a href="/demo" target="_blank">Playground</a></div>\n </div>\n\n </section>\n\n <br>\n\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="title">Follow us on</div>\n </div>\n <section ng-if="!vm.license.custom" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <a class="md-fab md-mini md-button blue-900-bg" href="https://www.facebook.com/xcallymotion" target="_blank">\n <md-icon md-font-icon="icon-facebook"></md-icon>\n </a>\n\n <a class="md-fab md-mini md-button" href="https://twitter.com/xcallymotion" target="_blank">\n <md-icon md-font-icon="icon-twitter"></md-icon>\n </a>\n <a class="md-fab md-mini md-button md-warn" href="https://plus.google.com/+Xcally" target="_blank">\n <md-icon md-font-icon="icon-google-plus"></md-icon>\n </a>\n <a class="md-fab md-mini md-button light-blue-800-bg" href="https://www.linkedin.com/company/xcally" target="_blank">\n <md-icon md-font-icon="icon-linkedin"></md-icon>\n </a>\n </section>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="title" translate="HELP.CONTACT_US">Contact Us</div>\n </div>\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="info"><a href="mailto:support@xcally.com" target="_top">support@xcally.com</a></div>\n </div>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info">xCALLY Motion <u>{{vm.info.current}}</u> | <a href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.info.current}}" target="_blank">Changelog</a></div>\n\n <br>\n\n <div class="info" ng-if="!vm.license.custom">xCALLY© 2016 - 2018 | Powered by Xenialab | <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">EULA</a></div>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info" ng-if="!vm.license.custom"><a href="https://www.xenialab.com/" target="_blank">www.xenialab.com</a> | <a href="https://www.xcallymotion.com/" target="_blank">www.xcallymotion.com</a></div>\n </div>\n </div>\n </div>\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/create/dialog.html",'<md-dialog class="deskAccount-dialog" aria-label="New DeskAccount">\n <form name="deskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus>\n <div ng-messages="deskAccountForm[\'name\'].$error" ng-show="deskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }}</md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }}</md-option>\n </md-select>\n <div ng-messages="deskAccountForm[\'type\'].$error" ng-show="deskAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true">\n <div ng-messages="deskAccountForm[\'remoteUri\'].$error" ng-show="deskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.deskAccount.authType" required>\n <md-option ng-value="\'basic\'">Basic</md-option>\n </md-select>\n <div ng-messages="deskAccountForm[\'authType\'].$error" ng-show="deskAccountForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true">\n <div ng-messages="deskAccountForm[\'username\'].$error" ng-show="deskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="deskAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="deskAccountForm[\'serverUrl\'].$error" ng-show="deskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.deskAccount.description">\n <div ng-messages="deskAccountForm[\'description\'].$error" ng-show="deskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newDeskAccount" ng-click="vm.saveDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid || deskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newDeskAccount" ng-click="vm.addNewDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n ADD DESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newDeskAccount" ng-click="vm.deleteDeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/deskAccounts.html",'<div id="deskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.DESKACCOUNTS">DeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedDeskAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedDeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-deskAccounts-count">\n <span>{{vm.selectedDeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="DESKACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllDeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectDeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedDeskAccounts" csv-label="true" filename="deskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedDeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="DESKACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- DESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedDeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.deskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="deskAccount" md-select-id="id" ng-repeat="deskAccount in vm.deskAccounts.rows">\n <td md-cell ng-if="deskAccount.userpic"><img class="avatar" alt="{{deskAccount.name}}" ng-src="api/users/{{deskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!deskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{deskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="id ">{{deskAccount.id}}</td>\n <td ng-click="vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="name ">{{deskAccount.name}}</td>\n <td ng-click="vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="remoteUri ">{{deskAccount.remoteUri}}</td>\n <td ng-click="vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="username ">{{deskAccount.username}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(deskAccount, $event)" translate="INTEGRATIONS.EDIT_DESKACCOUNT">\n Edit DeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(deskAccount, $event)" translate="INTEGRATIONS.TEST_DESKACCOUNT">\n Test DeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(deskAccount, $event)" translate="INTEGRATIONS.DELETE_DESKACCOUNT">\n Delete DeskAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.deskAccounts.count}}" md-on-paginate="vm.getDeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / DESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD DESKACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-deskAccount-button" ng-click="vm.createOrEditDeskAccount($event)" aria-label="add deskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD DESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",'<md-dialog class="deskConfiguration-dialog" aria-label="New DeskConfiguration">\n <form name="deskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.deskConfiguration.name" ng-required="true" autofocus>\n <div ng-messages="deskConfigurationForm[\'name\'].$error" ng-show="deskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.deskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="deskConfigurationForm[\'channel\'].$error" ng-show="deskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="deskConfigurationForm[\'type\'].$error" ng-show="deskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newDeskConfiguration" ng-click="vm.saveDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid || deskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newDeskConfiguration" ng-click="vm.addNewDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_DESKCONFIGURATION">\n ADD DESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newDeskConfiguration" ng-click="vm.deleteDeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",'<md-dialog class="deskAccount-item-dialog" aria-label="New Item">\n <form name="deskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="deskAccountItemForm.key.$error" ng-show="deskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.keyType.$error" ng-show="deskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="deskAccountItemForm.keyContent.$error" ng-show="deskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.variableName.$error" ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.customField.$error" ng-show="deskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.option.$error" ng-show="deskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="deskAccountItemForm.option.$error" ng-show="deskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.variableName.$error" ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/view.html",'<div id="integrations-deskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-deskAccounts-button md-icon-button" aria-label="Go to deskAccounts" ng-click="vm.gotoDeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_DESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="deskAccount-image" hide-xs>\n <img ng-src="assets/images/business/deskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.deskAccount.id}}\n <span ng-if="vm.deskAccount.name">{{vm.deskAccount.name}}</span>\n <span ng-if="vm.deskAccount.exten">{{vm.deskAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.deskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveDeskAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="deskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }}</md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true">\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.deskAccount.authType" required>\n <md-option ng-value="\'basic\'">Basic</md-option>\n </md-select>\n <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true">\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.deskAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="deskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="DeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.deskAccount)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-click="vm_cc.createOrEditDeskConfiguration($event)" class="md-icon-button" aria-label="create deskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="deskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedDeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getDeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ deskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.deleteDeskConfiguration($event, deskConfiguration)" translate="INTEGRATIONS.DELETE_DESKCONFIGURATION">\n Delete DeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length" ng-click="vm_cc.createOrEditDeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",'<md-dialog class="freshdeskAccount-dialog" aria-label="New FreshdeskAccount">\n <form name="freshdeskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus>\n <div ng-messages="freshdeskAccountForm[\'name\'].$error" ng-show="freshdeskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true">\n <div ng-messages="freshdeskAccountForm[\'username\'].$error" ng-show="freshdeskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true">\n <div ng-messages="freshdeskAccountForm[\'remoteUri\'].$error" ng-show="freshdeskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true">\n <div ng-messages="freshdeskAccountForm[\'apiKey\'].$error" ng-show="freshdeskAccountForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="freshdeskAccountForm[\'serverUrl\'].$error" ng-show="freshdeskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshdeskAccount.description">\n <div ng-messages="freshdeskAccountForm[\'description\'].$error" ng-show="freshdeskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newFreshdeskAccount" ng-click="vm.saveFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid || freshdeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newFreshdeskAccount" ng-click="vm.addNewFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n ADD FRESHDESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newFreshdeskAccount" ng-click="vm.deleteFreshdeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",'<md-dialog class="freshdeskConfiguration-dialog" aria-label="New FreshdeskConfiguration">\n <form name="freshdeskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.freshdeskConfiguration.name" ng-required="true" autofocus>\n <div ng-messages="freshdeskConfigurationForm[\'name\'].$error" ng-show="freshdeskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.freshdeskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="freshdeskConfigurationForm[\'channel\'].$error" ng-show="freshdeskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.freshdeskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="freshdeskConfigurationForm[\'type\'].$error" ng-show="freshdeskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newFreshdeskConfiguration" ng-click="vm.saveFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid || freshdeskConfigurationForm.$pristine" aria-label="SAVE"\n translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newFreshdeskConfiguration" ng-click="vm.addNewFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION"\n translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION">\n ADD FRESHDESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newFreshdeskConfiguration" ng-click="vm.deleteFreshdeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",'<md-dialog class="freshdeskAccount-item-dialog" aria-label="New Item">\n <form name="freshdeskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.key.$error" ng-show="freshdeskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.keyType.$error" ng-show="freshdeskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.keyContent.$error" ng-show="freshdeskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.variableName.$error" ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.customField.$error" ng-show="freshdeskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.option.$error" ng-show="freshdeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="freshdeskAccountItemForm.option.$error" ng-show="freshdeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.variableName.$error" ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",'<div id="integrations-freshdeskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-freshdeskAccounts-button md-icon-button" aria-label="Go to freshdeskAccounts" ng-click="vm.gotoFreshdeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_FRESHDESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="freshdeskAccount-image" hide-xs>\n <img ng-src="assets/images/business/freshdeskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.freshdeskAccount.id}}\n <span ng-if="vm.freshdeskAccount.name">{{vm.freshdeskAccount.name}}</span>\n <span ng-if="vm.freshdeskAccount.exten">{{vm.freshdeskAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.freshdeskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="freshdeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true">\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true">\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true">\n <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshdeskAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="freshdeskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="FreshdeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.freshdeskAccount)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" class="md-icon-button" aria-label="create freshdeskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="freshdeskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedFreshdeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getFreshdeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ freshdeskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.deleteFreshdeskConfiguration($event, freshdeskConfiguration)" translate="INTEGRATIONS.DELETE_FRESHDESKCONFIGURATION">\n Delete FreshdeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",'<div id="freshdeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.FRESHDESKACCOUNTS">FreshdeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFreshdeskAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFreshdeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-freshdeskAccounts-count">\n <span>{{vm.selectedFreshdeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FRESHDESKACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFreshdeskAccounts" csv-label="true" filename="freshdeskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedFreshdeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="FRESHDESKACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- FRESHDESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFreshdeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFreshdeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.freshdeskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="freshdeskAccount" md-select-id="id" ng-repeat="freshdeskAccount in vm.freshdeskAccounts.rows">\n <td md-cell ng-if="freshdeskAccount.userpic"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="api/users/{{freshdeskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!freshdeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="id ">{{freshdeskAccount.id}}</td>\n <td ng-click="vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="name ">{{freshdeskAccount.name}}</td>\n <td ng-click="vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="username ">{{freshdeskAccount.username}}</td>\n <td ng-click="vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="remoteUri ">{{freshdeskAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(freshdeskAccount, $event)" translate="INTEGRATIONS.EDIT_FRESHDESKACCOUNT">\n Edit FreshdeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(freshdeskAccount, $event)" translate="INTEGRATIONS.TEST_FRESHDESKACCOUNT">\n Test FreshdeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(freshdeskAccount, $event)" translate="INTEGRATIONS.DELETE_FRESHDESKACCOUNT">\n Delete FreshdeskAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.freshdeskAccounts.count}}" md-on-paginate="vm.getFreshdeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FRESHDESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FRESHDESKACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-freshdeskAccount-button" ng-click="vm.createOrEditFreshdeskAccount($event)" aria-label="add freshdeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FRESHDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",'<md-dialog class="salesforceAccount-dialog" aria-label="New SalesforceAccount">\n <form name="salesforceAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus>\n <div ng-messages="salesforceAccountForm[\'name\'].$error" ng-show="salesforceAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }}</md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }}</md-option>\n </md-select>\n <div ng-messages="salesforceAccountForm[\'type\'].$error" ng-show="salesforceAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true">\n <div ng-messages="salesforceAccountForm[\'username\'].$error" ng-show="salesforceAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true">\n <div ng-messages="salesforceAccountForm[\'remoteUri\'].$error" ng-show="salesforceAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="salesforceAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true">\n <div ng-messages="salesforceAccountForm[\'clientId\'].$error" ng-show="salesforceAccountForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true">\n <div ng-messages="salesforceAccountForm[\'clientSecret\'].$error" ng-show="salesforceAccountForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true">\n <div ng-messages="salesforceAccountForm[\'securityToken\'].$error" ng-show="salesforceAccountForm[\'securityToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="salesforceAccountForm[\'serverUrl\'].$error" ng-show="salesforceAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.salesforceAccount.description">\n <div ng-messages="salesforceAccountForm[\'description\'].$error" ng-show="salesforceAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSalesforceAccount" ng-click="vm.saveSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid || salesforceAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSalesforceAccount" ng-click="vm.addNewSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCEACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n ADD SALESFORCEACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSalesforceAccount" ng-click="vm.deleteSalesforceAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",'<md-dialog class="salesforceConfiguration-dialog" aria-label="New SalesforceConfiguration">\n <form name="salesforceConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.salesforceConfiguration.name" ng-required="true" autofocus>\n <div ng-messages="salesforceConfigurationForm[\'name\'].$error" ng-show="salesforceConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.salesforceConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="salesforceConfigurationForm[\'channel\'].$error" ng-show="salesforceConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="salesforceConfigurationForm[\'type\'].$error" ng-show="salesforceConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSalesforceConfiguration" ng-click="vm.saveSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid || salesforceConfigurationForm.$pristine" aria-label="SAVE"\n translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSalesforceConfiguration" ng-click="vm.addNewSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCECONFIGURATION"\n translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCECONFIGURATION">\n ADD SALESFORCECONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSalesforceConfiguration" ng-click="vm.deleteSalesforceConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",'<md-dialog class="salesforceAccount-item-dialog" aria-label="New Item">\n <form name="salesforceAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.key.$error" ng-show="salesforceAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.keyType.$error" ng-show="salesforceAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.keyContent.$error" ng-show="salesforceAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.variableName.$error" ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.customField.$error" ng-show="salesforceAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.option.$error" ng-show="salesforceAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="salesforceAccountItemForm.option.$error" ng-show="salesforceAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.variableName.$error" ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/view.html",'<div id="integrations-salesforceAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-salesforceAccounts-button md-icon-button" aria-label="Go to salesforceAccounts" ng-click="vm.gotoSalesforceAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SALESFORCEACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="salesforceAccount-image" hide-xs>\n <img ng-src="assets/images/business/salesforceAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.salesforceAccount.id}}\n <span ng-if="vm.salesforceAccount.name">{{vm.salesforceAccount.name}}</span>\n <span ng-if="vm.salesforceAccount.exten">{{vm.salesforceAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.salesforceAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="salesforceAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }}</md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true">\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true">\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true">\n <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true">\n <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true">\n <div ng-messages="generalForm[\'securityToken\'].$error" ng-show="generalForm[\'securityToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.salesforceAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="salesforceAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="SalesforceAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.salesforceAccount)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" class="md-icon-button" aria-label="create salesforceConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="salesforceConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSalesforceConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSalesforceConfiguration($index)">\n <span class="text-truncate" flex="80">{{ salesforceConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.deleteSalesforceConfiguration($event, salesforceConfiguration)" translate="INTEGRATIONS.DELETE_SALESFORCECONFIGURATION">\n Delete SalesforceConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_SEARCH"></label>\n <md-select ng-model="vm_cc.salesforceConfiguration.moduleSearch" ng-change="vm_cc.selectChangedAdvanced()">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'contact_lead\', value: \'Contact & Lead\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">{{ option.value }}</md-option>\n </md-select>\n </div>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_CREATE"></label>\n <md-select ng-model="vm_cc.salesforceConfiguration.moduleCreate" ng-change="vm_cc.selectChangedAdvanced()">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'nothing\', value: \'Nothing\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">{{ option.value }}</md-option>\n </md-select>\n </div>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",'<div id="salesforceAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SALESFORCEACCOUNTS">SalesforceAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSalesforceAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSalesforceAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-salesforceAccounts-count">\n <span>{{vm.selectedSalesforceAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SALESFORCEACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSalesforceAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSalesforceAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSalesforceAccounts" csv-label="true" filename="salesforceAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedSalesforceAccounts($event)" aria-label="delete selected" translate translate-attr-label="SALESFORCEACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- SALESFORCEACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSalesforceAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSalesforceAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.salesforceAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="salesforceAccount" md-select-id="id" ng-repeat="salesforceAccount in vm.salesforceAccounts.rows">\n <td md-cell ng-if="salesforceAccount.userpic"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="api/users/{{salesforceAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!salesforceAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="id ">{{salesforceAccount.id}}</td>\n <td ng-click="vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="name ">{{salesforceAccount.name}}</td>\n <td ng-click="vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="username ">{{salesforceAccount.username}}</td>\n <td ng-click="vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="remoteUri ">{{salesforceAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(salesforceAccount, $event)" translate="INTEGRATIONS.EDIT_SALESFORCEACCOUNT">\n Edit SalesforceAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(salesforceAccount, $event)" translate="INTEGRATIONS.TEST_SALESFORCEACCOUNT">\n Test SalesforceAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(salesforceAccount, $event)" translate="INTEGRATIONS.DELETE_SALESFORCEACCOUNT">\n Delete SalesforceAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.salesforceAccounts.count}}" md-on-paginate="vm.getSalesforceAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SALESFORCEACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SALESFORCEACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-salesforceAccount-button" ng-click="vm.createOrEditSalesforceAccount($event)" aria-label="add salesforceAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SALESFORCEACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",'<md-dialog class="sugarcrmAccount-dialog" aria-label="New SugarcrmAccount">\n <form name="sugarcrmAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus>\n <div ng-messages="sugarcrmAccountForm[\'name\'].$error" ng-show="sugarcrmAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true">\n <div ng-messages="sugarcrmAccountForm[\'username\'].$error" ng-show="sugarcrmAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true">\n <div ng-messages="sugarcrmAccountForm[\'remoteUri\'].$error" ng-show="sugarcrmAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="sugarcrmAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="sugarcrmAccountForm[\'serverUrl\'].$error" ng-show="sugarcrmAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sugarcrmAccount.description">\n <div ng-messages="sugarcrmAccountForm[\'description\'].$error" ng-show="sugarcrmAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSugarcrmAccount" ng-click="vm.saveSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid || sugarcrmAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSugarcrmAccount" ng-click="vm.addNewSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n ADD SUGARCRMACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSugarcrmAccount" ng-click="vm.deleteSugarcrmAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",'<md-dialog class="sugarcrmConfiguration-dialog" aria-label="New SugarcrmConfiguration">\n <form name="sugarcrmConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.sugarcrmConfiguration.name" ng-required="true" autofocus>\n <div ng-messages="sugarcrmConfigurationForm[\'name\'].$error" ng-show="sugarcrmConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.sugarcrmConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="sugarcrmConfigurationForm[\'channel\'].$error" ng-show="sugarcrmConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.sugarcrmConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="sugarcrmConfigurationForm[\'type\'].$error" ng-show="sugarcrmConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSugarcrmConfiguration" ng-click="vm.saveSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid || sugarcrmConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSugarcrmConfiguration" ng-click="vm.addNewSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION"\n translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION">\n ADD SUGARCRMCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSugarcrmConfiguration" ng-click="vm.deleteSugarcrmConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",'<md-dialog class="sugarcrmAccount-item-dialog" aria-label="New Item">\n <form name="sugarcrmAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.key.$error" ng-show="sugarcrmAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.keyType.$error" ng-show="sugarcrmAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.keyContent.$error" ng-show="sugarcrmAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.variableName.$error" ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.customField.$error" ng-show="sugarcrmAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.option.$error" ng-show="sugarcrmAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="sugarcrmAccountItemForm.option.$error" ng-show="sugarcrmAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.variableName.$error" ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",'<div id="integrations-sugarcrmAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-sugarcrmAccounts-button md-icon-button" aria-label="Go to sugarcrmAccounts" ng-click="vm.gotoSugarcrmAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SUGARCRMACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="sugarcrmAccount-image" hide-xs>\n <img ng-src="assets/images/business/sugarcrmAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.sugarcrmAccount.id}}\n <span ng-if="vm.sugarcrmAccount.name">{{vm.sugarcrmAccount.name}}</span>\n <span ng-if="vm.sugarcrmAccount.exten">{{vm.sugarcrmAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.sugarcrmAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="sugarcrmAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true">\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true">\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sugarcrmAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="sugarcrmAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="SugarcrmAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.sugarcrmAccount)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" class="md-icon-button" aria-label="create sugarcrmConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="sugarcrmConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSugarcrmConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSugarcrmConfiguration($index)">\n <span class="text-truncate" flex="80">{{ sugarcrmConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.deleteSugarcrmConfiguration($event, sugarcrmConfiguration)" translate="INTEGRATIONS.DELETE_SUGARCRMCONFIGURATION">\n Delete SugarcrmConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",'<div id="sugarcrmAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SUGARCRMACCOUNTS">SugarcrmAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSugarcrmAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSugarcrmAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-sugarcrmAccounts-count">\n <span>{{vm.selectedSugarcrmAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SUGARCRMACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSugarcrmAccounts" csv-label="true" filename="sugarcrmAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedSugarcrmAccounts($event)" aria-label="delete selected" translate translate-attr-label="SUGARCRMACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- SUGARCRMACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSugarcrmAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSugarcrmAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.sugarcrmAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="sugarcrmAccount" md-select-id="id" ng-repeat="sugarcrmAccount in vm.sugarcrmAccounts.rows">\n <td md-cell ng-if="sugarcrmAccount.userpic"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="api/users/{{sugarcrmAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!sugarcrmAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="id ">{{sugarcrmAccount.id}}</td>\n <td ng-click="vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="name ">{{sugarcrmAccount.name}}</td>\n <td ng-click="vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="username ">{{sugarcrmAccount.username}}</td>\n <td ng-click="vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="remoteUri ">{{sugarcrmAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(sugarcrmAccount, $event)" translate="INTEGRATIONS.EDIT_SUGARCRMACCOUNT">\n Edit SugarcrmAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(sugarcrmAccount, $event)" translate="INTEGRATIONS.TEST_SUGARCRMACCOUNT">\n Test SugarcrmAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(sugarcrmAccount, $event)" translate="INTEGRATIONS.DELETE_SUGARCRMACCOUNT">\n Delete SugarcrmAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.sugarcrmAccounts.count}}" md-on-paginate="vm.getSugarcrmAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SUGARCRMACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SUGARCRMACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-sugarcrmAccount-button" ng-click="vm.createOrEditSugarcrmAccount($event)" aria-label="add sugarcrmAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SUGARCRMACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",'<md-dialog class="zendeskAccount-dialog" aria-label="New ZendeskAccount">\n <form name="zendeskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus>\n <div ng-messages="zendeskAccountForm[\'name\'].$error" ng-show="zendeskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }}</md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }}</md-option>\n </md-select>\n <div ng-messages="zendeskAccountForm[\'type\'].$error" ng-show="zendeskAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true">\n <div ng-messages="zendeskAccountForm[\'username\'].$error" ng-show="zendeskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true">\n <div ng-messages="zendeskAccountForm[\'remoteUri\'].$error" ng-show="zendeskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.zendeskAccount.authType" required>\n <md-option ng-value="\'password\'">Password</md-option>\n <md-option ng-value="\'token\'">Token</md-option>\n </md-select>\n <div ng-messages="zendeskAccountForm[\'authType\'].$error" ng-show="zendeskAccountForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="zendeskAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n <label translate="INTEGRATIONS.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true">\n <div ng-messages="zendeskAccountForm[\'token\'].$error" ng-show="zendeskAccountForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="zendeskAccountForm[\'serverUrl\'].$error" ng-show="zendeskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zendeskAccount.description">\n <div ng-messages="zendeskAccountForm[\'description\'].$error" ng-show="zendeskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newZendeskAccount" ng-click="vm.saveZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid || zendeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newZendeskAccount" ng-click="vm.addNewZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n ADD ZENDESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newZendeskAccount" ng-click="vm.deleteZendeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",'<md-dialog class="zendeskAccount-item-dialog" aria-label="New Item">\n <form name="zendeskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.key.$error" ng-show="zendeskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.keyType.$error" ng-show="zendeskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.keyContent.$error" ng-show="zendeskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.variableName.$error" ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.customField.$error" ng-show="zendeskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.option.$error" ng-show="zendeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="zendeskAccountItemForm.option.$error" ng-show="zendeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.variableName.$error" ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/view.html",'<div id="integrations-zendeskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-zendeskAccounts-button md-icon-button" aria-label="Go to zendeskAccounts" ng-click="vm.gotoZendeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZENDESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="zendeskAccount-image" hide-xs>\n <img ng-src="assets/images/business/zendeskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.zendeskAccount.id}}\n <span ng-if="vm.zendeskAccount.name">{{vm.zendeskAccount.name}}</span>\n <span ng-if="vm.zendeskAccount.exten">{{vm.zendeskAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zendeskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (zendeskConfigurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="zendeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }}</md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true">\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true">\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.zendeskAccount.authType" required>\n <md-option ng-value="\'password\'">Password</md-option>\n <md-option ng-value="\'token\'">Token</md-option>\n </md-select>\n <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n <label translate="INTEGRATIONS.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true">\n <div ng-messages="generalForm[\'token\'].$error" ng-show="generalForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zendeskAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="zendeskAccount-detail-form-container zendeskconfigurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.ZENDESKCONFIGURATIONS">ZENDESKCONFIGURATIONS</div>\n </div>\n <div ng-controller="ZendeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zendeskAccount)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" class="md-icon-button" aria-label="create zendeskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="zendeskConfiguration in vm_cc.zendeskConfigurations" class="border-top" md-colors="{background: (vm_cc.selectedZendeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZendeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ zendeskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.deleteZendeskConfiguration($event, zendeskConfiguration)" translate="INTEGRATIONS.DELETE_ZENDESKCONFIGURATION">\n Delete ZendeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.zendeskConfigurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.zendeskConfigurations.length" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",'<md-dialog class="zendeskConfiguration-dialog" aria-label="New ZendeskConfiguration">\n <form name="zendeskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.zendeskConfiguration.name" ng-required="true" autofocus>\n <div ng-messages="zendeskConfigurationForm[\'name\'].$error" ng-show="zendeskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.zendeskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="zendeskConfigurationForm[\'channel\'].$error" ng-show="zendeskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="zendeskConfigurationForm[\'type\'].$error" ng-show="zendeskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newZendeskConfiguration" ng-click="vm.saveZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid || zendeskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newZendeskConfiguration" ng-click="vm.addNewZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKCONFIGURATION"\n translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKCONFIGURATION">\n ADD ZENDESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newZendeskConfiguration" ng-click="vm.deleteZendeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",'<div id="zendeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.ZENDESKACCOUNTS">ZendeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedZendeskAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedZendeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-zendeskAccounts-count">\n <span>{{vm.selectedZendeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ZENDESKACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllZendeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectZendeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedZendeskAccounts" csv-label="true" filename="zendeskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedZendeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="ZENDESKACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- ZENDESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedZendeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZendeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.zendeskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="zendeskAccount" md-select-id="id" ng-repeat="zendeskAccount in vm.zendeskAccounts.rows">\n <td md-cell ng-if="zendeskAccount.userpic"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="api/users/{{zendeskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!zendeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="id ">{{zendeskAccount.id}}</td>\n <td ng-click="vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="name ">{{zendeskAccount.name}}</td>\n <td ng-click="vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="username ">{{zendeskAccount.username}}</td>\n <td ng-click="vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="remoteUri ">{{zendeskAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(zendeskAccount, $event)" translate="INTEGRATIONS.EDIT_ZENDESKACCOUNT">\n Edit ZendeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(zendeskAccount, $event)" translate="INTEGRATIONS.TEST_ZENDESKACCOUNT">\n Test ZendeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(zendeskAccount, $event)" translate="INTEGRATIONS.DELETE_ZENDESKACCOUNT">\n Delete ZendeskAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.zendeskAccounts.count}}" md-on-paginate="vm.getZendeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ZENDESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ZENDESKACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-zendeskAccount-button" ng-click="vm.createOrEditZendeskAccount($event)" aria-label="add zendeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ZENDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/create/dialog.html",'<md-dialog class="zohoAccount-dialog" aria-label="New ZohoAccount">\n <form name="zohoAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus>\n <div ng-messages="zohoAccountForm[\'name\'].$error" ng-show="zohoAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <md-select name="host" ng-model="vm.zohoAccount.host" required>\n <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n </md-select>\n <div ng-messages="zohoAccountForm[\'host\'].$error" ng-show="zohoAccountForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.zohoAccount.authToken" ng-required="true">\n <div ng-messages="zohoAccountForm[\'authToken\'].$error" ng-show="zohoAccountForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="zohoAccountForm[\'serverUrl\'].$error" ng-show="zohoAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zohoAccount.description">\n <div ng-messages="zohoAccountForm[\'description\'].$error" ng-show="zohoAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newZohoAccount" ng-click="vm.saveZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid || zohoAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newZohoAccount" ng-click="vm.addNewZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n ADD ZOHOACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newZohoAccount" ng-click="vm.deleteZohoAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",'<md-dialog class="zohoConfiguration-dialog" aria-label="New ZohoConfiguration">\n <form name="zohoConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.zohoConfiguration.name" ng-required="true" autofocus>\n <div ng-messages="zohoConfigurationForm[\'name\'].$error" ng-show="zohoConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.zohoConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="zohoConfigurationForm[\'channel\'].$error" ng-show="zohoConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zohoConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="zohoConfigurationForm[\'type\'].$error" ng-show="zohoConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newZohoConfiguration" ng-click="vm.saveZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid || zohoConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE"\n translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newZohoConfiguration" ng-click="vm.addNewZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOCONFIGURATION">\n ADD ZOHOCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newZohoConfiguration" ng-click="vm.deleteZohoConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",'<md-dialog class="zohoAccount-item-dialog" aria-label="New Item">\n <form name="zohoAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.key.$error" ng-show="zohoAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.keyType.$error" ng-show="zohoAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.keyContent.$error" ng-show="zohoAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.variableName.$error" ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.customField.$error" ng-show="zohoAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.option.$error" ng-show="zohoAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="zohoAccountItemForm.option.$error" ng-show="zohoAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.variableName.$error" ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/view.html",'<div id="integrations-zohoAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-zohoAccounts-button md-icon-button" aria-label="Go to zohoAccounts" ng-click="vm.gotoZohoAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZOHOACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="zohoAccount-image" hide-xs>\n <img ng-src="assets/images/business/zohoAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.zohoAccount.id}}\n <span ng-if="vm.zohoAccount.name">{{vm.zohoAccount.name}}</span>\n <span ng-if="vm.zohoAccount.exten">{{vm.zohoAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zohoAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveZohoAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="zohoAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <md-select name="host" ng-model="vm.zohoAccount.host" required>\n <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n </md-select>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.zohoAccount.authToken" ng-required="true">\n <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl">\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zohoAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="zohoAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="ZohoAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zohoAccount)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-click="vm_cc.createOrEditZohoConfiguration($event)" class="md-icon-button" aria-label="create zohoConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="zohoConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedZohoConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZohoConfiguration($index)">\n <span class="text-truncate" flex="80">{{ zohoConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.deleteZohoConfiguration($event, zohoConfiguration)" translate="INTEGRATIONS.DELETE_ZOHOCONFIGURATION">\n Delete ZohoConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.currentUser.crudPermissions === 0 || vm_cc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length" ng-click="vm_cc.createOrEditZohoConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",'<div id="zohoAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.ZOHOACCOUNTS">ZohoAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedZohoAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedZohoAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-zohoAccounts-count">\n <span>{{vm.selectedZohoAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ZOHOACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllZohoAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectZohoAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedZohoAccounts" csv-label="true" filename="zohoAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedZohoAccounts($event)" aria-label="delete selected" translate translate-attr-label="ZOHOACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- ZOHOACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedZohoAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZohoAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="host">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.zohoAccounts.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="zohoAccount" md-select-id="id" ng-repeat="zohoAccount in vm.zohoAccounts.rows">\n <td md-cell ng-if="zohoAccount.userpic"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="api/users/{{zohoAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!zohoAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="id ">{{zohoAccount.id}}</td>\n <td ng-click="vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="name ">{{zohoAccount.name}}</td>\n <td ng-click="vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="host ">{{ vm.arrayhost[zohoAccount.host].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(zohoAccount, $event)" translate="INTEGRATIONS.EDIT_ZOHOACCOUNT">\n Edit ZohoAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(zohoAccount, $event)" translate="INTEGRATIONS.TEST_ZOHOACCOUNT">\n Test ZohoAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(zohoAccount, $event)" translate="INTEGRATIONS.DELETE_ZOHOACCOUNT">\n Delete ZohoAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.zohoAccounts.count}}" md-on-paginate="vm.getZohoAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ZOHOACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ZOHOACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-zohoAccount-button" ng-click="vm.createOrEditZohoAccount($event)" aria-label="add zohoAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ZOHOACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/jscripty/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.project.description">\n <div ng-messages="projectForm[\'description\'].$error" ng-show="projectForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="JSCRIPTY.SAVE" translate-attr-aria-label="JSCRIPTY.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="ADD" translate="JSCRIPTY.ADD_PROJECT" translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n ADD PROJECT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="JSCRIPTY.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="JSCRIPTY.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/clone/clone.html",'<md-dialog class="project-dialog" aria-label="Clone Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="CLONE" translate="JSCRIPTY.CLONE_PROJECT" translate-attr-aria-label="JSCRIPTY.CLONE_PROJECT">\n CLONE PROJECT\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",'<md-dialog class="session-dialog" aria-label="New Session">\n <form name="sessionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <md-list>\n <md-subheader class="md-no-sticky">\n <div class="margin-bottom-5"><span translate="JSCRIPTY.ANSWERS">Answers</span></div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.STARTTIME" class="ng-scope font-weight-700">Start Time</span>: <span class="ng-binding">{{vm.session.starttime | date:\'medium\'}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.MEMBERNAME" class="ng-scope font-weight-700">Member Name</span>: <span class="ng-binding">{{vm.session.membername}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.PROJECT" class="ng-scope font-weight-700">Project</span>: <span class="ng-binding">{{vm.project.name}}</span>\n </div>\n </md-subheader>\n <md-list-item ng-if="vm.questions.rows.length" class="md-2-line contact-item" ng-repeat="question in vm.questions.rows">\n <div class="md-list-item-text compact">\n <h3>{{$index+1}}. {{question.question}}</h3>\n <p>{{question.answer}}</p>\n </div>\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n <md-list-item ng-if="!vm.questions.rows.length" class="md-2-line contact-item">\n <div class="md-list-item-text compact">\n <h3><span class="text-boxed-ligth" translate="JSCRIPTY.NO_RESULTS_AVAILABLE">No results available</span></h3>\n </div>\n </md-list-item>\n </md-list>\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/view.html",'<div id="jscripty-project" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="JSCRIPTY.GO_TO_PROJECTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="project-image" hide-xs>\n <img ng-src="assets/images/business/projects.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.project.id}}\n <span ng-if="vm.project.name">{{vm.project.name}}</span>\n <span ng-if="vm.project.exten">{{vm.project.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.clonedialog(vm.project, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="JSCRIPTY.CLONE_PROJECT"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (builderForm.$invalid) || (previewForm.$invalid) || (sessionsForm.$invalid) || (answersForm.$invalid)" translate="JSCRIPTY.SAVE"\n translate-attr-aria-label="JSCRIPTY.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="project-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="JSCRIPTY.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.project.enableUncompleteSave" aria-label="EnableUncompleteSave"><span translate="JSCRIPTY.ENABLEUNCOMPLETESAVE">EnableUncompleteSave</span></md-switch>\n <div class="hint"><span translate="JSCRIPTY.HELP.ENABLEUNCOMPLETESAVE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.project.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.BUILDER">BUILDER</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="project-detail-form-container builder md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectBuilderController as vm_bc" ng-init="vm_bc.init(vm.project)">\n <mw-form-builder ng-if="vm_bc.project.formData" form-data="vm_bc.project.formData" options="vm_bc.optionsBuilder" read-only="false"></mw-form-builder>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.PREVIEW">PREVIEW</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="project-detail-form-container preview md-background-bg md-whiteframe-1dp">\n <div layout="column" layout-align="center" ng-controller="ProjectViewerController as vm_vc" ng-init="vm_vc.init(vm.project)">\n <div layout="row" layout-align="center">\n <md-button class="md-raised md-accent" aria-label="Reset" ng-click="vm_vc.resetViewer()">\n Reset\n </md-button>\n </div>\n <mw-form-viewer ng-if="vm_vc.project.formData" form-data="vm_vc.project.formData" response-data="vm_vc.responseData" on-submit="vm_vc.onSubmit($event)" api="vm_vc.formViewer"></mw-form-viewer>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.SESSIONS">SESSIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="project-detail-form-container sessions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectSessionsController as vm_dc" ng-init="vm_dc.init(vm.project)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedProjectSessions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="JSCRIPTY.SESSIONS">Sessions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedProjectSessions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedProjectSessions.length}} {{vm_dc.selectedProjectSessions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedProjectSessions" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedProjectSessions($event)" aria-label="delete selected" translate translate-attr-label="PROJECTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedProjectSessions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getProjectSessions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'JSCRIPTY.ID\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'JSCRIPTY.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'JSCRIPTY.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="membername">{{ \'JSCRIPTY.MEMBERNAME\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'JSCRIPTY.CALLERIDNUM\' | translate }}</th>\n <th md-column md-order-by="completed">{{ \'JSCRIPTY.COMPLETE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="session" md-select-id="id" ng-repeat="session in vm_dc.projectSessions.rows">\n <td md-cell>{{session.id}}</td>\n <td md-cell>{{session.starttime | date:\'medium\'}}</td>\n <td md-cell>{{session.endtime | date:\'medium\'}}</td>\n <td md-cell>{{session.membername}}</td>\n <td md-cell>{{session.calleridnum}}</td>\n <td md-cell class="completed ">\n <md-icon md-colors="{color: {{session.completed ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{session.completed? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.showQuestionsProjectSession($event, session)" translate="JSCRIPTY.SHOW_QUESTIONS_SESSION">\n Results Session\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(session, $event)" translate="JSCRIPTY.DELETE_SESSION">\n Delete Session\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.projectSessions.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="JSCRIPTY.NO_SESSION_AVAILABLE">No session available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.projectSessions.count}}" md-on-paginate="vm_dc.getProjectSessions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.ANSWERS">ANSWERS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="project-detail-form-container answers md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectAnswersController as vm_an" ng-init="vm_an.init(vm.project)">\n <div class="pb-16" layout="row" layout-align="space-between center">\n <div class="h2 secondary-text" translate="JSCRIPTY.ANSWERS">Answers</div>\n <md-date-range localization-map="vm_an.localizationMap" ng-model="vm_an.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_an.getAnswers()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n <md-button type="button" ng-disabled="!vm_an.answers" ng-click="vm_an.getSummary($event)" class="md-accent md-raised md-button ng-scope md-default-theme md-ink-ripple md-green-500-bg md-icon-button" title="{{\'JSCRIPTY.EXPORT_TO_CSV\' | translate}}">\n <md-icon md-font-icon="icon-file-excel" class="md-default-theme md-font material-icons icon-file-excel"></md-icon>\n </md-button>\n </div>\n <div layout="row">\n <md-card class="md-whiteframe-1dp" ng-if="vm_an.answers && vm_an.hasIdAnswers" flex>\n <md-list>\n <md-list-item class="md-2-line contact-item" ng-repeat="(key, question) in vm_an.answers">\n <div class="md-list-item-text compact" layout-padding>\n <h3>{{question.question}}</h3>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column></th>\n <th md-column>#</th>\n <th md-column>%</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="(key, value) in question.answers">\n <td md-cell>{{key}}</td>\n <td md-cell width="20px">{{value}}</td>\n <td md-cell width="20px">{{value*100/question.sum | number:1}}</td>\n </tr>\n <tr md-row>\n <td md-cell><b>{{\'JSCRIPTY.TOTAL\' | translate}}</b></td>\n <td md-cell width="20px"><b>{{question.sum}}</b></td>\n <td md-cell width="20px"><b>100</b></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n </md-list>\n </md-card>\n <span ng-if="!vm_an.answers || !vm_an.hasIdAnswers" class="text-boxed-ligth" translate="JSCRIPTY.NO_ANSWERS_AVAILABLE">No answers available</span>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/jscripty/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-script" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="JSCRIPTY.PROJECTS">Projects</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="JSCRIPTY.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="JSCRIPTY.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-projects-count">\n <span>{{vm.selectedProjects.length}}</span>\n <span translate="JSCRIPTY.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="PROJECTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllProjects()" translate="JSCRIPTY.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectProjects()" translate="JSCRIPTY.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="PROJECTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- PROJECT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'JSCRIPTY.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'JSCRIPTY.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'JSCRIPTY.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'JSCRIPTY.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.projects.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="JSCRIPTY.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n <td md-cell ng-if="project.userpic"><img class="avatar" alt="{{project.name}}" ng-src="api/users/{{project.id}}/avatar" /></td>\n <td md-cell ng-if="!project.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{project.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n <td ng-click="vm.createOrEditProject($event, project)" md-cell class="createdAt ">{{project.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(project, $event)" translate="JSCRIPTY.EDIT_PROJECT">\n Edit Project\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.clonedialog(project, $event)" translate="JSCRIPTY.CLONE_PROJECT">\n clone Project\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.sessionsgoto(project, $event)" translate="JSCRIPTY.SESSIONS_PROJECT">\n Sessions Project\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(project, $event)" translate="JSCRIPTY.DELETE_PROJECT">\n Delete Project\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PROJECT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PROJECT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-project-button" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PROJECT BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/create/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus>\n <div ng-messages="mailAccountForm[\'name\'].$error" ng-show="mailAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="mailAccountForm[\'key\'].$error" ng-show="mailAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.EMAIL_ADDRESS">Email_Address</label>\n <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true">\n <div ng-messages="mailAccountForm[\'email\'].$error" ng-show="mailAccountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email_Address field is required</span>\n </div>\n <div ng-message="email">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email_Address must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.mailAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountForm[\'ListId\'].$error" ng-show="mailAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.active" aria-label="Active"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.newMailAccount" class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="cservice" ng-model="vm.mailAccount.cservice" required>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="mailAccountForm[\'cservice\'].$error" ng-show="mailAccountForm[\'cservice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true">\n <div ng-messages="mailAccountForm[\'Imap.host\'].$error" ng-show="mailAccountForm[\'Imap.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_PORT">IMAP_Port</label>\n <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" ng-required="true">\n <div ng-messages="mailAccountForm[\'Imap.port\'].$error" ng-show="mailAccountForm[\'Imap.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true">\n <div ng-messages="mailAccountForm[\'Smtp.host\'].$error" ng-show="mailAccountForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" ng-required="true">\n <div ng-messages="mailAccountForm[\'Smtp.port\'].$error" ng-show="mailAccountForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.cservice !== undefined && vm.mailAccount.cservice == null && vm.newMailAccount" class="md-block">\n <md-switch ng-model="vm.mailAccount.cauthentication" aria-label="Authentication"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="(vm.mailAccount.cauthentication == true || vm.mailAccount.cservice != null) && vm.newMailAccount" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="cuser" ng-model="vm.mailAccount.cuser" ng-required="true">\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="mailAccountForm[\'cuser\'].$error" ng-show="mailAccountForm[\'cuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="(vm.mailAccount.cauthentication == true || vm.mailAccount.cservice != null) && vm.newMailAccount">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="cpassword" ng-model="vm.mailAccount.cpassword" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="mailAccountForm[\'cpassword\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailAccount.description">\n <div ng-messages="mailAccountForm[\'description\'].$error" ng-show="mailAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMailAccount" ng-click="vm.saveMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid || mailAccountForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMailAccount" ng-click="vm.addNewMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILACCOUNT" translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n ADD MAILACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMailAccount" ng-click="vm.deleteMailAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/agent/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" required autofocus>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'agent\'].$error" ng-show="mailAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" required autofocus>\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'times\'].$error" ng-show="mailAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.TEXT">Text</label>\n <textarea aria-label="Text text" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.autoreply.text"></textarea>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/close/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus>\n <div ng-messages="mailAccountFormApp[\'disposition\'].$error" ng-show="mailAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus>\n <div ng-messages="mailAccountFormApp[\'condition\'].$error" ng-show="mailAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true">\n <div ng-messages="mailAccountFormApp[\'truepriority\'].$error" ng-show="mailAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true">\n <div ng-messages="mailAccountFormApp[\'falsepriority\'].$error" ng-show="mailAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus>\n <div ng-messages="mailAccountFormApp[\'priority\'].$error" ng-show="mailAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/noop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus>\n <div ng-messages="mailAccountFormApp[\'value\'].$error" ng-show="mailAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/queue/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" required autofocus>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'queue\'].$error" ng-show="mailAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/system/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus>\n <div ng-messages="mailAccountFormApp[\'command\'].$error" ng-show="mailAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable">\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables">{{ variable.name }}</md-option>\n <md-option ng-value="\'\'">None</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'variable\'].$error" ng-show="mailAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",'<md-dialog class="mailCannedAnswer-dialog" aria-label="New MailCannedAnswer">\n <form name="mailCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">Key</label>\n <input type="" name="key" ng-model="vm.mailCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n <div ng-messages="mailCannedAnswerForm[\'key\'].$error" ng-show="mailCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.VALUE">Value</label>\n <textarea name="value" ng-model="vm.mailCannedAnswer.value" required></textarea>\n\n <div ng-messages="mailCannedAnswerForm[\'value\'].$error" ng-show="mailCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="MAIL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailCannedAnswer.description">\n <div ng-messages="mailCannedAnswerForm[\'description\'].$error" ng-show="mailCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMailCannedAnswer" ng-click="vm.saveMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid || mailCannedAnswerForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE"\n translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMailCannedAnswer" ng-click="vm.addNewMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILCANNEDANSWER" translate-attr-aria-label="MAIL.ADD_MAILCANNEDANSWER">\n ADD MAILCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMailCannedAnswer" ng-click="vm.deleteMailCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/mailDispositions/dialog.html",'<md-dialog class="mailDisposition-dialog" aria-label="New MailDisposition">\n <form name="mailDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="" name="name" ng-model="vm.mailDisposition.name" ng-required="true" autofocus>\n <div ng-messages="mailDispositionForm[\'name\'].$error" ng-show="mailDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMailDisposition" ng-click="vm.saveMailDisposition()" class="send-button md-accent md-raised" ng-disabled="mailDispositionForm.$invalid || mailDispositionForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMailDisposition" ng-click="vm.addNewMailDisposition()" class="send-button md-accent md-raised" ng-disabled="mailDispositionForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILDISPOSITION" translate-attr-aria-label="MAIL.ADD_MAILDISPOSITION">\n ADD MAILDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMailDisposition" ng-click="vm.deleteMailDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/view.html",'<div id="mail-mailAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-mailAccounts-button md-icon-button" aria-label="Go to mailAccounts" ng-click="vm.gotoMailAccounts()" translate translate-attr-aria-label="MAIL.GO_TO_MAILACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="mailAccount-image" hide-xs>\n <img ng-src="assets/images/business/mailAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.mailAccount.id}}\n <span ng-if="vm.mailAccount.name">{{vm.mailAccount.name}}</span>\n <span ng-if="vm.mailAccount.exten">{{vm.mailAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.mailAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MAIL.GOTO_MAILACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMailAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (imapForm.$invalid) || (smtpForm.$invalid) || (mailDispositionsForm.$invalid) || (mailCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)"\n translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.EMAIL_ADDRESS">Email_Address</label>\n <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true">\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email_Address field is required</span>\n </div>\n <div ng-message="email">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email_Address must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.mailAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.active" aria-label="Active"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FONT_FAMILY">Font_Family</label>\n <ms-font-family name="fontFamily" ng-model="vm.mailAccount.fontFamily" required></ms-font-family>\n <div class="hint"><span translate="MAIL.HELP.FONT_FAMILY"></span></div>\n <div ng-messages="generalForm[\'fontFamily\'].$error" ng-show="generalForm[fontFamily].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FONT_FAMILY_REQUIRED">Font_Family field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FONT_SIZE">Font_Size</label>\n <input type="number" name="fontSize" ng-model="vm.mailAccount.fontSize" min="8" max="72" ng-required="true">\n <div class="hint"><span translate="MAIL.HELP.FONT_SIZE"></span></div>\n <div ng-messages="generalForm[\'fontSize\'].$error" ng-show="generalForm[\'fontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FONT_SIZE_REQUIRED">Font_Size field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>8</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>72</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.TEMPLATE">Template</label>\n <textarea aria-label="Template template" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.mailAccount.template"></textarea>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.markAsUnread" aria-label="mark_as_unread"><span translate="MAIL.MARK_AS_UNREAD">mark_as_unread</span></md-switch>\n <div class="hint"><span translate="MAIL.HELP.MARK_AS_UNREAD"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.mailAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="mailAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.notificationSound" aria-label="notificationSound"><span translate="MAIL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.notificationShake" aria-label="notificationShake"><span translate="MAIL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.mailAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.IMAP">IMAP</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailAccount-detail-form-container imap md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.IMAP">IMAP</div>\n </div>\n <form name="imapForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="Imap.service" ng-model="vm.mailAccount.Imap.service" required autofocus>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="imapForm[\'Imap.service\'].$error" ng-show="imapForm[\'Imap.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true">\n <div ng-messages="imapForm[\'Imap.host\'].$error" ng-show="imapForm[\'Imap.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_PORT">IMAP_Port</label>\n <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" ng-required="true">\n <div ng-messages="imapForm[\'Imap.port\'].$error" ng-show="imapForm[\'Imap.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.tls" aria-label="ssl"><span translate="MAIL.SSL">ssl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Imap.service == null" class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.authentication" aria-label="Authentication"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Imap.authentication == true || vm.mailAccount.Imap.service != null" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="Imap.user" ng-model="vm.mailAccount.Imap.user" ng-required="true">\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="imapForm[\'Imap.user\'].$error" ng-show="imapForm[\'Imap.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.mailAccount.Imap.authentication == true || vm.mailAccount.Imap.service != null">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="Imap.password" ng-model="vm.mailAccount.Imap.password" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="imapForm[\'Imap.password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="MAIL.MAILBOX">mailbox</label>\n <input type="text" name="Imap.mailbox" ng-model="vm.mailAccount.Imap.mailbox">\n <div ng-messages="imapForm[\'Imap.mailbox\'].$error" ng-show="imapForm[\'Imap.mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.MAILBOX_REQUIRED">mailbox field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.CONNTIMEOUT">connTimeout</label>\n <input type="number" name="Imap.connTimeout" ng-model="vm.mailAccount.Imap.connTimeout" min="1" ng-required="true">\n <div ng-messages="imapForm[\'Imap.connTimeout\'].$error" ng-show="imapForm[\'Imap.connTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_REQUIRED">connTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">connTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AUTHTIMEOUT">authTimeout</label>\n <input type="number" name="Imap.authTimeout" ng-model="vm.mailAccount.Imap.authTimeout" min="1" ng-required="true">\n <div ng-messages="imapForm[\'Imap.authTimeout\'].$error" ng-show="imapForm[\'Imap.authTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_REQUIRED">authTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">authTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SMTP">SMTP</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailAccount-detail-form-container smtp md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.SMTP">SMTP</div>\n </div>\n <form name="smtpForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="Smtp.service" ng-model="vm.mailAccount.Smtp.service" required autofocus>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="smtpForm[\'Smtp.service\'].$error" ng-show="smtpForm[\'Smtp.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true">\n <div ng-messages="smtpForm[\'Smtp.host\'].$error" ng-show="smtpForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" ng-required="true">\n <div ng-messages="smtpForm[\'Smtp.port\'].$error" ng-show="smtpForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.secure" aria-label="Secure"><span translate="MAIL.SECURE">Secure</span></md-switch>\n <div class="hint"><span translate="MAIL.HELP.SECURE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.authentication" aria-label="Authentication"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Smtp.authentication == true || vm.mailAccount.Smtp.service != null" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="Smtp.user" ng-model="vm.mailAccount.Smtp.user" ng-required="true">\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="smtpForm[\'Smtp.user\'].$error" ng-show="smtpForm[\'Smtp.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.mailAccount.Smtp.authentication == true || vm.mailAccount.Smtp.service != null">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="Smtp.pass" ng-model="vm.mailAccount.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="smtpForm[\'Smtp.pass\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailAccount-detail-form-container maildispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountMailDispositionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountMailDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.MAILDISPOSITIONS">MailDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditMailAccountMailDisposition($event)" aria-label="add mailDisposition" translate translate-attr-label="MAIL.ADD_MAILDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountMailDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountMailDispositions.length}} {{vm_dc.selectedMailAccountMailDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountMailDispositions" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountMailDispositions($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountMailDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountMailDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'MAIL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mailDisposition" md-select-id="id" ng-repeat="mailDisposition in vm_dc.mailAccountMailDispositions.rows">\n <td ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" md-cell>{{mailDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" md-cell>{{mailDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" md-cell>{{mailDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" translate="MAIL.EDIT_MAILDISPOSITION">\n Edit MailDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(mailDisposition, $event)" translate="MAIL.DELETE_MAILDISPOSITION">\n Delete MailDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountMailDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="MAIL.NO_MAILDISPOSITION_AVAILABLE">No maildisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.mailAccountMailDispositions.count}}" md-on-paginate="vm_dc.getMailAccountMailDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailAccount-detail-form-container mailcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountMailCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.mailAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountMailCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.MAILCANNEDANSWERS">MailCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event)" aria-label="add mailCannedAnswer" translate translate-attr-label="MAIL.ADD_MAILCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountMailCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountMailCannedAnswers.length}} {{vm_dc.selectedMailAccountMailCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountMailCannedAnswers" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountMailCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountMailCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountMailCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'MAIL.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'MAIL.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'MAIL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mailCannedAnswer" md-select-id="id" ng-repeat="mailCannedAnswer in vm_dc.mailAccountMailCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.value}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" translate="MAIL.EDIT_MAILCANNEDANSWER">\n Edit MailCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(mailCannedAnswer, $event)" translate="MAIL.DELETE_MAILCANNEDANSWER">\n Delete MailCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountMailCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="MAIL.NO_MAILCANNEDANSWER_AVAILABLE">No mailcannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.mailAccountMailCannedAnswers.count}}" md-on-paginate="vm_dc.getMailAccountMailCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.mailAccount)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="MAIL.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedMailAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedMailAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedMailAccountApps.length}} {{vm_ac.selectedMailAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedMailAccountApps($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedMailAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.mailAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editMailAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.mailAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getMailAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="MAIL.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountInteractions.length}} {{vm_dc.selectedMailAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountInteractions" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'MAIL.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'MAIL.CONTACT\' | translate }}</th>\n <th md-column>{{ \'MAIL.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'MAIL.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'MAIL.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'MAIL.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'MAIL.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.mailAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spymailInteraction($event, interaction)" translate="MAIL.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="MAIL.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="MAIL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.mailAccountInteractions.count}}" md-on-paginate="vm_dc.getMailAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/mailAccounts.html",'<div id="mailAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILACCOUNTS">MailAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailAccounts-count">\n <span>{{vm.selectedMailAccounts.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAILACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailAccounts()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailAccounts()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailAccounts" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedMailAccounts($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- MAILACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'MAIL.KEY\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'MAIL.EMAIL_ADDRESS\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MAIL.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailAccount" md-select-id="id" ng-repeat="mailAccount in vm.mailAccounts.rows">\n <td md-cell ng-if="mailAccount.userpic"><img class="avatar" alt="{{mailAccount.name}}" ng-src="api/users/{{mailAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!mailAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMailAccount($event, mailAccount)" md-cell class="id ">{{mailAccount.id}}</td>\n <td ng-click="vm.createOrEditMailAccount($event, mailAccount)" md-cell class="name ">{{mailAccount.name}}</td>\n <td ng-click="vm.createOrEditMailAccount($event, mailAccount)" md-cell class="key ">{{mailAccount.key}}</td>\n <td ng-click="vm.createOrEditMailAccount($event, mailAccount)" md-cell class="email ">{{mailAccount.email}}</td>\n <td ng-click="vm.createOrEditMailAccount($event, mailAccount)" md-cell class="active ">\n <md-icon md-colors="{color: {{mailAccount.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{mailAccount.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditMailAccount($event, mailAccount)" md-cell class="description ">{{mailAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(mailAccount, $event)" translate="MAIL.EDIT_MAILACCOUNT">\n Edit MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.verifysmtpverifysmtp(mailAccount, $event)" translate="MAIL.VERIFYSMTP_MAILACCOUNT">\n verifysmtp MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(mailAccount, $event)" translate="MAIL.INTERACTIONS_MAILACCOUNT">\n Interactions MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(mailAccount, $event)" translate="MAIL.GOTOREALTIME_MAILACCOUNT">\n goToRealtime MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(mailAccount, $event)" translate="MAIL.DELETE_MAILACCOUNT">\n Delete MailAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.mailAccounts.count}}" md-on-paginate="vm.getMailAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-mailAccount-button" ng-click="vm.createOrEditMailAccount($event)" aria-label="add mailAccount" translate translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailQueues/create/dialog.html",'<md-dialog class="mailQueue-dialog" aria-label="New MailQueue">\n <form name="mailQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newMailQueue">\n <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n <div ng-messages="mailQueueForm[\'name\'].$error" ng-show="mailQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.mailQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="mailQueueForm[\'strategy\'].$error" ng-show="mailQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="mailQueueForm[\'timeout\'].$error" ng-show="mailQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailQueue.description">\n <div ng-messages="mailQueueForm[\'description\'].$error" ng-show="mailQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMailQueue" ng-click="vm.saveMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid || mailQueueForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMailQueue" ng-click="vm.addNewMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILQUEUE" translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n ADD MAILQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMailQueue" ng-click="vm.deleteMailQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue">\n <form name="mailQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.AGENTADD_MAILQUEUE">Add Agent to mailQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue">\n <form name="mailQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.TEAMADD_MAILQUEUE">Add Team in MAILQUEUE</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/view.html",'<div id="mail-mailQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-mailQueues-button md-icon-button" aria-label="Go to mailQueues" ng-click="vm.gotoMailQueues()" translate translate-attr-aria-label="MAIL.GO_TO_MAILQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="mailQueue-image" hide-xs>\n <img ng-src="assets/images/business/mailQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.mailQueue.id}}\n <span ng-if="vm.mailQueue.name">{{vm.mailQueue.name}}</span>\n <span ng-if="vm.mailQueue.exten">{{vm.mailQueue.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.mailQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="MAIL.TEAMADD_MAILQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.mailQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MAIL.AGENTADD_MAILQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMailQueue()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="mailQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.mailQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailQueue.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/mail/views/mailQueues/mailQueues.html",'<div id="mailQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILQUEUES">MailQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailQueues-count">\n <span>{{vm.selectedMailQueues.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAILQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailQueues()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailQueues()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailQueues" csv-label="true" filename="mailQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedMailQueues($event)" aria-label="delete selected" translate translate-attr-label="MAILQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- MAILQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'MAIL.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailQueue" md-select-id="id" ng-repeat="mailQueue in vm.mailQueues.rows">\n <td md-cell ng-if="mailQueue.userpic"><img class="avatar" alt="{{mailQueue.name}}" ng-src="api/users/{{mailQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!mailQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMailQueue($event, mailQueue)" md-cell class="id ">{{mailQueue.id}}</td>\n <td ng-click="vm.createOrEditMailQueue($event, mailQueue)" md-cell class="name ">{{mailQueue.name}}</td>\n <td ng-click="vm.createOrEditMailQueue($event, mailQueue)" md-cell class="strategy ">{{ vm.arraystrategy[mailQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(mailQueue, $event)" translate="MAIL.EDIT_MAILQUEUE">\n Edit MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(mailQueue, $event)" translate="MAIL.TEAMADD_MAILQUEUE">\n teamadd MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(mailQueue, $event)" translate="MAIL.AGENTADD_MAILQUEUE">\n agentadd MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(mailQueue, $event)" translate="MAIL.DELETE_MAILQUEUE">\n Delete MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(mailQueue, $event)" translate="MAIL.GOTOREALTIME_MAILQUEUE">\n goToRealtime MailQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.mailQueues.count}}" md-on-paginate="vm.getMailQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILQUEUE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-mailQueue-button" ng-click="vm.createOrEditMailQueue($event)" aria-label="add mailQueue" translate translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailSubtatuses/create/dialog.html",'<md-dialog class="mailSubstatus-dialog" aria-label="New MailSubstatus">\n <form name="mailSubstatusForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailSubstatus.name" ng-required="true" autofocus>\n <div ng-messages="mailSubstatusForm[\'name\'].$error" ng-show="mailSubstatusForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailSubstatus.description">\n <div ng-messages="mailSubstatusForm[\'description\'].$error" ng-show="mailSubstatusForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMailSubstatus" ng-click="vm.saveMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid || mailSubstatusForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMailSubstatus" ng-click="vm.addNewMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILSUBSTATUS" translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n ADD MAILSUBSTATUS\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMailSubstatus" ng-click="vm.deleteMailSubstatus($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",'<div id="mailSubtatuses" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILSUBSTATUSES">MailSubstatuses</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailSubstatuses.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailSubstatuses =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailSubtatuses-count">\n <span>{{vm.selectedMailSubstatuses.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAILSUBSTATUSES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailSubstatuses()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailSubstatuses()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailSubstatuses" csv-label="true" filename="mailSubtatuses.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedMailSubstatuses($event)" aria-label="delete selected" translate translate-attr-label="MAILSUBSTATUSES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- MAILSUBSTATUS TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailSubstatuses" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailSubstatuses">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailSubtatuses.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailSubstatus" md-select-id="id" ng-repeat="mailSubstatus in vm.mailSubtatuses.rows">\n <td md-cell ng-if="mailSubstatus.userpic"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="api/users/{{mailSubstatus.id}}/avatar" /></td>\n <td md-cell ng-if="!mailSubstatus.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="id ">{{mailSubstatus.id}}</td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="name ">{{mailSubstatus.name}}</td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="description ">{{mailSubstatus.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(mailSubstatus, $event)" translate="MAIL.EDIT_MAILSUBSTATUS">\n Edit MailSubstatus\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(mailSubstatus, $event)" translate="MAIL.DELETE_MAILSUBSTATUS">\n Delete MailSubstatus\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.mailSubtatuses.count}}" md-on-paginate="vm.getMailSubstatuses" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILSUBSTATUS TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILSUBSTATUS BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-mailSubstatus-button" ng-click="vm.createOrEditMailSubstatus($event)" aria-label="add mailSubstatus" translate translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILSUBSTATUS BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.ACCOUNTS">Accounts</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column>{{ \'MAIL.KEY\' | translate }}</th>\n <th md-column>{{ \'MAIL.TOTAL\' | translate }}</th>\n <th md-column>{{ \'MAIL.IN\' | translate }}</th>\n <th md-column>{{ \'MAIL.OUT\' | translate }}</th>\n <th md-column>{{ \'MAIL.IMAP_STATUS\' | translate }}</th>\n <th md-column>{{ \'MAIL.SMTP_STATUS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailAccounts">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.mailAccounts[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.mailAccounts[value].name}}</td>\n <td md-cell>{{vm.mailAccounts[value].key}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(vm.mailAccounts[value].in || 0) + (vm.mailAccounts[value].out || 0)}}</span>\n </td>\n <td md-cell>\n <div layout="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">{{vm.mailAccounts[value].in || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.in">{{vm.mailAccounts[value].lastIn ? (vm.mailAccounts[value].lastIn | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">{{vm.mailAccounts[value].out || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.out">{{vm.mailAccounts[value].lastOut ? (vm.mailAccounts[value].lastOut | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column" layout-align="center center">\n <md-button class="md-icon-button" aria-label="Status">\n <md-tooltip>{{vm.mailAccounts[value].Imap.messageStatus}}</md-tooltip>\n <div ng-switch="vm.mailAccounts[value].Imap.status">\n <md-icon ng-switch-when="error" md-font-icon="icon-alert yellow-fg"></md-icon>\n <md-icon ng-switch-when="disabled" md-font-icon="icon-close grey-fg"></md-icon>\n <md-icon ng-switch-default md-font-icon="icon-checkbox-marked-circle-outline green-fg"></md-icon>\n </div>\n </md-button>\n <span class="md-caption grey-fg">{{ (\'MAIL.\' + vm.mailAccounts[value].Imap.status.toUpperCase()) | translate}}</span>\n </div>\n <span class="text-boxed" ng-if="vm.mailAccounts[value].active">{{vm.mailAccounts[value].Imap.lastSync | date: \'shortTime\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row" layout-align="start center" ng-if="vm.mailAccounts[value].Smtp.status">\n <div layout="column" layout-align="center center">\n <md-button class="md-icon-button" aria-label="Status">\n <md-tooltip>{{vm.mailAccounts[value].Smtp.messageStatus}}</md-tooltip>\n <md-icon md-font-icon="{{ vm.mailAccounts[value].Smtp.status == \'error\' ? \'icon-alert yellow-fg\' : \'icon-checkbox-marked-circle-outline green-fg\'}}"></md-icon>\n </md-button>\n <span class="md-caption grey-fg">{{ (\'MAIL.\' + vm.mailAccounts[value].Smtp.status.toUpperCase()) | translate}}</span>\n </div>\n <span class="text-boxed">{{vm.mailAccounts[value].Smtp.lastSync | date: \'shortTime\'}}</span>\n </div>\n <span class="md-caption grey-fg" ng-if="!vm.mailAccounts[value].Smtp.status">{{ \'MAIL.NEVER_VERIFIED\' | translate }}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToMailAccount($event, vm.mailAccounts[value])" translate="MAIL.EDIT_ACCOUNT">\n Edit Account\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.verifySmtp($event, vm.mailAccounts[value])" translate="MAIL.VERIFY_SMTP">\n Verify Smtp\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.count}}" md-on-paginate="vm.getmailAccounts" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/mail/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'MAIL.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'MAIL.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'MAIL.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'MAIL.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'MAIL.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="3">{{ \'MAIL.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n \x3c!-- <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSE\' | translate }}</th>\n <th md-column width="10px"></th> --\x3e\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'MAIL.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'MAIL.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatusTime">{{ \'MAIL.TIMER\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'MAIL.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'busy\':\'indigo-100-bg\',\'*pause\':\'amber-50-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].globalStatus]">{{ vm.isPause(vm.agents[value].globalStatus) ? \'\' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? \'*\'+vm.agents[value].pauseType || \'DEFAULT PAUSE\' : vm.agents[value].pauseType || \'DEFAULT PAUSE\') : \'\'}}</span>\n </td>\n <td class="bt custom-column">\n <timer start-time="vm.agents[value].globalStatusTime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class="bt bl">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'talking\':\'indigo-100-bg\',\'ringing\':\'orange-400-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt bl">\n <div layout="column">\n <span ng-if="vm.agents[value].queue" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].queue }}</span>\n <span ng-if="vm.agents[value].destconnectedlinenum" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class="padding-5" ng-if="vm.agents[value].queue || vm.agents[value].destconnectedlinenum">\n <timer start-time="vm.agents[value].voiceStatusTime" interval="1000" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n \x3c!-- <td class="bt">--</td>\n <td class="bt">--</td> --\x3e\n <td class="bt bl" ng-if="vm.license.chat">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n \x3c!-- <td class="bt padding-5 text-center">{{ agent.chatCurrentCapacity }}/{{ agent.chatCapacity > 0 ? agent.chatCapacity : \'∞\' }}</td> --\x3e\n <td md-number class="bt text-center font-size-20" ng-if="vm.license.chat" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.mail">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.mail" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.messaging">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.messaging" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.openchannel">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">4</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">89</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.openchannel" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.fax">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">7</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">2</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.fax" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class="bl bt padding-5 text-center">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.logout(vm.agents[value], $event)" translate="MAIL.LOGOUT">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.queueAdd(vm.agents[value], $event)" translate="MAIL.AGENTADD_QUEUE">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="MAIL.PAUSE">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=" vm.agents[value].voicePause && \'DEFAULT PAUSE\' === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value])"><em translate="MAIL.DEFAULT_PAUSE">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.pauses.rows.length" ng-repeat="pause in vm.pauses.rows">\n <md-button ng-disabled="vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value], pause.name)">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="vm.isPause(vm.agents[value].globalStatus)">\n <md-button ng-click="vm.unPause(vm.agents[value])" translate="MAIL.UNPAUSE">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.filteredAgents.length}}" md-on-paginate="vm.onInit" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/mail/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column>{{ \'MAIL.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'MAIL.PAUSED\' | translate }}</th>\n <th md-column>{{ \'MAIL.READY\' | translate }}</th>\n <th md-column>{{ \'MAIL.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditMailQueue($event, vm.queues[value])" translate="MAIL.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="MAIL.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/mail/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ACCOUNTS">Accounts</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",'<md-dialog class="ivrCampaign-dialog" aria-label="New IvrCampaign">\n <form name="ivrCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newIvrCampaign">\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="ivrCampaignForm[\'name\'].$error" ng-show="ivrCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'TrunkId\'].$error" ng-show="ivrCampaignForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'IntervalId\'].$error" ng-show="ivrCampaignForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }}</md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }}</md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="ivrCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" required>\n <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects">{{ SquareProjectId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'SquareProjectId\'].$error" ng-show="ivrCampaignForm[\'SquareProjectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n <div ng-messages="ivrCampaignForm[\'limitCalls\'].$error" ng-show="ivrCampaignForm[\'limitCalls\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.ivrCampaign.description">\n <div ng-messages="ivrCampaignForm[\'description\'].$error" ng-show="ivrCampaignForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newIvrCampaign" ng-click="vm.saveIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid || ivrCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newIvrCampaign" ng-click="vm.addNewIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_IVRCAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n ADD IVRCAMPAIGN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newIvrCampaign" ng-click="vm.deleteIvrCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign">\n <form name="ivrCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n <md-select name="priority" ng-model="vm.hopper.priority">\n <md-option ng-value="\'4\'">Highest</md-option>\n <md-option ng-value="\'3\'">High</md-option>\n <md-option ng-value="\'2\'">Medium</md-option>\n <md-option ng-value="\'1\'">Low</md-option>\n <md-option ng-value="\'0\'">Lowest</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign">\n <form name="ivrCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-hide="vm.loading">\n <div layout="row" layout-wrap flex>\n <div flex-xs flex="50">\n <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n </md-checkbox>\n </div>\n <div flex-xs flex="50">\n </div>\n <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n {{ item.name | limitTo:40 }}\n </md-checkbox>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n <div>\n </div>\n <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n SAVE\n </md-button>\n </md-dialog-actions>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",'<div id="motiondialer-ivrCampaign" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-ivrCampaigns-button md-icon-button" aria-label="Go to ivrCampaigns" ng-click="vm.gotoIvrCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_IVRCAMPAIGNS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="ivrCampaign-image" hide-xs>\n <img ng-src="assets/images/business/ivrCampaigns.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.ivrCampaign.id}}\n <span ng-if="vm.ivrCampaign.name">{{vm.ivrCampaign.name}}</span>\n <span ng-if="vm.ivrCampaign.exten">{{vm.ivrCampaign.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.ivrCampaign.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.listadddialog(vm.ivrCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n <md-tooltip><span translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.blacklistadddialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-block-helper"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.resetlistdialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n <md-tooltip><span translate="MOTIONDIALER.RESETLIST_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-restore"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MOTIONDIALER.GOTO_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (advancedForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)"\n translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n <md-select name="TrunkBackupId" ng-model="vm.ivrCampaign.TrunkBackupId">\n <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks">{{ TrunkBackupId.name }}</md-option>\n <md-option ng-value="null">None</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }}</md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }}</md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.ivrCampaign.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n </div>\n <form name="campaignForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" required autofocus>\n <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects">{{ SquareProjectId.name }}</md-option>\n </md-select>\n <div ng-messages="campaignForm[\'SquareProjectId\'].$error" ng-show="campaignForm[\'SquareProjectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n <div ng-messages="campaignForm[\'limitCalls\'].$error" ng-show="campaignForm[\'limitCalls\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n </div>\n <form name="originateForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n <input type="text" name="dialOriginateCallerIdName" ng-model="vm.ivrCampaign.dialOriginateCallerIdName" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.ivrCampaign.dialOriginateCallerIdNumber">\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n <input type="number" name="dialOriginateTimeout" ng-model="vm.ivrCampaign.dialOriginateTimeout" min="1" max="999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.ivrCampaign.dialPrefix" ng-pattern="/^\\d+$/">\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n <input type="number" name="dialGlobalMaxRetry" ng-model="vm.ivrCampaign.dialGlobalMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n </div>\n <form name="congestionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n <input type="number" name="dialCongestionMaxRetry" ng-model="vm.ivrCampaign.dialCongestionMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.ivrCampaign.dialCongestionRetryFrequency" min="1" max="99999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n </div>\n <form name="busyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n <input type="number" name="dialBusyMaxRetry" ng-model="vm.ivrCampaign.dialBusyMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n <input type="number" name="dialBusyRetryFrequency" ng-model="vm.ivrCampaign.dialBusyRetryFrequency" min="1" max="99999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n </div>\n <form name="noanswerForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.ivrCampaign.dialNoAnswerMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.ivrCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.ivrCampaign.dialOrderByScheduledAt" autofocus>\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }}</md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n </div>\n <form name="globalintervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n <input type="text" name="dialGlobalInterval" ng-model="vm.ivrCampaign.dialGlobalInterval" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n </div>\n <form name="timezoneForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.ivrCampaign.dialTimezone" autofocus>\n < <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span></div>\n <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n </div>\n <form name="amdForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.dialAMDActive" aria-label="AMDActive"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n <input type="number" name="dialAMDInitialSilence" ng-model="vm.ivrCampaign.dialAMDInitialSilence" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n <input type="number" name="dialAMDGreeting" ng-model="vm.ivrCampaign.dialAMDGreeting" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.ivrCampaign.dialAMDAfterGreetingSilence" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.ivrCampaign.dialAMDTotalAnalysisTime" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n <input type="number" name="dialAMDMinWordLength" ng-model="vm.ivrCampaign.dialAMDMinWordLength" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.ivrCampaign.dialAMDBetweenWordsSilence" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.ivrCampaign.dialAMDMaximumNumberOfWords" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.ivrCampaign.dialAMDSilenceThreshold" min="0" max="32767">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.ivrCampaign.dialAMDMaximumWordLength" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.ivrCampaign)">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_hs.init(vm.ivrCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n </div>\n\n </div>\n <div class="ivrCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHoppers.length}} {{vm_dc.selectedIvrCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHoppers" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedIvrCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="IVRCAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHoppers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHoppers">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.ivrCampaignHoppers.rows">\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.ContactId}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.phone}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.countcongestionretry}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.countbusyretry}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.countnoanswerretry}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{ vm_dc.arraypriority[hopper.priority].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHoppers.rows.length">\n <td md-cell colspan="10">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHoppers.count}}" md-on-paginate="vm_dc.getIvrCampaignHoppers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperHistories.length}} {{vm_dc.selectedIvrCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperHistories" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperHistories" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.ivrCampaignHopperHistories.rows">\n <td md-cell>{{hopperHistory.uniqueid}}</td>\n <td md-cell>{{hopperHistory.ContactId}}</td>\n <td md-cell>{{hopperHistory.calleridnum}}</td>\n <td md-cell>{{hopperHistory.calleridname}}</td>\n <td md-cell>{{hopperHistory.statedesc}}</td>\n <td md-cell>{{hopperHistory.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.endtime | date:\'medium\'}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperHistories.rows.length">\n <td md-cell colspan="11">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperHistories" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.FINAL">FINAL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsIvrCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n <md-icon md-font-icon="icon-backup-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(3)">\n <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(5)">\n <span translate="MOTIONDIALER.BUSY ">Busy</span>\n <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(8)">\n <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(10)">\n <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(11)">\n <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(22)">\n <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(0)">\n <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperFinals.length}} {{vm_dc.selectedIvrCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperFinals" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-click="vm_dc.moveSelectedIvrCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="IVRCAMPAIGNS.MOVE_SELECTED">\n <md-icon md-font-icon="icon-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperFinals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'MOTIONDIALER.DISPOSITION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.ivrCampaignHopperFinals.rows">\n <td md-cell>{{hopperFinal.uniqueid}}</td>\n <td md-cell>{{hopperFinal.ContactId}}</td>\n <td md-cell>{{hopperFinal.calleridnum}}</td>\n <td md-cell>{{hopperFinal.calleridname}}</td>\n <td md-cell>{{hopperFinal.statedesc}}</td>\n <td md-cell>{{hopperFinal.countcongestionretry}}</td>\n <td md-cell>{{hopperFinal.countbusyretry}}</td>\n <td md-cell>{{hopperFinal.countnoanswerretry}}</td>\n <td md-cell>{{hopperFinal.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.endtime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.disposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n Move HopperFinal\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperFinals.rows.length">\n <td md-cell colspan="23">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperFinals" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperBlacks.length}} {{vm_dc.selectedIvrCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperBlacks" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperBlacks" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperBlacks">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.ivrCampaignHopperBlacks.rows">\n <td md-cell>{{hopperBlack.ContactId}}</td>\n <td md-cell>{{hopperBlack.phone}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperBlacks.rows.length">\n <td md-cell colspan="4">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperBlacks" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n</div>\n\x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",'<div id="ivrCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MOTIONDIALER.IVRCAMPAIGNS">IvrCampaigns</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedIvrCampaigns.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedIvrCampaigns =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MOTIONDIALER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-ivrCampaigns-count">\n <span>{{vm.selectedIvrCampaigns.length}}</span>\n <span translate="MOTIONDIALER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="IVRCAMPAIGNS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllIvrCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectIvrCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedIvrCampaigns" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedIvrCampaigns($event)" aria-label="delete selected" translate translate-attr-label="IVRCAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- IVRCAMPAIGN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedIvrCampaigns" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIvrCampaigns">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="SquareProjectId">{{ \'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.ivrCampaigns.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="ivrCampaign" md-select-id="id" ng-repeat="ivrCampaign in vm.ivrCampaigns.rows">\n <td md-cell ng-if="ivrCampaign.userpic"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="api/users/{{ivrCampaign.id}}/avatar" /></td>\n <td md-cell ng-if="!ivrCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="id ">{{ivrCampaign.id}}</td>\n <td ng-click="vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="name ">{{ivrCampaign.name}}</td>\n <td ng-click="vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="active ">\n <md-icon md-colors="{color: {{ivrCampaign.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{ivrCampaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="TrunkId ">{{ TrunkId = vm.trunks[ivrCampaign.TrunkId]; TrunkId.name }}</td>\n <td ng-click="vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="SquareProjectId ">{{ SquareProjectId = vm.projects[ivrCampaign.SquareProjectId]; SquareProjectId.name }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(ivrCampaign, $event)" translate="MOTIONDIALER.EDIT_IVRCAMPAIGN">\n Edit IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.listadddialog(ivrCampaign, $event)" translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">\n listadd IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.blacklistadddialog(ivrCampaign, $event)" translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">\n blacklistadd IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(ivrCampaign, $event)" translate="MOTIONDIALER.DELETE_IVRCAMPAIGN">\n Delete IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(ivrCampaign, $event)" translate="MOTIONDIALER.GOTOREALTIME_IVRCAMPAIGN">\n goToRealtime IvrCampaign\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.ivrCampaigns.count}}" md-on-paginate="vm.getIvrCampaigns" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / IVRCAMPAIGN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD IVRCAMPAIGN BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-ivrCampaign-button" ng-click="vm.createOrEditIvrCampaign($event)" aria-label="add ivrCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD IVRCAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",'<md-dialog class="queueCampaign-dialog" aria-label="New QueueCampaign">\n <form name="queueCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newQueueCampaign">\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="queueCampaignForm[\'name\'].$error" ng-show="queueCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'TrunkId\'].$error" ng-show="queueCampaignForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'IntervalId\'].$error" ng-show="queueCampaignForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }}</md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }}</md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }}</md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="queueCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.METHOD">Method</label>\n <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" required>\n <md-option ng-value="\'progressive\'">Progressive</md-option>\n <md-option ng-value="\'power\'">PowerDialing</md-option>\n <md-option ng-value="\'predictive\'">Predictive</md-option>\n <md-option ng-value="\'preview\'">Preview</md-option>\n <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n <div ng-messages="queueCampaignForm[\'dialMethod\'].$error" ng-show="queueCampaignForm[\'dialMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization">\n\n <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }}</md-option>\n\n <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n <div ng-messages="queueCampaignForm[\'dialPredictiveOptimization\'].$error" ng-show="queueCampaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n <div ng-messages="queueCampaignForm[\'dialLimitQueue\'].$error" ng-show="queueCampaignForm[\'dialLimitQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n <div ng-messages="queueCampaignForm[\'dialQueueTimeout\'].$error" ng-show="queueCampaignForm[\'dialQueueTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n <div ng-messages="queueCampaignForm[\'timeout\'].$error" ng-show="queueCampaignForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.queueCampaign.description">\n <div ng-messages="queueCampaignForm[\'description\'].$error" ng-show="queueCampaignForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newQueueCampaign" ng-click="vm.saveQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid || queueCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newQueueCampaign" ng-click="vm.addNewQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_QUEUECAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n ADD QUEUECAMPAIGN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newQueueCampaign" ng-click="vm.deleteQueueCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">Add Agent to queueCampaign</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n <md-select name="priority" ng-model="vm.hopper.priority">\n <md-option ng-value="\'4\'">Highest</md-option>\n <md-option ng-value="\'3\'">High</md-option>\n <md-option ng-value="\'2\'">Medium</md-option>\n <md-option ng-value="\'1\'">Low</md-option>\n <md-option ng-value="\'0\'">Lowest</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.hopper.recallme" aria-label="RecallAgent"><span translate="MOTIONDIALER.RECALLAGENT">RecallAgent</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.hopper.recallme" class="md-block">\n <label translate="MOTIONDIALER.AGENT">Agent</label>\n <md-select name="UserId" ng-model="vm.hopper.UserId" required>\n <md-option ng-value="UserId.id" ng-repeat="UserId in vm.agents">{{ UserId.name }}</md-option>\n </md-select>\n <div ng-messages="hopperForm[\'UserId\'].$error" ng-show="hopperForm[\'UserId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-hide="vm.loading">\n <div layout="row" layout-wrap flex>\n <div flex-xs flex="50">\n <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n </md-checkbox>\n </div>\n <div flex-xs flex="50">\n </div>\n <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n {{ item.name | limitTo:40 }}\n </md-checkbox>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n <div>\n </div>\n <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n SAVE\n </md-button>\n </md-dialog-actions>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN">Add Team in QUEUECAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",'<div id="motiondialer-queueCampaign" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-queueCampaigns-button md-icon-button" aria-label="Go to queueCampaigns" ng-click="vm.gotoQueueCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_QUEUECAMPAIGNS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="queueCampaign-image" hide-xs>\n <img ng-src="assets/images/business/queueCampaigns.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.queueCampaign.id}}\n <span ng-if="vm.queueCampaign.name">{{vm.queueCampaign.name}}</span>\n <span ng-if="vm.queueCampaign.exten">{{vm.queueCampaign.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.queueCampaign.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.listadddialog(vm.queueCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n <md-tooltip><span translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.blacklistadddialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-block-helper"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.queueCampaign, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.queueCampaign, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.resetlistdialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n <md-tooltip><span translate="MOTIONDIALER.RESETLIST_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-restore"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MOTIONDIALER.GOTO_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (queueForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (advancedForm.$invalid) || (advancedpreviewForm.$invalid) || (recallmeForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)"\n translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="queueCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n <md-select name="TrunkBackupId" ng-model="vm.queueCampaign.TrunkBackupId">\n <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks">{{ TrunkBackupId.name }}</md-option>\n <md-option ng-value="null">None</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }}</md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }}</md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.queueCampaign.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="queueCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n </div>\n <form name="campaignForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.METHOD">Method</label>\n <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" required autofocus>\n <md-option ng-value="\'progressive\'">Progressive</md-option>\n <md-option ng-value="\'power\'">PowerDialing</md-option>\n <md-option ng-value="\'predictive\'">Predictive</md-option>\n <md-option ng-value="\'preview\'">Preview</md-option>\n <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n <div ng-messages="campaignForm[\'dialMethod\'].$error" ng-show="campaignForm[\'dialMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization">\n\n <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }}</md-option>\n\n <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n <div ng-messages="campaignForm[\'dialPredictiveOptimization\'].$error" ng-show="campaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n <div ng-messages="campaignForm[\'dialLimitQueue\'].$error" ng-show="campaignForm[\'dialLimitQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n <div ng-messages="campaignForm[\'timeout\'].$error" ng-show="campaignForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container queue md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.QUEUE">QUEUE</div>\n </div>\n <form name="queueForm" novalidate>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUEOPTIONS">QueueOptions</label>\n <input type="text" name="dialQueueOptions" ng-model="vm.queueCampaign.dialQueueOptions" autofocus>\n <div ng-messages="queueForm[\'dialQueueOptions\'].$error" ng-show="queueForm[\'dialQueueOptions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUEOPTIONS_REQUIRED">QueueOptions field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n <div ng-messages="queueForm[\'dialQueueTimeout\'].$error" ng-show="queueForm[\'dialQueueTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'booked\' || vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.queueCampaign.strategy" required>\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'roundrobin\'" ng-if="vm.queueCampaign.dialMethod === \'booked\'">Round Robin</md-option>\n <md-option ng-value="\'leastrecent\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Random</md-option>\n <md-option ng-value="\'linear\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="queueForm[\'strategy\'].$error" ng-show="queueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.RETRY">Retry</label>\n <input type="number" name="retry" ng-model="vm.queueCampaign.retry" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.RETRY"></span></div>\n <div ng-messages="queueForm[\'retry\'].$error" ng-show="queueForm[\'retry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.WRAPUPTIME">WrapupTime</label>\n <input type="number" name="wrapuptime" ng-model="vm.queueCampaign.wrapuptime" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.WRAPUPTIME"></span></div>\n <div ng-messages="queueForm[\'wrapuptime\'].$error" ng-show="queueForm[\'wrapuptime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.WEIGHT">Weight</label>\n <input type="number" name="weight" ng-model="vm.queueCampaign.weight" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.WEIGHT"></span></div>\n <div ng-messages="queueForm[\'weight\'].$error" ng-show="queueForm[\'weight\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.MUSICONHOLD">MusicOnHold</label>\n <md-select name="musiconhold" ng-model="vm.queueCampaign.musiconhold">\n <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds">{{ musiconhold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MUSICONHOLD"></span></div>\n <div ng-messages="queueForm[\'musiconhold\'].$error" ng-show="queueForm[\'musiconhold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject">\n <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects">{{ dialQueueProject.name }}</md-option>\n <md-option ng-value="null">None</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT2">CallySquareProject2</label>\n <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2">\n <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects">{{ dialQueueProject2.name }}</md-option>\n <md-option ng-value="null">None</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT2"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT2_REQUIRED">CallySquareProject2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW">CallySquareProjectPreview</label>\n <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject">\n <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects">{{ dialQueueProject.name }}</md-option>\n <md-option ng-value="null">None</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW_REQUIRED">CallySquareProjectPreview field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW2">CallySquareProjectPreview2</label>\n <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2">\n <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects">{{ dialQueueProject2.name }}</md-option>\n <md-option ng-value="null">None</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW2"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW2_REQUIRED">CallySquareProjectPreview2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialQueueProject2 && (vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\')" class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialAgiAfterHangupAgent" aria-label="RunIfHangupAgent"><span translate="MOTIONDIALER.RUNIFHANGUPAGENT">RunIfHangupAgent</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.RUNIFHANGUPAGENT"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n </div>\n <form name="originateForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n <input type="text" name="dialOriginateCallerIdName" ng-model="vm.queueCampaign.dialOriginateCallerIdName" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.queueCampaign.dialOriginateCallerIdNumber">\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n <input type="number" name="dialOriginateTimeout" ng-model="vm.queueCampaign.dialOriginateTimeout" min="1" max="999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.queueCampaign.dialPrefix" ng-pattern="/^\\d+$/">\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="queueCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n <input type="number" name="dialGlobalMaxRetry" ng-model="vm.queueCampaign.dialGlobalMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n </div>\n <form name="congestionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n <input type="number" name="dialCongestionMaxRetry" ng-model="vm.queueCampaign.dialCongestionMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.queueCampaign.dialCongestionRetryFrequency" min="1" max="99999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n </div>\n <form name="busyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n <input type="number" name="dialBusyMaxRetry" ng-model="vm.queueCampaign.dialBusyMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n <input type="number" name="dialBusyRetryFrequency" ng-model="vm.queueCampaign.dialBusyRetryFrequency" min="1" max="99999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n </div>\n <form name="noanswerForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.queueCampaign.dialNoAnswerMaxRetry" min="1" max="999" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.queueCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.acw" aria-label="AfterCallWork"><span translate="MOTIONDIALER.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.acw" class="md-block">\n <label translate="MOTIONDIALER.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.queueCampaign.acwTimeout" min="0" ng-required="true">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AUTOPAUSE">AutoPause</label>\n <md-select name="autopause" ng-model="vm.queueCampaign.autopause">\n\n <md-option ng-value="\'all\'"> {{ \'MOTIONDIALER.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AUTOPAUSE"></span></div>\n <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.RINGINUSE">RingInUse</label>\n <md-select name="ringinuse" ng-model="vm.queueCampaign.ringinuse">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.RINGINUSE"></span></div>\n <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MEMBERDELAY">MemberDelay</label>\n <input type="number" name="memberdelay" ng-model="vm.queueCampaign.memberdelay" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.MEMBERDELAY"></span></div>\n <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEOUTRESTART">TimeoutRestart</label>\n <md-select name="timeoutrestart" ng-model="vm.queueCampaign.timeoutrestart">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEOUTRESTART"></span></div>\n <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONTEXT">Context</label>\n <input type="text" name="context" ng-model="vm.queueCampaign.context">\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONTEXT"></span></div>\n <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n <md-select name="setinterfacevar" ng-model="vm.queueCampaign.setinterfacevar">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETINTERFACEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETQUEUEVARIABLES">SetQueueVariables</label>\n <md-select name="setqueuevar" ng-model="vm.queueCampaign.setqueuevar">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n <md-select name="setqueueentryvar" ng-model="vm.queueCampaign.setqueueentryvar">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }}</md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="queueCampaign-detail-form-container advancedpreview md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCEDPREVIEW">ADVANCEDPREVIEW</div>\n </div>\n <form name="advancedpreviewForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format" autofocus>\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedpreviewForm[\'monitor_format\'].$error" ng-show="advancedpreviewForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }}</md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedpreviewForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedpreviewForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container recallme md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.RECALLME">RECALLME</div>\n </div>\n <form name="recallmeForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALRECALLMETIMEOUT">DialRecallMeTimeout</label>\n <input type="number" name="dialRecallMeTimeout" ng-model="vm.queueCampaign.dialRecallMeTimeout" min="1" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLMETIMEOUT"></span></div>\n <div ng-messages="recallmeForm[\'dialRecallMeTimeout\'].$error" ng-show="recallmeForm[\'dialRecallMeTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_REQUIRED">DialRecallMeTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DialRecallMeTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialRecallInQueue" aria-label="DialRecallInQueue"><span translate="MOTIONDIALER.DIALRECALLINQUEUE">DialRecallInQueue</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLINQUEUE"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n </div>\n <form name="globalintervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n <input type="text" name="dialGlobalInterval" ng-model="vm.queueCampaign.dialGlobalInterval" ng-required="true" autofocus>\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n </div>\n <form name="timezoneForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.queueCampaign.dialTimezone" autofocus>\n < <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span></div>\n <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n </div>\n <form name="amdForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialAMDActive" aria-label="AMDActive"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n <input type="number" name="dialAMDInitialSilence" ng-model="vm.queueCampaign.dialAMDInitialSilence" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n <input type="number" name="dialAMDGreeting" ng-model="vm.queueCampaign.dialAMDGreeting" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.queueCampaign.dialAMDAfterGreetingSilence" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.queueCampaign.dialAMDTotalAnalysisTime" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n <input type="number" name="dialAMDMinWordLength" ng-model="vm.queueCampaign.dialAMDMinWordLength" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.queueCampaign.dialAMDBetweenWordsSilence" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.queueCampaign.dialAMDMaximumNumberOfWords" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.queueCampaign.dialAMDSilenceThreshold" min="0" max="32767">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.queueCampaign.dialAMDMaximumWordLength" min="0">\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.queueCampaign)">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_hs.init(vm.queueCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n </div>\n\n </div>\n <div class="queueCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHoppers.length}} {{vm_dc.selectedQueueCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHoppers" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedQueueCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="QUEUECAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHoppers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHoppers">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column md-order-by="recallme">{{ \'MOTIONDIALER.RECALLAGENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.queueCampaignHoppers.rows">\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.ContactId}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.phone}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.countcongestionretry}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.countbusyretry}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.countnoanswerretry}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{ vm_dc.arraypriority[hopper.priority].option }}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell class="recallme ">\n <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHoppers.rows.length">\n <td md-cell colspan="12">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHoppers.count}}" md-on-paginate="vm_dc.getQueueCampaignHoppers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperHistories.length}} {{vm_dc.selectedQueueCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperHistories" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperHistories" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.queueCampaignHopperHistories.rows">\n <td md-cell>{{hopperHistory.uniqueid}}</td>\n <td md-cell>{{hopperHistory.ContactId}}</td>\n <td md-cell>{{hopperHistory.calleridnum}}</td>\n <td md-cell>{{hopperHistory.calleridname}}</td>\n <td md-cell>{{hopperHistory.statedesc}}</td>\n <td md-cell>{{hopperHistory.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.endtime | date:\'medium\'}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperHistories.rows.length">\n <td md-cell colspan="11">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperHistories" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.FINAL">FINAL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsQueueCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n <md-icon md-font-icon="icon-backup-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(3)">\n <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(5)">\n <span translate="MOTIONDIALER.BUSY ">Busy</span>\n <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(8)">\n <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(10)">\n <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(11)">\n <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(22)">\n <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(0)">\n <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperFinals.length}} {{vm_dc.selectedQueueCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperFinals" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-click="vm_dc.moveSelectedQueueCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="QUEUECAMPAIGNS.MOVE_SELECTED">\n <md-icon md-font-icon="icon-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperFinals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'MOTIONDIALER.DISPOSITION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.queueCampaignHopperFinals.rows">\n <td md-cell>{{hopperFinal.uniqueid}}</td>\n <td md-cell>{{hopperFinal.ContactId}}</td>\n <td md-cell>{{hopperFinal.calleridnum}}</td>\n <td md-cell>{{hopperFinal.calleridname}}</td>\n <td md-cell>{{hopperFinal.statedesc}}</td>\n <td md-cell>{{hopperFinal.countcongestionretry}}</td>\n <td md-cell>{{hopperFinal.countbusyretry}}</td>\n <td md-cell>{{hopperFinal.countnoanswerretry}}</td>\n <td md-cell>{{hopperFinal.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.endtime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.disposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n Move HopperFinal\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperFinals.rows.length">\n <td md-cell colspan="23">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperFinals" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperBlacks.length}} {{vm_dc.selectedQueueCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperBlacks" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperBlacks" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperBlacks">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.queueCampaignHopperBlacks.rows">\n <td md-cell>{{hopperBlack.ContactId}}</td>\n <td md-cell>{{hopperBlack.phone}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperBlacks.rows.length">\n <td md-cell colspan="4">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperBlacks" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n</div>\n\x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",'<div id="queueCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MOTIONDIALER.QUEUECAMPAIGNS">QueueCampaigns</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedQueueCampaigns.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedQueueCampaigns =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MOTIONDIALER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-queueCampaigns-count">\n <span>{{vm.selectedQueueCampaigns.length}}</span>\n <span translate="MOTIONDIALER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="QUEUECAMPAIGNS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllQueueCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectQueueCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedQueueCampaigns" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedQueueCampaigns($event)" aria-label="delete selected" translate translate-attr-label="QUEUECAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- QUEUECAMPAIGN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedQueueCampaigns" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueueCampaigns">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="dialActive">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="dialMethod">{{ \'MOTIONDIALER.METHOD\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'MOTIONDIALER.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queueCampaigns.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="queueCampaign" md-select-id="id" ng-repeat="queueCampaign in vm.queueCampaigns.rows">\n <td md-cell ng-if="queueCampaign.userpic"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="api/users/{{queueCampaign.id}}/avatar" /></td>\n <td md-cell ng-if="!queueCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="id ">{{queueCampaign.id}}</td>\n <td ng-click="vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="name ">{{queueCampaign.name}}</td>\n <td ng-click="vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialActive ">\n <md-icon md-colors="{color: {{queueCampaign.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queueCampaign.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="TrunkId ">{{ TrunkId = vm.trunks[queueCampaign.TrunkId]; TrunkId.name }}</td>\n <td ng-click="vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialMethod ">{{ vm.arraydialMethod[queueCampaign.dialMethod].option }}</td>\n <td ng-click="vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="strategy ">{{ vm.arraystrategy[queueCampaign.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(queueCampaign, $event)" translate="MOTIONDIALER.EDIT_QUEUECAMPAIGN">\n Edit QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.listadddialog(queueCampaign, $event)" translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">\n listadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.blacklistadddialog(queueCampaign, $event)" translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">\n blacklistadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(queueCampaign, $event)" translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN">\n teamadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(queueCampaign, $event)" translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">\n agentadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(queueCampaign, $event)" translate="MOTIONDIALER.DELETE_QUEUECAMPAIGN">\n Delete QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(queueCampaign, $event)" translate="MOTIONDIALER.GOTOREALTIME_QUEUECAMPAIGN">\n goToRealtime QueueCampaign\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.queueCampaigns.count}}" md-on-paginate="vm.getQueueCampaigns" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / QUEUECAMPAIGN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD QUEUECAMPAIGN BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-queueCampaign-button" ng-click="vm.createOrEditQueueCampaign($event)" aria-label="add queueCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD QUEUECAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",'<md-toolbar class="md-table-toolbar md-default table-header">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 black-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getContacts()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.lastAssignedTo" ng-change="vm.getContacts()">\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents.rows">{{agent.name}}</md-option>\n </md-select>\n </div>\n <div ng-if="vm.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.queue" ng-change="vm.getContacts()">\n <md-option ng-value="undefined" ng-if="vm.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshContacts($event)" aria-label="refresh Contacts" translate translate-attr-label="DASHBOARDS.REFRESH_CONTACTS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n</md-toolbar>\n<md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td md-cell class="id">{{contact.id}}</td>\n <td md-cell class="firstName">{{contact.calleridname}}</td>\n <td md-cell class="list">{{contact.calleridnum}}</td>\n <td md-cell class="list">{{vm.queuesMap[contact.queue]}}</td>\n <td md-cell class="list">{{contact.queuecallerabandonAt ? (contact.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.queuecallerexitAt ? (contact.queuecallerexitAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.queuecallerexitreason}}</td>\n <td md-cell class="list">{{contact.lastAssignedTo}}</td>\n <td md-cell class="list">{{contact.disposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">Assigned a</md-button>\n <md-menu-content>\n <md-menu-item ng-if="contact.lastAssignedTo">\n <md-button ng-click="vm.assignedA(contact)"><em translate="DASHBOARDS.NONE">Not Assigned</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.assignedA(contact,agent)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, null)"><em translate="DASHBOARDS.NONE">NONE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'fax\')"><em translate="DASHBOARDS.FAX">FAX</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Answer Machine\')"><em translate="DASHBOARDS.ANSWER_MACHINE">ANSWER_MACHINE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Interested\')"><em translate="DASHBOARDS.INTERESTED">INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Not Interested\')"><em translate="DASHBOARDS.NOT_INTERESTED">NOT_INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Sold\')"><em translate="DASHBOARDS.SOLD">SOLD</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Special\')"><em translate="DASHBOARDS.SPECIAL">SPECIAL</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.disposition.length" ng-repeat="disposition in vm.disposition">\n <md-button ng-click="vm.disposed(contact, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>'),e.put("app/main/apps/motiondialer/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'MOTIONDIALER.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'MOTIONDIALER.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'MOTIONDIALER.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'MOTIONDIALER.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'MOTIONDIALER.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="3">{{ \'MOTIONDIALER.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n \x3c!-- <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSE\' | translate }}</th>\n <th md-column width="10px"></th> --\x3e\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatusTime">{{ \'MOTIONDIALER.TIMER\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'MOTIONDIALER.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'busy\':\'indigo-100-bg\',\'*pause\':\'amber-50-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].globalStatus]">{{ vm.isPause(vm.agents[value].globalStatus) ? \'\' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? \'*\'+vm.agents[value].pauseType || \'DEFAULT PAUSE\' : vm.agents[value].pauseType || \'DEFAULT PAUSE\') : \'\'}}</span>\n </td>\n <td class="bt custom-column">\n <timer start-time="vm.agents[value].globalStatusTime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class="bt bl">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'talking\':\'indigo-100-bg\',\'ringing\':\'orange-400-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt bl">\n <div layout="column">\n <span ng-if="vm.agents[value].queue" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].queue }}</span>\n <span ng-if="vm.agents[value].destconnectedlinenum" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class="padding-5" ng-if="vm.agents[value].queue || vm.agents[value].destconnectedlinenum">\n <timer start-time="vm.agents[value].voiceStatusTime" interval="1000" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n \x3c!-- <td class="bt">--</td>\n <td class="bt">--</td> --\x3e\n <td class="bt bl" ng-if="vm.license.chat">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n \x3c!-- <td class="bt padding-5 text-center">{{ agent.chatCurrentCapacity }}/{{ agent.chatCapacity > 0 ? agent.chatCapacity : \'∞\' }}</td> --\x3e\n <td md-number class="bt text-center font-size-20" ng-if="vm.license.chat" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.mail">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.mail" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.messaging">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.messaging" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.openchannel">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">4</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">89</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.openchannel" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.fax">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">7</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">2</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.fax" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class="bl bt padding-5 text-center">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.logout(vm.agents[value], $event)" translate="MOTIONDIALER.LOGOUT">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.queueAdd(vm.agents[value], $event)" translate="MOTIONDIALER.AGENTADD_QUEUE">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="MOTIONDIALER.PAUSE">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=" vm.agents[value].voicePause && \'DEFAULT PAUSE\' === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value])"><em translate="MOTIONDIALER.DEFAULT_PAUSE">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.pauses.rows.length" ng-repeat="pause in vm.pauses.rows">\n <md-button ng-disabled="vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value], pause.name)">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="vm.isPause(vm.agents[value].globalStatus)">\n <md-button ng-click="vm.unPause(vm.agents[value])" translate="MOTIONDIALER.UNPAUSE">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.filteredAgents.length}}" md-on-paginate="vm.onInit" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCampaigns">\n <tr md-row>\n <th md-column>{{\'MOTIONDIALER.NAME\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL_MANAGED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.LIMITED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.ORIGINATED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.MESSAGE\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate}}</th>\n <th md-column>{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.campaigns">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, campaign) in vm.campaigns">\n <td md-cell>\n <span>{{campaign.name}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.ivrTotalCallsDays || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.ivrAnswerCallsDay || 0}} ({{(campaign.ivrTotalCallsDays) ? (campaign.ivrAnswerCallsDay || 0) * 100/(campaign.ivrTotalCallsDays ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.limitCalls || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.originated || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.message ? (\'MOTIONDIALER.\'+campaign.message | translate) : \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.dialQueueProject || \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{campaign.Trunk ? campaign.Trunk.name : \'--\'}}</span>\n </td>\n <td md-cell>\n <md-icon md-colors="{color: {{campaign.active ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{campaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditIvrCampaign($event, campaign)" translate="MOTIONDIALER.EDIT_CAMPAIGN">\n Edit Campaign\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getCampaigns" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queue_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_CALLS">Queue Calls</span>\n \x3c!-- <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUES TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'MOTIONDIALER.DID\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.QUEUE\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.CALLER\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.AGENT\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.DURATION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.getSize(vm.rpcVoiceQueuesChannels)">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm.rpcVoiceQueuesChannels | limitObjectFromTo: vm.queryChannels.limit:(vm.queryChannels.page - 1) * vm.queryChannels.limit">\n <td md-cell>\n <md-icon ng-if="channel.queuecallerleaveAt" md-font-icon="icon-phone-in-talk green-fg"></md-icon>\n <md-icon ng-if="!channel.queuecallerleaveAt" md-font-icon="icon-phone-incoming md-accent"></md-icon>\n </td>\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n <td md-cell>\n <span ng-if="channel.queuecallerleaveAt">\n {{channel.connectedlinename}}, {{channel.connectedlinenum}}\n <span class="text-boxed">\n <timer start-time="channel.queuecallerleaveAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n <span ng-if="!channel.queuecallerleaveAt" class="text-boxed">\n {{ \'MOTIONDIALER.WAITING_FOR_AGENT\' | translate }}\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell>\n <span class="text-boxed">\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.hangup(channel.uniqueid)" translate="MOTIONDIALER.HANGUP">\n Hangup\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.redirectToNumber($event, channel.uniqueid)" translate="MOTIONDIALER.REDIRECT_TO_NUMBER">\n Number\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" translate="MOTIONDIALER.REDIRECT_TO_AGENT">Redirect to Agent</md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.redirectToAgent(channel.uniqueid, agent.name)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n \x3c!-- <tr md-row ng-repeat="call in vm.calls.rows | filter: vm.query.filter | limitTo: vm.query.limit: (vm.query.page - 1) * vm.query.limit">\n <td md-cell>\n <i ng-class="vm.channelStatusClass[call.status.toLowerCase()]"></i>\n </td>\n <td md-cell>{{call.exten}}</td>\n <td md-cell>{{call.queue}}</td>\n <td md-cell><span ng-if="call.calleridname">{{call.calleridname}}, </span>{{call.calleridnum}}</td>\n <td md-cell>\n <span ng-if="call.queuecallerleaveAt">\n {{call.connectedlinename}}, {{call.connectedlinenum}}\n <span class="text-boxed">\n <timer start-time="call.queuecallerleaveAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n <span ng-if="!call.queuecallerleaveAt" class="text-boxed" translate="MOTIONDIALER.WAITING_FOR_AGENT">\n Waiting for agent...\n <span class="text-boxed">\n <timer start-time="call.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n </td>\n <td md-cell>\n <span class="text-boxed">\n <timer ng-if="call.queuecallerjoinAt" start-time="call.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <span ng-if="call.queuecallercomplete || call.queuecallerabandon || call.queuecallerexit" translate="MOTIONDIALER.CLOSING">Closing</span>\n </span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical" ></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.hangup(call.uniqueid)" translate="MOTIONDIALER.HANGUP">\n Hangup\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.redirectToNumber($event, call.uniqueid)" translate="MOTIONDIALER.REDIRECT_TO_NUMBER">\n Number\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" translate="MOTIONDIALER.REDIRECT_TO_AGENT">Redirect to Agent</md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.redirectToAgent(call.uniqueid, agent.name)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr> --\x3e\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.queryChannels.limit" md-page="vm.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-total="{{vm.getSize(vm.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n\x3c!-- / QUEUES TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column>{{\' MOTIONDIALER.NAME\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.TOTAL\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.TOTAL_OFFERED\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.MANAGED\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.ABANDONED\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.DROPPED\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.AVG_HOLD_TIME\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.AVG_DURATION\' | translate}}</th>\n <th md-column>{{\' MOTIONDIALER.AVG_BILLABLE\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, queue) in vm.queues">\n <td md-cell>\n <span>{{queue.name}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(queue.answered + queue.outboundNoAnswerCallsDay + queue.outboundBusyCallsDay + queue.outboundCongestionCallsDay + queue.outboundNoSuchCallsDay + queue.outboundUnknownCallsDay + queue.outboundDropCallsDayTimeout + queue.outboundDropCallsDayCallersExit + queue.outboundBlacklistCallsDay + queue.outboundOriginateFailureCallsDay + queue.outboundAnswerAgiCallsDay + queue.outboundReCallsDay + queue.outboundRejectCallsDay )|| 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{queue.total || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.answered) ? (100 - (((queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total)) | number:1 ) - (((queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total )) | number:1 ) ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayCallersExit || 0}} ({{(queue.outboundDropCallsDayCallersExit) ? (queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayTimeout || 0}} ({{(queue.outboundDropCallsDayTimeout) ? (queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumHoldTime / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumDuration / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.PAUSED\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.READY\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.WAITING\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.TALKING\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.ORIGINATED\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.MESSAGE\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.METHOD\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="dialActive">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{(vm.queues[value].talking || 0) + (vm.queues[value].pTalking || 0)}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].originated || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].message ? (\'MOTIONDIALER.\'+vm.queues[value].message | translate) : \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].dialMethod || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].Trunk ? vm.queues[value].Trunk.name : \'--\'}}</span>\n </td>\n <td md-cell>\n <md-icon md-colors="{color: {{vm.queues[value].dialActive ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{vm.queues[value].dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditMotionDialerQueue($event, vm.queues[value])" translate="MOTIONDIALER.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="MOTIONDIALER.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUE_CALLS">Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ABANDONEDCALLS">Abandoned Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUE_PARAMS">Queue Parameters</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelAccount">\n <div ng-messages="openchannelAccountForm[\'name\'].$error" ng-show="openchannelAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="openchannelAccountForm[\'key\'].$error" ng-show="openchannelAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri">\n <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n <div ng-messages="openchannelAccountForm[\'replyUri\'].$error" ng-show="openchannelAccountForm[\'replyUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n <div ng-messages="openchannelAccountForm[\'ListId\'].$error" ng-show="openchannelAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelAccount.description">\n <div ng-messages="openchannelAccountForm[\'description\'].$error" ng-show="openchannelAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newOpenchannelAccount" ng-click="vm.saveOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid || openchannelAccountForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE"\n translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newOpenchannelAccount" ng-click="vm.addNewOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELACCOUNT" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n ADD OPENCHANNELACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newOpenchannelAccount" ng-click="vm.deleteOpenchannelAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/agent/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" required autofocus>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'agent\'].$error" ng-show="openchannelAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" required autofocus>\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'times\'].$error" ng-show="openchannelAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" md-maxlength="255" required></textarea>\n\n <div ng-messages="openchannelAccountFormApp[\'text\'].$error" ng-show="openchannelAccountFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.TEXT_MAX_LENGTH" translate-values=\'{max: 255}\'>Text must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/close/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus>\n <div ng-messages="openchannelAccountFormApp[\'disposition\'].$error" ng-show="openchannelAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus>\n <div ng-messages="openchannelAccountFormApp[\'condition\'].$error" ng-show="openchannelAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true">\n <div ng-messages="openchannelAccountFormApp[\'truepriority\'].$error" ng-show="openchannelAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true">\n <div ng-messages="openchannelAccountFormApp[\'falsepriority\'].$error" ng-show="openchannelAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus>\n <div ng-messages="openchannelAccountFormApp[\'priority\'].$error" ng-show="openchannelAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/noop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus>\n <div ng-messages="openchannelAccountFormApp[\'value\'].$error" ng-show="openchannelAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/queue/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" required autofocus>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'queue\'].$error" ng-show="openchannelAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/system/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus>\n <div ng-messages="openchannelAccountFormApp[\'command\'].$error" ng-show="openchannelAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable">\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables">{{ variable.name }}</md-option>\n <md-option ng-value="\'\'">None</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'variable\'].$error" ng-show="openchannelAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",'<md-dialog class="openchannelCannedAnswer-dialog" aria-label="New OpenchannelCannedAnswer">\n <form name="openchannelCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">Key</label>\n <input type="" name="key" ng-model="vm.openchannelCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n <div ng-messages="openchannelCannedAnswerForm[\'key\'].$error" ng-show="openchannelCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VALUE">Value</label>\n <textarea name="value" ng-model="vm.openchannelCannedAnswer.value" required></textarea>\n\n <div ng-messages="openchannelCannedAnswerForm[\'value\'].$error" ng-show="openchannelCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelCannedAnswer.description">\n <div ng-messages="openchannelCannedAnswerForm[\'description\'].$error" ng-show="openchannelCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newOpenchannelCannedAnswer" ng-click="vm.saveOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid || openchannelCannedAnswerForm.$pristine" aria-label="SAVE"\n translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newOpenchannelCannedAnswer" ng-click="vm.addNewOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER"\n translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n ADD OPENCHANNELCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newOpenchannelCannedAnswer" ng-click="vm.deleteOpenchannelCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelDispositions/dialog.html",'<md-dialog class="openchannelDisposition-dialog" aria-label="New OpenchannelDisposition">\n <form name="openchannelDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="" name="name" ng-model="vm.openchannelDisposition.name" ng-required="true" autofocus>\n <div ng-messages="openchannelDispositionForm[\'name\'].$error" ng-show="openchannelDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newOpenchannelDisposition" ng-click="vm.saveOpenchannelDisposition()" class="send-button md-accent md-raised" ng-disabled="openchannelDispositionForm.$invalid || openchannelDispositionForm.$pristine" aria-label="SAVE"\n translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newOpenchannelDisposition" ng-click="vm.addNewOpenchannelDisposition()" class="send-button md-accent md-raised" ng-disabled="openchannelDispositionForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELDISPOSITION"\n translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELDISPOSITION">\n ADD OPENCHANNELDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newOpenchannelDisposition" ng-click="vm.deleteOpenchannelDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",'<div id="openchannel-openchannelAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-openchannelAccounts-button md-icon-button" aria-label="Go to openchannelAccounts" ng-click="vm.gotoOpenchannelAccounts()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="openchannelAccount-image" hide-xs>\n <img ng-src="assets/images/business/openchannelAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.openchannelAccount.id}}\n <span ng-if="vm.openchannelAccount.name">{{vm.openchannelAccount.name}}</span>\n <span ng-if="vm.openchannelAccount.exten">{{vm.openchannelAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (openchannelDispositionsForm.$invalid) || (openchannelCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)"\n translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus ng-disabled="true">\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri">\n <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n <div ng-messages="generalForm[\'replyUri\'].$error" ng-show="generalForm[\'replyUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.openchannelAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.RECEIVEURI">receiveUri</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUri" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-receiveUri" name="receiveUri" ng-value="vm.location + \'/api/openchannel/accounts/\' + vm.openchannelAccount.id + \'/notify\'" ng-readonly="true">\n </div>\n <div class="hint"><span translate="OPENCHANNEL.HELP.RECEIVEURI"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="openchannelAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.notificationSound" aria-label="notificationSound"><span translate="OPENCHANNEL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.notificationShake" aria-label="notificationShake"><span translate="OPENCHANNEL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="OPENCHANNEL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.openchannelAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container openchanneldispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountOpenchannelDispositionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.OPENCHANNELDISPOSITIONS">OpenchannelDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event)" aria-label="add openchannelDisposition" translate translate-attr-label="OPENCHANNEL.ADD_OPENCHANNELDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length}} {{vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountOpenchannelDispositions" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountOpenchannelDispositions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountOpenchannelDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountOpenchannelDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'OPENCHANNEL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="openchannelDisposition" md-select-id="id" ng-repeat="openchannelDisposition in vm_dc.openchannelAccountOpenchannelDispositions.rows">\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" md-cell>{{openchannelDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" md-cell>{{openchannelDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" md-cell>{{openchannelDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" translate="OPENCHANNEL.EDIT_OPENCHANNELDISPOSITION">\n Edit OpenchannelDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(openchannelDisposition, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELDISPOSITION">\n Delete OpenchannelDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountOpenchannelDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="OPENCHANNEL.NO_OPENCHANNELDISPOSITION_AVAILABLE">No openchanneldisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountOpenchannelDispositions.count}}" md-on-paginate="vm_dc.getOpenchannelAccountOpenchannelDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container openchannelcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountOpenchannelCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.OPENCHANNELCANNEDANSWERS">OpenchannelCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event)" aria-label="add openchannelCannedAnswer" translate translate-attr-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length}} {{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountOpenchannelCannedAnswers" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'OPENCHANNEL.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'OPENCHANNEL.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'OPENCHANNEL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="openchannelCannedAnswer" md-select-id="id" ng-repeat="openchannelCannedAnswer in vm_dc.openchannelAccountOpenchannelCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.value}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" translate="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER">\n Edit OpenchannelCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(openchannelCannedAnswer, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELCANNEDANSWER">\n Delete OpenchannelCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountOpenchannelCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="OPENCHANNEL.NO_OPENCHANNELCANNEDANSWER_AVAILABLE">No openchannelcannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountOpenchannelCannedAnswers.count}}" md-on-paginate="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.openchannelAccount)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="OPENCHANNEL.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedOpenchannelAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedOpenchannelAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedOpenchannelAccountApps.length}} {{vm_ac.selectedOpenchannelAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedOpenchannelAccountApps($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedOpenchannelAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.openchannelAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editOpenchannelAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.openchannelAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getOpenchannelAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="OPENCHANNEL.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountInteractions.length}} {{vm_dc.selectedOpenchannelAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountInteractions" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'OPENCHANNEL.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.CONTACT\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'OPENCHANNEL.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'OPENCHANNEL.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'OPENCHANNEL.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'OPENCHANNEL.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.openchannelAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spyopenchannelInteraction($event, interaction)" translate="OPENCHANNEL.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="OPENCHANNEL.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="OPENCHANNEL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountInteractions.count}}" md-on-paginate="vm_dc.getOpenchannelAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",'<div id="openchannelAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELACCOUNTS">OpenchannelAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOpenchannelAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="OPENCHANNEL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-openchannelAccounts-count">\n <span>{{vm.selectedOpenchannelAccounts.length}}</span>\n <span translate="OPENCHANNEL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNELACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelAccounts" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedOpenchannelAccounts($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- OPENCHANNELACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'OPENCHANNEL.KEY\' | translate }}</th>\n <th md-column md-order-by="replyUri">{{ \'OPENCHANNEL.REPLYURI\' | translate }}</th>\n <th md-column md-order-by="ListId">{{ \'OPENCHANNEL.LIST\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="openchannelAccount" md-select-id="id" ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">\n <td md-cell ng-if="openchannelAccount.userpic"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="api/users/{{openchannelAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!openchannelAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="id ">{{openchannelAccount.id}}</td>\n <td ng-click="vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="name ">{{openchannelAccount.name}}</td>\n <td ng-click="vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="key ">{{openchannelAccount.key}}</td>\n <td ng-click="vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="replyUri ">{{openchannelAccount.replyUri}}</td>\n <td ng-click="vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="ListId ">{{ ListId = vm.lists[openchannelAccount.ListId]; ListId.name }}</td>\n <td ng-click="vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="description ">{{openchannelAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(openchannelAccount, $event)" translate="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT">\n Edit OpenchannelAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(openchannelAccount, $event)" translate="OPENCHANNEL.INTERACTIONS_OPENCHANNELACCOUNT">\n Interactions OpenchannelAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(openchannelAccount, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELACCOUNT">\n Delete OpenchannelAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.openchannelAccounts.count}}" md-on-paginate="vm.getOpenchannelAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OPENCHANNELACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OPENCHANNELACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-openchannelAccount-button" ng-click="vm.createOrEditOpenchannelAccount($event)" aria-label="add openchannelAccount" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OPENCHANNELACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",'<md-dialog class="openchannelQueue-dialog" aria-label="New OpenchannelQueue">\n <form name="openchannelQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelQueue">\n <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n <div ng-messages="openchannelQueueForm[\'name\'].$error" ng-show="openchannelQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="openchannelQueueForm[\'strategy\'].$error" ng-show="openchannelQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="openchannelQueueForm[\'timeout\'].$error" ng-show="openchannelQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelQueue.description">\n <div ng-messages="openchannelQueueForm[\'description\'].$error" ng-show="openchannelQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newOpenchannelQueue" ng-click="vm.saveOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid || openchannelQueueForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE"\n translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newOpenchannelQueue" ng-click="vm.addNewOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELQUEUE" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n ADD OPENCHANNELQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newOpenchannelQueue" ng-click="vm.deleteOpenchannelQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue">\n <form name="openchannelQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">Add Agent to openchannelQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue">\n <form name="openchannelQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE">Add Team in OPENCHANNELQUEUE</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/view.html",'<div id="openchannel-openchannelQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-openchannelQueues-button md-icon-button" aria-label="Go to openchannelQueues" ng-click="vm.gotoOpenchannelQueues()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="openchannelQueue-image" hide-xs>\n <img ng-src="assets/images/business/openchannelQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.openchannelQueue.id}}\n <span ng-if="vm.openchannelQueue.name">{{vm.openchannelQueue.name}}</span>\n <span ng-if="vm.openchannelQueue.exten">{{vm.openchannelQueue.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.openchannelQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.openchannelQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="openchannelQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelQueue.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",'<div id="openchannelQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELQUEUES">OpenchannelQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOpenchannelQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="OPENCHANNEL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-openchannelQueues-count">\n <span>{{vm.selectedOpenchannelQueues.length}}</span>\n <span translate="OPENCHANNEL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNELQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOpenchannelQueues()" translate="OPENCHANNEL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOpenchannelQueues()" translate="OPENCHANNEL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelQueues" csv-label="true" filename="openchannelQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedOpenchannelQueues($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- OPENCHANNELQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'OPENCHANNEL.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="openchannelQueue" md-select-id="id" ng-repeat="openchannelQueue in vm.openchannelQueues.rows">\n <td md-cell ng-if="openchannelQueue.userpic"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="api/users/{{openchannelQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!openchannelQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="id ">{{openchannelQueue.id}}</td>\n <td ng-click="vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="name ">{{openchannelQueue.name}}</td>\n <td ng-click="vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="strategy ">{{ vm.arraystrategy[openchannelQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(openchannelQueue, $event)" translate="OPENCHANNEL.EDIT_OPENCHANNELQUEUE">\n Edit OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(openchannelQueue, $event)" translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE">\n teamadd OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(openchannelQueue, $event)" translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">\n agentadd OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(openchannelQueue, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELQUEUE">\n Delete OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(openchannelQueue, $event)" translate="OPENCHANNEL.GOTOREALTIME_OPENCHANNELQUEUE">\n goToRealtime OpenchannelQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.openchannelQueues.count}}" md-on-paginate="vm.getOpenchannelQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OPENCHANNELQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OPENCHANNELQUEUE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-openchannelQueue-button" ng-click="vm.createOrEditOpenchannelQueue($event)" aria-label="add openchannelQueue" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OPENCHANNELQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'OPENCHANNEL.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'OPENCHANNEL.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'OPENCHANNEL.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'OPENCHANNEL.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'OPENCHANNEL.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="3">{{ \'OPENCHANNEL.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n \x3c!-- <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSE\' | translate }}</th>\n <th md-column width="10px"></th> --\x3e\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatusTime">{{ \'OPENCHANNEL.TIMER\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'OPENCHANNEL.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'busy\':\'indigo-100-bg\',\'*pause\':\'amber-50-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].globalStatus]">{{ vm.isPause(vm.agents[value].globalStatus) ? \'\' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? \'*\'+vm.agents[value].pauseType || \'DEFAULT PAUSE\' : vm.agents[value].pauseType || \'DEFAULT PAUSE\') : \'\'}}</span>\n </td>\n <td class="bt custom-column">\n <timer start-time="vm.agents[value].globalStatusTime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class="bt bl">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'talking\':\'indigo-100-bg\',\'ringing\':\'orange-400-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt bl">\n <div layout="column">\n <span ng-if="vm.agents[value].queue" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].queue }}</span>\n <span ng-if="vm.agents[value].destconnectedlinenum" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class="padding-5" ng-if="vm.agents[value].queue || vm.agents[value].destconnectedlinenum">\n <timer start-time="vm.agents[value].voiceStatusTime" interval="1000" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n \x3c!-- <td class="bt">--</td>\n <td class="bt">--</td> --\x3e\n <td class="bt bl" ng-if="vm.license.chat">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n \x3c!-- <td class="bt padding-5 text-center">{{ agent.chatCurrentCapacity }}/{{ agent.chatCapacity > 0 ? agent.chatCapacity : \'∞\' }}</td> --\x3e\n <td md-number class="bt text-center font-size-20" ng-if="vm.license.chat" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.mail">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.mail" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.messaging">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.messaging" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.openchannel">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">4</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">89</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.openchannel" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.fax">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">7</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">2</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.fax" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class="bl bt padding-5 text-center">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.logout(vm.agents[value], $event)" translate="OPENCHANNEL.LOGOUT">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.queueAdd(vm.agents[value], $event)" translate="OPENCHANNEL.AGENTADD_QUEUE">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="OPENCHANNEL.PAUSE">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=" vm.agents[value].voicePause && \'DEFAULT PAUSE\' === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value])"><em translate="OPENCHANNEL.DEFAULT_PAUSE">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.pauses.rows.length" ng-repeat="pause in vm.pauses.rows">\n <md-button ng-disabled="vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value], pause.name)">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="vm.isPause(vm.agents[value].globalStatus)">\n <md-button ng-click="vm.unPause(vm.agents[value])" translate="OPENCHANNEL.UNPAUSE">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.filteredAgents.length}}" md-on-paginate="vm.onInit" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/openchannel/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.PAUSED\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.READY\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditOpenchannelQueue($event, vm.queues[value])" translate="OPENCHANNEL.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="OPENCHANNEL.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/openchannel/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/customizations/create/dialog.html",'<md-dialog class="customization-dialog" aria-label="New Customization">\n <form name="customizationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n <div ng-messages="customizationForm[\'headerWhiteLabel\'].$error" ng-show="customizationForm[\'headerWhiteLabel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n <div ng-messages="customizationForm[\'pageTitle\'].$error" ng-show="customizationForm[\'pageTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newCustomization" ng-click="vm.saveCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid || customizationForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newCustomization" ng-click="vm.addNewCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_CUSTOMIZATION" translate-attr-aria-label="SETTINGS.ADD_CUSTOMIZATION">\n ADD CUSTOMIZATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newCustomization" ng-click="vm.deleteCustomization($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/customizations/customizations.html",'<div id="customizations" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.CUSTOMIZATIONS">Customizations</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.saveCustomization()" ng-disabled="customizationForm.$pristine || customizationForm.$invalid" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n <div class="customization-detail-form-container customizations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.CUSTOMIZATIONS">CUSTOMIZATIONS</div>\n </div>\n <form name="customizationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n <div ng-messages="customizationForm[\'headerWhiteLabel\'].$error" ng-show="customizationForm[\'headerWhiteLabel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n <div ng-messages="customizationForm[\'pageTitle\'].$error" ng-show="customizationForm[\'pageTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n <div ng-if="!vm.customization.defaultLogo" class="customization-detail-form-container logo md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.LOGO">LOGO</div>\n </div>\n <div ng-controller="CustomizationlogoController as vm_cl" ng-init="vm_cl.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cl.ngFlowOptions" flow-name="vm_cl.ngFlow.flow" flow-files-submitted="vm_cl.upload()" flow-file-added="vm_cl.fileAdded($file)" flow-file-success="vm_cl.fileSuccess($file, $message)" flow-complete="vm_cl.uploadComplete()"\n flow-drop flow-drag-enter="vm_cl.dropping=true" flow-drag-leave="vm_cl.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logoimage in vm_cl.customization.images" ng-switch="logoimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logoimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logoimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n <div ng-if="!vm.customization.defaultLoginLogo" class="customization-detail-form-container logologin md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.LOGOLOGIN">LOGOLOGIN</div>\n </div>\n <div ng-controller="CustomizationlogologinController as vm_cll" ng-init="vm_cll.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cll.ngFlowOptions" flow-name="vm_cll.ngFlow.flow" flow-files-submitted="vm_cll.upload()" flow-file-added="vm_cll.fileAdded($file)" flow-file-success="vm_cll.fileSuccess($file, $message)" flow-complete="vm_cll.uploadComplete()"\n flow-drop flow-drag-enter="vm_cll.dropping=true" flow-drag-leave="vm_cll.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logologinimage in vm_cll.customization.images" ng-switch="logologinimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logologinimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logologinimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logologinimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/generals/create/dialog.html",'<md-dialog class="general-dialog" aria-label="New General">\n <form name="generalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MIN_INTERNAL">Min_Internal</label>\n <input type="number" name="min_internal" ng-model="vm.general.min_internal" min="0" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'min_internal\'].$error" ng-show="generalForm[\'min_internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_REQUIRED">Min_Internal field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Min_Internal must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.securePassword" aria-label="Security_Suite"><span translate="SETTINGS.SECURITY_SUITE">Security_Suite</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SECURITY_SUITE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.callRecordingEncryption" aria-label="Call_Recording_Encryption"><span translate="SETTINGS.CALL_RECORDING_ENCRYPTION">Call_Recording_Encryption</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.STUNADDR">Stunaddr</label>\n <input type="text" name="stunaddr" ng-model="vm.general.stunaddr">\n <div ng-messages="generalForm[\'stunaddr\'].$error" ng-show="generalForm[\'stunaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.STUNADDR_REQUIRED">Stunaddr field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURNADDR">Turnaddr</label>\n <input type="text" name="turnaddr" ng-model="vm.general.turnaddr">\n <div ng-messages="generalForm[\'turnaddr\'].$error" ng-show="generalForm[\'turnaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURNADDR_REQUIRED">Turnaddr field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_USERNAME">Turn_Username</label>\n <input type="text" name="turnusername" ng-model="vm.general.turnusername">\n <div ng-messages="generalForm[\'turnusername\'].$error" ng-show="generalForm[\'turnusername\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_USERNAME_REQUIRED">Turn_Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_PASSWORD">Turn_Password</label>\n <input type="text" name="turnpassword" ng-model="vm.general.turnpassword">\n <div ng-messages="generalForm[\'turnpassword\'].$error" ng-show="generalForm[\'turnpassword\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_PASSWORD_REQUIRED">Turn_Password field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newGeneral" ng-click="vm.saveGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid || generalForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newGeneral" ng-click="vm.addNewGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_GENERAL" translate-attr-aria-label="SETTINGS.ADD_GENERAL">\n ADD GENERAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newGeneral" ng-click="vm.deleteGeneral($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/generals/generals.html",'<div id="generals" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.GENERAL">General</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.saveGeneral()" ng-disabled="generalForm.$pristine || generalForm.$invalid" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n <div class="general-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.GLOBAL">GLOBAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MIN_INTERNAL">Min_Internal</label>\n <input type="number" name="min_internal" ng-model="vm.general.min_internal" min="0" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'min_internal\'].$error" ng-show="generalForm[\'min_internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_REQUIRED">Min_Internal field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Min_Internal must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.securePassword" aria-label="Security_Suite"><span translate="SETTINGS.SECURITY_SUITE">Security_Suite</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SECURITY_SUITE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.callRecordingEncryption" aria-label="Call_Recording_Encryption"><span translate="SETTINGS.CALL_RECORDING_ENCRYPTION">Call_Recording_Encryption</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.STUNADDR">Stunaddr</label>\n <input type="text" name="stunaddr" ng-model="vm.general.stunaddr">\n <div ng-messages="generalForm[\'stunaddr\'].$error" ng-show="generalForm[\'stunaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.STUNADDR_REQUIRED">Stunaddr field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURNADDR">Turnaddr</label>\n <input type="text" name="turnaddr" ng-model="vm.general.turnaddr">\n <div ng-messages="generalForm[\'turnaddr\'].$error" ng-show="generalForm[\'turnaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURNADDR_REQUIRED">Turnaddr field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_USERNAME">Turn_Username</label>\n <input type="text" name="turnusername" ng-model="vm.general.turnusername">\n <div ng-messages="generalForm[\'turnusername\'].$error" ng-show="generalForm[\'turnusername\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_USERNAME_REQUIRED">Turn_Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_PASSWORD">Turn_Password</label>\n <input type="text" name="turnpassword" ng-model="vm.general.turnpassword">\n <div ng-messages="generalForm[\'turnpassword\'].$error" ng-show="generalForm[\'turnpassword\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_PASSWORD_REQUIRED">Turn_Password field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container motionbar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.MOTIONBAR">MOTIONBAR</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.phoneBarAutoUpdater" aria-label="MotionbarAutoUpdater"><span translate="SETTINGS.MOTIONBARAUTOUPDATER">MotionbarAutoUpdater</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.phoneBarAutoUpdater" class="md-block">\n <label translate="SETTINGS.MOTIONBARAUTOUPDATERURL">MotionbarAutoUpdaterUrl</label>\n <input type="url" name="phoneBarAutoUpdaterUrl" ng-model="vm.general.phoneBarAutoUpdaterUrl" ng-required="vm.general.phoneBarAutoUpdater">\n <div ng-messages="generalForm[\'phoneBarAutoUpdaterUrl\'].$error" ng-show="generalForm[\'phoneBarAutoUpdaterUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_REQUIRED">MotionbarAutoUpdaterUrl field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_MUST_VALID_URL">MotionbarAutoUpdaterUrl must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/license/license.html",'<div id="license" class="page-layout simple fullwidth doc-page">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.LICENSE">LICENSE</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n <div>\n <md-button type="submit" ng-click="vm.requestLicense()" class="send-button md-raised" translate="SETTINGS.REQUEST_LICENSE" translate-attr-aria-label="SETTINGS.REQUEST_LICENSE">\n REQUEST LICENSE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n \x3c!-- LICENSE CARD --\x3e\n <div layout="row" flex>\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="row" layout-align="center">\n <div flex layout="row" layout-align="start center">\n <div ng-if="!vm.license.custom">\n <a href="https://www.xcallymotion.com/prices" target="_blank" class="md-button md-fab green-A700-bg" aria-label="Eat cake">\n <md-tooltip><span translate="SETTINGS.PRICES">Prices</span></md-tooltip>\n <md-icon md-font-icon="icon-coin"></md-icon>\n </a>\n </div>\n </div>\n <div flex>\n <div ng-switch="vm.license.months" class="text-center">\n <span ng-switch-when="1" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></span>\n <span ng-switch-when="12" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.ANNUALLY">ANNUALLY</span></span>\n <span ng-switch-when="36" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.PERPETUAL">PERPETUAL</span></span>\n </div>\n </div>\n <div flex layout="row" layout-align="end center">\n <div>\n <md-button type="submit" ng-click="vm.updateLicense()" class="md-button md-fab md-accent">\n <md-tooltip><span translate="SETTINGS.UPDATE_LICENSE">License</span></md-tooltip>\n <md-icon md-font-icon="icon-pencil"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n\n <span ng-if="!vm.license.demo && !vm.license.gray" class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_DATE\' | translate }}: {{vm.license.expiration | date: \'longDate\'}}</span>\n <span class="text-center padding-bottom-10"> {{ vm.license.machineUuid !== vm.license.uuid ? \'SETTINGS.OLD_TOKEN\' : \'SETTINGS.TOKEN\' | translate }}: <span class="text-italic text-bold">{{vm.license.uuid}}</span></span>\n\n <div layout="column">\n <span ng-if="vm.license.machineUuid !== vm.license.uuid" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.NEW_TOKEN_DETECTED\' | translate }}</span>\n <span ng-if="vm.license.machineUuid !== vm.license.uuid" class="text-center padding-bottom-10"> {{\'SETTINGS.NEW_TOKEN\' | translate }}: <span class="text-italic text-bold">{{vm.license.machineUuid}}</span></span>\n <span ng-if="vm.license.gray" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_GRAY_PERIOD\' | translate }}: {{vm.license.deadline | date: \'longDate\'}}</span>\n <span ng-if="vm.license.machineUuid !== vm.license.uuid || vm.license.gray" class="text-center padding-bottom-10 text-italic text-bold"> {{\'SETTINGS.EXPIRATION_REASON\' | translate }} </span>\n <span ng-if="vm.license.gray" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_GRAY\' | translate }}</span>\n <span ng-if="vm.license.machineUuid !== vm.license.uuid" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_CHANGED\' | translate }}</span>\n <span ng-if="vm.license.machineUuid !== vm.license.uuid || vm.license.gray" class="text-center padding-bottom-10 text-italic text-bold" translate="SETTINGS.CONTACT_XCALLY_MOTION_SUPPORT"> Contact xCALLY MOTION Support </span>\n <span ng-if="vm.license.machineUuid !== vm.license.uuid" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=New%20token%20detected&body=Hi xCALLY, New Token: {{vm.license.machineUuid}}, Old token: {{vm.license.uuid}}">license@xcally.com</a>.</span>\n <span ng-if="vm.license.gray && vm.license.machineUuid === vm.license.uuid" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=License%20expired%20or%20disabled&body=Hi xCALLY, My Token: {{vm.license.machineUuid}}">license@xcally.com</a>.</span>\n </div>\n\n <div ng-if="vm.license.demo" layout="column">\n <span class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.TRIAL_VERSION\' | translate }}</span>\n <span class="md-subhead md-warn-fg text-center"><a href="https://www.xcallymotion.com/prices" target="_blank">{{ \'SETTINGS.PRICES\' | translate}}</a></span>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-account" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.users || 0 }} <span ng-class="{\'red-fg\': vm.license.users <= vm.users && vm.license.users > 0}">({{vm.license.users >= vm.users ? vm.users : vm.license.users}})</span></h3>\n <p translate="SETTINGS.USERS">Users</p>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-headphones" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.agents || 0 }} <span ng-class="{\'red-fg\': (vm.license.agents <= vm.agents && vm.license.agents > 0) }">({{vm.license.agents >= vm.agents ? vm.agents : vm.license.agents}})</span></h3>\n <p translate="SETTINGS.AGENTS">Agents</p>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-phone" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.telephones || 0 }} <span ng-class="{\'red-fg\': vm.license.telephones <= vm.telephones && vm.license.telephones > 0}">({{vm.license.telephones >= vm.telephones ? vm.telephones : vm.license.telephones}})</span></h3>\n <p translate="SETTINGS.TELEPHONES">Telephones</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="channel in vm.channels" flex="20">\n <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="module in vm.modules" flex="33">\n <md-icon md-font-icon="{{module.icon}}" class="md-avatar-icon" ng-class="vm.license[module.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{module.name | uppercase}}"></h3>\n <p ng-class="vm.license[module.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[module.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <div ng-repeat="other in vm.others" ng-switch="other.name" flex="33">\n <md-list-item class="md-2-line" ng-switch-when="callysquare">\n <md-icon md-font-icon="{{other.icon}}" class="md-avatar-icon green-A700-bg"></md-icon>\n <div class="md-list-item-text">\n <div layout="row" layout="start center">\n <h3>Cally Square</h3>\n <button ng-click="vm.gotoProcess($event)" class="md-mini" aria-label="restart">\n <md-tooltip>Restart</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </button>\n </div>\n <p ng-if="vm.license[other.name]" class="green-A700-fg">{{vm.license[other.name]}} {{ \'SETTINGS.CHANNELS\' | translate }}</p>\n <p ng-if="!vm.license[other.name]" class="green-A700-fg" translate="SETTINGS.UNLIMITED_CHANNELS">UNLIMITED CHANNELS</p>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-switch-default>\n <md-icon md-font-icon="{{other.icon}}" class="md-avatar-icon" ng-class="vm.license[other.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{other.name | uppercase}}"></h3>\n'+" <p ng-class=\"vm.license[other.name] ? 'green-A700-fg' : 'red-A700-fg'\">{{ 'SETTINGS.' + (vm.license[other.name] ? 'ENABLED' : 'DISABLED') | translate }}</p>\n </div>\n </md-list-item>\n </div>\n\n </md-list>\n </md-card>\n </div>\n \x3c!-- / LICENSE CARD --\x3e\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>"),e.put("app/main/apps/settings/views/license/request/dialog.html",'<md-dialog class="request-dialog" aria-label="Send Request">\n <form name="requestForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="SETTINGS.REQUEST_LICENSE">Request License</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.license.name" required>\n <div ng-messages="requestForm.name.$error" ng-show="requestForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.NAME_REQUIRED">Address field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.license.email" required>\n <div ng-messages="requestForm.email.$error" ng-show="requestForm.email.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.PLAN">Plan</label>\n <md-select name="plan" ng-model="vm.license.months" required>\n <md-option ng-value="1"><span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></md-option>\n <md-option ng-value="12"><span translate="SETTINGS.ANNUALLY">ANNUALLY</span></md-option>\n <md-option ng-value="36"><span translate="SETTINGS.PERPETUAL">PERPETUAL</span></md-option>\n </md-select>\n <div ng-messages="requestForm.plan.$error" ng-show="requestForm.plan.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PLAN_REQUIRED">Plan field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.USERS">Users</label>\n <input type="number" name="users" ng-model="vm.license.users" required>\n <div ng-messages="requestForm.users.$error" ng-show="requestForm.users.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.USERS_REQUIRED">Users field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.AGENTS">Agents</label>\n <input type="number" name="agents" ng-model="vm.license.agents" required>\n <div ng-messages="requestForm.agents.$error" ng-show="requestForm.agents.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.AGENTS_REQUIRED">Agents field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.TELEPHONES">Telephones</label>\n <input type="number" name="telephones" ng-model="vm.license.telephones" required>\n <div ng-messages="requestForm.telephones.$error" ng-show="requestForm.telephones.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TELEPHONES_REQUIRED">Telephones field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[channel.name]" aria-label="{{channel.name}}" ng-repeat="channel in vm.channels"><span translate="SETTINGS.{{channel.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[module.name]" aria-label="{{module.name}}" ng-repeat="module in vm.modules"><span translate="SETTINGS.{{module.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <div ng-repeat="other in vm.others" ng-switch="other.name">\n <md-input-container class="md-block" flex ng-switch-when="callysquare">\n <label>Cally Square ({{ \'SETTINGS.CHANNELS\' | translate }})</label>\n <input type="number" name="callysquare" ng-model="vm.license.callysquare" required>\n <div class="hint"><span>0={{ \'SETTINGS.UNLIMITED_CHANNELS\' | translate }}</span></div>\n <div ng-messages="requestForm.users.$error" ng-show="requestForm.users.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.USERS_REQUIRED">Users field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-switch-default>\n <md-switch ng-model="vm.license[other.name]" aria-label="{{other.name}}"><span translate="SETTINGS.{{other.name | uppercase}}"></span></md-switch>\n </div>\n\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <textarea name="description" ng-model="vm.license.description"></textarea>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.sendRequest()" class="send-button md-accent md-raised" ng-disabled="requestForm.$invalid || requestForm.$pristine" aria-label="SEND" translate="SETTINGS.SEND" translate-attr-aria-label="SETTINGS.SEND">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/create/dialog.html",'<md-dialog class="network-dialog" aria-label="New Network">\n <form name="networkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.network.type" required autofocus>\n <md-option ng-value="\'localnet\'">LocalNET</md-option>\n <md-option ng-value="\'externip\'">ExternIP</md-option>\n </md-select>\n <div ng-messages="networkForm[\'type\'].$error" ng-show="networkForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'localnet\'" class="md-block">\n <label translate="SETTINGS.LOCALNETADDRESS">localNetAddress</label>\n <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/"\n ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.LOCALNETADDRESS"></span></div>\n <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_REQUIRED">localNetAddress field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">localNetAddress must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'externip\'" class="md-block">\n <label translate="SETTINGS.ADDRESS">Address</label>\n <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.ADDRESS"></span></div>\n <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ADDRESS_REQUIRED">Address field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.ADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">Address must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newNetwork" ng-click="vm.saveNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid || networkForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newNetwork" ng-click="vm.addNewNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_NETWORK" translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n ADD NETWORK\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newNetwork" ng-click="vm.deleteNetwork($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/networks.html",'<div id="networks" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.NETWORKS">Networks</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SETTINGS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedNetworks.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedNetworks =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SETTINGS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-networks-count">\n <span>{{vm.selectedNetworks.length}}</span>\n <span translate="SETTINGS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="NETWORKS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllNetworks()" translate="SETTINGS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectNetworks()" translate="SETTINGS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedNetworks" csv-label="true" filename="networks.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedNetworks($event)" aria-label="delete selected" translate translate-attr-label="NETWORKS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- NETWORK TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedNetworks" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getNetworks">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SETTINGS.ID\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'SETTINGS.TYPE\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'SETTINGS.ADDRESS\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SETTINGS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.networks.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="SETTINGS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="network" md-select-id="id" ng-repeat="network in vm.networks.rows">\n <td md-cell ng-if="network.userpic"><img class="avatar" alt="{{network.name}}" ng-src="api/users/{{network.id}}/avatar" /></td>\n <td md-cell ng-if="!network.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{network.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="id ">{{network.id}}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="type ">{{ vm.arraytype[network.type].option }}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="value ">{{network.value}}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="createdAt ">{{network.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SETTINGS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(network, $event)" translate="SETTINGS.EDIT_NETWORK">\n Edit Network\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(network, $event)" translate="SETTINGS.DELETE_NETWORK">\n Delete Network\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SETTINGS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SETTINGS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SETTINGS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.networks.count}}" md-on-paginate="vm.getNetworks" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / NETWORK TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD NETWORK BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-network-button" ng-click="vm.createOrEditNetwork($event)" aria-label="add network" translate translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD NETWORK BUTTON --\x3e\n</div>'),e.put("app/main/apps/settings/views/smtps/create/dialog.html",'<md-dialog class="smtp-dialog" aria-label="New Smtp">\n <form name="smtpForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.ACCOUNTNAME">AccountName</label>\n <input type="text" name="name" ng-model="vm.smtp.name" ng-required="true" autofocus>\n <div ng-messages="smtpForm[\'name\'].$error" ng-show="smtpForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ACCOUNTNAME_REQUIRED">AccountName field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.EMAILADDRESS">EmailAddress</label>\n <input type="email" name="email" ng-model="vm.smtp.email" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="smtpForm[\'email\'].$error" ng-show="smtpForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_MUST_VALID">EmailAddress must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.SMTP_SERVICE">SMTP_Service</label>\n <md-select name="Smtp.service" ng-model="vm.smtp.Smtp.service" required>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="smtpForm[\'Smtp.service\'].$error" ng-show="smtpForm[\'Smtp.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_SERVICE_REQUIRED">SMTP_Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.smtp.Smtp.host" ng-required="true">\n <div ng-messages="smtpForm[\'Smtp.host\'].$error" ng-show="smtpForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.smtp.Smtp.port" ng-required="true">\n <div ng-messages="smtpForm[\'Smtp.port\'].$error" ng-show="smtpForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.secure" aria-label="SMTP_Secure"><span translate="SETTINGS.SMTP_SECURE">SMTP_Secure</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_SECURE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.authentication" aria-label="SMTP_Authentication"><span translate="SETTINGS.SMTP_AUTHENTICATION">SMTP_Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null" class="md-block">\n <label translate="SETTINGS.SMTP_USERNAME">SMTP_Username</label>\n <input type="text" name="Smtp.user" ng-model="vm.smtp.Smtp.user" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_USERNAME"></span></div>\n <div ng-messages="smtpForm[\'Smtp.user\'].$error" ng-show="smtpForm[\'Smtp.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_USERNAME_REQUIRED">SMTP_Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null">\n <label translate="SETTINGS.SMTP_PASSWORD">SMTP_Password</label>\n <input type="password" name="Smtp.pass" ng-model="vm.smtp.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="SETTINGS.PASSWORD" required>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_PASSWORD"></span></div>\n <div ng-messages="smtpForm[\'Smtp.pass\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.smtp.description">\n <div ng-messages="smtpForm[\'description\'].$error" ng-show="smtpForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSmtp" ng-click="vm.saveSmtp()" class="send-button md-accent md-raised" ng-disabled="smtpForm.$invalid || smtpForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSmtp" ng-click="vm.addNewSmtp()" class="send-button md-accent md-raised" ng-disabled="smtpForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_SMTP" translate-attr-aria-label="SETTINGS.ADD_SMTP">\n ADD SMTP\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSmtp" ng-click="vm.deleteSmtp($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/smtps/smtps.html",'<div id="smtps" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.SMTP">Smtp</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.verifySmtp()" ng-disabled="!vm.smtp.id" class="send-button md-accent md-raised" translate="SETTINGS.VERIFY" translate-attr-aria-label="SETTINGS.VERIFY">\n VERIFY\n </md-button>\n <md-button type="submit" ng-click="vm.saveSmtp()" ng-disabled="smtpForm.$pristine || smtpForm.$invalid" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n <div class="smtp-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.GENERAL">GENERAL</div>\n </div>\n <form name="smtpForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.ACCOUNTNAME">AccountName</label>\n <input type="text" name="name" ng-model="vm.smtp.name" ng-required="true" autofocus>\n <div ng-messages="smtpForm[\'name\'].$error" ng-show="smtpForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ACCOUNTNAME_REQUIRED">AccountName field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.EMAILADDRESS">EmailAddress</label>\n <input type="email" name="email" ng-model="vm.smtp.email" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="smtpForm[\'email\'].$error" ng-show="smtpForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_MUST_VALID">EmailAddress must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.SMTP_SERVICE">SMTP_Service</label>\n <md-select name="Smtp.service" ng-model="vm.smtp.Smtp.service" required>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="smtpForm[\'Smtp.service\'].$error" ng-show="smtpForm[\'Smtp.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_SERVICE_REQUIRED">SMTP_Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.smtp.Smtp.host" ng-required="true">\n <div ng-messages="smtpForm[\'Smtp.host\'].$error" ng-show="smtpForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.smtp.Smtp.port" ng-required="true">\n <div ng-messages="smtpForm[\'Smtp.port\'].$error" ng-show="smtpForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.secure" aria-label="SMTP_Secure"><span translate="SETTINGS.SMTP_SECURE">SMTP_Secure</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_SECURE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.authentication" aria-label="SMTP_Authentication"><span translate="SETTINGS.SMTP_AUTHENTICATION">SMTP_Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null" class="md-block">\n <label translate="SETTINGS.SMTP_USERNAME">SMTP_Username</label>\n <input type="text" name="Smtp.user" ng-model="vm.smtp.Smtp.user" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_USERNAME"></span></div>\n <div ng-messages="smtpForm[\'Smtp.user\'].$error" ng-show="smtpForm[\'Smtp.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_USERNAME_REQUIRED">SMTP_Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null">\n <label translate="SETTINGS.SMTP_PASSWORD">SMTP_Password</label>\n <input type="password" name="Smtp.pass" ng-model="vm.smtp.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="SETTINGS.PASSWORD" required>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_PASSWORD"></span></div>\n <div ng-messages="smtpForm[\'Smtp.pass\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.smtp.description">\n <div ng-messages="smtpForm[\'description\'].$error" ng-show="smtpForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/system/system.html",'<div id="system" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.SYSTEM">SYSTEM</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" md-border-bottom flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SETTINGS.GENERAL">GENERAL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="system-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget flex="50" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg">\n <div class="h3">OS</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{vm.system.system.manufacturer}} {{vm.system.system.model}}</div>\n <div class="h4">{{vm.system.cpu.manufacturer}} {{vm.system.cpu.brand}} - {{vm.system.cpu.speed}} GHz - {{vm.system.cpu.cores}} Cores</div>\n <div class="h4">{{vm.system.os.distro}} - {{vm.system.os.release}} - Kernel: {{vm.system.os.kernel}}</div>\n <div class="h4">Node.js: {{vm.system.node}}</div>\n <div class="h4">Host: {{vm.system.os.hostname}} - Uptime: {{vm.system.time.uptime / 60 | number:0}} m</div>\n <div class="h4">TimeZone: {{vm.system.time.timezone}} ({{vm.system.time.timezoneName}})</div>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n <ms-widget flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-1">\n <div class="h3">CPU</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.AVG_LOAD">AVG Load</span>\n <span class="h3 secondary-text font-weight-500">{{vm.system.currentLoad.avgload * 100 | number:0}}%</span>\n </div>\n <md-progress-linear class="red" md-mode="determinate" value="{{vm.system.currentLoad.avgload * 100 | number:0}}"></md-progress-linear>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n <ms-widget flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">MEM</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{vm.system.mem.total / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.FREE\' | translate}}: {{vm.system.mem.available / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{vm.system.mem.active / 1024 / 1024 / 1024 | number:0}} GB</div>\n </div>\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.USED">Used</span>\n <span class="h3 secondary-text font-weight-500">{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0}}%</span>\n </div>\n <md-progress-linear class="md-warn" md-mode="determinate" value="{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0 }}"></md-progress-linear>\n\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget ng-repeat="disk in vm.system.fsSize" flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">DISK {{$index + 1}}</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.FILE_SYSTEM\' | translate}}: {{disk.fs}}</div>\n <div class="h4">{{\'SETTINGS.MOUNT_POINT\' | translate}}: "{{disk.mount}}"</div>\n <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{disk.size / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{disk.used / 1024 / 1024 / 1024 | number:0}} GB</div>\n </div>\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.USED">Used</span>\n <span class="h4 secondary-text font-weight-500">{{disk.use | number:0}}%</span>\n </div>\n <md-progress-linear class="red" md-mode="determinate" value="{{disk.use | number:0}}"></md-progress-linear>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget ng-repeat="net in vm.system.net" flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">NET {{$index + 1}}</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.INTERFACE\' | translate}}: {{net.iface}}</div>\n <div class="h4">IPv4: {{net.ip4}}</div>\n <div class="h4">IPv6: {{net.ip6}}</div>\n <div class="h4">MAC: {{net.mac}}</div>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row">\n <div flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.TOP_N_PROCESSES" translate-values="{value: vm.processLimit}"></span>\n <div flex></div>\n <ms-search-bar on-search="vm.searchTerm1 = query" on-collapse="vm.searchTerm1 = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>pid</th>\n <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n <th md-column>pmem</th>\n <th md-column>pcpu</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="process in vm.system.processes.list | limitTo: vm.processLimit | filter: vm.searchTerm1 | orderBy:\'-pcpu\'">\n <td md-cell>{{process.pid}}</td>\n <td md-cell>{{process.command}}</td>\n <td md-cell>\n <span class="text-boxed white-fg" ng-class="{\n \'green-600-bg\': process.state == \'running\',\n \'yellow-600-bg\': process.state == \'sleeping\',\n \'red-600-bg\': process.state == \'blocked\'}">{{process.state | uppercase}}</span>\n </td>\n <td md-cell>{{process.pmem}}%</td>\n <td md-cell>{{process.pcpu}}%</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </md-card>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SETTINGS.PROCESSES">PROCESSES</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="system-detail-form-container general md-background-bg md-whiteframe-1dp">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.MOTION_PROCESS_MANAGEMENT"></span>\n <div flex></div>\n <ms-search-bar on-search="vm.searchTerm2 = query" on-collapse="vm.searchTerm2 = undefined" debounce="300"></ms-search-bar>\n <md-button ng-click="vm.getProcesses()" class="md-icon-button" aria-label="Reload">\n <md-icon md-font-icon="icon-reload" class="s24"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>id</th>\n <th md-column>pid</th>\n <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n <th md-column>MEM</th>\n <th md-column>CPU</th>\n <th md-column width="20px">Actions</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="process in vm.processes | filter: vm.searchTerm2 | orderBy:\'-monit.cpu\'">\n <td md-cell>{{process.pm_id}}</td>\n <td md-cell>{{process.pid}}</td>\n <td md-cell>{{process.name == \'agi\' ? \'agi (Cally Square IVR)\' : process.name}}</td>\n <td md-cell>\n <span class="text-boxed white-fg" ng-class="{\'green-600-bg\': process.pm2_env.status == \'online\', \'red-600-bg\': process.pm2_env.status == \'stopped\'}">{{process.pm2_env.status | uppercase}}</span>\n </td>\n <td md-cell>{{process.monit.memory / 1024 / 1024 | number:0}} MB</td>\n <td md-cell>{{process.monit.cpu}}%</td>\n <td md-cell>\n <md-button ng-if="process.pm2_env.status !== \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'online\')" class="md-icon-button" aria-label="Play">\n <md-icon md-font-icon="icon-play" class="s24"></md-icon>\n </md-button>\n <md-button ng-if="process.pm2_env.status === \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'stopped\')" class="md-icon-button" aria-label="Stop">\n <md-icon md-font-icon="icon-stop" class="s24"></md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell>{{ (vm.processes | map: \'monit.memory\' | sum) / 1024 / 1024 | number:0 }} MB</td>\n <td md-cell></td>\n <td md-cell></td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n </md-card>\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.USEFUL_COMMANDS"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30%">{{\'SETTINGS.COMMAND\' | translate}}</th>\n <th md-column>{{\'SETTINGS.DESCRIPTION\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr>\n <td md-cell class="no-border">pm2 list</td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_LIST\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 start <id | name></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_START\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 stop <id | name | all></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_STOP\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 restart <id | name></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_RESTART\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 logs [id | name]</td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_LOGS\' | translate}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-card>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/settings/views/updates/update/dialog.html",'<md-dialog aria-label="Update">\n <form name="updateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear md-mode="determinate" value="{{vm.progress}}" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content ms-scroll>\n <div layout="row" layout-align="center center">\n <div ng-if="vm.updating" layout="column" layout-align="center center">\n <span class="text-center md-title">Grab a quick coffee and</span>\n <span class="text-center md-title">get back here as soon as completed!</span>\n <span class="text-center md-title">{{vm.output}}</span>\n </div>\n <div ng-if="!vm.updating">\n <div ng-if="vm.success" layout="column" layout-align="center center">\n <span class="text-center md-title">Update Completed! Thank you for your time.</span>\n <span class="text-center md-title">In order to complete the update,</span>\n <span class="text-center md-title">please click on reload button</span>\n </div>\n <div ng-if="!vm.success" layout="column" layout-align="center center">\n <span class="text-center md-title">Update Error!</span>\n <span class="text-center md-title">Please contact your administrator!</span>\n <span class="text-center md-title">{{vm.output}}</span>\n </div>\n </div>\n <img src="assets/images/business/users.jpg" alt="" width="128" height="128" />\n </div>\n </md-dialog-content>\n\n <md-dialog-actions ng-if="!vm.updating" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.reload()" class="send-button md-warm md-raised" aria-label="RELOAD" translate="SETTINGS.RELOAD" translate-attr-aria-label="SETTINGS.RELOAD">\n RELOAD\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/updates/updates.html",'<div id="updates" class="page-layout simple fullwidth doc-page">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.UPDATES">UPDATES</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- UPDATE CARD --\x3e\n <div layout="row" ng-if="!vm.updating">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.CURRENT_VERSION">CURRENT VERSION</span>\n\n <span class="md-display-3 padding-20">{{vm.version.current}}</span>\n\n <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.current}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n CHANGELOG\n </md-button>\n </div>\n </md-card>\n <md-card class="md-whiteframe-20dp padding-20" flex ng-if="vm.version.current != vm.version.latest">\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.NEW_VERSION">NEW VERSION</span>\n\n <span class="md-display-3 padding-20">{{vm.version.latest}}</span>\n\n <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.latest}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n CHANGELOG\n </md-button>\n <md-button ng-click="vm.updateConfirm($event)" class="md-raised md-warn" aria-label="CHANGELOG" translate="SETTINGS.UPDATE" translate-attr-aria-label="SETTINGS.UPDATE">UPDATE</md-button>\n </div>\n </md-card>\n <md-card class="md-whiteframe-1dp padding-20" flex ng-if="vm.version.current == vm.version.latest">\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.REMOTE_VERSION">REMOTE VERSION</span>\n\n <span class="md-subhead padding-20" translate="SETTINGS.NO_NEW_VERSION_AVAILABLE">NO NEW VERSION AVAILABLE</span>\n </div>\n </md-card>\n </div>\n \x3c!-- / UPDATE CARD --\x3e\n\n <div ng-if="vm.updating">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.UPDATING">...</span>\n <md-progress-linear md-mode="determinate" class="md-accent padding-20" value="{{vm.progress}}"></md-progress-linear>\n <span class="md-display-1 padding-5 text-center">Grab a quick coffee and</span>\n <span class="md-display-1 padding-5 text-center">get back here as soon as completed</span>\n <img src="assets/images/business/users.jpg" alt="" width="40%" height="40%" />\n </div>\n </md-card>\n </div>\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'SMS.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'SMS.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'SMS.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'SMS.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'SMS.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="3">{{ \'SMS.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n \x3c!-- <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSE\' | translate }}</th>\n <th md-column width="10px"></th> --\x3e\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'SMS.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'SMS.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatusTime">{{ \'SMS.TIMER\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'SMS.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'busy\':\'indigo-100-bg\',\'*pause\':\'amber-50-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].globalStatus]">{{ vm.isPause(vm.agents[value].globalStatus) ? \'\' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? \'*\'+vm.agents[value].pauseType || \'DEFAULT PAUSE\' : vm.agents[value].pauseType || \'DEFAULT PAUSE\') : \'\'}}</span>\n </td>\n <td class="bt custom-column">\n <timer start-time="vm.agents[value].globalStatusTime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class="bt bl">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'talking\':\'indigo-100-bg\',\'ringing\':\'orange-400-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt bl">\n <div layout="column">\n <span ng-if="vm.agents[value].queue" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].queue }}</span>\n <span ng-if="vm.agents[value].destconnectedlinenum" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class="padding-5" ng-if="vm.agents[value].queue || vm.agents[value].destconnectedlinenum">\n <timer start-time="vm.agents[value].voiceStatusTime" interval="1000" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n \x3c!-- <td class="bt">--</td>\n <td class="bt">--</td> --\x3e\n <td class="bt bl" ng-if="vm.license.chat">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n \x3c!-- <td class="bt padding-5 text-center">{{ agent.chatCurrentCapacity }}/{{ agent.chatCapacity > 0 ? agent.chatCapacity : \'∞\' }}</td> --\x3e\n <td md-number class="bt text-center font-size-20" ng-if="vm.license.chat" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.mail">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.mail" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.messaging">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.messaging" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.openchannel">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">4</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">89</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.openchannel" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.fax">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">7</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">2</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.fax" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class="bl bt padding-5 text-center">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.logout(vm.agents[value], $event)" translate="SMS.LOGOUT">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.queueAdd(vm.agents[value], $event)" translate="SMS.AGENTADD_QUEUE">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="SMS.PAUSE">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=" vm.agents[value].voicePause && \'DEFAULT PAUSE\' === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value])"><em translate="SMS.DEFAULT_PAUSE">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.pauses.rows.length" ng-repeat="pause in vm.pauses.rows">\n <md-button ng-disabled="vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value], pause.name)">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="vm.isPause(vm.agents[value].globalStatus)">\n <md-button ng-click="vm.unPause(vm.agents[value])" translate="SMS.UNPAUSE">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.filteredAgents.length}}"\n md-on-paginate="vm.onInit" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/sms/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column>{{ \'SMS.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'SMS.PAUSED\' | translate }}</th>\n <th md-column>{{ \'SMS.READY\' | translate }}</th>\n <th md-column>{{ \'SMS.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditSmsQueue($event, vm.queues[value])" translate="SMS.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="SMS.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}"\n md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/sms/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/create/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus ng-disabled="!vm.newSmsAccount">\n <div ng-messages="smsAccountForm[\'name\'].$error" ng-show="smsAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">key</label>\n <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="smsAccountForm[\'key\'].$error" ng-show="smsAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" ng-required="true">\n <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="smsAccountForm[\'remote\'].$error" ng-show="smsAccountForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LIST">List</label>\n <md-select name="ListId" ng-model="vm.smsAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n <div ng-messages="smsAccountForm[\'ListId\'].$error" ng-show="smsAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true">\n <div ng-messages="smsAccountForm[\'phone\'].$error" ng-show="smsAccountForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.smsAccount.type" required>\n <md-option ng-value="\'twilio\'">Twilio</md-option>\n <md-option ng-value="\'skebby\'">Skebby</md-option>\n <md-option ng-value="\'connectel\'">Connectel</md-option>\n <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n <md-option ng-value="\'plivo\'">Plivo</md-option>\n </md-select>\n <div ng-messages="smsAccountForm[\'type\'].$error" ng-show="smsAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n <label translate="SMS.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true">\n <div ng-messages="smsAccountForm[\'accountSid\'].$error" ng-show="smsAccountForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHID">AuthID</label>\n <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true">\n <div ng-messages="smsAccountForm[\'authId\'].$error" ng-show="smsAccountForm[\'authId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true">\n <div ng-messages="smsAccountForm[\'authToken\'].$error" ng-show="smsAccountForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n <label translate="SMS.METHOD">Method</label>\n <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required>\n <md-option ng-value="\'basic\'">Basic</md-option>\n <md-option ng-value="\'classic\'">Classic</md-option>\n <md-option ng-value="\'classic+\'">Classic+</md-option>\n </md-select>\n <div ng-messages="smsAccountForm[\'smsMethod\'].$error" ng-show="smsAccountForm[\'smsMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\'" class="md-block">\n <label translate="SMS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true">\n <div ng-messages="smsAccountForm[\'username\'].$error" ng-show="smsAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\'">\n <label translate="SMS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n <div ng-messages="smsAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsAccount.description">\n <div ng-messages="smsAccountForm[\'description\'].$error" ng-show="smsAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSmsAccount" ng-click="vm.saveSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid || smsAccountForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSmsAccount" ng-click="vm.addNewSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSACCOUNT" translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n ADD SMSACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSmsAccount" ng-click="vm.deleteSmsAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/agent/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" required autofocus>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'agent\'].$error" ng-show="smsAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" required autofocus>\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'times\'].$error" ng-show="smsAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" md-maxlength="255" required></textarea>\n\n <div ng-messages="smsAccountFormApp[\'text\'].$error" ng-show="smsAccountFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.TEXT_MAX_LENGTH" translate-values=\'{max: 255}\'>Text must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/close/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus>\n <div ng-messages="smsAccountFormApp[\'disposition\'].$error" ng-show="smsAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus>\n <div ng-messages="smsAccountFormApp[\'condition\'].$error" ng-show="smsAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true">\n <div ng-messages="smsAccountFormApp[\'truepriority\'].$error" ng-show="smsAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true">\n <div ng-messages="smsAccountFormApp[\'falsepriority\'].$error" ng-show="smsAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus>\n <div ng-messages="smsAccountFormApp[\'priority\'].$error" ng-show="smsAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/noop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus>\n <div ng-messages="smsAccountFormApp[\'value\'].$error" ng-show="smsAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/queue/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" required autofocus>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'queue\'].$error" ng-show="smsAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true">\n <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/system/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus>\n <div ng-messages="smsAccountFormApp[\'command\'].$error" ng-show="smsAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable">\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables">{{ variable.name }}</md-option>\n <md-option ng-value="\'\'">None</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'variable\'].$error" ng-show="smsAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",'<md-dialog class="smsCannedAnswer-dialog" aria-label="New SmsCannedAnswer">\n <form name="smsCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">Key</label>\n <input type="" name="key" ng-model="vm.smsCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n <div ng-messages="smsCannedAnswerForm[\'key\'].$error" ng-show="smsCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.VALUE">Value</label>\n <textarea name="value" ng-model="vm.smsCannedAnswer.value" required></textarea>\n\n <div ng-messages="smsCannedAnswerForm[\'value\'].$error" ng-show="smsCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsCannedAnswer.description">\n <div ng-messages="smsCannedAnswerForm[\'description\'].$error" ng-show="smsCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSmsCannedAnswer" ng-click="vm.saveSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid || smsCannedAnswerForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSmsCannedAnswer" ng-click="vm.addNewSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSCANNEDANSWER" translate-attr-aria-label="SMS.ADD_SMSCANNEDANSWER">\n ADD SMSCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSmsCannedAnswer" ng-click="vm.deleteSmsCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/smsDispositions/dialog.html",'<md-dialog class="smsDisposition-dialog" aria-label="New SmsDisposition">\n <form name="smsDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.smsDisposition.name" ng-required="true" autofocus>\n <div ng-messages="smsDispositionForm[\'name\'].$error" ng-show="smsDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSmsDisposition" ng-click="vm.saveSmsDisposition()" class="send-button md-accent md-raised" ng-disabled="smsDispositionForm.$invalid || smsDispositionForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSmsDisposition" ng-click="vm.addNewSmsDisposition()" class="send-button md-accent md-raised" ng-disabled="smsDispositionForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSDISPOSITION" translate-attr-aria-label="SMS.ADD_SMSDISPOSITION">\n ADD SMSDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSmsDisposition" ng-click="vm.deleteSmsDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/view.html",'<div id="sms-smsAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-smsAccounts-button md-icon-button" aria-label="Go to smsAccounts" ng-click="vm.gotoSmsAccounts()" translate translate-attr-aria-label="SMS.GO_TO_SMSACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="smsAccount-image" hide-xs>\n <img ng-src="assets/images/business/smsAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.smsAccount.id}}\n <span ng-if="vm.smsAccount.name">{{vm.smsAccount.name}}</span>\n <span ng-if="vm.smsAccount.exten">{{vm.smsAccount.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveSmsAccount()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (proxyForm.$invalid) || (smsDispositionsForm.$invalid) || (smsCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)"\n translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="smsAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus ng-disabled="true">\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">key</label>\n <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true">\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LIST">List</label>\n <md-select name="ListId" ng-model="vm.smsAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true">\n <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.smsAccount.type" required>\n <md-option ng-value="\'twilio\'">Twilio</md-option>\n <md-option ng-value="\'skebby\'">Skebby</md-option>\n <md-option ng-value="\'connectel\'">Connectel</md-option>\n <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n <md-option ng-value="\'plivo\'">Plivo</md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n <label translate="SMS.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true">\n <div ng-messages="generalForm[\'accountSid\'].$error" ng-show="generalForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHID">AuthID</label>\n <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true">\n <div ng-messages="generalForm[\'authId\'].$error" ng-show="generalForm[\'authId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true">\n <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n <label translate="SMS.METHOD">Method</label>\n <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required>\n <md-option ng-value="\'basic\'">Basic</md-option>\n <md-option ng-value="\'classic\'">Classic</md-option>\n <md-option ng-value="\'classic+\'">Classic+</md-option>\n </md-select>\n <div ng-messages="generalForm[\'smsMethod\'].$error" ng-show="generalForm[\'smsMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\'" class="md-block">\n <label translate="SMS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true">\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\'">\n <label translate="SMS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="(vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'classic+\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.SENDERSTRING">SenderString</label>\n <input type="text" name="senderString" ng-model="vm.smsAccount.senderString" md-maxlength="11" ng-pattern="/^[A-Za-z0-9\\.\\s]*$/i">\n <div ng-messages="generalForm[\'senderString\'].$error" ng-show="generalForm[\'senderString\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.SENDERSTRING_REQUIRED">SenderString field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SENDERSTRING_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\s]*$/i\' }">SenderString must be valid pattern </span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.SENDERSTRING_MAX_LENGTH" translate-values=\'{max: 11}\'>SenderString must have a maximum length equal to 11</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'classic+\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\'" class="md-block">\n <md-switch ng-model="vm.smsAccount.deliveryReport" aria-label="deliveryReport"><span translate="SMS.DELIVERYREPORT">deliveryReport</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.smsAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsAccount.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.RECEIVEURL">receiveUrl</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-receiveUrl" name="receiveUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/notify?token=\' + vm.smsAccount.token" ng-readonly="true">\n </div>\n <div class="hint"><span translate="SMS.HELP.RECEIVEURL"></span></div>\n </md-input-container>\n <md-input-container ng-if="( (vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'classic+\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' ) && vm.smsAccount.deliveryReport" class="md-block">\n <label translate="SMS.DELIVERYREPORTURL">deliveryReportUrl</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-deliveryReportUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-deliveryReportUrl" name="deliveryReportUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/status?token=\' + vm.smsAccount.token" ng-readonly="true">\n </div>\n <div class="hint"><span translate="SMS.HELP.DELIVERYREPORTURL"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="smsAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.notificationSound" aria-label="notificationSound"><span translate="SMS.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.notificationShake" aria-label="notificationShake"><span translate="SMS.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="SMS.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.smsAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="smsAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.PROXY">PROXY</div>\n </div>\n <form name="proxyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.TOKEN">token</label>\n <input type="text" name="token" ng-model="vm.smsAccount.token" autofocus ng-disabled="true">\n <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TOKEN_REQUIRED">token field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" ng-required="true">\n <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="proxyForm[\'remote\'].$error" ng-show="proxyForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="smsAccount-detail-form-container smsdispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountSmsDispositionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountSmsDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.SMSDISPOSITIONS">SmsDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event)" aria-label="add smsDisposition" translate translate-attr-label="SMS.ADD_SMSDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountSmsDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountSmsDispositions.length}} {{vm_dc.selectedSmsAccountSmsDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountSmsDispositions" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountSmsDispositions($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountSmsDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountSmsDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SMS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="smsDisposition" md-select-id="id" ng-repeat="smsDisposition in vm_dc.smsAccountSmsDispositions.rows">\n <td ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" md-cell>{{smsDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" md-cell>{{smsDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" md-cell>{{smsDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" translate="SMS.EDIT_SMSDISPOSITION">\n Edit SmsDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(smsDisposition, $event)" translate="SMS.DELETE_SMSDISPOSITION">\n Delete SmsDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountSmsDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="SMS.NO_SMSDISPOSITION_AVAILABLE">No smsdisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.smsAccountSmsDispositions.count}}" md-on-paginate="vm_dc.getSmsAccountSmsDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="smsAccount-detail-form-container smscannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountSmsCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.smsAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.SMSCANNEDANSWERS">SmsCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event)" aria-label="add smsCannedAnswer" translate translate-attr-label="SMS.ADD_SMSCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountSmsCannedAnswers.length}} {{vm_dc.selectedSmsAccountSmsCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountSmsCannedAnswers" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountSmsCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountSmsCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountSmsCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'SMS.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'SMS.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SMS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="smsCannedAnswer" md-select-id="id" ng-repeat="smsCannedAnswer in vm_dc.smsAccountSmsCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.value}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" translate="SMS.EDIT_SMSCANNEDANSWER">\n Edit SmsCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(smsCannedAnswer, $event)" translate="SMS.DELETE_SMSCANNEDANSWER">\n Delete SmsCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountSmsCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="SMS.NO_SMSCANNEDANSWER_AVAILABLE">No smscannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.smsAccountSmsCannedAnswers.count}}" md-on-paginate="vm_dc.getSmsAccountSmsCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="smsAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.smsAccount)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="SMS.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedSmsAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedSmsAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedSmsAccountApps.length}} {{vm_ac.selectedSmsAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedSmsAccountApps($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedSmsAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.smsAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editSmsAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.smsAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="smsAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getSmsAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="SMS.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountInteractions.length}} {{vm_dc.selectedSmsAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountInteractions" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SMS.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'SMS.CONTACT\' | translate }}</th>\n <th md-column>{{ \'SMS.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'SMS.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'SMS.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'SMS.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'SMS.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.smsAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spysmsInteraction($event, interaction)" translate="SMS.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="SMS.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="SMS.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.smsAccountInteractions.count}}" md-on-paginate="vm_dc.getSmsAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/smsAccounts.html",'<div id="smsAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SMS.SMSACCOUNTS">SmsAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSmsAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSmsAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SMS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-smsAccounts-count">\n <span>{{vm.selectedSmsAccounts.length}}</span>\n <span translate="SMS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMSACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSmsAccounts()" translate="SMS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSmsAccounts()" translate="SMS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSmsAccounts" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedSmsAccounts($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- SMSACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSmsAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'SMS.KEY\' | translate }}</th>\n <th md-column md-order-by="ListId">{{ \'SMS.LIST\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'SMS.PHONE\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'SMS.TYPE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsAccounts.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="smsAccount" md-select-id="id" ng-repeat="smsAccount in vm.smsAccounts.rows">\n <td md-cell ng-if="smsAccount.userpic"><img class="avatar" alt="{{smsAccount.name}}" ng-src="api/users/{{smsAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!smsAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="id ">{{smsAccount.id}}</td>\n <td ng-click="vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="name ">{{smsAccount.name}}</td>\n <td ng-click="vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="key ">{{smsAccount.key}}</td>\n <td ng-click="vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="ListId ">{{ ListId = vm.lists[smsAccount.ListId]; ListId.name }}</td>\n <td ng-click="vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="phone ">{{smsAccount.phone}}</td>\n <td ng-click="vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="type ">{{ vm.arraytype[smsAccount.type].option }}</td>\n <td ng-click="vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="description ">{{smsAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(smsAccount, $event)" translate="SMS.EDIT_SMSACCOUNT">\n Edit SmsAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(smsAccount, $event)" translate="SMS.INTERACTIONS_SMSACCOUNT">\n Interactions SmsAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(smsAccount, $event)" translate="SMS.DELETE_SMSACCOUNT">\n Delete SmsAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsAccounts.count}}"\n md-on-paginate="vm.getSmsAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SMSACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SMSACCOUNT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-smsAccount-button" ng-click="vm.createOrEditSmsAccount($event)" aria-label="add smsAccount" translate translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SMSACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsQueues/create/dialog.html",'<md-dialog class="smsQueue-dialog" aria-label="New SmsQueue">\n <form name="smsQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newSmsQueue">\n <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n <div ng-messages="smsQueueForm[\'name\'].$error" ng-show="smsQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.smsQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="smsQueueForm[\'strategy\'].$error" ng-show="smsQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="smsQueueForm[\'timeout\'].$error" ng-show="smsQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsQueue.description">\n <div ng-messages="smsQueueForm[\'description\'].$error" ng-show="smsQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSmsQueue" ng-click="vm.saveSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid || smsQueueForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSmsQueue" ng-click="vm.addNewSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSQUEUE" translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n ADD SMSQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSmsQueue" ng-click="vm.deleteSmsQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue">\n <form name="smsQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.AGENTADD_SMSQUEUE">Add Agent to smsQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue">\n <form name="smsQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.TEAMADD_SMSQUEUE">Add Team in SMSQUEUE</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/view.html",'<div id="sms-smsQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-smsQueues-button md-icon-button" aria-label="Go to smsQueues" ng-click="vm.gotoSmsQueues()" translate translate-attr-aria-label="SMS.GO_TO_SMSQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="smsQueue-image" hide-xs>\n <img ng-src="assets/images/business/smsQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.smsQueue.id}}\n <span ng-if="vm.smsQueue.name">{{vm.smsQueue.name}}</span>\n <span ng-if="vm.smsQueue.exten">{{vm.smsQueue.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.smsQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="SMS.TEAMADD_SMSQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.smsQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="SMS.AGENTADD_SMSQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSmsQueue()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="smsQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.smsQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" ng-required="true">\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsQueue.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsQueues/smsQueues.html",'<div id="smsQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SMS.SMSQUEUES">SmsQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSmsQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSmsQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SMS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-smsQueues-count">\n <span>{{vm.selectedSmsQueues.length}}</span>\n <span translate="SMS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMSQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSmsQueues()" translate="SMS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSmsQueues()" translate="SMS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSmsQueues" csv-label="true" filename="smsQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedSmsQueues($event)" aria-label="delete selected" translate translate-attr-label="SMSQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- SMSQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSmsQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'SMS.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="smsQueue" md-select-id="id" ng-repeat="smsQueue in vm.smsQueues.rows">\n <td md-cell ng-if="smsQueue.userpic"><img class="avatar" alt="{{smsQueue.name}}" ng-src="api/users/{{smsQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!smsQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="id ">{{smsQueue.id}}</td>\n <td ng-click="vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="name ">{{smsQueue.name}}</td>\n <td ng-click="vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="strategy ">{{ vm.arraystrategy[smsQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(smsQueue, $event)" translate="SMS.EDIT_SMSQUEUE">\n Edit SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(smsQueue, $event)" translate="SMS.TEAMADD_SMSQUEUE">\n teamadd SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(smsQueue, $event)" translate="SMS.AGENTADD_SMSQUEUE">\n agentadd SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(smsQueue, $event)" translate="SMS.DELETE_SMSQUEUE">\n Delete SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(smsQueue, $event)" translate="SMS.GOTOREALTIME_SMSQUEUE">\n goToRealtime SmsQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsQueues.count}}"\n md-on-paginate="vm.getSmsQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SMSQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SMSQUEUE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-smsQueue-button" ng-click="vm.createOrEditSmsQueue($event)" aria-label="add smsQueue" translate translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SMSQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/agents.html",'<div id="agents" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.AGENTS">Agents</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedAgents.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedAgents =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-agents-count">\n <span>{{vm.selectedAgents.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="AGENTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllAgents()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectAgents()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedAgents" csv-label="true" filename="agents.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedAgents($event)" aria-label="delete selected" translate translate-attr-label="AGENTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- AGENT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedAgents" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAgents">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.agents.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="agent" md-select-id="id" ng-repeat="agent in vm.agents.rows">\n <td md-cell ng-if="agent.userpic"><img class="avatar" alt="{{agent.name}}" ng-src="api/users/{{agent.id}}/avatar" /></td>\n <td md-cell ng-if="!agent.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{agent.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditAgent($event, agent)" md-cell class="fullname font-weight-600">{{agent.fullname}}</td>\n <td ng-click="vm.createOrEditAgent($event, agent)" md-cell class="name ">{{agent.name}}</td>\n <td ng-click="vm.createOrEditAgent($event, agent)" md-cell class="email ">{{agent.email}}</td>\n <td ng-click="vm.createOrEditAgent($event, agent)" md-cell class="phone ">{{agent.phone}}</td>\n <td ng-click="vm.createOrEditAgent($event, agent)" md-cell class="mobile ">{{agent.mobile}}</td>\n <td ng-click="vm.createOrEditAgent($event, agent)" md-cell class="internal ">{{agent.internal}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(agent, $event)" translate="STAFF.EDIT_AGENT">\n Edit Agent\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(agent, $event)" translate="STAFF.TEAMADD_AGENT">\n teamadd Agent\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(agent, $event)" translate="STAFF.DELETE_AGENT">\n Delete Agent\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.agents.count}}" md-on-paginate="vm.getAgents" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / AGENT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD AGENT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-agent-button" ng-click="vm.createOrEditAgent($event)" aria-label="add agent" translate translate-attr-aria-label="STAFF.ADD_AGENT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD AGENT BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/create/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n <form name="agentForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus>\n <div ng-messages="agentForm[\'fullname\'].$error" ng-show="agentForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newAgent">\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="agentForm[\'name\'].$error" ng-show="agentForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.agent.alias">\n <div ng-messages="agentForm[\'alias\'].$error" ng-show="agentForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.agent.email" ng-required="true">\n <div ng-messages="agentForm[\'email\'].$error" ng-show="agentForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newAgent">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.agent.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="agentForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newAgent && (vm.newAgent)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n <md-select name="showWebBar" ng-model="vm.agent.showWebBar">\n <md-option ng-value="0">Phonebar</md-option>\n <md-option ng-value="1">External</md-option>\n <md-option ng-value="2">WebRTC (rc-1)</md-option>\n </md-select>\n <div ng-messages="agentForm[\'showWebBar\'].$error" ng-show="agentForm[\'showWebBar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newAgent" class="md-block">\n <md-switch ng-model="vm.agent.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" ng-disabled="!vm.newAgent">\n <div ng-messages="agentForm[\'internal\'].$error" ng-show="agentForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.agent.description">\n <div ng-messages="agentForm[\'description\'].$error" ng-show="agentForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newAgent" class="md-block">\n <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" ng-required="true">\n <div ng-messages="agentForm[\'phoneBarRemoteControlPort\'].$error" ng-show="agentForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newUser" class="md-block">\n <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newAgent" ng-click="vm.saveAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newAgent" ng-click="vm.addNewAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid" aria-label="ADD" translate="STAFF.ADD_AGENT" translate-attr-aria-label="STAFF.ADD_AGENT">\n ADD AGENT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newAgent" ng-click="vm.deleteAgent($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",'<md-dialog class="agent-dialog" aria-label="{{vm.name}}">\n <form name="agentForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="agentForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",'<md-dialog class="agent-dialog" aria-label="agent">\n <form name="agentForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>{{vm.title}}</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin" ng-if="vm.agent.role === \'agent\' && vm.isVoiceChannel()">\n <label translate="STAFF.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="agentForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",'<md-dialog class="agent-dialog" aria-label="agent">\n <form name="agentForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="STAFF.TEAMADD_AGENT">Add Team in AGENT</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/view.html",'<div id="staff-agent" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-agents-button md-icon-button" aria-label="Go to agents" ng-click="vm.gotoAgents()" translate translate-attr-aria-label="STAFF.GO_TO_AGENTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="agent-image" hide-xs>\n <img ng-src="assets/images/business/agents.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.agent.id}}\n <span ng-if="vm.agent.name">{{vm.agent.name}}</span>\n <span ng-if="vm.agent.exten">{{vm.agent.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.agent.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.agent.role !== \'admin\'">\n <md-fab-speed-dial md-direction="left" class="md-scale md-fab">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n <md-tooltip md-direction="top" md-visible="false"><span translate="STAFF.CHANNELS">Channels</span></md-tooltip>\n <md-icon md-font-icon="icon-stackoverflow" aria-label="queueadd"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <md-button aria-label="voice" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'inbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="VOICE.VOICE">Voice</span></md-tooltip>\n <md-icon md-font-icon="icon-phone" aria-label="voice"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.dialer" aria-label="motion bull" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'outbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MOTIONDIALER.MOTIONDIALER">Motion Bull</span></md-tooltip>\n <md-icon md-font-icon="icon-fire" aria-label="motion bull"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.chat" aria-label="chat" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'chat\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="CHAT.CHAT">Chat</span></md-tooltip>\n <md-icon md-font-icon="icon-hangouts" aria-label="chat"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.mail" aria-label="mail" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'mail\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MAIL.MAIL">Email</span></md-tooltip>\n <md-icon md-font-icon="icon-email" aria-label="mail"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.messaging" aria-label="sms" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'sms\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="SMS.SMS">Sms</span></md-tooltip>\n <md-icon md-font-icon="icon-message-text" aria-label="sms"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.openchannel" aria-label="openchannel" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'openchannel\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="OPENCHANNEL.OPENCHANNEL">Openchannel</span></md-tooltip>\n <md-icon md-font-icon="icon-google-earth" aria-label="openchannel"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.fax" aria-label="fax" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'fax\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="FAX.FAX">Fax</span></md-tooltip>\n <md-icon md-font-icon="icon-deskphone" aria-label="fax"></md-icon>\n </md-button>\n </md-fab-actions>\n </md-fab-speed-dial>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.agent, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="STAFF.TEAMADD_AGENT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.changepassworddialog(vm.agent, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_AGENT"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveAgent()" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid) || (capacityForm.$invalid) || (settingsForm.$invalid) || (remote_controlForm.$invalid) || (sipForm.$invalid) || (callforwardingForm.$invalid) || (settings_webrtcForm.$invalid) || (sip_webrtcForm.$invalid) || (general_permissionsForm.$invalid) || (permissionsForm.$invalid)"\n translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="agent-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="personal_infoForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus>\n <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="true">\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.agent.alias">\n <div ng-messages="personal_infoForm[\'alias\'].$error" ng-show="personal_infoForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.agent.email" ng-required="true">\n <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.agent.phone">\n <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.agent.mobile">\n <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n <md-select name="showWebBar" ng-model="vm.agent.showWebBar">\n <md-option ng-value="0">Phonebar</md-option>\n <md-option ng-value="1">External</md-option>\n <md-option ng-value="2">WebRTC (rc-1)</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'showWebBar\'].$error" ng-show="personal_infoForm[\'showWebBar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.loginInPause" aria-label="LoginInPause"><span translate="STAFF.LOGININPAUSE">LoginInPause</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.agent.description">\n <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n </div>\n <form name="security_suiteForm" novalidate>\n <md-input-container ng-if="vm.agent.passwordResetAt != null" class="md-block">\n <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" autofocus ng-disabled="true">\n <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.passwordResetAt == null" class="md-block">\n <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" ng-disabled="true">\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n </div>\n <div ng-controller="Agentchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.agent)" class="agent-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="agent-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()"\n flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="change_avatarimage in vm_ca.agent.images" ng-switch="change_avatarimage.type">\n <div class="agent-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="change_avatarimage.file">\n </div>\n\n <div class="agent-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{change_avatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="agent-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" autofocus ng-disabled="true">\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar != 2" class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.agent.transport" multiple>\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'" ng-if="vm.agent.showWebBar == 1">ws</md-option>\n <md-option ng-value="\'wss\'" ng-if="vm.agent.showWebBar == 1">wss</md-option>\n <md-option ng-value="\'tls\'" ng-if="vm.agent.showWebBar == 1">tls</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.HOST">Host</label>\n <input type="text" name="host" ng-model="vm.agent.host" ng-required="true">\n <div class="hint"><span translate="STAFF.HELP.HOST"></span></div>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.agent.nat" required multiple>\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TYPE">Type</label>\n <md-select name="type" ng-model="vm.agent.type">\n <md-option ng-value="\'friend\'">Friend</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n <md-option ng-value="\'peer\'">Peer</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TYPE"></span></div>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.agent.allow" required multiple>\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLERID">CallerId</label>\n <input type="text" name="callerid" ng-model="vm.agent.callerid">\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.agent.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.agent.callgroup">\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.agent.pickupgroup">\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.chanspy" aria-label="chanSpy"><span translate="STAFF.CHANSPY">chanSpy</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MONITOREXTENSION">MonitorExtension</label>\n <md-select name="extensionMonitor" ng-model="vm.agent.extensionMonitor" required>\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div ng-messages="generalForm[\'extensionMonitor\'].$error" ng-show="generalForm[\'extensionMonitor\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MONITOREXTENSION_REQUIRED">MonitorExtension field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.OTHER_CHANNELS">OTHER_CHANNELS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="agent-detail-form-container capacity md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CAPACITY">CAPACITY</div>\n </div>\n <form name="capacityForm" novalidate>\n <md-input-container ng-if="vm.license.chat" class="md-block">\n <label translate="STAFF.CHATCAPACITY">ChatCapacity</label>\n <input type="number" name="chatCapacity" ng-model="vm.agent.chatCapacity" min="0" ng-required="true" autofocus>\n <div class="hint"><span translate="STAFF.HELP.CHATCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'chatCapacity\'].$error" ng-show="capacityForm[\'chatCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CHATCAPACITY_REQUIRED">ChatCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ChatCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.mail" class="md-block">\n <label translate="STAFF.MAILCAPACITY">MailCapacity</label>\n <input type="number" name="mailCapacity" ng-model="vm.agent.mailCapacity" min="0" ng-required="true">\n <div class="hint"><span translate="STAFF.HELP.MAILCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'mailCapacity\'].$error" ng-show="capacityForm[\'mailCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MAILCAPACITY_REQUIRED">MailCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MailCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.fax" class="md-block">\n <label translate="STAFF.FAXCAPACITY">FaxCapacity</label>\n <input type="number" name="faxCapacity" ng-model="vm.agent.faxCapacity" min="0" ng-required="true">\n <div class="hint"><span translate="STAFF.HELP.FAXCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'faxCapacity\'].$error" ng-show="capacityForm[\'faxCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FAXCAPACITY_REQUIRED">FaxCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FaxCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.messaging" class="md-block">\n <label translate="STAFF.SMSCAPACITY">SMSCapacity</label>\n <input type="number" name="smsCapacity" ng-model="vm.agent.smsCapacity" min="0" ng-required="true">\n <div class="hint"><span translate="STAFF.HELP.SMSCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'smsCapacity\'].$error" ng-show="capacityForm[\'smsCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SMSCAPACITY_REQUIRED">SMSCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.SMSCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">SMSCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.openchannel" class="md-block">\n <label translate="STAFF.OPENCHANNELCAPACITY">OpenchannelCapacity</label>\n <input type="number" name="openchannelCapacity" ng-model="vm.agent.openchannelCapacity" min="0" ng-required="true">\n <div class="hint"><span translate="STAFF.HELP.OPENCHANNELCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'openchannelCapacity\'].$error" ng-show="capacityForm[\'openchannelCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_REQUIRED">OpenchannelCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OpenchannelCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.agent.showWebBar == 0">\n <md-tab-label>\n <span translate="STAFF.MOTIONBAR">MOTIONBAR</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="agent-detail-form-container settings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SETTINGS">SETTINGS</div>\n </div>\n <form name="settingsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" ng-required="true">\n <div ng-messages="settingsForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settingsForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRingInUse" aria-label="RingInUse"><span translate="STAFF.RINGINUSE">RingInUse</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarDnd" aria-label="Dnd"><span translate="STAFF.DND">Dnd</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarUnansweredCallBadge" aria-label="UnansweredCallBadge"><span translate="STAFF.UNANSWEREDCALLBADGE">UnansweredCallBadge</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableJaws" aria-label="EnableJawsIntegration"><span translate="STAFF.ENABLEJAWSINTEGRATION">EnableJawsIntegration</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container remote_control md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.REMOTE_CONTROL">REMOTE_CONTROL</div>\n </div>\n <form name="remote_controlForm" novalidate>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" ng-required="true">\n <div ng-messages="remote_controlForm[\'phoneBarRemoteControlPort\'].$error" ng-show="remote_controlForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container sip md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SIP">SIP</div>\n </div>\n <form name="sipForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus>\n <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n <div ng-messages="sipForm[\'phoneBarExpires\'].$error" ng-show="sipForm[\'phoneBarExpires\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPPORT">SipPort</label>\n <input type="number" name="phoneBarListenPort" ng-model="vm.agent.phoneBarListenPort" ng-required="true">\n <div class="hint"><span translate="STAFF.HELP.SIPPORT"></span></div>\n <div ng-messages="sipForm[\'phoneBarListenPort\'].$error" ng-show="sipForm[\'phoneBarListenPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPPORT_REQUIRED">SipPort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container callforwarding md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CALLFORWARDING">CALLFORWARDING</div>\n </div>\n <form name="callforwardingForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarUnconditional" aria-label="Unconditional"><span translate="STAFF.UNCONDITIONAL">Unconditional</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarUnconditional" class="md-block">\n <label translate="STAFF.UNCONDITIONALNUMBER">UnconditionalNumber</label>\n <input type="text" name="phoneBarUnconditionalNumber" ng-model="vm.agent.phoneBarUnconditionalNumber" ng-required="true">\n <div ng-messages="callforwardingForm[\'phoneBarUnconditionalNumber\'].$error" ng-show="callforwardingForm[\'phoneBarUnconditionalNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.UNCONDITIONALNUMBER_REQUIRED">UnconditionalNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.agent.showWebBar == 2">\n <md-tab-label>\n <span translate="STAFF.WEBRTC">WEBRTC</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="agent-detail-form-container settings_webrtc md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SETTINGS_WEBRTC">SETTINGS_WEBRTC</div>\n </div>\n <form name="settings_webrtcForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.DTLSCERTFILE">dtlscertfile</label>\n <input type="text" name="dtlscertfile" ng-model="vm.agent.dtlscertfile" ng-required="true" autofocus>\n <div class="hint"><span translate="STAFF.HELP.DTLSCERTFILE"></span></div>\n <div ng-messages="settings_webrtcForm[\'dtlscertfile\'].$error" ng-show="settings_webrtcForm[\'dtlscertfile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DTLSCERTFILE_REQUIRED">dtlscertfile field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DTLSPRIVATEKEY">dtlsprivatekey</label>\n <input type="text" name="dtlsprivatekey" ng-model="vm.agent.dtlsprivatekey" ng-required="true">\n <div class="hint"><span translate="STAFF.HELP.DTLSPRIVATEKEY"></span></div>\n <div ng-messages="settings_webrtcForm[\'dtlsprivatekey\'].$error" ng-show="settings_webrtcForm[\'dtlsprivatekey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DTLSPRIVATEKEY_REQUIRED">dtlsprivatekey field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" ng-required="true">\n <div ng-messages="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container sip_webrtc md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SIP_WEBRTC">SIP_WEBRTC</div>\n </div>\n <form name="sip_webrtcForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus>\n <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n <div ng-messages="sip_webrtcForm[\'phoneBarExpires\'].$error" ng-show="sip_webrtcForm[\'phoneBarExpires\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="agent-detail-form-container general_permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL_PERMISSIONS">GENERAL_PERMISSIONS</div>\n </div>\n <form name="general_permissionsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.allowmessenger" aria-label="EnableMessenger"><span translate="STAFF.ENABLEMESSENGER">EnableMessenger</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERMISSIONS">PERMISSIONS</div>\n </div>\n <div ng-controller="AgentPermissionsController as vm_pc" ng-init="vm_pc.init(vm.agent)" class="agent-detail-form-container">\n <md-list ng-repeat="father in vm_pc.navigation[0].children" ng-include="\'permission-nested.html\'" ng-if="vm_pc.agent.role !== \'admin\' && !father.hidden()"></md-list>\n\n \x3c!-- Nested navigation template --\x3e\n <script type="text/ng-template" id="permission-nested.html">\n <md-list-item>\n <md-icon md-font-icon="{{father.icon}}"></md-icon>\n <p translate="{{father.translate}}">{{ father.title }}</p>\n <md-switch class="md-secondary" ng-model="father.enabled" ng-change="vm_pc.onChange(father)" ng-init="father.enabled = vm_pc.agent.permissions.includes(father.id)"></md-switch>\n </md-list-item>\n\n <md-divider></md-divider>\n\n <md-list>\n <md-list-item ng-repeat="child in father.children">\n <md-icon ng-if="child.icon" md-font-icon="{{child.icon}}"></md-icon>\n <p translate="{{child.translate}}">{{ child.title }}</p>\n <md-switch class="md-secondary" ng-model="child.enabled" ng-change="vm_pc.onChange(father, child)" ng-init="child.enabled = vm_pc.agent.permissions.includes(child.id)"></md-switch>\n </md-list-item>\n </md-list>\n <\/script>\n \x3c!-- / Nested navigation template --\x3e\n\n <span ng-if="vm_pc.agent.role === \'admin\'" class="md-headline" translate="STAFF.ALL_MODULES_AVAILABLE">All modules are already available.</span>\n\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/teams/create/dialog.html",'<md-dialog class="team-dialog" aria-label="New Team">\n <form name="teamForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.team.name" ng-required="true" autofocus>\n <div ng-messages="teamForm[\'name\'].$error" ng-show="teamForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.team.description">\n <div ng-messages="teamForm[\'description\'].$error" ng-show="teamForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newTeam" ng-click="vm.saveTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid || teamForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newTeam" ng-click="vm.addNewTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TEAM" translate-attr-aria-label="STAFF.ADD_TEAM">\n ADD TEAM\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newTeam" ng-click="vm.deleteTeam($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",'<md-dialog class="team-dialog" aria-label="team">\n <form name="teamForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="STAFF.AGENTADD_TEAM">Add Agent to team</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/teams.html",'<div id="teams" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.TEAMS">Teams</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTeams.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTeams =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-teams-count">\n <span>{{vm.selectedTeams.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TEAMS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTeams()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTeams()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTeams" csv-label="true" filename="teams.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedTeams($event)" aria-label="delete selected" translate translate-attr-label="TEAMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- TEAM TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTeams" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTeams">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'STAFF.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'STAFF.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.teams.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="team" md-select-id="id" ng-repeat="team in vm.teams.rows">\n <td md-cell ng-if="team.userpic"><img class="avatar" alt="{{team.name}}" ng-src="api/users/{{team.id}}/avatar" /></td>\n <td md-cell ng-if="!team.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{team.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="id ">{{team.id}}</td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="name ">{{team.name}}</td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="description ">{{team.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(team, $event)" translate="STAFF.EDIT_TEAM">\n Edit Team\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(team, $event)" translate="STAFF.AGENTADD_TEAM">\n AgentAdd Team\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(team, $event)" translate="STAFF.DELETE_TEAM">\n Delete Team\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.teams.count}}" md-on-paginate="vm.getTeams" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TEAM TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TEAM BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-team-button" ng-click="vm.createOrEditTeam($event)" aria-label="add team" translate translate-attr-aria-label="STAFF.ADD_TEAM">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TEAM BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/telephones/create/dialog.html",'<md-dialog class="telephone-dialog" aria-label="New Telephone">\n <form name="telephoneForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus>\n <div ng-messages="telephoneForm[\'fullname\'].$error" ng-show="telephoneForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newTelephone">\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="telephoneForm[\'name\'].$error" ng-show="telephoneForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true">\n <div ng-messages="telephoneForm[\'email\'].$error" ng-show="telephoneForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newTelephone">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.telephone.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="telephoneForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newTelephone && (vm.newTelephone)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.telephone.description">\n <div ng-messages="telephoneForm[\'description\'].$error" ng-show="telephoneForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newTelephone" class="md-block">\n <md-switch ng-model="vm.telephone.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" ng-disabled="!vm.newTelephone">\n <div ng-messages="telephoneForm[\'internal\'].$error" ng-show="telephoneForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newTelephone" class="md-block">\n <md-switch ng-model="vm.telephone.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newTelephone" ng-click="vm.saveTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newTelephone" ng-click="vm.addNewTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TELEPHONE" translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n ADD TELEPHONE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newTelephone" ng-click="vm.deleteTelephone($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",'<md-dialog class="telephone-dialog" aria-label="{{vm.name}}">\n <form name="telephoneForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="telephoneForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/view.html",'<div id="staff-telephone" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-telephones-button md-icon-button" aria-label="Go to telephones" ng-click="vm.gotoTelephones()" translate translate-attr-aria-label="STAFF.GO_TO_TELEPHONES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="telephone-image" hide-xs>\n <img ng-src="assets/images/business/telephones.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.telephone.id}}\n <span ng-if="vm.telephone.name">{{vm.telephone.name}}</span>\n <span ng-if="vm.telephone.exten">{{vm.telephone.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.telephone.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.changepassworddialog(vm.telephone, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_TELEPHONE"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTelephone()" class="send-button md-accent md-raised" ng-disabled="(accountForm.$invalid) || (generalForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="telephone-detail-form-container account md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.ACCOUNT">ACCOUNT</div>\n </div>\n <form name="accountForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus>\n <div ng-messages="accountForm[\'fullname\'].$error" ng-show="accountForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="true">\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="accountForm[\'name\'].$error" ng-show="accountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true">\n <div ng-messages="accountForm[\'email\'].$error" ng-show="accountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.telephone.description">\n <div ng-messages="accountForm[\'description\'].$error" ng-show="accountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.telephone.phone">\n <div ng-messages="accountForm[\'phone\'].$error" ng-show="accountForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.telephone.mobile">\n <div ng-messages="accountForm[\'mobile\'].$error" ng-show="accountForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="telephone-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" autofocus ng-disabled="true">\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.telephone.transport" required multiple>\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.telephone.nat" required multiple>\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.telephone.allow" required multiple>\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLERID">CallerId</label>\n <input type="text" name="callerid" ng-model="vm.telephone.callerid">\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.telephone.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.telephone.callgroup">\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.telephone.pickupgroup">\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ENCRYPTION">Encryption</label>\n <md-select name="encryption" ng-model="vm.telephone.encryption" required>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ENCRYPTION"></span></div>\n <div ng-messages="generalForm[\'encryption\'].$error" ng-show="generalForm[\'encryption\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ENCRYPTION_REQUIRED">Encryption field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/telephones/telephones.html",'<div id="telephones" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.TELEPHONES">Telephones</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTelephones.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTelephones =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-telephones-count">\n <span>{{vm.selectedTelephones.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TELEPHONES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTelephones()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTelephones()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTelephones" csv-label="true" filename="telephones.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedTelephones($event)" aria-label="delete selected" translate translate-attr-label="TELEPHONES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- TELEPHONE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTelephones" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="fullname">{{ \'STAFF.ACCOUNTNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.telephones.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="telephone" md-select-id="id" ng-repeat="telephone in vm.telephones.rows">\n <td md-cell ng-if="telephone.userpic"><img class="avatar" alt="{{telephone.name}}" ng-src="api/users/{{telephone.id}}/avatar" /></td>\n <td md-cell ng-if="!telephone.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{telephone.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTelephone($event, telephone)" md-cell class="fullname font-weight-600">{{telephone.fullname}}</td>\n <td ng-click="vm.createOrEditTelephone($event, telephone)" md-cell class="name ">{{telephone.name}}</td>\n <td ng-click="vm.createOrEditTelephone($event, telephone)" md-cell class="email ">{{telephone.email}}</td>\n <td ng-click="vm.createOrEditTelephone($event, telephone)" md-cell class="internal ">{{telephone.internal}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(telephone, $event)" translate="STAFF.EDIT_TELEPHONE">\n Edit Telephone\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(telephone, $event)" translate="STAFF.DELETE_TELEPHONE">\n Delete Telephone\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.telephones.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TELEPHONE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TELEPHONE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-telephone-button" ng-click="vm.createOrEditTelephone($event)" aria-label="add telephone" translate translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TELEPHONE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/users/create/dialog.html",'<md-dialog class="user-dialog" aria-label="New User">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.ROLE">Role</label>\n <md-select name="role" ng-model="vm.user.role" required autofocus ng-disabled="!vm.newUser">\n <md-option ng-value="\'admin\'">Admin</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n </md-select>\n <div ng-messages="userForm[\'role\'].$error" ng-show="userForm[\'role\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true">\n <div ng-messages="userForm[\'fullname\'].$error" ng-show="userForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newUser">\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="userForm[\'name\'].$error" ng-show="userForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.user.email" ng-required="true">\n <div ng-messages="userForm[\'email\'].$error" ng-show="userForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newUser">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.user.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="userForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newUser && (vm.newUser)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.user.description">\n <div ng-messages="userForm[\'description\'].$error" ng-show="userForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newUser" class="md-block">\n <md-switch ng-model="vm.user.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" ng-disabled="!vm.newUser">\n <div ng-messages="userForm[\'internal\'].$error" ng-show="userForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newUser" ng-click="vm.saveUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newUser" ng-click="vm.addNewUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid" aria-label="ADD" translate="STAFF.ADD_USER" translate-attr-aria-label="STAFF.ADD_USER">\n ADD USER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newUser" ng-click="vm.deleteUser($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="userForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/queueadd/queueadd.html",'<md-dialog class="user-dialog" aria-label="user">\n <form name="userForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>{{vm.title}}</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin" ng-if="vm.user.role === \'agent\' && vm.isVoiceChannel()">\n <label translate="STAFF.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="userForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/view.html",'<div id="staff-user" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-users-button md-icon-button" aria-label="Go to users" ng-click="vm.gotoUsers()" translate translate-attr-aria-label="STAFF.GO_TO_USERS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="user-image" hide-xs>\n <img ng-src="assets/images/business/users.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.user.id}}\n <span ng-if="vm.user.name">{{vm.user.name}}</span>\n <span ng-if="vm.user.exten">{{vm.user.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.user.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.user.role !== \'admin\'">\n <md-fab-speed-dial md-direction="left" class="md-scale md-fab">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n <md-tooltip md-direction="top" md-visible="false"><span translate="STAFF.CHANNELS">Channels</span></md-tooltip>\n <md-icon md-font-icon="icon-eye" aria-label="queueadd"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <md-button aria-label="voice" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.user, \'voice\', $event, \'inbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="VOICE.VOICE">Voice</span></md-tooltip>\n <md-icon md-font-icon="icon-phone" aria-label="voice"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.dialer" aria-label="motion bull" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.user, \'voice\', $event, \'outbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MOTIONDIALER.MOTIONDIALER">Motion Bull</span></md-tooltip>\n <md-icon md-font-icon="icon-fire" aria-label="motion bull"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.chat" aria-label="chat" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.user, \'chat\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="CHAT.CHAT">Chat</span></md-tooltip>\n <md-icon md-font-icon="icon-hangouts" aria-label="chat"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.mail" aria-label="mail" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.user, \'mail\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MAIL.MAIL">Email</span></md-tooltip>\n <md-icon md-font-icon="icon-email" aria-label="mail"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.messaging" aria-label="sms" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.user, \'sms\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="SMS.SMS">Sms</span></md-tooltip>\n <md-icon md-font-icon="icon-message-text" aria-label="sms"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.openchannel" aria-label="openchannel" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.user, \'openchannel\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="OPENCHANNEL.OPENCHANNEL">Openchannel</span></md-tooltip>\n <md-icon md-font-icon="icon-google-earth" aria-label="openchannel"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.fax" aria-label="fax" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.user, \'fax\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="FAX.FAX">Fax</span></md-tooltip>\n <md-icon md-font-icon="icon-deskphone" aria-label="fax"></md-icon>\n </md-button>\n </md-fab-actions>\n </md-fab-speed-dial>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.changepassworddialog(vm.user, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_USER"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveUser()" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid) || (general_permissionsForm.$invalid) || (permissionsForm.$invalid)"\n translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="user-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="personal_infoForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.ROLE">Role</label>\n <md-select name="role" ng-model="vm.user.role" required autofocus ng-disabled="true">\n <md-option ng-value="\'admin\'">Admin</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'role\'].$error" ng-show="personal_infoForm[\'role\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true">\n <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="true">\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.user.email" ng-required="true">\n <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.user.phone">\n <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.user.mobile">\n <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.user.description">\n <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="user-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n </div>\n <form name="security_suiteForm" novalidate>\n <md-input-container ng-if="vm.user.passwordResetAt != null" class="md-block">\n <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" autofocus ng-disabled="true">\n <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.user.passwordResetAt == null" class="md-block">\n <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" ng-disabled="true">\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="user-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n </div>\n <div ng-controller="Userchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.user)" class="user-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="user-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()"\n flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="change_avatarimage in vm_ca.user.images" ng-switch="change_avatarimage.type">\n <div class="user-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="change_avatarimage.file">\n </div>\n\n <div class="user-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{change_avatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="user-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" autofocus ng-disabled="true">\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.user.transport" required multiple>\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.user.nat" required multiple>\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.user.allow" required multiple>\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.user.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.user.callgroup">\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.user.pickupgroup">\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div ng-if="vm.currentUser.role === \'admin\' && vm.user.role !== \'admin\'" class="user-detail-form-container general_permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL_PERMISSIONS">GENERAL_PERMISSIONS</div>\n </div>\n <form name="general_permissionsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.EDITPERMISSIONS">EditPermissions</label>\n <md-select name="crudPermissions" ng-model="vm.user.crudPermissions" autofocus>\n\n <md-option ng-value="0"> {{ \'STAFF.READANDEDITANDDELETE\' | translate }}</md-option>\n\n <md-option ng-value="1"> {{ \'STAFF.READANDEDIT\' | translate }}</md-option>\n </md-select>\n <div ng-messages="general_permissionsForm[\'crudPermissions\'].$error" ng-show="general_permissionsForm[\'crudPermissions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EDITPERMISSIONS_REQUIRED">EditPermissions field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="user-detail-form-container permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERMISSIONS">PERMISSIONS</div>\n </div>\n <div ng-controller="UserPermissionsController as vm_pc" ng-init="vm_pc.init(vm.user)" class="user-detail-form-container">\n <md-list ng-repeat="father in vm_pc.navigation[0].children" ng-include="\'permission-nested.html\'" ng-if="vm_pc.user.role !== \'admin\' && !father.hidden()"></md-list>\n\n \x3c!-- Nested navigation template --\x3e\n <script type="text/ng-template" id="permission-nested.html">\n <md-list-item>\n <md-icon md-font-icon="{{father.icon}}"></md-icon>\n <p translate="{{father.translate}}">{{ father.title }}</p>\n <md-switch class="md-secondary" ng-model="father.enabled" ng-change="vm_pc.onChange(father)" ng-init="father.enabled = vm_pc.user.permissions.includes(father.id)"></md-switch>\n </md-list-item>\n\n <md-divider></md-divider>\n\n <md-list>\n <md-list-item ng-repeat="child in father.children">\n <md-icon ng-if="child.icon" md-font-icon="{{child.icon}}"></md-icon>\n <p translate="{{child.translate}}">{{ child.title }}</p>\n <md-switch class="md-secondary" ng-model="child.enabled" ng-change="vm_pc.onChange(father, child)" ng-init="child.enabled = vm_pc.user.permissions.includes(child.id)"></md-switch>\n </md-list-item>\n </md-list>\n <\/script>\n \x3c!-- / Nested navigation template --\x3e\n\n <span ng-if="vm_pc.user.role === \'admin\'" class="md-headline" translate="STAFF.ALL_MODULES_AVAILABLE">All modules are already available.</span>\n\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/users/users.html",'<div id="users" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.USERS">Users</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedUsers.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedUsers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-users-count">\n <span>{{vm.selectedUsers.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="USERS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllUsers()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectUsers()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedUsers" csv-label="true" filename="users.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- USER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedUsers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getUsers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="role">{{ \'STAFF.ROLE\' | translate }}</th>\n <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.users.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="user" md-select-id="id" ng-repeat="user in vm.users.rows">\n <td md-cell ng-if="user.userpic"><img class="avatar" alt="{{user.name}}" ng-src="api/users/{{user.id}}/avatar" /></td>\n <td md-cell ng-if="!user.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{user.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditUser($event, user)" md-cell class="role ">{{ vm.arrayrole[user.role].option }}</td>\n <td ng-click="vm.createOrEditUser($event, user)" md-cell class="fullname font-weight-600">{{user.fullname}}</td>\n <td ng-click="vm.createOrEditUser($event, user)" md-cell class="name ">{{user.name}}</td>\n <td ng-click="vm.createOrEditUser($event, user)" md-cell class="email ">{{user.email}}</td>\n <td ng-click="vm.createOrEditUser($event, user)" md-cell class="phone ">{{user.phone}}</td>\n <td ng-click="vm.createOrEditUser($event, user)" md-cell class="mobile ">{{user.mobile}}</td>\n <td ng-click="vm.createOrEditUser($event, user)" md-cell class="internal ">{{user.internal}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(user, $event)" translate="STAFF.EDIT_USER">\n Edit User\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.role === \'admin\' && user.id !== vm.currentUser.id">\n <md-button ng-click="vm.deleteconfirm(user, $event)" translate="STAFF.DELETE_USER">\n Delete User\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.users.count}}" md-on-paginate="vm.getUsers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USER BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-user-button" ng-click="vm.createOrEditUser($event)" aria-label="add user" translate translate-attr-aria-label="STAFF.ADD_USER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",'<div id="cannedAnswers" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.CANNEDANSWERS">CannedAnswers</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCannedAnswers.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCannedAnswers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-cannedAnswers-count">\n <span>{{vm.selectedCannedAnswers.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CANNEDANSWERS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCannedAnswers()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCannedAnswers()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCannedAnswers" csv-label="true" filename="cannedAnswers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="CANNEDANSWERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- CANNEDANSWER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCannedAnswers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCannedAnswers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'TOOLS.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.cannedAnswers.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="cannedAnswer" md-select-id="id" ng-repeat="cannedAnswer in vm.cannedAnswers.rows">\n <td md-cell ng-if="cannedAnswer.userpic"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="api/users/{{cannedAnswer.id}}/avatar" /></td>\n <td md-cell ng-if="!cannedAnswer.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="id ">{{cannedAnswer.id}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="key ">{{cannedAnswer.key}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="value ">{{cannedAnswer.value}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="description ">{{cannedAnswer.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(cannedAnswer, $event)" translate="TOOLS.EDIT_CANNEDANSWER">\n Edit CannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(cannedAnswer, $event)" translate="TOOLS.DELETE_CANNEDANSWER">\n Delete CannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.cannedAnswers.count}}" md-on-paginate="vm.getCannedAnswers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CANNEDANSWER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CANNEDANSWER BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-cannedAnswer-button" ng-click="vm.createOrEditCannedAnswer($event)" aria-label="add cannedAnswer" translate translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CANNEDANSWER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/create/dialog.html",'<md-dialog class="cannedAnswer-dialog" aria-label="New CannedAnswer">\n <form name="cannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.cannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n <div ng-messages="cannedAnswerForm[\'key\'].$error" ng-show="cannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 255}\'>Key must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <textarea name="value" ng-model="vm.cannedAnswer.value" required></textarea>\n\n <div ng-messages="cannedAnswerForm[\'value\'].$error" ng-show="cannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.cannedAnswer.description">\n <div ng-messages="cannedAnswerForm[\'description\'].$error" ng-show="cannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newCannedAnswer" ng-click="vm.saveCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid || cannedAnswerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newCannedAnswer" ng-click="vm.addNewCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CANNEDANSWER" translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n ADD CANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newCannedAnswer" ng-click="vm.deleteCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/create/dialog.html",'<md-dialog class="customDashboard-dialog" aria-label="New CustomDashboard">\n <form name="customDashboardForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.customDashboard.description">\n <div ng-messages="customDashboardForm[\'description\'].$error" ng-show="customDashboardForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newCustomDashboard" ng-click="vm.saveCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid || customDashboardForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newCustomDashboard" ng-click="vm.addNewCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n ADD CUSTOMDASHBOARD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newCustomDashboard" ng-click="vm.deleteCustomDashboard($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/customDashboards.html",'<div id="customDashboards" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.CUSTOMDASHBOARDS">CustomDashboards</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCustomDashboards.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCustomDashboards =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-customDashboards-count">\n <span>{{vm.selectedCustomDashboards.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CUSTOMDASHBOARDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCustomDashboards()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCustomDashboards()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCustomDashboards" csv-label="true" filename="customDashboards.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedCustomDashboards($event)" aria-label="delete selected" translate translate-attr-label="CUSTOMDASHBOARDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- CUSTOMDASHBOARD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCustomDashboards" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCustomDashboards">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.customDashboards.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="customDashboard" md-select-id="id" ng-repeat="customDashboard in vm.customDashboards.rows">\n <td md-cell ng-if="customDashboard.userpic"><img class="avatar" alt="{{customDashboard.name}}" ng-src="api/users/{{customDashboard.id}}/avatar" /></td>\n <td md-cell ng-if="!customDashboard.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{customDashboard.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="id ">{{customDashboard.id}}</td>\n <td ng-click="vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="name ">{{customDashboard.name}}</td>\n <td ng-click="vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="description ">{{customDashboard.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(customDashboard, $event)" translate="TOOLS.EDIT_CUSTOMDASHBOARD">\n Edit CustomDashboard\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.role == \'admin\'">\n <md-button ng-click="vm.useradddialog(customDashboard, $event)" translate="TOOLS.USERADD_CUSTOMDASHBOARD">\n useradd CustomDashboard\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.clonedialog(customDashboard, $event)" translate="TOOLS.CLONE_CUSTOMDASHBOARD">\n clone CustomDashboard\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotodashboardgoto(customDashboard, $event)" translate="TOOLS.GOTODASHBOARD_CUSTOMDASHBOARD">\n goToDashboard CustomDashboard\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(customDashboard, $event)" translate="TOOLS.DELETE_CUSTOMDASHBOARD">\n Delete CustomDashboard\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.customDashboards.count}}" md-on-paginate="vm.getCustomDashboards" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CUSTOMDASHBOARD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CUSTOMDASHBOARD BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-customDashboard-button" ng-click="vm.createOrEditCustomDashboard($event)" aria-label="add customDashboard" translate translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CUSTOMDASHBOARD BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/customDashboards/edit/clone/clone.html",'<md-dialog class="customDashboard-dialog" aria-label="Clone CustomDashboard">\n <form name="customDashboardForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="CLONE" translate="TOOLS.CLONE_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.CLONE_CUSTOMDASHBOARD">\n CLONE CUSTOMDASHBOARD\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",'<md-dialog class="dashboarditem-dialog" aria-label="New DashboardItem">\n <form name="dashboarditemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.dashboarditem.type" autofocus ng-disabled="!vm.newDashboardItem">\n\n <md-option ng-value="\'counter\'"> {{ \'TOOLS.COUNTER\' | translate }}</md-option>\n\n <md-option ng-value="\'multibar-chart\'"> {{ \'TOOLS.MULTIBARCHART\' | translate }}</md-option>\n\n <md-option ng-value="\'pie-chart\'"> {{ \'TOOLS.PIECHART\' | translate }}</md-option>\n\n <md-option ng-value="\'web-report\'"> {{ \'TOOLS.WEBREPORT\' | translate }}</md-option>\n\n <md-option ng-value="\'iframe\'"> {{ \'TOOLS.IFRAME\' | translate }}</md-option>\n\n <md-option ng-value="\'clock\'"> {{ \'TOOLS.CLOCK\' | translate }}</md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'TOOLS.CUSTOMTYPE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'type\'].$error" ng-show="dashboarditemForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TITLE">Title</label>\n <input type="text" name="title" ng-model="vm.dashboarditem.title" ng-required="true">\n <div ng-messages="dashboarditemForm[\'title\'].$error" ng-show="dashboarditemForm[\'title\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TITLE_REQUIRED">Title field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'iframe\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="attrUrl" ng-model="vm.dashboarditem.attrUrl" ng-required="true">\n <div ng-messages="dashboarditemForm[\'attrUrl\'].$error" ng-show="dashboarditemForm[\'attrUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'custom\'" class="md-block">\n <label translate="TOOLS.PATH">Path</label>\n <input type="text" name="attrPath" ng-model="vm.dashboarditem.attrPath" ng-required="true">\n <div ng-messages="dashboarditemForm[\'attrPath\'].$error" ng-show="dashboarditemForm[\'attrPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PATH_REQUIRED">Path field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n <label translate="TOOLS.FORMAT">Format</label>\n <input type="text" name="attrHourFormat" ng-model="vm.dashboarditem.attrHourFormat" ng-required="true">\n <div ng-messages="dashboarditemForm[\'attrHourFormat\'].$error" ng-show="dashboarditemForm[\'attrHourFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n <label translate="TOOLS.TIMEZONE">Timezone</label>\n <md-select name="attrTimezone" ng-model="vm.dashboarditem.attrTimezone" required>\n <md-option ng-value="\'-12.00\'">GMT-12.00</md-option>\n <md-option ng-value="\'-11.00\'">GMT-11.00</md-option>\n <md-option ng-value="\'-10.00\'">GMT-10.00</md-option>\n <md-option ng-value="\'-9.00\'">GMT-9.00</md-option>\n <md-option ng-value="\'-8.00\'">GMT-8.00</md-option>\n <md-option ng-value="\'-7.00\'">GMT-7.00</md-option>\n <md-option ng-value="\'-6.00\'">GMT-6.00</md-option>\n <md-option ng-value="\'-5.00\'">GMT-5.00</md-option>\n <md-option ng-value="\'-4.00\'">GMT-4.00</md-option>\n <md-option ng-value="\'-3.30\'">GMT-3.30</md-option>\n <md-option ng-value="\'-3.00\'">GMT-3.00</md-option>\n <md-option ng-value="\'-2.00\'">GMT-2.00</md-option>\n <md-option ng-value="\'-1.00\'">GMT-1.00</md-option>\n <md-option ng-value="\'0.00\'">GMT 0.00</md-option>\n <md-option ng-value="\'1.00\'">GMT+1.00</md-option>\n <md-option ng-value="\'2.00\'">GMT+2.00</md-option>\n <md-option ng-value="\'3.00\'">GMT+3.00</md-option>\n <md-option ng-value="\'3.30\'">GMT+3.30</md-option>\n <md-option ng-value="\'4.00\'">GMT+4.00</md-option>\n <md-option ng-value="\'4.30\'">GMT+4.30</md-option>\n <md-option ng-value="\'5.00\'">GMT+5.00</md-option>\n <md-option ng-value="\'5.30\'">GMT+5.30</md-option>\n <md-option ng-value="\'5.45\'">GMT+5.45</md-option>\n <md-option ng-value="\'6.00\'">GMT+6.00</md-option>\n <md-option ng-value="\'6.30\'">GMT+6.30</md-option>\n <md-option ng-value="\'7.00\'">GMT+7.00</md-option>\n <md-option ng-value="\'8.00\'">GMT+8.00</md-option>\n <md-option ng-value="\'9.00\'">GMT+9.00</md-option>\n <md-option ng-value="\'9.30\'">GMT+9.30</md-option>\n <md-option ng-value="\'10.00\'">GMT+10.00</md-option>\n <md-option ng-value="\'11.00\'">GMT+11.00</md-option>\n <md-option ng-value="\'12.00\'">GMT+12.00</md-option>\n <md-option ng-value="\'13.00\'">GMT+13.00</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrTimezone\'].$error" ng-show="dashboarditemForm[\'attrTimezone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'counter\'" class="md-block">\n <label translate="TOOLS.METRIC">Metric</label>\n <md-select name="attrMetric" ng-model="vm.dashboarditem.attrMetric" required>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }}</md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }}</md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }}</md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }}</md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }}</md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrMetric\'].$error" ng-show="dashboarditemForm[\'attrMetric\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE1">Serie1</label>\n <md-select name="attrSerie1" ng-model="vm.dashboarditem.attrSerie1" required>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }}</md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }}</md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }}</md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }}</md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }}</md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie1\'].$error" ng-show="dashboarditemForm[\'attrSerie1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE1_REQUIRED">Serie1 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE2">Serie2</label>\n <md-select name="attrSerie2" ng-model="vm.dashboarditem.attrSerie2">\n\n <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }}</md-option>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }}</md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }}</md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }}</md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }}</md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }}</md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie2\'].$error" ng-show="dashboarditemForm[\'attrSerie2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE2_REQUIRED">Serie2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE3">Serie3</label>\n <md-select name="attrSerie3" ng-model="vm.dashboarditem.attrSerie3">\n\n <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }}</md-option>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }}</md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }}</md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }}</md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }}</md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }}</md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie3\'].$error" ng-show="dashboarditemForm[\'attrSerie3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE3_REQUIRED">Serie3 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n <label translate="TOOLS.REFRESH">Refresh</label>\n <input type="number" name="attrRefresh" ng-model="vm.dashboarditem.attrRefresh" min="5" ng-required="true">\n <div ng-messages="dashboarditemForm[\'attrRefresh\'].$error" ng-show="dashboarditemForm[\'attrRefresh\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REFRESH_REQUIRED">Refresh field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLS.ERRORS.REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Refresh must be a valid greater or equal than</span> <span>5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n <label translate="TOOLS.REPORT">Report</label>\n <md-select name="attrReport" ng-model="vm.dashboarditem.attrReport" required>\n <md-option ng-value="attrReport.id" ng-repeat="attrReport in vm.customReports">{{ attrReport.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrReport\'].$error" ng-show="dashboarditemForm[\'attrReport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\', \'counter\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.FILTERVOICEQUEUES">FilterVoiceQueues</label>\n <md-select name="attrVoiceQueues" ng-model="vm.dashboarditem.attrVoiceQueues" multiple>\n <md-option ng-value="attrVoiceQueues.id" ng-repeat="attrVoiceQueues in vm.voiceQueues">{{ attrVoiceQueues.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrVoiceQueues\'].$error" ng-show="dashboarditemForm[\'attrVoiceQueues\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTERVOICEQUEUES_REQUIRED">FilterVoiceQueues field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'counter\', \'clock\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.FONTSIZE">FontSize</label>\n <input type="number" name="attrFontSize" ng-model="vm.dashboarditem.attrFontSize" min="12" max="40" ng-required="true">\n <div ng-messages="dashboarditemForm[\'attrFontSize\'].$error" ng-show="dashboarditemForm[\'attrFontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FONTSIZE_REQUIRED">FontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>12</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>40</span>\n </div>\n </div>\n </md-input-container>\n <div flex md-color-picker ng-model="vm.dashboarditem.foreground" label="{{\'TOOLS.FOREGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false"\n open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.dashboarditem.background" label="{{\'TOOLS.BACKGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false"\n open-on-input="true"></div>\n <md-input-container class="md-block">\n <label translate="TOOLS.LINK">link</label>\n <input type="url" name="link" ng-model="vm.dashboarditem.link">\n <div ng-messages="dashboarditemForm[\'link\'].$error" ng-show="dashboarditemForm[\'link\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LINK_REQUIRED">link field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.LINK_MUST_VALID_URL">link must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newDashboardItem" ng-click="vm.saveDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid || dashboarditemForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newDashboardItem" ng-click="vm.addNewDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_DASHBOARDITEM" translate-attr-aria-label="TOOLS.ADD_DASHBOARDITEM">\n ADD DASHBOARDITEM\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newDashboardItem" ng-click="vm.deleteDashboardItem($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/useradd/useradd.html",'<md-dialog class="customDashboard-dialog" aria-label="customDashboard">\n <form name="customDashboardForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="TOOLS.USERADD_CUSTOMDASHBOARD">Add User to customDashboard</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/view.html",'<div id="tools-customDashboard" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-customDashboards-button md-icon-button" aria-label="Go to customDashboards" ng-click="vm.gotoCustomDashboards()" translate translate-attr-aria-label="TOOLS.GO_TO_CUSTOMDASHBOARDS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="customDashboard-image" hide-xs>\n <img ng-src="assets/images/business/customDashboards.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.customDashboard.id}}\n <span ng-if="vm.customDashboard.name">{{vm.customDashboard.name}}</span>\n <span ng-if="vm.customDashboard.exten">{{vm.customDashboard.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.customDashboard.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.useradddialog(vm.customDashboard, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="useradd" ng-if="vm.currentUser.role == \'admin\'">\n <md-tooltip><span translate="TOOLS.USERADD_CUSTOMDASHBOARD"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.clonedialog(vm.customDashboard, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="TOOLS.CLONE_CUSTOMDASHBOARD"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.customDashboard, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="TOOLS.GOTO_CUSTOMDASHBOARD"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (dashboardForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="customDashboard-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.customDashboard.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.DASHBOARD">DASHBOARD</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="customDashboard-detail-form-container dashboard md-background-bg md-whiteframe-1dp">\n <div ng-controller="CustomDashboardItemsController as vm_cd" ng-init="vm_cd.init(vm.customDashboard)" class="customDashboard-detail-form-container no-padding no-margin" layout="column">\n <div ng-if="vm_cd.customDashboard.widgets.length">\n <md-button class="md-fab md-mini md-accent" ng-click="vm_cd.createOrEditWidget()" aria-label="add item">\n <md-tooltip>{{ \'TOOLS.ADD_WIDGET\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-content flex>\n <ms-widget-engine config="vm_cd.customDashboard" on-edit="vm_cd.createOrEditWidget(widget)" on-delete="vm_cd.deleteWidget(widget)"></ms-widget-engine>\n </md-content>\n </div>\n <div ng-if="!vm_cd.customDashboard.widgets.length" layout="row" layout-align="center center" flex>\n <md-button class="width-130 height-130 md-accent md-raised" ng-click="vm_cd.createOrEditWidget()" aria-label="add item" layout="column">\n <md-icon md-font-icon="icon-plus-circle" class="s50"></md-icon>\n <span layout-wrap translate="TOOLS.ADD_WIDGET"></span>\n </md-button>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/intervals/create/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.interval.description">\n <div ng-messages="intervalForm[\'description\'].$error" ng-show="intervalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input ng-model="vm.interval.name" type="text" name="name" placeholder="{{\'TOOLS.NAME\' | translate}}" md-autofocus required>\n <div ng-messages="intervalForm.name.$error" ng-show="intervalForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/intervals/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/view.html",'<div id="tools-interval" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-intervals-button md-icon-button" aria-label="Go to intervals" ng-click="vm.gotoIntervals()" translate translate-attr-aria-label="TOOLS.GO_TO_INTERVALS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="interval-image" hide-xs>\n <img ng-src="assets/images/business/intervals.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.interval.id}}\n <span ng-if="vm.interval.name">{{vm.interval.name}}</span>\n <span ng-if="vm.interval.exten">{{vm.interval.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.interval.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (intervalsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="interval-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.interval.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.INTERVALS">INTERVALS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="interval-detail-form-container intervals md-background-bg md-whiteframe-1dp">\n <div ng-controller="IntervalIntervalsController as vm_dc" ng-init="vm_dc.init(vm.interval)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIntervalIntervals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.INTERVALS">Intervals</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditIntervalInterval($event)" aria-label="add interval" translate translate-attr-label="TOOLS.ADD_INTERVAL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIntervalIntervals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIntervalIntervals.length}} {{vm_dc.selectedIntervalIntervals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIntervalIntervals" csv-label="true" filename="intervals.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedIntervalIntervals($event)" aria-label="delete selected" translate translate-attr-label="INTERVALS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIntervalIntervals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIntervalIntervals">\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="interval">{{ \'TOOLS.INTERVAL\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_dc.sortableTable">\n <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm_dc.intervalIntervals.rows">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.id}}</td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.name}}</td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.interval}}</td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" translate="TOOLS.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(interval, $event)" translate="TOOLS.DELETE_INTERVAL">\n Delete Interval\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.intervalIntervals.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="TOOLS.NO_INTERVALS_AVAILABLE">No intervals available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/intervals/intervals.html",'<div id="intervals" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.INTERVALS">Intervals</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedIntervals.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedIntervals =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-intervals-count">\n <span>{{vm.selectedIntervals.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTERVALS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllIntervals()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectIntervals()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedIntervals" csv-label="true" filename="intervals.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedIntervals($event)" aria-label="delete selected" translate translate-attr-label="INTERVALS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- INTERVAL TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedIntervals" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIntervals">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.intervals.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm.intervals.rows">\n <td md-cell ng-if="interval.userpic"><img class="avatar" alt="{{interval.name}}" ng-src="api/users/{{interval.id}}/avatar" /></td>\n <td md-cell ng-if="!interval.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{interval.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditInterval($event, interval)" md-cell class="id ">{{interval.id}}</td>\n <td ng-click="vm.createOrEditInterval($event, interval)" md-cell class="name ">{{interval.name}}</td>\n <td ng-click="vm.createOrEditInterval($event, interval)" md-cell class="description ">{{interval.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(interval, $event)" translate="TOOLS.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(interval, $event)" translate="TOOLS.DELETE_INTERVAL">\n Delete Interval\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.intervals.count}}" md-on-paginate="vm.getIntervals" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / INTERVAL TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD INTERVAL BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-interval-button" ng-click="vm.createOrEditInterval($event)" aria-label="add interval" translate translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD INTERVAL BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/pauses/create/dialog.html",'<md-dialog class="pause-dialog" aria-label="New Pause">\n <form name="pauseForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.pause.name" ng-required="true" autofocus>\n <div ng-messages="pauseForm[\'name\'].$error" ng-show="pauseForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.pause.description">\n <div ng-messages="pauseForm[\'description\'].$error" ng-show="pauseForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newPause" ng-click="vm.savePause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid || pauseForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newPause" ng-click="vm.addNewPause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_PAUSE" translate-attr-aria-label="TOOLS.ADD_PAUSE">\n ADD PAUSE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newPause" ng-click="vm.deletePause($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/pauses/pauses.html",'<div id="pauses" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.PAUSES">Pauses</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedPauses.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedPauses =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-pauses-count">\n <span>{{vm.selectedPauses.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="PAUSES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllPauses()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectPauses()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedPauses" csv-label="true" filename="pauses.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedPauses($event)" aria-label="delete selected" translate translate-attr-label="PAUSES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- PAUSE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedPauses" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getPauses">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.pauses.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="pause" md-select-id="id" ng-repeat="pause in vm.pauses.rows">\n <td md-cell ng-if="pause.userpic"><img class="avatar" alt="{{pause.name}}" ng-src="api/users/{{pause.id}}/avatar" /></td>\n <td md-cell ng-if="!pause.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{pause.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="id ">{{pause.id}}</td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="name ">{{pause.name}}</td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="description ">{{pause.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(pause, $event)" translate="TOOLS.EDIT_PAUSE">\n Edit Pause\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(pause, $event)" translate="TOOLS.DELETE_PAUSE">\n Delete Pause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.pauses.count}}" md-on-paginate="vm.getPauses" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PAUSE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PAUSE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-pause-button" ng-click="vm.createOrEditPause($event)" aria-label="add pause" translate translate-attr-aria-label="TOOLS.ADD_PAUSE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PAUSE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/schedules/create/dialog.html",'<md-dialog class="schedule-dialog" aria-label="New Schedule">\n <form name="scheduleForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.schedule.name" ng-required="true" autofocus>\n <div ng-messages="scheduleForm[\'name\'].$error" ng-show="scheduleForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.REPORTTYPE">ReportType</label>\n <md-select name="type" ng-model="vm.schedule.type" required>\n <md-option ng-value="\'default\'">Default</md-option>\n <md-option ng-value="\'custom\'">Custom</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'type\'].$error" ng-show="scheduleForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORTTYPE_REQUIRED">ReportType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.type == \'default\'" class="md-block">\n <label translate="TOOLS.REPORT">Report</label>\n <md-select name="DefaultReportId" ng-model="vm.schedule.DefaultReportId" required>\n <md-option ng-value="DefaultReportId.id" ng-repeat="DefaultReportId in vm.defaultReports">{{ DefaultReportId.name }}</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'DefaultReportId\'].$error" ng-show="scheduleForm[\'DefaultReportId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.type == \'custom\'" class="md-block">\n <label translate="TOOLS.REPORT">Report</label>\n <md-select name="CustomReportId" ng-model="vm.schedule.CustomReportId" required>\n <md-option ng-value="CustomReportId.id" ng-repeat="CustomReportId in vm.customReports">{{ CustomReportId.name }}</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'CustomReportId\'].$error" ng-show="scheduleForm[\'CustomReportId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OUTPUT">Output</label>\n <md-select name="output" ng-model="vm.schedule.output" required>\n <md-option ng-value="\'csv\'">CSV</md-option>\n <md-option ng-value="\'pdf\'">PDF</md-option>\n <md-option ng-value="\'xlsx\'">Excel</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'output\'].$error" ng-show="scheduleForm[\'output\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTPUT_REQUIRED">Output field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.schedule.active" aria-label="Active"><span translate="TOOLS.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label translate="TOOLS.VALIDITYSTART">ValidityStart</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="startAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="startAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <div class="md-block">\n <label translate="TOOLS.VALIDITYEND">ValidityEnd</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="endAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="endAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <div flex class="md-block">\n <label> {{ \'TOOLS.CRON\' | translate }} ({{vm.schedule.cron}})</label>\n <cron-selection name="cron" ng-model="vm.schedule.cron" template="assets/angular-cron-jobs/template.html" required></cron-selection>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.LAST">Last</label>\n <input type="number" name="subtractNumber" ng-model="vm.schedule.subtractNumber" ng-required="true">\n <div ng-messages="scheduleForm[\'subtractNumber\'].$error" ng-show="scheduleForm[\'subtractNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LAST_REQUIRED">Last field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.LASTUNIT">LastUnit</label>\n <md-select name="subtractUnit" ng-model="vm.schedule.subtractUnit" required>\n <md-option ng-value="\'minutes\'">Minutes</md-option>\n <md-option ng-value="\'hours\'">Hours</md-option>\n <md-option ng-value="\'days\'">Days</md-option>\n <md-option ng-value="\'weeks\'">Weeks</md-option>\n <md-option ng-value="\'months\'">Months</md-option>\n <md-option ng-value="\'quarters\'">Quarters</md-option>\n <md-option ng-value="\'years\'">Years</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'subtractUnit\'].$error" ng-show="scheduleForm[\'subtractUnit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LASTUNIT_REQUIRED">LastUnit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.schedule.sendMail" aria-label="SendMail"><span translate="TOOLS.SENDMAIL">SendMail</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.MAILACCOUNT">MailAccount</label>\n <md-select name="MailAccountId" ng-model="vm.schedule.MailAccountId" required>\n <md-option ng-value="MailAccountId.id" ng-repeat="MailAccountId in vm.mailAccounts">{{ MailAccountId.name }}</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'MailAccountId\'].$error" ng-show="scheduleForm[\'MailAccountId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.MAILACCOUNT_REQUIRED">MailAccount field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.EMAILADDRESS">EmailAddress</label>\n <input type="text" name="email" ng-model="vm.schedule.email" ng-required="true">\n <div class="hint"><span translate="TOOLS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="scheduleForm[\'email\'].$error" ng-show="scheduleForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.schedule.description">\n <div ng-messages="scheduleForm[\'description\'].$error" ng-show="scheduleForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSchedule" ng-click="vm.saveSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid || scheduleForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSchedule" ng-click="vm.addNewSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SCHEDULE" translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n ADD SCHEDULE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSchedule" ng-click="vm.deleteSchedule($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/schedules/schedules.html",'<div id="schedules" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.SCHEDULER">Scheduler</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedScheduler.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedScheduler =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-schedules-count">\n <span>{{vm.selectedScheduler.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SCHEDULER.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllScheduler()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectScheduler()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedScheduler" csv-label="true" filename="schedules.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedScheduler($event)" aria-label="delete selected" translate translate-attr-label="SCHEDULER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- SCHEDULE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedScheduler" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScheduler">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="startAt">{{ \'TOOLS.VALIDITYSTART\' | translate }}</th>\n <th md-column md-order-by="endAt">{{ \'TOOLS.VALIDITYEND\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.schedules.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="schedule" md-select-id="id" ng-repeat="schedule in vm.schedules.rows">\n <td md-cell ng-if="schedule.userpic"><img class="avatar" alt="{{schedule.name}}" ng-src="api/users/{{schedule.id}}/avatar" /></td>\n <td md-cell ng-if="!schedule.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{schedule.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="id ">{{schedule.id}}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="name ">{{schedule.name}}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="active ">\n <md-icon md-colors="{color: {{schedule.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{schedule.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="startAt ">{{schedule.startAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="endAt ">{{schedule.endAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="description ">{{schedule.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(schedule, $event)" translate="TOOLS.EDIT_SCHEDULE">\n Edit Schedule\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(schedule, $event)" translate="TOOLS.DELETE_SCHEDULE">\n Delete Schedule\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.schedules.count}}" md-on-paginate="vm.getScheduler" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SCHEDULE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SCHEDULE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-schedule-button" ng-click="vm.createOrEditSchedule($event)" aria-label="add schedule" translate translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SCHEDULE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/create/dialog.html",'<md-dialog class="sound-dialog" aria-label="New Sound">\n <form name="soundForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sound.name" ng-required="true" autofocus>\n <div ng-messages="soundForm[\'name\'].$error" ng-show="soundForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sound.description">\n <div ng-messages="soundForm[\'description\'].$error" ng-show="soundForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newSound" ng-click="vm.saveSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid || soundForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newSound" ng-click="vm.addNewSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SOUND" translate-attr-aria-label="TOOLS.ADD_SOUND">\n ADD SOUND\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newSound" ng-click="vm.deleteSound($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/sounds/sounds.html",'<div id="sounds" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.SOUNDS">Sounds</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSounds.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSounds =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-sounds-count">\n <span>{{vm.selectedSounds.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SOUNDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSounds()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSounds()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSounds" csv-label="true" filename="sounds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedSounds($event)" aria-label="delete selected" translate translate-attr-label="SOUNDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- SOUND TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSounds" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSounds">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'TOOLS.AUDIO\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.sounds.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="sound" md-select-id="id" ng-repeat="sound in vm.sounds.rows">\n <td md-cell ng-if="sound.userpic"><img class="avatar" alt="{{sound.name}}" ng-src="api/users/{{sound.id}}/avatar" /></td>\n <td md-cell ng-if="!sound.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sound.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="id ">{{sound.id}}</td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="name ">{{sound.name}}</td>\n <td md-cell class="audio ">\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="sound.id" model="\'sound\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="description ">{{sound.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(sound, $event)" translate="TOOLS.EDIT_SOUND">\n Edit Sound\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(sound, $event)" translate="TOOLS.DOWNLOAD_SOUND">\n Download Sound\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(sound, $event)" translate="TOOLS.DELETE_SOUND">\n Delete Sound\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.sounds.count}}" md-on-paginate="vm.getSounds" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SOUND TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SOUND BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-sound-button" ng-click="vm.uploadSound($event)" aria-label="add sound" translate translate-attr-aria-label="SOUNDS.ADD_SOUND">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SOUND BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/uploadsound/dialog.html",'<md-dialog class="upload-dialog" aria-label="Upload Sound">\n <form name="uploadForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="sound-uploader" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)" flow-complete="vm.uploadComplete()" flow-drop\n flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="TOOLS.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="TOOLS.DROP_TO_UPLOAD_MESSAGE">You can also drop audio here to upload. Only MP3, WAV, GSM - Max. 15MB</span>\n </div>\n\n <div layout="row" layout-align="start start">\n <div ng-repeat="sound in vm.uploadSounds | orderBy:\'-\'" ng-switch="sound.type">\n <div class="sound-image" ng-switch-when="uploading" flex>\n <img class="media" src="assets/images/music-player/uploading.png">\n <md-progress-linear md-mode="indeterminate"></md-progress-linear>\n <span class="text-truncate">{{sound.file.name}}</span>\n </div>\n <div class="sound-image" ng-switch-when="sound" flex>\n <img class="media" src="assets/images/music-player/success.png">\n <span class="text-truncate">{{sound.file.name}}</span>\n </div>\n </div>\n </div>\n\n\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center"></div>\n <div layout="row">\n <md-button ng-click="vm.closeDialog()" class="md-accent md-raised" aria-label="FINISH" translate="TOOLS.FINISH" translate-attr-aria-label="TOOLS.FINISH">\n FINISH\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/create/dialog.html",'<md-dialog class="tag-dialog" aria-label="New Tag">\n <form name="tagForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.tag.name" ng-required="true" autofocus>\n <div ng-messages="tagForm[\'name\'].$error" ng-show="tagForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.tag.description">\n <div ng-messages="tagForm[\'description\'].$error" ng-show="tagForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <div flex md-color-picker ng-model="vm.tag.color" label="{{\'TOOLS.COLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newTag" ng-click="vm.saveTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid || tagForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newTag" ng-click="vm.addNewTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TAG" translate-attr-aria-label="TOOLS.ADD_TAG">\n ADD TAG\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newTag" ng-click="vm.deleteTag($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/tags.html",'<div id="tags" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TAGS">Tags</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTags.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTags =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-tags-count">\n <span>{{vm.selectedTags.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TAGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTags()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTags()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTags" csv-label="true" filename="tags.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedTags($event)" aria-label="delete selected" translate translate-attr-label="TAGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- TAG TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTags" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTags">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="color">{{ \'TOOLS.COLOR\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.tags.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="tag" md-select-id="id" ng-repeat="tag in vm.tags.rows">\n <td md-cell ng-if="tag.userpic"><img class="avatar" alt="{{tag.name}}" ng-src="api/users/{{tag.id}}/avatar" /></td>\n <td md-cell ng-if="!tag.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{tag.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="id ">{{tag.id}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="name ">{{tag.name}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="description ">{{tag.description}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="color ">{{tag.color}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(tag, $event)" translate="TOOLS.EDIT_TAG">\n Edit Tag\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(tag, $event)" translate="TOOLS.DELETE_TAG">\n Delete Tag\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.tags.count}}" md-on-paginate="vm.getTags" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TAG TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TAG BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-tag-button" ng-click="vm.createOrEditTag($event)" aria-label="add tag" translate translate-attr-aria-label="TOOLS.ADD_TAG">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TAG BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/templates/create/dialog.html",'<md-dialog class="template-dialog" aria-label="New Template">\n <form name="templateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.template.name" ng-required="true" autofocus>\n <div ng-messages="templateForm[\'name\'].$error" ng-show="templateForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="TOOLS.CONTENT">Content</label>\n <textarea aria-label="Content html" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }"\n ng-model="vm.template.html"></textarea>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.template.description">\n <div ng-messages="templateForm[\'description\'].$error" ng-show="templateForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newTemplate" ng-click="vm.saveTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid || templateForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newTemplate" ng-click="vm.addNewTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TEMPLATE" translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n ADD TEMPLATE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newTemplate" ng-click="vm.deleteTemplate($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/templates/templates.html",'<div id="templates" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TEMPLATES">Templates</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTemplates.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTemplates =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-templates-count">\n <span>{{vm.selectedTemplates.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TEMPLATES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTemplates()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTemplates()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTemplates" csv-label="true" filename="templates.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedTemplates($event)" aria-label="delete selected" translate translate-attr-label="TEMPLATES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- TEMPLATE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTemplates" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTemplates">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.templates.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="template" md-select-id="id" ng-repeat="template in vm.templates.rows">\n <td md-cell ng-if="template.userpic"><img class="avatar" alt="{{template.name}}" ng-src="api/users/{{template.id}}/avatar" /></td>\n <td md-cell ng-if="!template.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{template.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="id ">{{template.id}}</td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="name ">{{template.name}}</td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="description ">{{template.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(template, $event)" translate="TOOLS.EDIT_TEMPLATE">\n Edit Template\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(template, $event)" translate="TOOLS.DELETE_TEMPLATE">\n Delete Template\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.templates.count}}" md-on-paginate="vm.getTemplates" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TEMPLATE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TEMPLATE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-template-button" ng-click="vm.createOrEditTemplate($event)" aria-label="add template" translate translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TEMPLATE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/triggers/create/dialog.html",'<md-dialog class="trigger-dialog" aria-label="New Trigger">\n <form name="triggerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trigger.name" ng-required="true" autofocus>\n <div ng-messages="triggerForm[\'name\'].$error" ng-show="triggerForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.trigger.channel" required ng-disabled="!vm.newTrigger">\n\n <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }}</md-option>\n\n <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel"> {{ \'TOOLS.OPENCHANNEL\' | translate }}</md-option>\n\n <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }}</md-option>\n\n <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }}</md-option>\n\n <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }}</md-option>\n\n <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }}</md-option>\n </md-select>\n <div ng-messages="triggerForm[\'channel\'].$error" ng-show="triggerForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trigger.status" aria-label="Status"><span translate="TOOLS.STATUS">Status</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trigger.description">\n <div ng-messages="triggerForm[\'description\'].$error" ng-show="triggerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newTrigger" ng-click="vm.saveTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid || triggerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newTrigger" ng-click="vm.addNewTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRIGGER" translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n ADD TRIGGER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newTrigger" ng-click="vm.deleteTrigger($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/actions/dialog.html",'<md-dialog class="action-dialog" aria-label="New Action">\n <form name="actionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.ACTION">Action</label>\n <md-select name="action" ng-model="vm.action.action" required autofocus ng-disabled="!vm.newAction">\n\n <md-option ng-value="\'contactManager\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CONTACT_MANAGER\' | translate }}</md-option>\n\n <md-option ng-value="\'integration\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.INTEGRATIONS\' | translate }}</md-option>\n\n <md-option ng-value="\'motionbar\'"> {{ \'TOOLS.MOTION_BAR\' | translate }}</md-option>\n\n <md-option ng-value="\'jscripty\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.JSCRIPTY\' | translate }}</md-option>\n\n <md-option ng-value="\'urlForward\'"> {{ \'TOOLS.URL_FORWARD\' | translate }}</md-option>\n\n <md-option ng-value="\'browser\'"> {{ \'TOOLS.BROWSER\' | translate }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'action\'].$error" ng-show="actionForm[\'action\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACTION_REQUIRED">Action field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'jscripty\'" class="md-block">\n <label translate="TOOLS.PROJECT">Project</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.projects">{{ data1.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'0\'">Popup</md-option>\n <md-option ng-value="\'1\'">CTI URL</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.LIST">List</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.lists">{{ data1.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.AUTOCREATECONTACT">AutoCreateContact</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n\n <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.AUTOCREATECONTACT_REQUIRED">AutoCreateContact field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'GET\'">GET</md-option>\n <md-option ng-value="\'POST\'">POST</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\'" class="md-block">\n <label translate="TOOLS.INTEGRATION">Integration</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'zendesk\'">Zendesk</md-option>\n <md-option ng-value="\'salesforce\'">Salesforce</md-option>\n <md-option ng-value="\'sugarcrm\'">SugarCRM</md-option>\n <md-option ng-value="\'freshdesk\'">Freshdesk</md-option>\n <md-option ng-value="\'desk\'">Desk</md-option>\n <md-option ng-value="\'zoho\'">Zoho</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.INTEGRATION_REQUIRED">Integration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zendesk\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.zendeskAccounts">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'desk\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.deskAccounts">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zoho\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.zohoAccounts">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'salesforce\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.salesforceAccounts">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'sugarcrm\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.sugarcrmAccounts">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'freshdesk\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.freshdeskAccounts">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zendesk\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.zendeskConfigurations | filter:{AccountId:vm.action.data2}">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'desk\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.deskConfigurations | filter:{AccountId:vm.action.data2}">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zoho\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.zohoConfigurations | filter:{AccountId:vm.action.data2}">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'salesforce\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.salesforceConfigurations | filter:{AccountId:vm.action.data2}">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'sugarcrm\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.sugarcrmConfigurations | filter:{AccountId:vm.action.data2}">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'freshdesk\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.freshdeskConfigurations | filter:{AccountId:vm.action.data2}">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'0\'">Popup</md-option>\n <md-option ng-value="\'1\'">CTI URL</md-option>\n <md-option ng-value="\'2\'">Windows App</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n <label translate="TOOLS.APPLICATION">Application</label>\n <input type="text" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n <label translate="TOOLS.ARGUMENTS">Arguments</label>\n <input type="text" name="data3" ng-model="vm.action.data3">\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'0\'" class="md-block">\n <label translate="TOOLS.TEMPLATE">Template</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'0\'" class="md-block">\n <label translate="TOOLS.TEMPLATE">Template</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.action.action == \'motionbar\' || vm.action.action == \'browser\') && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.EVENTVARIABLES">EventVariables</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n\n <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.EVENTVARIABLES"></span></div>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EVENTVARIABLES_REQUIRED">EventVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.LOCATION">Location</label>\n <md-select name="data4" ng-model="vm.action.data4" required>\n\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NEW_TAB\' | translate }}</md-option>\n\n <md-option ng-value="\'1\'"> {{ \'TOOLS.NEW_WINDOW\' | translate }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data4\'].$error" ng-show="actionForm[\'data4\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LOCATION_REQUIRED">Location field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n <label translate="TOOLS.WINDOWWIDTH">WindowWidth</label>\n <input type="text" name="data5" ng-model="vm.action.data5">\n <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.WINDOWWIDTH_REQUIRED">WindowWidth field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n <label translate="TOOLS.WINDOWHEIGHT">WindowHeight</label>\n <input type="text" name="data6" ng-model="vm.action.data6">\n <div ng-messages="actionForm[\'data6\'].$error" ng-show="actionForm[\'data6\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.WINDOWHEIGHT_REQUIRED">WindowHeight field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newAction" ng-click="vm.saveAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid || actionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newAction" ng-click="vm.addNewAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ACTION" translate-attr-aria-label="TOOLS.ADD_ACTION">\n ADD ACTION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newAction" ng-click="vm.deleteAction($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/allconditions/dialog.html",'<md-dialog class="allCondition-dialog" aria-label="New AllCondition">\n <form name="allConditionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.FIELD">Field</label>\n <md-select name="field" ng-model="vm.allCondition.field" required autofocus>\n\n <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }}</md-option>\n\n <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }}</md-option>\n\n <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }}</md-option>\n\n <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.INTERACTION\' | translate }}</md-option>\n\n <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'field\'].$error" ng-show="allConditionForm[\'field\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OPERATOR">Operator</label>\n <md-select name="operator" ng-model="vm.allCondition.operator" required>\n\n <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }}</md-option>\n\n <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'operator\'].$error" ng-show="allConditionForm[\'operator\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'chat\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.chatAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'mail\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.mailAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'sms\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.smsAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'fax\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.faxAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'openchannel\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.openchannelAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.QUEUE">Queue</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.queues">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.outboundRoutes">{{ value.exten }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'lastevent\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'abandoned\'">Abandon</md-option>\n <md-option ng-value="\'complete\'">Hangup</md-option>\n <md-option ng-value="\'rejected\'">Reject</md-option>\n <md-option ng-value="\'called\'">Ring</md-option>\n <md-option ng-value="\'connect\'">Answer</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'opened\'">Opened</md-option>\n <md-option ng-value="\'closed\'">Closed</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'in\'">Incoming</md-option>\n <md-option ng-value="\'out\'">Outgoing</md-option>\n <md-option ng-value="\'accept\'">Accepted</md-option>\n <md-option ng-value="\'reject\'">Rejected</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newAllCondition" ng-click="vm.saveAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid || allConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newAllCondition" ng-click="vm.addNewAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ALLCONDITION" translate-attr-aria-label="TOOLS.ADD_ALLCONDITION">\n ADD ALLCONDITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newAllCondition" ng-click="vm.deleteAllCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/anyconditions/dialog.html",'<md-dialog class="anyCondition-dialog" aria-label="New AnyCondition">\n <form name="anyConditionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.FIELD">Field</label>\n <md-select name="field" ng-model="vm.anyCondition.field" required autofocus>\n\n <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }}</md-option>\n\n <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }}</md-option>\n\n <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }}</md-option>\n\n <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }}</md-option>\n\n <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.INTERACTION\' | translate }}</md-option>\n\n <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'field\'].$error" ng-show="anyConditionForm[\'field\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OPERATOR">Operator</label>\n <md-select name="operator" ng-model="vm.anyCondition.operator" required>\n\n <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }}</md-option>\n\n <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'operator\'].$error" ng-show="anyConditionForm[\'operator\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'chat\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.chatAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'mail\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.mailAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'sms\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.smsAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'fax\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.faxAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'openchannel\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.openchannelAccounts">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.QUEUE">Queue</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.queues">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.outboundRoutes">{{ value.exten }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'lastevent\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'abandoned\'">Abandon</md-option>\n <md-option ng-value="\'complete\'">Hangup</md-option>\n <md-option ng-value="\'rejected\'">Reject</md-option>\n <md-option ng-value="\'called\'">Ring</md-option>\n <md-option ng-value="\'connect\'">Answer</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'opened\'">Opened</md-option>\n <md-option ng-value="\'closed\'">Closed</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'in\'">Incoming</md-option>\n <md-option ng-value="\'out\'">Outgoing</md-option>\n <md-option ng-value="\'accept\'">Accepted</md-option>\n <md-option ng-value="\'reject\'">Rejected</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newAnyCondition" ng-click="vm.saveAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid || anyConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newAnyCondition" ng-click="vm.addNewAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ANYCONDITION" translate-attr-aria-label="TOOLS.ADD_ANYCONDITION">\n ADD ANYCONDITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newAnyCondition" ng-click="vm.deleteAnyCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/view.html",'<div id="tools-trigger" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-triggers-button md-icon-button" aria-label="Go to triggers" ng-click="vm.gotoTriggers()" translate translate-attr-aria-label="TOOLS.GO_TO_TRIGGERS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="trigger-image" hide-xs>\n <img ng-src="assets/images/business/triggers.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.trigger.id}}\n <span ng-if="vm.trigger.name">{{vm.trigger.name}}</span>\n <span ng-if="vm.trigger.exten">{{vm.trigger.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.trigger.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveTrigger()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (allconditionsForm.$invalid) || (anyconditionsForm.$invalid) || (actionsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="trigger-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trigger.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.trigger.channel" required ng-disabled="true">\n\n <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }}</md-option>\n\n <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel"> {{ \'TOOLS.OPENCHANNEL\' | translate }}</md-option>\n\n <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }}</md-option>\n\n <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }}</md-option>\n\n <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }}</md-option>\n\n <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'channel\'].$error" ng-show="generalForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trigger.status" aria-label="Status"><span translate="TOOLS.STATUS">Status</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trigger.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.CONDITIONS&ACTIONS">CONDITIONS&ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="trigger-detail-form-container allconditions md-background-bg md-whiteframe-1dp">\n <div ng-controller="TriggerAllConditionsController as vm_dc" ng-init="vm_dc.init(vm.trigger)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerAllConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ALLCONDITIONS">AllConditions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAllCondition($event)" aria-label="add allCondition" translate translate-attr-label="TOOLS.ADD_ALLCONDITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerAllConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedTriggerAllConditions.length}} {{vm_dc.selectedTriggerAllConditions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerAllConditions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerAllConditions($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerAllConditions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerAllConditions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="field">{{ \'TOOLS.FIELD\' | translate }}</th>\n <th md-column md-order-by="operator">{{ \'TOOLS.OPERATOR\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="allCondition" md-select-id="id" ng-repeat="allCondition in vm_dc.triggerAllConditions.rows">\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{allCondition.id}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayfield[allCondition.field].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayoperator[allCondition.operator].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="!allCondition.value" md-cell>{{allCondition.value}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'chat\' && allCondition.field == \'account\'" md-cell>{{ value = vm_dc.chatAccounts[allCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'mail\' && allCondition.field == \'account\'" md-cell>{{ value = vm_dc.mailAccounts[allCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'sms\' && allCondition.field == \'account\'" md-cell>{{ value = vm_dc.smsAccounts[allCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'fax\' && allCondition.field == \'account\'" md-cell>{{ value = vm_dc.faxAccounts[allCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'openchannel\' && allCondition.field == \'account\'" md-cell>{{ value = vm_dc.openchannelAccounts[allCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'queue\'" md-cell>{{ value = vm_dc.queues[allCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'routeId\'" md-cell>{{ value = vm_dc.outboundRoutes[allCondition.value]; value.exten }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'lastevent\'" md-cell>{{ vm_dc.callStatusValues[allCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'interaction\'" md-cell>{{ vm_dc.interactionStatusValues[allCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'message\'" md-cell>{{ vm_dc.messageStatusValues[allCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{allCondition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" translate="TOOLS.EDIT_ALLCONDITION">\n Edit AllCondition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(allCondition, $event)" translate="TOOLS.DELETE_ALLCONDITION">\n Delete AllCondition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.triggerAllConditions.rows.length">\n <td md-cell colspan="17">\n <span class="text-boxed-ligth" translate="TOOLS.NO_ALLCONDITION_AVAILABLE">No allcondition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.triggerAllConditions.count}}" md-on-paginate="vm_dc.getTriggerAllConditions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n <div class="trigger-detail-form-container anyconditions md-background-bg md-whiteframe-1dp">\n <div ng-controller="TriggerAnyConditionsController as vm_dc" ng-init="vm_dc.init(vm.trigger)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerAnyConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ANYCONDITIONS">AnyConditions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAnyCondition($event)" aria-label="add anyCondition" translate translate-attr-label="TOOLS.ADD_ANYCONDITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerAnyConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedTriggerAnyConditions.length}} {{vm_dc.selectedTriggerAnyConditions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerAnyConditions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerAnyConditions($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerAnyConditions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerAnyConditions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="field">{{ \'TOOLS.FIELD\' | translate }}</th>\n <th md-column md-order-by="operator">{{ \'TOOLS.OPERATOR\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="anyCondition" md-select-id="id" ng-repeat="anyCondition in vm_dc.triggerAnyConditions.rows">\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{anyCondition.id}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayfield[anyCondition.field].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayoperator[anyCondition.operator].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="!anyCondition.value" md-cell>{{anyCondition.value}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'chat\' && anyCondition.field == \'account\'" md-cell>{{ value = vm_dc.chatAccounts[anyCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'mail\' && anyCondition.field == \'account\'" md-cell>{{ value = vm_dc.mailAccounts[anyCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'sms\' && anyCondition.field == \'account\'" md-cell>{{ value = vm_dc.smsAccounts[anyCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'fax\' && anyCondition.field == \'account\'" md-cell>{{ value = vm_dc.faxAccounts[anyCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'openchannel\' && anyCondition.field == \'account\'" md-cell>{{ value = vm_dc.openchannelAccounts[anyCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'queue\'" md-cell>{{ value = vm_dc.queues[anyCondition.value]; value.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'routeId\'" md-cell>{{ value = vm_dc.outboundRoutes[anyCondition.value]; value.exten }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'lastevent\'" md-cell>{{ vm_dc.callStatusValues[anyCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'interaction\'" md-cell>{{ vm_dc.interactionStatusValues[anyCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'message\'" md-cell>{{ vm_dc.messageStatusValues[anyCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{anyCondition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" translate="TOOLS.EDIT_ANYCONDITION">\n Edit AnyCondition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(anyCondition, $event)" translate="TOOLS.DELETE_ANYCONDITION">\n Delete AnyCondition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.triggerAnyConditions.rows.length">\n <td md-cell colspan="17">\n <span class="text-boxed-ligth" translate="TOOLS.NO_ANYCONDITION_AVAILABLE">No anycondition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.triggerAnyConditions.count}}" md-on-paginate="vm_dc.getTriggerAnyConditions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n <div class="trigger-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="TriggerActionsController as vm_dc" ng-init="vm_dc.init(vm.trigger)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ACTIONS">Actions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAction($event)" aria-label="add action" translate translate-attr-label="TOOLS.ADD_ACTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedTriggerActions.length}} {{vm_dc.selectedTriggerActions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerActions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerActions($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerActions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerActions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="action">{{ \'TOOLS.ACTION\' | translate }}</th>\n <th md-column md-order-by="data1">{{ \'TOOLS.TYPE\' | translate }}</th>\n <th md-column md-order-by="data2">{{ \'TOOLS.INFO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="action" md-select-id="id" ng-repeat="action in vm_dc.triggerActions.rows">\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>{{action.id}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayaction[action.action].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'jscripty\'" md-cell>{{ data1 = vm_dc.projects[action.data1]; data1.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\'" md-cell>{{ vm_dc.browserValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>{{ data1 = vm_dc.lists[action.data1]; data1.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>{{ \'TOOLS.\' + vm_dc.autoCreateContact[action.data2].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>{{ vm_dc.urlForwardValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="!action.data2" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\'" md-cell>{{ vm_dc.integrationValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zendesk\'" md-cell>{{ data2 = vm_dc.zendeskAccounts[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'desk\'" md-cell>{{ data2 = vm_dc.deskAccounts[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zoho\'" md-cell>{{ data2 = vm_dc.zohoAccounts[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'salesforce\'" md-cell>{{ data2 = vm_dc.salesforceAccounts[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'sugarcrm\'" md-cell>{{ data2 = vm_dc.sugarcrmAccounts[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'freshdesk\'" md-cell>{{ data2 = vm_dc.freshdeskAccounts[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\'" md-cell>{{ vm_dc.motionbarValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 == \'1\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 == \'2\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 == \'0\'" md-cell>{{ data2 = vm_dc.templates[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 == \'0\'" md-cell>{{ data2 = vm_dc.templates[action.data2]; data2.name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 == \'1\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>{{action.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.createOrEditTriggerAction($event, action)" translate="TOOLS.EDIT_ACTION">\n Edit Action\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(action, $event)" translate="TOOLS.DELETE_ACTION">\n Delete Action\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.triggerActions.rows.length">\n <td md-cell colspan="36">\n <span class="text-boxed-ligth" translate="TOOLS.NO_ACTION_AVAILABLE">No action available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.triggerActions.count}}" md-on-paginate="vm_dc.getTriggerActions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/triggers/triggers.html",'<div id="triggers" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TRIGGERS">Triggers</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTriggers.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTriggers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-triggers-count">\n <span>{{vm.selectedTriggers.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TRIGGERS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTriggers()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTriggers()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTriggers" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedTriggers($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- TRIGGER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTriggers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTriggers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="channel">{{ \'TOOLS.CHANNEL\' | translate }}</th>\n <th md-column md-order-by="status">{{ \'TOOLS.STATUS\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.triggers.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="trigger" md-select-id="id" ng-repeat="trigger in vm.triggers.rows">\n <td md-cell ng-if="trigger.userpic"><img class="avatar" alt="{{trigger.name}}" ng-src="api/users/{{trigger.id}}/avatar" /></td>\n <td md-cell ng-if="!trigger.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{trigger.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="id ">{{trigger.id}}</td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="name ">{{trigger.name}}</td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="channel ">{{ \'TOOLS.\' + vm.arraychannel[trigger.channel].option | uppercase | translate }}</td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="status ">\n <md-icon md-colors="{color: {{trigger.status ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{trigger.status ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="description ">{{trigger.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(trigger, $event)" translate="TOOLS.EDIT_TRIGGER">\n Edit Trigger\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(trigger, $event)" translate="TOOLS.DELETE_TRIGGER">\n Delete Trigger\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.triggers.count}}" md-on-paginate="vm.getTriggers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TRIGGER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TRIGGER BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-trigger-button" ng-click="vm.createOrEditTrigger($event)" aria-label="add trigger" translate translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TRIGGER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/trunks/create/dialog.html",'<md-dialog class="trunk-dialog" aria-label="New Trunk">\n <form name="trunkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newTrunk">\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="trunkForm[\'name\'].$error" ng-show="trunkForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.HOST">host</label>\n <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true">\n <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n <div ng-messages="trunkForm[\'host\'].$error" ng-show="trunkForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SECRET">secret</label>\n <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n <div ng-messages="trunkForm[\'secret\'].$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser">\n <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n <div ng-messages="trunkForm[\'defaultuser\'].$error" ng-show="trunkForm[\'defaultuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.REGISTRY">registry</label>\n <input type="text" name="registry" ng-model="vm.trunk.registry">\n <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n <div ng-messages="trunkForm[\'registry\'].$error" ng-show="trunkForm[\'registry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trunk.description">\n <div ng-messages="trunkForm[\'description\'].$error" ng-show="trunkForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newTrunk" ng-click="vm.saveTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid || trunkForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newTrunk" ng-click="vm.addNewTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRUNK" translate-attr-aria-label="TOOLS.ADD_TRUNK">\n ADD TRUNK\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newTrunk" ng-click="vm.deleteTrunk($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/trunks/edit/view.html",'<div id="tools-trunk" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-trunks-button md-icon-button" aria-label="Go to trunks" ng-click="vm.gotoTrunks()" translate translate-attr-aria-label="TOOLS.GO_TO_TRUNKS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="trunk-image" hide-xs>\n <img ng-src="assets/images/business/trunks.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.trunk.id}}\n <span ng-if="vm.trunk.name">{{vm.trunk.name}}</span>\n <span ng-if="vm.trunk.exten">{{vm.trunk.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.trunk.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.trunk, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="TOOLS.GOTO_TRUNK"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTrunk()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (otherFieldsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="trunk-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.HOST">host</label>\n <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true">\n <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SECRET">secret</label>\n <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n <div ng-messages="generalForm[\'secret\'].$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser">\n <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n <div ng-messages="generalForm[\'defaultuser\'].$error" ng-show="generalForm[\'defaultuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CONTEXT">context</label>\n <md-select name="context" ng-model="vm.trunk.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.CONTEXT"></span></div>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONTEXT_REQUIRED">context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALLERID">callerid</label>\n <input type="text" name="callerid" ng-model="vm.trunk.callerid" ng-required="true">\n <div class="hint"><span translate="TOOLS.HELP.CALLERID"></span></div>\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALLERID_REQUIRED">callerid field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.trunk.type" required>\n <md-option ng-value="\'friend\'">Friend</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n <md-option ng-value="\'peer\'">Peer</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TYPE"></span></div>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DTMFMODE">dtmfmode</label>\n <md-select name="dtmfmode" ng-model="vm.trunk.dtmfmode" required>\n <md-option ng-value="\'rfc2833\'">rfc2833</md-option>\n <md-option ng-value="\'info\'">info</md-option>\n <md-option ng-value="\'shortinfo\'">shortinfo</md-option>\n <md-option ng-value="\'inband\'">inband</md-option>\n <md-option ng-value="\'auto\'">auto</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.DTMFMODE"></span></div>\n <div ng-messages="generalForm[\'dtmfmode\'].$error" ng-show="generalForm[\'dtmfmode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DTMFMODE_REQUIRED">dtmfmode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAT">nat</label>\n <md-select name="nat" ng-model="vm.trunk.nat" required multiple>\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAT_REQUIRED">nat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.QUALIFY">qualify</label>\n <md-select name="qualify" ng-model="vm.trunk.qualify" required>\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.QUALIFY"></span></div>\n <div ng-messages="generalForm[\'qualify\'].$error" ng-show="generalForm[\'qualify\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUALIFY_REQUIRED">qualify field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.trunk.allow" required multiple>\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g723\'">g723</md-option>\n <md-option ng-value="\'g726\'">g726</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'ilbc\'">ilbc</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.INSECURE">insecure</label>\n <md-select name="insecure" ng-model="vm.trunk.insecure" required multiple>\n <md-option ng-value="\'port\'">port</md-option>\n <md-option ng-value="\'invite\'">invite</md-option>\n <md-option ng-value="\'very\'">very</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.INSECURE"></span></div>\n <div ng-messages="generalForm[\'insecure\'].$error" ng-show="generalForm[\'insecure\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.INSECURE_REQUIRED">insecure field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALL_LIMIT">call_limit</label>\n <input type="number" name="call_limit" ng-model="vm.trunk.call_limit">\n <div class="hint"><span translate="TOOLS.HELP.CALL_LIMIT"></span></div>\n <div ng-messages="generalForm[\'call_limit\'].$error" ng-show="generalForm[\'call_limit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALL_LIMIT_REQUIRED">call_limit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trunk.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="trunk-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.REGISTRY">registry</label>\n <input type="text" name="registry" ng-model="vm.trunk.registry" autofocus>\n <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n <div ng-messages="advancedForm[\'registry\'].$error" ng-show="advancedForm[\'registry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DIRECTMEDIA">directmedia</label>\n <md-select name="directmedia" ng-model="vm.trunk.directmedia" required>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'nonat\'">nonat</md-option>\n <md-option ng-value="\'update\'">update</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.DIRECTMEDIA"></span></div>\n <div ng-messages="advancedForm[\'directmedia\'].$error" ng-show="advancedForm[\'directmedia\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DIRECTMEDIA_REQUIRED">directmedia field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALLCOUNTER">callcounter</label>\n <md-select name="callcounter" ng-model="vm.trunk.callcounter" required>\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.CALLCOUNTER"></span></div>\n <div ng-messages="advancedForm[\'callcounter\'].$error" ng-show="advancedForm[\'callcounter\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALLCOUNTER_REQUIRED">callcounter field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.FROMDOMAIN">fromdomain</label>\n <input type="text" name="fromdomain" ng-model="vm.trunk.fromdomain">\n <div class="hint"><span translate="TOOLS.HELP.FROMDOMAIN"></span></div>\n <div ng-messages="advancedForm[\'fromdomain\'].$error" ng-show="advancedForm[\'fromdomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FROMDOMAIN_REQUIRED">fromdomain field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.FROMUSER">fromuser</label>\n <input type="text" name="fromuser" ng-model="vm.trunk.fromuser">\n <div class="hint"><span translate="TOOLS.HELP.FROMUSER"></span></div>\n <div ng-messages="advancedForm[\'fromuser\'].$error" ng-show="advancedForm[\'fromuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FROMUSER_REQUIRED">fromuser field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OUTBOUNDPROXY">outboundproxy</label>\n <input type="text" name="outboundproxy" ng-model="vm.trunk.outboundproxy">\n <div class="hint"><span translate="TOOLS.HELP.OUTBOUNDPROXY"></span></div>\n <div ng-messages="advancedForm[\'outboundproxy\'].$error" ng-show="advancedForm[\'outboundproxy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDPROXY_REQUIRED">outboundproxy field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ADD_PHONE_TO_URI">Add_phone_to_URI</label>\n <md-select name="usereqphone" ng-model="vm.trunk.usereqphone" required>\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ADD_PHONE_TO_URI"></span></div>\n <div ng-messages="advancedForm[\'usereqphone\'].$error" ng-show="advancedForm[\'usereqphone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ADD_PHONE_TO_URI_REQUIRED">Add_phone_to_URI field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TRUST_REMOTE_PARTY_ID">Trust_Remote_Party_ID</label>\n <md-select name="trustrpid" ng-model="vm.trunk.trustrpid" required>\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TRUST_REMOTE_PARTY_ID"></span></div>\n <div ng-messages="advancedForm[\'trustrpid\'].$error" ng-show="advancedForm[\'trustrpid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TRUST_REMOTE_PARTY_ID_REQUIRED">Trust_Remote_Party_ID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SEND_REMOTE_PARTY_ID_HEADER">Send_Remote_Party_ID_header</label>\n <md-select name="sendrpid" ng-model="vm.trunk.sendrpid" required>\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n\n <md-option ng-value="\'pai\'"> {{ \'TOOLS.PAI\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.SEND_REMOTE_PARTY_ID_HEADER"></span></div>\n <div ng-messages="advancedForm[\'sendrpid\'].$error" ng-show="advancedForm[\'sendrpid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SEND_REMOTE_PARTY_ID_HEADER_REQUIRED">Send_Remote_Party_ID_header field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ENCRYPTION">encryption</label>\n <md-select name="encryption" ng-model="vm.trunk.encryption" required>\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ENCRYPTION"></span></div>\n <div ng-messages="advancedForm[\'encryption\'].$error" ng-show="advancedForm[\'encryption\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ENCRYPTION_REQUIRED">encryption field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.PORT">port</label>\n <input type="number" name="port" ng-model="vm.trunk.port">\n <div class="hint"><span translate="TOOLS.HELP.PORT"></span></div>\n <div ng-messages="advancedForm[\'port\'].$error" ng-show="advancedForm[\'port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PORT_REQUIRED">port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.trunk.transport" required multiple>\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TRANSPORT"></span></div>\n <div ng-messages="advancedForm[\'transport\'].$error" ng-show="advancedForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.T38PT_UDPTL">t38pt_udptl</label>\n <input type="string" name="t38pt_udptl" ng-model="vm.trunk.t38pt_udptl">\n <div class="hint"><span translate="TOOLS.HELP.T38PT_UDPTL"></span></div>\n <div ng-messages="advancedForm[\'t38pt_udptl\'].$error" ng-show="advancedForm[\'t38pt_udptl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.T38PT_UDPTL_REQUIRED">t38pt_udptl field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.OTHERFIELDS">OTHERFIELDS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="trunk-detail-form-container otherfields md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.OTHERFIELDS">OTHERFIELDS</div>\n </div>\n <form name="otherFieldsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.OTHERFIELDS">otherFields</label>\n <textarea name="otherFields" ng-model="vm.trunk.otherFields" autofocus></textarea>\n <div class="hint"><span translate="TOOLS.HELP.OTHERFIELDS"></span></div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/trunks/trunks.html",'<div id="trunks" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TRUNKS">Trunks</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTrunks.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTrunks =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-trunks-count">\n <span>{{vm.selectedTrunks.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TRUNKS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTrunks()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTrunks()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTrunks" csv-label="true" filename="trunks.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedTrunks($event)" aria-label="delete selected" translate translate-attr-label="TRUNKS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- TRUNK TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTrunks" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="host">{{ \'TOOLS.HOST\' | translate }}</th>\n <th md-column md-order-by="registry">{{ \'TOOLS.REGISTRY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="trunk" md-select-id="id" ng-repeat="trunk in vm.trunks.rows">\n <td md-cell ng-if="trunk.userpic"><img class="avatar" alt="{{trunk.name}}" ng-src="api/users/{{trunk.id}}/avatar" /></td>\n <td md-cell ng-if="!trunk.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{trunk.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTrunk($event, trunk)" md-cell class="id ">{{trunk.id}}</td>\n <td ng-click="vm.createOrEditTrunk($event, trunk)" md-cell class="name ">{{trunk.name}}</td>\n <td ng-click="vm.createOrEditTrunk($event, trunk)" md-cell class="active ">\n <md-icon md-colors="{color: {{trunk.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{trunk.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditTrunk($event, trunk)" md-cell class="host ">{{trunk.host}}</td>\n <td ng-click="vm.createOrEditTrunk($event, trunk)" md-cell class="registry ">{{trunk.registry}}</td>\n <td ng-click="vm.createOrEditTrunk($event, trunk)" md-cell class="description ">{{trunk.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(trunk, $event)" translate="TOOLS.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(trunk, $event)" translate="TOOLS.GOTOREALTIME_TRUNK">\n goToRealtime Trunk\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(trunk, $event)" translate="TOOLS.DELETE_TRUNK">\n Delete Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.trunks.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TRUNK TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TRUNK BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-trunk-button" ng-click="vm.createOrEditTrunk($event)" aria-label="add trunk" translate translate-attr-aria-label="TOOLS.ADD_TRUNK">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TRUNK BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/variables/create/dialog.html",'<md-dialog class="variable-dialog" aria-label="New Variable">\n <form name="variableForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.variable.name" ng-required="true" autofocus>\n <div ng-messages="variableForm[\'name\'].$error" ng-show="variableForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.variable.description">\n <div ng-messages="variableForm[\'description\'].$error" ng-show="variableForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newVariable" ng-click="vm.saveVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid || variableForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newVariable" ng-click="vm.addNewVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_VARIABLE" translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n ADD VARIABLE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newVariable" ng-click="vm.deleteVariable($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/variables/variables.html",'<div id="variables" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.VARIABLES">Variables</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVariables.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVariables =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-variables-count">\n <span>{{vm.selectedVariables.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VARIABLES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVariables()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVariables()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVariables" csv-label="true" filename="variables.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedVariables($event)" aria-label="delete selected" translate translate-attr-label="VARIABLES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- VARIABLE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVariables" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVariables">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.variables.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="variable" md-select-id="id" ng-repeat="variable in vm.variables.rows">\n <td md-cell ng-if="variable.userpic"><img class="avatar" alt="{{variable.name}}" ng-src="api/users/{{variable.id}}/avatar" /></td>\n <td md-cell ng-if="!variable.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{variable.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="id ">{{variable.id}}</td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="name ">{{variable.name}}</td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="description ">{{variable.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(variable, $event)" translate="TOOLS.EDIT_VARIABLE">\n Edit Variable\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(variable, $event)" translate="TOOLS.DELETE_VARIABLE">\n Delete Variable\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.variables.count}}" md-on-paginate="vm.getVariables" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VARIABLE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VARIABLE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-variable-button" ng-click="vm.createOrEditVariable($event)" aria-label="add variable" translate translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VARIABLE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/chanSpies/chanSpies.html",'<div id="chanSpies" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.CHANSPIES">ChanSpies</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChanSpies.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChanSpies =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chanSpies-count">\n <span>{{vm.selectedChanSpies.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHANSPIES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChanSpies()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChanSpies()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChanSpies" csv-label="true" filename="chanSpies.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedChanSpies($event)" aria-label="delete selected" translate translate-attr-label="CHANSPIES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- CHANSPY TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChanSpies" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChanSpies">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="prefix">{{ \'VOICE.PREFIX\' | translate }}</th>\n <th md-column md-order-by="auth">{{ \'VOICE.AUTH\' | translate }}</th>\n <th md-column md-order-by="record">{{ \'VOICE.RECORD\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chanSpies.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chanSpy" md-select-id="id" ng-repeat="chanSpy in vm.chanSpies.rows">\n <td md-cell ng-if="chanSpy.userpic"><img class="avatar" alt="{{chanSpy.name}}" ng-src="api/users/{{chanSpy.id}}/avatar" /></td>\n <td md-cell ng-if="!chanSpy.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chanSpy.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="id ">{{chanSpy.id}}</td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="name ">{{chanSpy.name}}</td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="prefix ">{{chanSpy.prefix}}</td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="auth ">\n <md-icon md-colors="{color: {{chanSpy.auth ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.auth ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="record ">\n <md-icon md-colors="{color: {{chanSpy.record ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.record ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="description ">{{chanSpy.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(chanSpy, $event)" translate="VOICE.EDIT_CHANSPY">\n Edit chanSpy\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(chanSpy, $event)" translate="VOICE.DELETE_CHANSPY">\n Delete chanSpy\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.chanSpies.count}}" md-on-paginate="vm.getChanSpies" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHANSPY TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHANSPY BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-chanSpy-button" ng-click="vm.createOrEditchanSpy($event)" aria-label="add chanSpy" translate translate-attr-aria-label="VOICE.ADD_CHANSPY">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHANSPY BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/chanSpies/create/dialog.html",'<md-dialog class="chanSpy-dialog" aria-label="New chanSpy">\n <form name="chanSpyForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chanSpy.name" ng-required="true" autofocus>\n <div ng-messages="chanSpyForm[\'name\'].$error" ng-show="chanSpyForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PREFIX">Prefix</label>\n <input type="text" name="prefix" ng-model="vm.chanSpy.prefix" ng-required="true">\n <div ng-messages="chanSpyForm[\'prefix\'].$error" ng-show="chanSpyForm[\'prefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <md-select name="options" ng-model="vm.chanSpy.options" required multiple>\n <md-option ng-value="\'b\'">b: Only spy on channels involved in a bridged call.</md-option>\n <md-option ng-value="\'B\'">B: Instead of whispering on a single channel barge in on both channels involved in the call.</md-option>\n <md-option ng-value="\'E\'">E: Exit when the spied-on channel hangs up.</md-option>\n <md-option ng-value="\'o\'">o: Only listen to audio coming from this channel.</md-option>\n <md-option ng-value="\'q\'">q: Don\'t play a beep when beginning to spy on a channel, or speak the selected channel name.</md-option>\n <md-option ng-value="\'s\'">s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.</md-option>\n <md-option ng-value="\'S\'">S: Stop when no more channels are left to spy on.</md-option>\n <md-option ng-value="\'w\'">w: Enable whisper mode, so the spying channel can talk to the spied-on channel.</md-option>\n <md-option ng-value="\'W\'">W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.</md-option>\n </md-select>\n <div ng-messages="chanSpyForm[\'options\'].$error" ng-show="chanSpyForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chanSpy.auth" aria-label="Auth"><span translate="VOICE.AUTH">Auth</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.chanSpy.auth">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.chanSpy.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="chanSpyForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chanSpy.record" aria-label="Record"><span translate="VOICE.RECORD">Record</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chanSpy.record" class="md-block">\n <label translate="VOICE.RECORDINGFORMAT">recordingFormat</label>\n <md-select name="recordingFormat" ng-model="vm.chanSpy.recordingFormat" required>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n </md-select>\n <div ng-messages="chanSpyForm[\'recordingFormat\'].$error" ng-show="chanSpyForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDINGFORMAT_REQUIRED">recordingFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chanSpy.description">\n <div ng-messages="chanSpyForm[\'description\'].$error" ng-show="chanSpyForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newchanSpy" ng-click="vm.savechanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid || chanSpyForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newchanSpy" ng-click="vm.addNewchanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CHANSPY" translate-attr-aria-label="VOICE.ADD_CHANSPY">\n ADD CHANSPY\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newchanSpy" ng-click="vm.deletechanSpy($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/contexts/contexts.html",'<div id="contexts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.CONTEXTS">Contexts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedContexts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedContexts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-contexts-count">\n <span>{{vm.selectedContexts.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTEXTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllContexts()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectContexts()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedContexts" csv-label="true" filename="contexts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedContexts($event)" aria-label="delete selected" translate translate-attr-label="CONTEXTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- CONTEXT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedContexts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContexts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contexts.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="context" md-select-id="id" ng-repeat="context in vm.contexts.rows">\n <td md-cell ng-if="context.userpic"><img class="avatar" alt="{{context.name}}" ng-src="api/users/{{context.id}}/avatar" /></td>\n <td md-cell ng-if="!context.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{context.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="id ">{{context.id}}</td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="name ">{{context.name}}</td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="description ">{{context.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(context, $event)" translate="VOICE.EDIT_CONTEXT">\n Edit Context\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(context, $event)" translate="VOICE.DELETE_CONTEXT">\n Delete Context\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.contexts.count}}" md-on-paginate="vm.getContexts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CONTEXT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CONTEXT BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-context-button" ng-click="vm.createOrEditContext($event)" aria-label="add context" translate translate-attr-aria-label="VOICE.ADD_CONTEXT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CONTEXT BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/contexts/create/dialog.html",'<md-dialog class="context-dialog" aria-label="New Context">\n <form name="contextForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.context.name" ng-required="true" autofocus>\n <div ng-messages="contextForm[\'name\'].$error" ng-show="contextForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.context.description">\n <div ng-messages="contextForm[\'description\'].$error" ng-show="contextForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newContext" ng-click="vm.saveContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid || contextForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newContext" ng-click="vm.addNewContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CONTEXT" translate-attr-aria-label="VOICE.ADD_CONTEXT">\n ADD CONTEXT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newContext" ng-click="vm.deleteContext($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/create/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.inboundroute.exten" ng-required="true" autofocus>\n <div ng-messages="inboundrouteForm[\'exten\'].$error" ng-show="inboundrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.inboundroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteForm[\'context\'].$error" ng-show="inboundrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.inboundroute.description">\n <div ng-messages="inboundrouteForm[\'description\'].$error" ng-show="inboundrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInboundRoute" ng-click="vm.saveInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid || inboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInboundRoute" ng-click="vm.addNewInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n ADD INBOUNDROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newInboundRoute" ng-click="vm.deleteInboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/agi/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PROJECT">Project</label>\n <md-select name="project" ng-model="vm.agi.project" required autofocus>\n <md-option ng-value="\'agi://127.0.0.1/square,{{project.name}}\'" ng-repeat="project in vm.projects">{{ project.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'project\'].$error" ng-show="inboundrouteFormApp[\'project\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/custom/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n <input type="text" name="app" ng-model="vm.custom.app" ng-required="true" autofocus>\n <div ng-messages="inboundrouteFormApp[\'app\'].$error" ng-show="inboundrouteFormApp[\'app\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ARGUMENTS">Arguments</label>\n <input type="text" name="appdata" ng-model="vm.custom.appdata">\n <div ng-messages="inboundrouteFormApp[\'appdata\'].$error" ng-show="inboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/dial/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TECHNOLOGY/RESOURCE">Technology/Resource</label>\n <input type="text" name="tech" ng-model="vm.dial.tech" ng-required="true" autofocus>\n <div ng-messages="inboundrouteFormApp[\'tech\'].$error" ng-show="inboundrouteFormApp[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TECHNOLOGY/RESOURCE_REQUIRED">Technology/Resource field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.dial.timeout" min="0">\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.dial.options">\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.dial.url">\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/externaldial/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.externaldial.trunk" required autofocus>\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks">{{ trunk.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'trunk\'].$error" ng-show="inboundrouteFormApp[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.externaldial.phone" ng-required="true">\n <div ng-messages="inboundrouteFormApp[\'phone\'].$error" ng-show="inboundrouteFormApp[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.externaldial.timeout" min="0">\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.externaldial.options">\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.externaldial.url">\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/goto/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.goto.context" required autofocus>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'context\'].$error" ng-show="inboundrouteFormApp[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EXTENSION">Extension</label>\n <input type="text" name="extension" ng-model="vm.goto.extension" ng-required="true">\n <div ng-messages="inboundrouteFormApp[\'extension\'].$error" ng-show="inboundrouteFormApp[\'extension\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EXTENSION_REQUIRED">Extension field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PRIORITY">Priority</label>\n <input type="text" name="priority" ng-model="vm.goto.priority" ng-required="true">\n <div ng-messages="inboundrouteFormApp[\'priority\'].$error" ng-show="inboundrouteFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/hangup/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.HANGUP_CAUSE">Hangup_Cause</label>\n <md-select name="appdata" ng-model="vm.hangup.appdata" required autofocus>\n\n <md-option ng-value="\'1\'"> {{ \'VOICE.HANGUPCAUSE_1\' | translate }}</md-option>\n\n <md-option ng-value="\'16\'"> {{ \'VOICE.HANGUPCAUSE_16\' | translate }}</md-option>\n\n <md-option ng-value="\'17\'"> {{ \'VOICE.HANGUPCAUSE_17\' | translate }}</md-option>\n\n <md-option ng-value="\'18\'"> {{ \'VOICE.HANGUPCAUSE_18\' | translate }}</md-option>\n\n <md-option ng-value="\'21\'"> {{ \'VOICE.HANGUPCAUSE_21\' | translate }}</md-option>\n\n <md-option ng-value="\'22\'"> {{ \'VOICE.HANGUPCAUSE_22\' | translate }}</md-option>\n\n <md-option ng-value="\'27\'"> {{ \'VOICE.HANGUPCAUSE_27\' | translate }}</md-option>\n\n <md-option ng-value="\'38\'"> {{ \'VOICE.HANGUPCAUSE_38\' | translate }}</md-option>\n\n <md-option ng-value="\'41\'"> {{ \'VOICE.HANGUPCAUSE_41\' | translate }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'appdata\'].$error" ng-show="inboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.HANGUP_CAUSE_REQUIRED">Hangup_Cause field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/internaldial/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="user" ng-model="vm.internaldial.user" required autofocus>\n <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users">{{ user.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'user\'].$error" ng-show="inboundrouteFormApp[\'user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.internaldial.timeout" min="0">\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.internaldial.options">\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.internaldial.url">\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/playback/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.AUDIO_FILES">Audio_Files</label>\n <md-select name="appdata" ng-model="vm.playback.appdata" required autofocus>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}\'" ng-repeat="appdata in vm.sounds">{{ appdata.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'appdata\'].$error" ng-show="inboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUDIO_FILES_REQUIRED">Audio_Files field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.playback.options">\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.playback.answer" aria-label="Answer"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/queue/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" required autofocus>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'queue\'].$error" ng-show="inboundrouteFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.queue.options">\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="URL" ng-model="vm.queue.URL">\n <div ng-messages="inboundrouteFormApp[\'URL\'].$error" ng-show="inboundrouteFormApp[\'URL\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCE_OVERRIDES">Announce_Overrides</label>\n <md-select name="sound" ng-model="vm.queue.sound">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds">{{ sound.name }}</md-option>\n <md-option ng-value="\'\'">None</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'sound\'].$error" ng-show="inboundrouteFormApp[\'sound\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCE_OVERRIDES_REQUIRED">Announce_Overrides field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0">\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AGI">Agi</label>\n <input type="text" name="agi" ng-model="vm.queue.agi">\n <div ng-messages="inboundrouteFormApp[\'agi\'].$error" ng-show="inboundrouteFormApp[\'agi\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AGI_REQUIRED">Agi field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MACRO">Macro</label>\n <input type="text" name="macro" ng-model="vm.queue.macro">\n <div ng-messages="inboundrouteFormApp[\'macro\'].$error" ng-show="inboundrouteFormApp[\'macro\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MACRO_REQUIRED">Macro field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.GOSUB">GoSub</label>\n <input type="text" name="gosub" ng-model="vm.queue.gosub">\n <div ng-messages="inboundrouteFormApp[\'gosub\'].$error" ng-show="inboundrouteFormApp[\'gosub\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.GOSUB_REQUIRED">GoSub field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RULE">Rule</label>\n <input type="text" name="rule" ng-model="vm.queue.rule">\n <div ng-messages="inboundrouteFormApp[\'rule\'].$error" ng-show="inboundrouteFormApp[\'rule\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RULE_REQUIRED">Rule field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.POSITION">Position</label>\n <input type="number" name="position" ng-model="vm.queue.position" min="0">\n <div ng-messages="inboundrouteFormApp[\'position\'].$error" ng-show="inboundrouteFormApp[\'position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.POSITION_REQUIRED">Position field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Position must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queue.answer" aria-label="Answer"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/ringgroup/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="multipleUsers" ng-model="vm.ringgroup.multipleUsers" required autofocus multiple>\n <md-option ng-value="\'SIP/{{multipleUsers.name}}\'" ng-repeat="multipleUsers in vm.users">{{ multipleUsers.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'multipleUsers\'].$error" ng-show="inboundrouteFormApp[\'multipleUsers\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.ringgroup.timeout" min="0">\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.ringgroup.options">\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.ringgroup.url">\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/set/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.VARIABLE">Variable</label>\n <md-select name="name" ng-model="vm.set.name" required autofocus>\n <md-option ng-value="name.name" ng-repeat="name in vm.variables">{{ name.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'name\'].$error" ng-show="inboundrouteFormApp[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.set.value" ng-required="true">\n <div ng-messages="inboundrouteFormApp[\'value\'].$error" ng-show="inboundrouteFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/voicemail/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX@CONTEXT">Mailbox@Context</label>\n <md-select name="voiceMail" ng-model="vm.voicemail.voiceMail" required autofocus>\n <md-option ng-value="\'{{voiceMail.mailbox}}@from-voicemail\'" ng-repeat="voiceMail in vm.voiceMails">{{ voiceMail.mailbox }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'voiceMail\'].$error" ng-show="inboundrouteFormApp[\'voiceMail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX@CONTEXT_REQUIRED">Mailbox@Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.voicemail.options">\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/view.html",'<div id="voice-inboundroute" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-inboundroutes-button md-icon-button" aria-label="Go to inboundroutes" ng-click="vm.gotoInboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INBOUNDROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="inboundroute-image" hide-xs>\n <img ng-src="assets/images/business/inboundroutes.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.inboundroute.id}}\n <span ng-if="vm.inboundroute.name">{{vm.inboundroute.name}}</span>\n <span ng-if="vm.inboundroute.exten">{{vm.inboundroute.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.inboundroute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveInboundRoute()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="inboundroute-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.inboundroute.exten" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.inboundroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.inboundroute.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="inboundroute-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="InboundRouteActionsController as vm_ac" ng-init="vm_ac.init(vm.inboundroute)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedInboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedInboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedInboundRouteApps.length}} {{vm_ac.selectedInboundRouteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedInboundRouteApps($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedInboundRouteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.inboundrouteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editInboundRouteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editInboundRouteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editInboundRouteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.inboundrouteApps.rows.length">\n <td md-cell colspan="6">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="6">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/inboundroutes/inboundroutes.html",'<div id="inboundroutes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.INBOUNDROUTES">InboundRoutes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedInboundRoutes.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedInboundRoutes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-inboundroutes-count">\n <span>{{vm.selectedInboundRoutes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INBOUNDROUTES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllInboundRoutes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectInboundRoutes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedInboundRoutes" csv-label="true" filename="inboundroutes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedInboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="INBOUNDROUTES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- INBOUNDROUTE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedInboundRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInboundRoutes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.inboundroutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="inboundroute" md-select-id="id" ng-repeat="inboundroute in vm.inboundroutes.rows">\n <td md-cell ng-if="inboundroute.userpic"><img class="avatar" alt="{{inboundroute.name}}" ng-src="api/users/{{inboundroute.id}}/avatar" /></td>\n <td md-cell ng-if="!inboundroute.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{inboundroute.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditInboundRoute($event, inboundroute)" md-cell class="id ">{{inboundroute.id}}</td>\n <td ng-click="vm.createOrEditInboundRoute($event, inboundroute)" md-cell class="exten ">{{inboundroute.exten}}</td>\n <td ng-click="vm.createOrEditInboundRoute($event, inboundroute)" md-cell class="description ">{{inboundroute.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(inboundroute, $event)" translate="VOICE.EDIT_INBOUNDROUTE">\n Edit InboundRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(inboundroute, $event)" translate="VOICE.DELETE_INBOUNDROUTE">\n Delete InboundRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.inboundroutes.count}}" md-on-paginate="vm.getInboundRoutes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / INBOUNDROUTE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD INBOUNDROUTE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-inboundroute-button" ng-click="vm.createOrEditInboundRoute($event)" aria-label="add inboundroute" translate translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD INBOUNDROUTE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/internalroutes/create/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.internalroute.exten" ng-required="true" autofocus>\n <div ng-messages="internalrouteForm[\'exten\'].$error" ng-show="internalrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.internalroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteForm[\'context\'].$error" ng-show="internalrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.internalroute.description">\n <div ng-messages="internalrouteForm[\'description\'].$error" ng-show="internalrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInternalRoute" ng-click="vm.saveInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid || internalrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInternalRoute" ng-click="vm.addNewInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INTERNALROUTE" translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n ADD INTERNALROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newInternalRoute" ng-click="vm.deleteInternalRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/agi/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PROJECT">Project</label>\n <md-select name="project" ng-model="vm.agi.project" required autofocus>\n <md-option ng-value="\'agi://127.0.0.1/square,{{project.name}}\'" ng-repeat="project in vm.projects">{{ project.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'project\'].$error" ng-show="internalrouteFormApp[\'project\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/custom/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n <input type="text" name="app" ng-model="vm.custom.app" ng-required="true" autofocus>\n <div ng-messages="internalrouteFormApp[\'app\'].$error" ng-show="internalrouteFormApp[\'app\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ARGUMENTS">Arguments</label>\n <input type="text" name="appdata" ng-model="vm.custom.appdata">\n <div ng-messages="internalrouteFormApp[\'appdata\'].$error" ng-show="internalrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/dial/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TECHNOLOGY/RESOURCE">Technology/Resource</label>\n <input type="text" name="tech" ng-model="vm.dial.tech" ng-required="true" autofocus>\n <div ng-messages="internalrouteFormApp[\'tech\'].$error" ng-show="internalrouteFormApp[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TECHNOLOGY/RESOURCE_REQUIRED">Technology/Resource field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.dial.timeout" min="0">\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.dial.options">\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.dial.url">\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/externaldial/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.externaldial.trunk" required autofocus>\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks">{{ trunk.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'trunk\'].$error" ng-show="internalrouteFormApp[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.externaldial.phone">\n <div ng-messages="internalrouteFormApp[\'phone\'].$error" ng-show="internalrouteFormApp[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.externaldial.timeout" min="0">\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.externaldial.options">\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.externaldial.url">\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/goto/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.goto.context" required autofocus>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'context\'].$error" ng-show="internalrouteFormApp[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EXTENSION">Extension</label>\n <input type="text" name="extension" ng-model="vm.goto.extension" ng-required="true">\n <div ng-messages="internalrouteFormApp[\'extension\'].$error" ng-show="internalrouteFormApp[\'extension\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EXTENSION_REQUIRED">Extension field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PRIORITY">Priority</label>\n <input type="text" name="priority" ng-model="vm.goto.priority" ng-required="true">\n <div ng-messages="internalrouteFormApp[\'priority\'].$error" ng-show="internalrouteFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/hangup/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.HANGUP_CAUSE">Hangup_Cause</label>\n <md-select name="appdata" ng-model="vm.hangup.appdata" required autofocus>\n\n <md-option ng-value="\'1\'"> {{ \'VOICE.HANGUPCAUSE_1\' | translate }}</md-option>\n\n <md-option ng-value="\'16\'"> {{ \'VOICE.HANGUPCAUSE_16\' | translate }}</md-option>\n\n <md-option ng-value="\'17\'"> {{ \'VOICE.HANGUPCAUSE_17\' | translate }}</md-option>\n\n <md-option ng-value="\'18\'"> {{ \'VOICE.HANGUPCAUSE_18\' | translate }}</md-option>\n\n <md-option ng-value="\'21\'"> {{ \'VOICE.HANGUPCAUSE_21\' | translate }}</md-option>\n\n <md-option ng-value="\'22\'"> {{ \'VOICE.HANGUPCAUSE_22\' | translate }}</md-option>\n\n <md-option ng-value="\'27\'"> {{ \'VOICE.HANGUPCAUSE_27\' | translate }}</md-option>\n\n <md-option ng-value="\'38\'"> {{ \'VOICE.HANGUPCAUSE_38\' | translate }}</md-option>\n\n <md-option ng-value="\'41\'"> {{ \'VOICE.HANGUPCAUSE_41\' | translate }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'appdata\'].$error" ng-show="internalrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.HANGUP_CAUSE_REQUIRED">Hangup_Cause field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/internaldial/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="user" ng-model="vm.internaldial.user" required autofocus>\n <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users">{{ user.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'user\'].$error" ng-show="internalrouteFormApp[\'user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.internaldial.timeout" min="0">\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.internaldial.options">\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.internaldial.url">\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/playback/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.AUDIO_FILES">Audio_Files</label>\n <md-select name="appdata" ng-model="vm.playback.appdata" required autofocus>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}\'" ng-repeat="appdata in vm.sounds">{{ appdata.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'appdata\'].$error" ng-show="internalrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUDIO_FILES_REQUIRED">Audio_Files field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.playback.options">\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.playback.answer" aria-label="Answer"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/queue/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" required autofocus>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'queue\'].$error" ng-show="internalrouteFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.queue.options">\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="URL" ng-model="vm.queue.URL">\n <div ng-messages="internalrouteFormApp[\'URL\'].$error" ng-show="internalrouteFormApp[\'URL\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCE_OVERRIDES">Announce_Overrides</label>\n <md-select name="sound" ng-model="vm.queue.sound">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds">{{ sound.name }}</md-option>\n <md-option ng-value="\'\'">None</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'sound\'].$error" ng-show="internalrouteFormApp[\'sound\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCE_OVERRIDES_REQUIRED">Announce_Overrides field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0">\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AGI">Agi</label>\n <input type="text" name="agi" ng-model="vm.queue.agi">\n <div ng-messages="internalrouteFormApp[\'agi\'].$error" ng-show="internalrouteFormApp[\'agi\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AGI_REQUIRED">Agi field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MACRO">Macro</label>\n <input type="text" name="macro" ng-model="vm.queue.macro">\n <div ng-messages="internalrouteFormApp[\'macro\'].$error" ng-show="internalrouteFormApp[\'macro\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MACRO_REQUIRED">Macro field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.GOSUB">GoSub</label>\n <input type="text" name="gosub" ng-model="vm.queue.gosub">\n <div ng-messages="internalrouteFormApp[\'gosub\'].$error" ng-show="internalrouteFormApp[\'gosub\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.GOSUB_REQUIRED">GoSub field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RULE">Rule</label>\n <input type="text" name="rule" ng-model="vm.queue.rule">\n <div ng-messages="internalrouteFormApp[\'rule\'].$error" ng-show="internalrouteFormApp[\'rule\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RULE_REQUIRED">Rule field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.POSITION">Position</label>\n <input type="number" name="position" ng-model="vm.queue.position" min="0">\n <div ng-messages="internalrouteFormApp[\'position\'].$error" ng-show="internalrouteFormApp[\'position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.POSITION_REQUIRED">Position field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Position must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queue.answer" aria-label="Answer"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/ringgroup/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="multipleUsers" ng-model="vm.ringgroup.multipleUsers" required autofocus multiple>\n <md-option ng-value="\'SIP/{{multipleUsers.name}}\'" ng-repeat="multipleUsers in vm.users">{{ multipleUsers.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'multipleUsers\'].$error" ng-show="internalrouteFormApp[\'multipleUsers\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.ringgroup.timeout" min="0">\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.ringgroup.options">\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.ringgroup.url">\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/set/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.VARIABLE">Variable</label>\n <md-select name="name" ng-model="vm.set.name" required autofocus>\n <md-option ng-value="name.name" ng-repeat="name in vm.variables">{{ name.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'name\'].$error" ng-show="internalrouteFormApp[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.set.value" ng-required="true">\n <div ng-messages="internalrouteFormApp[\'value\'].$error" ng-show="internalrouteFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/voicemail/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX@CONTEXT">Mailbox@Context</label>\n <md-select name="voiceMail" ng-model="vm.voicemail.voiceMail" required autofocus>\n <md-option ng-value="\'{{voiceMail.mailbox}}@from-voicemail\'" ng-repeat="voiceMail in vm.voiceMails">{{ voiceMail.mailbox }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'voiceMail\'].$error" ng-show="internalrouteFormApp[\'voiceMail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX@CONTEXT_REQUIRED">Mailbox@Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.voicemail.options">\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/view.html",'<div id="voice-internalroute" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-internalroutes-button md-icon-button" aria-label="Go to internalroutes" ng-click="vm.gotoInternalRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INTERNALROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="internalroute-image" hide-xs>\n <img ng-src="assets/images/business/internalroutes.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.internalroute.id}}\n <span ng-if="vm.internalroute.name">{{vm.internalroute.name}}</span>\n <span ng-if="vm.internalroute.exten">{{vm.internalroute.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.internalroute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveInternalRoute()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="internalroute-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.internalroute.exten" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.internalroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.internalroute.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="internalroute-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="InternalRouteActionsController as vm_ac" ng-init="vm_ac.init(vm.internalroute)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedInternalRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedInternalRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedInternalRouteApps.length}} {{vm_ac.selectedInternalRouteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedInternalRouteApps($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedInternalRouteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.internalrouteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editInternalRouteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editInternalRouteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editInternalRouteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.internalrouteApps.rows.length">\n <td md-cell colspan="6">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="6">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/internalroutes/internalroutes.html",'<div id="internalroutes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.INTERNALROUTES">InternalRoutes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedInternalRoutes.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedInternalRoutes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-internalroutes-count">\n <span>{{vm.selectedInternalRoutes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTERNALROUTES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllInternalRoutes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectInternalRoutes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedInternalRoutes" csv-label="true" filename="internalroutes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedInternalRoutes($event)" aria-label="delete selected" translate translate-attr-label="INTERNALROUTES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- INTERNALROUTE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedInternalRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInternalRoutes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.internalroutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="internalroute" md-select-id="id" ng-repeat="internalroute in vm.internalroutes.rows">\n <td md-cell ng-if="internalroute.userpic"><img class="avatar" alt="{{internalroute.name}}" ng-src="api/users/{{internalroute.id}}/avatar" /></td>\n <td md-cell ng-if="!internalroute.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{internalroute.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditInternalRoute($event, internalroute)" md-cell class="id ">{{internalroute.id}}</td>\n <td ng-click="vm.createOrEditInternalRoute($event, internalroute)" md-cell class="exten ">{{internalroute.exten}}</td>\n <td ng-click="vm.createOrEditInternalRoute($event, internalroute)" md-cell class="description ">{{internalroute.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(internalroute, $event)" translate="VOICE.EDIT_INTERNALROUTE">\n Edit InternalRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(internalroute, $event)" translate="VOICE.DELETE_INTERNALROUTE">\n Delete InternalRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.internalroutes.count}}" md-on-paginate="vm.getInternalRoutes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / INTERNALROUTE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD INTERNALROUTE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-internalroute-button" ng-click="vm.createOrEditInternalRoute($event)" aria-label="add internalroute" translate translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD INTERNALROUTE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/musiconholds/create/dialog.html",'<md-dialog class="musiconhold-dialog" aria-label="New MusicOnHold">\n <form name="musiconholdForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus ng-disabled="!vm.newMusicOnHold">\n <div ng-messages="musiconholdForm[\'name\'].$error" ng-show="musiconholdForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MODE">Mode</label>\n <md-select name="mode" ng-model="vm.musiconhold.mode" required ng-disabled="!vm.newMusicOnHold">\n\n <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }}</md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }}</md-option>\n </md-select>\n <div ng-messages="musiconholdForm[\'mode\'].$error" ng-show="musiconholdForm[\'mode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.DIRECTORY">Directory</label>\n <input type="" name="directory" ng-model="vm.musiconhold.directory">\n <div ng-messages="musiconholdForm[\'directory\'].$error" ng-show="musiconholdForm[\'directory\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.APPLICATION">Application</label>\n <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true">\n <div ng-messages="musiconholdForm[\'application\'].$error" ng-show="musiconholdForm[\'application\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n <label translate="VOICE.SORT">Sort</label>\n <md-select name="sort" ng-model="vm.musiconhold.sort">\n\n <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }}</md-option>\n\n <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="musiconholdForm[\'sort\'].$error" ng-show="musiconholdForm[\'sort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMusicOnHold" ng-click="vm.saveMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid || musiconholdForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMusicOnHold" ng-click="vm.addNewMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MUSICONHOLD" translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n ADD MUSICONHOLD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMusicOnHold" ng-click="vm.deleteMusicOnHold($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",'<md-dialog class="mohSound-dialog" aria-label="New MohSound">\n <form name="mohSoundForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.FILE">File</label>\n <md-select name="id" ng-model="vm.mohSound.id" autofocus>\n <md-option ng-value="id.id" ng-repeat="id in vm.sounds">{{ id.name }}</md-option>\n </md-select>\n <div ng-messages="mohSoundForm[\'id\'].$error" ng-show="mohSoundForm[\'id\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FILE_REQUIRED">File field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newMohSound" ng-click="vm.saveMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid || mohSoundForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newMohSound" ng-click="vm.addNewMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MOHSOUND" translate-attr-aria-label="VOICE.ADD_MOHSOUND">\n ADD MOHSOUND\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newMohSound" ng-click="vm.deleteMohSound($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/view.html",'<div id="voice-musiconhold" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-musiconholds-button md-icon-button" aria-label="Go to musiconholds" ng-click="vm.gotoMusicOnHolds()" translate translate-attr-aria-label="VOICE.GO_TO_MUSICONHOLDS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="musiconhold-image" hide-xs>\n <img ng-src="assets/images/business/musiconholds.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.musiconhold.id}}\n <span ng-if="vm.musiconhold.name">{{vm.musiconhold.name}}</span>\n <span ng-if="vm.musiconhold.exten">{{vm.musiconhold.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.musiconhold.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (mohSoundsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="musiconhold-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus ng-disabled="true">\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MODE">Mode</label>\n <md-select name="mode" ng-model="vm.musiconhold.mode" required ng-disabled="true">\n\n <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }}</md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'mode\'].$error" ng-show="generalForm[\'mode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.DIRECTORY">Directory</label>\n <input type="" name="directory" ng-model="vm.musiconhold.directory">\n <div ng-messages="generalForm[\'directory\'].$error" ng-show="generalForm[\'directory\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.APPLICATION">Application</label>\n <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true">\n <div ng-messages="generalForm[\'application\'].$error" ng-show="generalForm[\'application\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n <label translate="VOICE.SORT">Sort</label>\n <md-select name="sort" ng-model="vm.musiconhold.sort">\n\n <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }}</md-option>\n\n <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'sort\'].$error" ng-show="generalForm[\'sort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.AUDIOFILES">AUDIOFILES</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="musiconhold-detail-form-container mohsounds md-background-bg md-whiteframe-1dp">\n <div ng-controller="MusicOnHoldMohSoundsController as vm_dc" ng-init="vm_dc.init(vm.musiconhold)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMusicOnHoldMohSounds.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.MOHSOUNDS">MohSounds</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.createOrEditMusicOnHoldMohSound($event)" aria-label="add mohSound" translate translate-attr-label="VOICE.ADD_MOHSOUND">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMusicOnHoldMohSounds.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMusicOnHoldMohSounds.length}} {{vm_dc.selectedMusicOnHoldMohSounds.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMusicOnHoldMohSounds" csv-label="true" filename="musiconholds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedMusicOnHoldMohSounds($event)" aria-label="delete selected" translate translate-attr-label="MUSICONHOLDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMusicOnHoldMohSounds" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMusicOnHoldMohSounds">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mohSound" md-select-id="id" ng-repeat="mohSound in vm_dc.musiconholdMohSounds.rows">\n <td md-cell>{{mohSound.id}}</td>\n <td md-cell>\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="mohSound.id" model="\'sound\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td md-cell>{{mohSound.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.voiceMusicOnHoldDownload(mohSound, $event)" translate="VOICE.DOWNLOAD_MOHSOUND">\n Download MohSound\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(mohSound, $event)" translate="VOICE.DELETE_MOHSOUND">\n Delete MohSound\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.musiconholdMohSounds.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="VOICE.NO_MOHSOUND_AVAILABLE">No mohsound available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.musiconholdMohSounds.count}}" md-on-paginate="vm_dc.getMusicOnHoldMohSounds" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/musiconholds/musiconholds.html",'<div id="musiconholds" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.MUSICONHOLDS">MusicOnHolds</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMusicOnHolds.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMusicOnHolds =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-musiconholds-count">\n <span>{{vm.selectedMusicOnHolds.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MUSICONHOLDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMusicOnHolds()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMusicOnHolds()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMusicOnHolds" csv-label="true" filename="musiconholds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedMusicOnHolds($event)" aria-label="delete selected" translate translate-attr-label="MUSICONHOLDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- MUSICONHOLD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMusicOnHolds" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMusicOnHolds">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="mode">{{ \'VOICE.MODE\' | translate }}</th>\n <th md-column md-order-by="sort">{{ \'VOICE.SORT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.musiconholds.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="musiconhold" md-select-id="id" ng-repeat="musiconhold in vm.musiconholds.rows">\n <td md-cell ng-if="musiconhold.userpic"><img class="avatar" alt="{{musiconhold.name}}" ng-src="api/users/{{musiconhold.id}}/avatar" /></td>\n <td md-cell ng-if="!musiconhold.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{musiconhold.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="id ">{{musiconhold.id}}</td>\n <td ng-click="vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="name ">{{musiconhold.name}}</td>\n <td ng-click="vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="mode ">{{ \'VOICE.\' + vm.arraymode[musiconhold.mode].option | uppercase | translate }}</td>\n <td ng-click="vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="sort ">{{ \'VOICE.\' + vm.arraysort[musiconhold.sort].option | uppercase | translate }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(musiconhold, $event)" translate="VOICE.EDIT_MUSICONHOLD">\n Edit MusicOnHold\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(musiconhold, $event)" translate="VOICE.DELETE_MUSICONHOLD">\n Delete MusicOnHold\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.musiconholds.count}}" md-on-paginate="vm.getMusicOnHolds" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MUSICONHOLD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MUSICONHOLD BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-musiconhold-button" ng-click="vm.createOrEditMusicOnHold($event)" aria-label="add musiconhold" translate translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MUSICONHOLD BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/outboundroutes/create/dialog.html",'<md-dialog class="outboundroute-dialog" aria-label="New OutboundRoute">\n <form name="outboundrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.outboundroute.exten" ng-required="true" autofocus>\n <div ng-messages="outboundrouteForm[\'exten\'].$error" ng-show="outboundrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.outboundroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="outboundrouteForm[\'context\'].$error" ng-show="outboundrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RECORDING">Recording</label>\n <md-select name="recordingFormat" ng-model="vm.outboundroute.recordingFormat" required>\n <md-option ng-value="\'none\'">none</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n <div ng-messages="outboundrouteForm[\'recordingFormat\'].$error" ng-show="outboundrouteForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CUTDIGITS">CutDigits</label>\n <input type="number" name="cutdigits" ng-model="vm.outboundroute.cutdigits" min="0">\n <div ng-messages="outboundrouteForm[\'cutdigits\'].$error" ng-show="outboundrouteForm[\'cutdigits\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.outboundroute.description">\n <div ng-messages="outboundrouteForm[\'description\'].$error" ng-show="outboundrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newOutboundRoute" ng-click="vm.saveOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid || outboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newOutboundRoute" ng-click="vm.addNewOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_OUTBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n ADD OUTBOUNDROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newOutboundRoute" ng-click="vm.deleteOutboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/apps/custom/dialog.html",'<md-dialog class="outboundroute-dialog" aria-label="New OutboundRoute">\n <form name="outboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n <input type="text" name="app" ng-model="vm.custom.app" ng-required="true" autofocus>\n <div ng-messages="outboundrouteFormApp[\'app\'].$error" ng-show="outboundrouteFormApp[\'app\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ARGUMENTS">Arguments</label>\n <input type="text" name="appdata" ng-model="vm.custom.appdata">\n <div ng-messages="outboundrouteFormApp[\'appdata\'].$error" ng-show="outboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOutboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="outboundrouteFormApp.$invalid || outboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/apps/outbounddial/dialog.html",'<md-dialog class="outboundroute-dialog" aria-label="New OutboundRoute">\n <form name="outboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.outbounddial.trunk" required autofocus>\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks">{{ trunk.name }}</md-option>\n </md-select>\n <div ng-messages="outboundrouteFormApp[\'trunk\'].$error" ng-show="outboundrouteFormApp[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CALLER_ID">Caller_ID</label>\n <input type="text" name="callerID" ng-model="vm.outbounddial.callerID">\n <div ng-messages="outboundrouteFormApp[\'callerID\'].$error" ng-show="outboundrouteFormApp[\'callerID\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CALLER_ID_REQUIRED">Caller_ID field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PREFIX">Prefix</label>\n <input type="text" name="prefix" ng-model="vm.outbounddial.prefix">\n <div ng-messages="outboundrouteFormApp[\'prefix\'].$error" ng-show="outboundrouteFormApp[\'prefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TAGS">Tags</label>\n <md-select name="tag" ng-model="vm.outbounddial.tag">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags">{{ tag.name }}</md-option>\n <md-option ng-value="\'--\'">None</md-option>\n </md-select>\n <div ng-messages="outboundrouteFormApp[\'tag\'].$error" ng-show="outboundrouteFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TAGS_REQUIRED">Tags field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.outbounddial.timeout" min="0">\n <div ng-messages="outboundrouteFormApp[\'timeout\'].$error" ng-show="outboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.outbounddial.options">\n <div ng-messages="outboundrouteFormApp[\'options\'].$error" ng-show="outboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.outbounddial.url">\n <div ng-messages="outboundrouteFormApp[\'url\'].$error" ng-show="outboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveOutboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="outboundrouteFormApp.$invalid || outboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/view.html",'<div id="voice-outboundroute" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-outboundroutes-button md-icon-button" aria-label="Go to outboundroutes" ng-click="vm.gotoOutboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_OUTBOUNDROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="outboundroute-image" hide-xs>\n <img ng-src="assets/images/business/outboundroutes.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.outboundroute.id}}\n <span ng-if="vm.outboundroute.name">{{vm.outboundroute.name}}</span>\n <span ng-if="vm.outboundroute.exten">{{vm.outboundroute.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.outboundroute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="outboundroute-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.outboundroute.exten" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.outboundroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RECORDING">Recording</label>\n <md-select name="recordingFormat" ng-model="vm.outboundroute.recordingFormat" required>\n <md-option ng-value="\'none\'">none</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n <div ng-messages="generalForm[\'recordingFormat\'].$error" ng-show="generalForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CUTDIGITS">CutDigits</label>\n <input type="number" name="cutdigits" ng-model="vm.outboundroute.cutdigits" min="0">\n <div ng-messages="generalForm[\'cutdigits\'].$error" ng-show="generalForm[\'cutdigits\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.outboundroute.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="outboundroute-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OutboundRouteActionsController as vm_ac" ng-init="vm_ac.init(vm.outboundroute)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="75">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedOutboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedOutboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedOutboundRouteApps.length}} {{vm_ac.selectedOutboundRouteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_ac.deleteSelectedOutboundRouteApps($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedOutboundRouteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.outboundrouteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editOutboundRouteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editOutboundRouteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_ac.editOutboundRouteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.currentUser.crudPermissions === 0 || vm_ac.currentUser.role === \'admin\'">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.outboundrouteApps.rows.length">\n <td md-cell colspan="6">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="6">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/outboundroutes/outboundroutes.html",'<div id="outboundroutes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.OUTBOUNDROUTES">OutboundRoutes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOutboundRoutes.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOutboundRoutes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-outboundroutes-count">\n <span>{{vm.selectedOutboundRoutes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OUTBOUNDROUTES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOutboundRoutes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOutboundRoutes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOutboundRoutes" csv-label="true" filename="outboundroutes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedOutboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="OUTBOUNDROUTES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- OUTBOUNDROUTE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOutboundRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOutboundRoutes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.outboundroutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="outboundroute" md-select-id="id" ng-repeat="outboundroute in vm.outboundroutes.rows">\n <td md-cell ng-if="outboundroute.userpic"><img class="avatar" alt="{{outboundroute.name}}" ng-src="api/users/{{outboundroute.id}}/avatar" /></td>\n <td md-cell ng-if="!outboundroute.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{outboundroute.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditOutboundRoute($event, outboundroute)" md-cell class="id ">{{outboundroute.id}}</td>\n <td ng-click="vm.createOrEditOutboundRoute($event, outboundroute)" md-cell class="exten ">{{outboundroute.exten}}</td>\n <td ng-click="vm.createOrEditOutboundRoute($event, outboundroute)" md-cell class="description ">{{outboundroute.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(outboundroute, $event)" translate="VOICE.EDIT_OUTBOUNDROUTE">\n Edit OutboundRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(outboundroute, $event)" translate="VOICE.DELETE_OUTBOUNDROUTE">\n Delete OutboundRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.outboundroutes.count}}" md-on-paginate="vm.getOutboundRoutes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OUTBOUNDROUTE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OUTBOUNDROUTE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-outboundroute-button" ng-click="vm.createOrEditOutboundRoute($event)" aria-label="add outboundroute" translate translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OUTBOUNDROUTE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/realtime/abandonedcalls/view.html",'<md-toolbar class="md-table-toolbar md-default table-header">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 black-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getContacts()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.lastAssignedTo" ng-change="vm.getContacts()">\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents.rows">{{agent.name}}</md-option>\n </md-select>\n </div>\n <div ng-if="vm.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.queue" ng-change="vm.getContacts()">\n <md-option ng-value="undefined" ng-if="vm.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshContacts($event)" aria-label="refresh Contacts" translate translate-attr-label="DASHBOARDS.REFRESH_CONTACTS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n</md-toolbar>\n<md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td md-cell class="id">{{contact.id}}</td>\n <td md-cell class="firstName">{{contact.calleridname}}</td>\n <td md-cell class="list">{{contact.calleridnum}}</td>\n <td md-cell class="list">{{vm.queuesMap[contact.queue]}}</td>\n <td md-cell class="list">{{contact.queuecallerabandonAt ? (contact.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.lastAssignedTo}}</td>\n <td md-cell class="list">{{contact.disposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">Assigned a</md-button>\n <md-menu-content>\n <md-menu-item ng-if="contact.lastAssignedTo">\n <md-button ng-click="vm.assignedA(contact)"><em translate="DASHBOARDS.NONE">Not Assigned</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.assignedA(contact,agent)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, null)"><em translate="DASHBOARDS.NONE">NONE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'fax\')"><em translate="DASHBOARDS.FAX">FAX</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Answer Machine\')"><em translate="DASHBOARDS.ANSWER_MACHINE">ANSWER_MACHINE</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Interested\')"><em translate="DASHBOARDS.INTERESTED">INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Not Interested\')"><em translate="DASHBOARDS.NOT_INTERESTED">NOT_INTERESTED</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Sold\')"><em translate="DASHBOARDS.SOLD">SOLD</em></md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.disposed(contact, \'Special\')"><em translate="DASHBOARDS.SPECIAL">SPECIAL</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.disposition.length" ng-repeat="disposition in vm.disposition">\n <md-button ng-click="vm.disposed(contact, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>'),e.put("app/main/apps/voice/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'VOICE.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'VOICE.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'VOICE.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'VOICE.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'VOICE.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="3">{{ \'VOICE.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n \x3c!-- <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSE\' | translate }}</th>\n <th md-column width="10px"></th> --\x3e\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'VOICE.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatusTime">{{ \'VOICE.TIMER\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'VOICE.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'busy\':\'indigo-100-bg\',\'*pause\':\'amber-50-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].globalStatus]">{{ vm.isPause(vm.agents[value].globalStatus) ? \'\' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? \'*\'+vm.agents[value].pauseType || \'DEFAULT PAUSE\' : vm.agents[value].pauseType || \'DEFAULT PAUSE\') : \'\'}}</span>\n </td>\n <td class="bt custom-column">\n <timer start-time="vm.agents[value].globalStatusTime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class="bt bl">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'talking\':\'indigo-100-bg\',\'ringing\':\'orange-400-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt bl">\n <div layout="column">\n <span ng-if="vm.agents[value].queue" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].queue }}</span>\n <span ng-if="vm.agents[value].destconnectedlinenum" class="padding-5" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class="padding-5" ng-if="vm.agents[value].queue || vm.agents[value].destconnectedlinenum">\n <timer start-time="vm.agents[value].voiceStatusTime" interval="1000" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].voiceStatus]">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n \x3c!-- <td class="bt">--</td>\n <td class="bt">--</td> --\x3e\n <td class="bt bl" ng-if="vm.license.chat">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n \x3c!-- <td class="bt padding-5 text-center">{{ agent.chatCurrentCapacity }}/{{ agent.chatCapacity > 0 ? agent.chatCapacity : \'∞\' }}</td> --\x3e\n <td md-number class="bt text-center font-size-20" ng-if="vm.license.chat" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].chatStatus]">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.mail">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.mail" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].mailStatus]">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class="bl bt" ng-if="vm.license.messaging">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">5</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">10</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.messaging" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].smsStatus]">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.openchannel">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">4</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">89</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.openchannel" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].openchannelStatus]">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class="bt bl" ng-if="vm.license.fax">\n <div layout="row">\n \x3c!-- <div class="column">\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon></span>\n <span class="md-capture green-fg">7</span>\n </div>\n <div class="row">\n <span><md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon></span>\n <span class="md-capture blue-fg">2</span>\n </div>\n </div> --\x3e\n <div layout="column" layout-align="center center">\n <span class="text-boxed md-background-bg bl bt padding-5" ng-class="{\'idle\':\'lime-300-bg\',\'maxcapacity\':\'red-A200-bg\',\'working\':\'indigo-100-bg\',\'pause\':\'amber-200-bg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5 text-center font-size-20" ng-if="vm.license.fax" ng-class="{\'idle\':\'lime-300-fg\',\'maxcapacity\':\'red-A200-fg\',\'working\':\'indigo-100-fg\',\'pause\':\'amber-200-fg\'}[vm.agents[value].faxStatus]">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class="bl bt padding-5 text-center">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.logout(vm.agents[value], $event)" translate="VOICE.LOGOUT">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.queueAdd(vm.agents[value], $event)" translate="VOICE.AGENTADD_QUEUE">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="VOICE.PAUSE">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=" vm.agents[value].voicePause && \'DEFAULT PAUSE\' === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value])"><em translate="VOICE.DEFAULT_PAUSE">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.pauses.rows.length" ng-repeat="pause in vm.pauses.rows">\n <md-button ng-disabled="vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType" ng-click="vm.pause(vm.agents[value], pause.name)">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="vm.isPause(vm.agents[value].globalStatus)">\n <md-button ng-click="vm.unPause(vm.agents[value])" translate="VOICE.UNPAUSE">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.filteredAgents.length}}" md-on-paginate="vm.onInit" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/outbound_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.OUTBOUND_CALLS">Ooutbound Calls</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- OUTBOUNDS TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'VOICE.SOURCE\' | translate }}</th>\n <th md-column>{{ \'VOICE.DESTINATION\' | translate }}</th>\n <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.calls.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="call in vm.calls.rows | filter: vm.query.filter | limitTo: vm.query.limit: (vm.query.page - 1) * vm.query.limit">\n <td md-cell>\n <i ng-class="vm.channelStatus[call.channelstatedesc.toLowerCase()]"></i>\n </td>\n <td md-cell>\n {{call.calleridname}}, {{call.calleridnum}} <span class="text-boxed" ng-if="call.answered"><timer ng-if="call.answertime" start-time="call.answertime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></span>\n </td>\n <td md-cell>{{call.exten}}</td>\n <td md-cell>\n <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() !== \'hangup\'">\n <timer ng-if="call.starttime" start-time="call.starttime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() === \'hangup\'" translate="VOICE.CLOSING">Closing</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.calls.count}}"></md-table-pagination>\n\x3c!-- / OUTBOUNDS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queue_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n \x3c!-- <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUES TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column>{{ \'VOICE.AGENT\' | translate }}</th>\n <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.getSize(vm.rpcVoiceQueuesChannels)">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm.rpcVoiceQueuesChannels | limitObjectFromTo: vm.queryChannels.limit:(vm.queryChannels.page - 1) * vm.queryChannels.limit">\n <td md-cell>\n <md-icon ng-if="channel.queuecallerleaveAt" md-font-icon="icon-phone-in-talk green-fg"></md-icon>\n <md-icon ng-if="!channel.queuecallerleaveAt" md-font-icon="icon-phone-incoming md-accent"></md-icon>\n </td>\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n <td md-cell>\n <span ng-if="channel.queuecallerleaveAt">\n {{channel.connectedlinename}}, {{channel.connectedlinenum}}\n <span class="text-boxed">\n <timer start-time="channel.queuecallerleaveAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n <span ng-if="!channel.queuecallerleaveAt" class="text-boxed">\n {{ \'VOICE.WAITING_FOR_AGENT\' | translate }}\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell>\n <span class="text-boxed">\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.hangup(channel.uniqueid)" translate="VOICE.HANGUP">\n Hangup\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.redirectToNumber($event, channel.uniqueid)" translate="VOICE.REDIRECT_TO_NUMBER">\n Number\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" translate="VOICE.REDIRECT_TO_AGENT">Redirect to Agent</md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.redirectToAgent(channel.uniqueid, agent.name)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n \x3c!-- <tr md-row ng-repeat="call in vm.calls.rows | filter: vm.query.filter | limitTo: vm.query.limit: (vm.query.page - 1) * vm.query.limit">\n <td md-cell>\n <i ng-class="vm.channelStatusClass[call.status.toLowerCase()]"></i>\n </td>\n <td md-cell>{{call.exten}}</td>\n <td md-cell>{{call.queue}}</td>\n <td md-cell><span ng-if="call.calleridname">{{call.calleridname}}, </span>{{call.calleridnum}}</td>\n <td md-cell>\n <span ng-if="call.queuecallerleaveAt">\n {{call.connectedlinename}}, {{call.connectedlinenum}}\n <span class="text-boxed">\n <timer start-time="call.queuecallerleaveAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n <span ng-if="!call.queuecallerleaveAt" class="text-boxed" translate="VOICE.WAITING_FOR_AGENT">\n Waiting for agent...\n <span class="text-boxed">\n <timer start-time="call.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n </td>\n <td md-cell>\n <span class="text-boxed">\n <timer ng-if="call.queuecallerjoinAt" start-time="call.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <span ng-if="call.queuecallercomplete || call.queuecallerabandon || call.queuecallerexit" translate="VOICE.CLOSING">Closing</span>\n </span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical" ></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.hangup(call.uniqueid)" translate="VOICE.HANGUP">\n Hangup\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.redirectToNumber($event, call.uniqueid)" translate="VOICE.REDIRECT_TO_NUMBER">\n Number\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" translate="VOICE.REDIRECT_TO_AGENT">Redirect to Agent</md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.redirectToAgent(call.uniqueid, agent.name)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr> --\x3e\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.queryChannels.limit" md-page="vm.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-total="{{vm.getSize(vm.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n\x3c!-- / QUEUES TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column>{{\' VOICE.NAME\' | translate}}</th>\n <th md-column>{{\' VOICE.TOTAL_OFFERED\' | translate}}</th>\n <th md-column>{{\' VOICE.ANSWERED\' | translate}}</th>\n <th md-column>{{\' VOICE.ABANDONED\' | translate}}</th>\n <th md-column>{{\' VOICE.UNMANAGED\' | translate}}</th>\n <th md-column>{{\' VOICE.AVG_HOLD_TIME\' | translate}}</th>\n <th md-column>{{\' VOICE.AVG_DURATION\' | translate}}</th>\n <th md-column>{{\' VOICE.AVG_BILLABLE\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, queue) in vm.queues">\n <td md-cell>\n <span>{{queue.name}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{queue.total || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.total) ? (queue.answered || 0) * 100/queue.total : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{(queue.total - queue.answered - queue.unmanaged) || 0}} ({{(queue.total) ? ((queue.total - queue.answered - queue.unmanaged) || 0) * 100/queue.total : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.unmanaged || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumHoldTime / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumDuration / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]"\n md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSED\' | translate }}</th>\n <th md-column>{{ \'VOICE.READY\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th md-column>{{ \'VOICE.TALKING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{(vm.queues[value].talking || 0) }}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditVoiceQueue($event, vm.queues[value])" translate="VOICE.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="VOICE.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.TELEPHONES">Telephones</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.TRUNKS">Trunks</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ABANDONEDCALLS">Abandoned Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUE_PARAMS">Queue Parameters</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.OUTBOUND_CALLS">Outbound Calls</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/realtime/telephones/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.TELEPHONES">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n <tr md-row>\n <th md-column md-order-by="fullname">{{ \'VOICE.ACCOUNTNAME\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'VOICE.INTERNAL\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.telephones">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="telephone" md-select-id="id" ng-repeat="(id, telephone) in vm.telephones">\n <td md-cell>{{telephone.fullname}}</td>\n <td md-cell>{{telephone.internal}}</td>\n <td md-cell>\n <i ng-class="vm.stateClass[telephone.state]">\n <md-tooltip>{{\'VOICE.\' + telephone.state | uppercase | translate}}</md-tooltip>\n </i>\n </td>\n <td md-cell>\n <i ng-class="vm.statusClass[telephone.status]">\n <md-tooltip>{{\'VOICE.\' + telephone.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="telephone.status === \'registered\'" class="text-boxed">{{telephone.address}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.TRUNKS">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'FAX.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head>\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.TRUNK_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.REGISTRY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n <td md-cell>{{trunk.name}}</td>\n <td md-cell>\n <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n <md-tooltip>{{\'VOICE.\' + trunk.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n </td>\n <td md-cell>\n <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n <md-tooltip>{{\'VOICE.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n <span ng-if="!trunk.registry" translate="VOICE.NO_REGISTRY">\n No Registry\n </span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToTrunk($event, trunk)" translate="VOICE.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/voicemails/create/dialog.html",'<md-dialog class="voicemail-dialog" aria-label="New Voicemail">\n <form name="voicemailForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.FULLNAME">FullName</label>\n <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus>\n <div ng-messages="voicemailForm[\'fullname\'].$error" ng-show="voicemailForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'">\n <div ng-messages="voicemailForm[\'email\'].$error" ng-show="voicemailForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="voicemailForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="voicemailForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX">MailBox</label>\n <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" ng-disabled="!vm.newVoicemail">\n <div ng-messages="voicemailForm[\'mailbox\'].$error" ng-show="voicemailForm[\'mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ATTACH">Attach</label>\n <md-select name="attach" ng-model="vm.voicemail.attach">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div ng-messages="voicemailForm[\'attach\'].$error" ng-show="voicemailForm[\'attach\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newVoicemail" ng-click="vm.saveVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid || voicemailForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newVoicemail" ng-click="vm.addNewVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEMAIL" translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n ADD VOICEMAIL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newVoicemail" ng-click="vm.deleteVoicemail($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicemails/edit/view.html",'<div id="voice-voicemail" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-voicemails-button md-icon-button" aria-label="Go to voicemails" ng-click="vm.gotoVoicemails()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEMAILS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="voicemail-image" hide-xs>\n <img ng-src="assets/images/business/voicemails.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.voicemail.id}}\n <span ng-if="vm.voicemail.name">{{vm.voicemail.name}}</span>\n <span ng-if="vm.voicemail.exten">{{vm.voicemail.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voicemail.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveVoicemail()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (messagesForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="voicemail-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.FULLNAME">FullName</label>\n <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'fullname\'].$error" ng-show="generalForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'">\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="generalForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX">MailBox</label>\n <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" ng-disabled="true">\n <div ng-messages="generalForm[\'mailbox\'].$error" ng-show="generalForm[\'mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.VOICEMAIL_CONTEXT">Voicemail_Context</label>\n <md-select name="context" ng-model="vm.voicemail.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts">{{ context.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.VOICEMAIL_CONTEXT"></span></div>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VOICEMAIL_CONTEXT_REQUIRED">Voicemail_Context field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="voicemail-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEZONE">TimeZone</label>\n <input type="text" name="tz" ng-model="vm.voicemail.tz" ng-required="true" autofocus>\n <div ng-messages="advancedForm[\'tz\'].$error" ng-show="advancedForm[\'tz\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEZONE_REQUIRED">TimeZone field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ATTACH">Attach</label>\n <md-select name="attach" ng-model="vm.voicemail.attach">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'attach\'].$error" ng-show="advancedForm[\'attach\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ENVELOPE">Envelope</label>\n <md-select name="envelope" ng-model="vm.voicemail.envelope">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'envelope\'].$error" ng-show="advancedForm[\'envelope\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ENVELOPE_REQUIRED">Envelope field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DELETE">Delete</label>\n <md-select name="delete" ng-model="vm.voicemail.delete">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'delete\'].$error" ng-show="advancedForm[\'delete\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DELETE_REQUIRED">Delete field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAILBODY">EmailBody</label>\n <input type="text" name="emailbody" ng-model="vm.voicemail.emailbody">\n <div ng-messages="advancedForm[\'emailbody\'].$error" ng-show="advancedForm[\'emailbody\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAILBODY_REQUIRED">EmailBody field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAILSUBJECT">EmailSubject</label>\n <input type="text" name="emailsubject" ng-model="vm.voicemail.emailsubject">\n <div ng-messages="advancedForm[\'emailsubject\'].$error" ng-show="advancedForm[\'emailsubject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAILSUBJECT_REQUIRED">EmailSubject field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXSECONDS">MaxSeconds</label>\n <input type="number" name="maxsecs" ng-model="vm.voicemail.maxsecs" min="0">\n <div ng-messages="advancedForm[\'maxsecs\'].$error" ng-show="advancedForm[\'maxsecs\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXSECONDS_REQUIRED">MaxSeconds field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxSeconds must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXMESSAGES">MaxMessages</label>\n <input type="number" name="maxmsg" ng-model="vm.voicemail.maxmsg" min="0" max="9999">\n <div ng-messages="advancedForm[\'maxmsg\'].$error" ng-show="advancedForm[\'maxmsg\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXMESSAGES_REQUIRED">MaxMessages field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.MESSAGES">MESSAGES</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="voicemail-detail-form-container messages md-background-bg md-whiteframe-1dp">\n <div ng-controller="VoicemailMessagesController as vm_dc" ng-init="vm_dc.init(vm.voicemail)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedVoicemailMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.MESSAGES">Messages</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedVoicemailMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedVoicemailMessages.length}} {{vm_dc.selectedVoicemailMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedVoicemailMessages" csv-label="true" filename="voicemails.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'" class="md-icon-button" ng-click="vm_dc.deleteSelectedVoicemailMessages($event)" aria-label="delete selected" translate translate-attr-label="VOICEMAILS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedVoicemailMessages" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getVoicemailMessages">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="callerid">{{ \'VOICE.CALLER_ID\' | translate }}</th>\n <th md-column md-order-by="duration">{{ \'VOICE.DURATION\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="stamp">{{ \'VOICE.RECEIVED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="message" md-select-id="id" ng-repeat="message in vm_dc.voicemailMessages.rows">\n <td md-cell>{{message.id}}</td>\n <td md-cell>{{message.callerid}}</td>\n <td md-cell>{{message.duration}}</td>\n <td md-cell>\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="message.id" model="\'voiceMailMessage\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td md-cell>{{message.stamp | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.voiceMailMessageDownload(message, $event)" translate="VOICE.DOWNLOAD_MESSAGE">\n Download Message\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.crudPermissions === 0 || vm_dc.currentUser.role === \'admin\'">\n <md-button ng-click="vm_dc.deleteConfirm(message, $event)" translate="VOICE.DELETE_MESSAGE">\n Delete Message\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.voicemailMessages.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="VOICE.NO_MESSAGE_AVAILABLE">No message available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page"\n md-total="{{vm_dc.voicemailMessages.count}}" md-on-paginate="vm_dc.getVoicemailMessages" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voicemails/voicemails.html",'<div id="voicemails" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEMAILS">Voicemails</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoicemails.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoicemails =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voicemails-count">\n <span>{{vm.selectedVoicemails.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICEMAILS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoicemails()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoicemails()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoicemails" csv-label="true" filename="voicemails.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedVoicemails($event)" aria-label="delete selected" translate translate-attr-label="VOICEMAILS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- VOICEMAIL TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoicemails" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoicemails">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="fullname">{{ \'VOICE.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'VOICE.EMAIL\' | translate }}</th>\n <th md-column md-order-by="mailbox">{{ \'VOICE.MAILBOX\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voicemails.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voicemail" md-select-id="id" ng-repeat="voicemail in vm.voicemails.rows">\n <td md-cell ng-if="voicemail.userpic"><img class="avatar" alt="{{voicemail.name}}" ng-src="api/users/{{voicemail.id}}/avatar" /></td>\n <td md-cell ng-if="!voicemail.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voicemail.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditVoicemail($event, voicemail)" md-cell class="id ">{{voicemail.id}}</td>\n <td ng-click="vm.createOrEditVoicemail($event, voicemail)" md-cell class="fullname ">{{voicemail.fullname}}</td>\n <td ng-click="vm.createOrEditVoicemail($event, voicemail)" md-cell class="email ">{{voicemail.email}}</td>\n <td ng-click="vm.createOrEditVoicemail($event, voicemail)" md-cell class="mailbox ">{{voicemail.mailbox}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(voicemail, $event)" translate="VOICE.EDIT_VOICEMAIL">\n Edit Voicemail\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(voicemail, $event)" translate="VOICE.DELETE_VOICEMAIL">\n Delete Voicemail\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.voicemails.count}}" md-on-paginate="vm.getVoicemails" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEMAIL TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEMAIL BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-voicemail-button" ng-click="vm.createOrEditVoicemail($event)" aria-label="add voicemail" translate translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEMAIL BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/create/dialog.html",'<md-dialog class="voiceQueue-dialog" aria-label="New VoiceQueue">\n <form name="voiceQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newVoiceQueue">\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="voiceQueueForm[\'name\'].$error" ng-show="voiceQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required>\n <md-option ng-value="\'ringall\'">Ringall</md-option>\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'">Random</md-option>\n <md-option ng-value="\'linear\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="voiceQueueForm[\'strategy\'].$error" ng-show="voiceQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voiceQueue.description">\n <div ng-messages="voiceQueueForm[\'description\'].$error" ng-show="voiceQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newVoiceQueue" ng-click="vm.saveVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid || voiceQueueForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newVoiceQueue" ng-click="vm.addNewVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEQUEUE" translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n ADD VOICEQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newVoiceQueue" ng-click="vm.deleteVoiceQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue">\n <form name="voiceQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.AGENTADD_VOICEQUEUE">Add Agent to voiceQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="VOICE.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue">\n <form name="voiceQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.TEAMADD_VOICEQUEUE">Add Team in VOICEQUEUE</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="VOICE.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/view.html",'<div id="voice-voiceQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-voiceQueues-button md-icon-button" aria-label="Go to voiceQueues" ng-click="vm.gotoVoiceQueues()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="voiceQueue-image" hide-xs>\n <img ng-src="assets/images/business/voiceQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.voiceQueue.id}}\n <span ng-if="vm.voiceQueue.name">{{vm.voiceQueue.name}}</span>\n <span ng-if="vm.voiceQueue.exten">{{vm.voiceQueue.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voiceQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.voiceQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="VOICE.TEAMADD_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.voiceQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="VOICE.AGENTADD_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.voiceQueue, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="VOICE.GOTO_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (settingsForm.$invalid) || (announcementsForm.$invalid) || (advancedForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="voiceQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="true">\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required>\n <md-option ng-value="\'ringall\'">Ringall</md-option>\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'">Random</md-option>\n <md-option ng-value="\'linear\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.voiceQueue.timeout" min="0" ng-required="true">\n <div class="hint"><span translate="VOICE.HELP.TIMEOUT"></span></div>\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXLENGTH">MaxLength</label>\n <input type="number" name="maxlen" ng-model="vm.voiceQueue.maxlen" min="0">\n <div class="hint"><span translate="VOICE.HELP.MAXLENGTH"></span></div>\n <div ng-messages="generalForm[\'maxlen\'].$error" ng-show="generalForm[\'maxlen\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXLENGTH_REQUIRED">MaxLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RETRY">Retry</label>\n <input type="number" name="retry" ng-model="vm.voiceQueue.retry" min="0">\n <div class="hint"><span translate="VOICE.HELP.RETRY"></span></div>\n <div ng-messages="generalForm[\'retry\'].$error" ng-show="generalForm[\'retry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WRAPUPTIME">WrapupTime</label>\n <input type="number" name="wrapuptime" ng-model="vm.voiceQueue.wrapuptime" min="0">\n <div class="hint"><span translate="VOICE.HELP.WRAPUPTIME"></span></div>\n <div ng-messages="generalForm[\'wrapuptime\'].$error" ng-show="generalForm[\'wrapuptime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WEIGHT">Weight</label>\n <input type="number" name="weight" ng-model="vm.voiceQueue.weight" min="0">\n <div class="hint"><span translate="VOICE.HELP.WEIGHT"></span></div>\n <div ng-messages="generalForm[\'weight\'].$error" ng-show="generalForm[\'weight\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.JOINWHENEMPTY">JoinWhenEmpty</label>\n <md-select name="joinempty" ng-model="vm.voiceQueue.joinempty" multiple>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'strict\'">strict</md-option>\n <md-option ng-value="\'loose\'">loose</md-option>\n <md-option ng-value="\'paused\'">paused</md-option>\n <md-option ng-value="\'penalty\'">penalty</md-option>\n <md-option ng-value="\'inuse\'">inuse</md-option>\n <md-option ng-value="\'ringing\'">ringing</md-option>\n <md-option ng-value="\'unavailable\'">unavailable</md-option>\n <md-option ng-value="\'invalid\'">invalid</md-option>\n <md-option ng-value="\'unknown\'">unknoww</md-option>\n <md-option ng-value="\'wrapup\'">wrapup</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.JOINWHENEMPTY"></span></div>\n <div ng-messages="generalForm[\'joinempty\'].$error" ng-show="generalForm[\'joinempty\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.JOINWHENEMPTY_REQUIRED">JoinWhenEmpty field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.LEAVEWHENEMPTY">LeaveWhenEmpty</label>\n <md-select name="leavewhenempty" ng-model="vm.voiceQueue.leavewhenempty" multiple>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'strict\'">strict</md-option>\n <md-option ng-value="\'loose\'">loose</md-option>\n <md-option ng-value="\'paused\'">paused</md-option>\n <md-option ng-value="\'penalty\'">penalty</md-option>\n <md-option ng-value="\'inuse\'">inuse</md-option>\n <md-option ng-value="\'ringing\'">ringing</md-option>\n <md-option ng-value="\'unavailable\'">unavailable</md-option>\n <md-option ng-value="\'invalid\'">invalid</md-option>\n <md-option ng-value="\'unknown\'">unknoww</md-option>\n <md-option ng-value="\'wrapup\'">wrapup</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.LEAVEWHENEMPTY"></span></div>\n <div ng-messages="generalForm[\'leavewhenempty\'].$error" ng-show="generalForm[\'leavewhenempty\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.LEAVEWHENEMPTY_REQUIRED">LeaveWhenEmpty field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MUSICONHOLD">MusicOnHold</label>\n <md-select name="musiconhold" ng-model="vm.voiceQueue.musiconhold">\n <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds">{{ musiconhold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MUSICONHOLD"></span></div>\n <div ng-messages="generalForm[\'musiconhold\'].$error" ng-show="generalForm[\'musiconhold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCETOAGENT">AnnounceToAgent</label>\n <md-select name="announce" ng-model="vm.voiceQueue.announce">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + announce.save_name" ng-repeat="announce in vm.sounds">{{ announce.name }}</md-option>\n <md-option ng-value="\'FALSE\'">None</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCETOAGENT"></span></div>\n <div ng-messages="generalForm[\'announce\'].$error" ng-show="generalForm[\'announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCETOAGENT_REQUIRED">AnnounceToAgent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voiceQueue.description">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="voiceQueue-detail-form-container settings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.SETTINGS">SETTINGS</div>\n </div>\n <form name="settingsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEFREQUENCY">AnnounceFrequency</label>\n <input type="number" name="announce_frequency" ng-model="vm.voiceQueue.announce_frequency" min="0" autofocus>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'announce_frequency\'].$error" ng-show="settingsForm[\'announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_REQUIRED">AnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINANNOUNCEFREQUENCY">MinAnnounceFrequency</label>\n <input type="number" name="min_announce_frequency" ng-model="vm.voiceQueue.min_announce_frequency" min="0">\n <div class="hint"><span translate="VOICE.HELP.MINANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'min_announce_frequency\'].$error" ng-show="settingsForm[\'min_announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_REQUIRED">MinAnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MinAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PERIODICANNOUNCEFREQUENCY">PeriodicAnnounceFrequency</label>\n <input type="number" name="periodic_announce_frequency" ng-model="vm.voiceQueue.periodic_announce_frequency" min="0">\n <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'periodic_announce_frequency\'].$error" ng-show="settingsForm[\'periodic_announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_REQUIRED">PeriodicAnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">PeriodicAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RANDOMPERIODICANNOUNCE">RandomPeriodicAnnounce</label>\n <md-select name="random_periodic_announce" ng-model="vm.voiceQueue.random_periodic_announce">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RANDOMPERIODICANNOUNCE"></span></div>\n <div ng-messages="settingsForm[\'random_periodic_announce\'].$error" ng-show="settingsForm[\'random_periodic_announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RANDOMPERIODICANNOUNCE_REQUIRED">RandomPeriodicAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEHOLDTIME">AnnounceHoldtime</label>\n <md-select name="announce_holdtime" ng-model="vm.voiceQueue.announce_holdtime">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'once\'">Once</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEHOLDTIME"></span></div>\n <div ng-messages="settingsForm[\'announce_holdtime\'].$error" ng-show="settingsForm[\'announce_holdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEHOLDTIME_REQUIRED">AnnounceHoldtime field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCECALLERPOSITION">AnnounceCallerPosition</label>\n <md-select name="announce_position" ng-model="vm.voiceQueue.announce_position">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'limit\'">Limit</md-option>\n <md-option ng-value="\'more\'">More</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCECALLERPOSITION"></span></div>\n <div ng-messages="settingsForm[\'announce_position\'].$error" ng-show="settingsForm[\'announce_position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCECALLERPOSITION_REQUIRED">AnnounceCallerPosition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEPOSITIONLIMIT">AnnouncePositionLimit</label>\n <input type="number" name="announce_position_limit" ng-model="vm.voiceQueue.announce_position_limit">\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEPOSITIONLIMIT"></span></div>\n <div ng-messages="settingsForm[\'announce_position_limit\'].$error" ng-show="settingsForm[\'announce_position_limit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEPOSITIONLIMIT_REQUIRED">AnnouncePositionLimit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.REPORTHOLDTIMEAGENT">ReportHoldtimeAgent</label>\n <md-select name="reportholdtime" ng-model="vm.voiceQueue.reportholdtime">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.REPORTHOLDTIMEAGENT"></span></div>\n <div ng-messages="settingsForm[\'reportholdtime\'].$error" ng-show="settingsForm[\'reportholdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.REPORTHOLDTIMEAGENT_REQUIRED">ReportHoldtimeAgent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="voiceQueue-detail-form-container announcements md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</div>\n </div>\n <form name="announcementsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PERIODICANNOUNCE">PeriodicAnnounce</label>\n <md-select name="periodic_announce" ng-model="vm.voiceQueue.periodic_announce" autofocus multiple>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + periodic_announce.save_name" ng-repeat="periodic_announce in vm.sounds">{{ periodic_announce.name }}</md-option>\n <md-option ng-value="\'\'">Default</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'periodic_announce\'].$error" ng-show="announcementsForm[\'periodic_announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCE_REQUIRED">PeriodicAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.HOLDTIMEANNOUNCE">HoldTimeAnnounce</label>\n <md-select name="queue_reporthold" ng-model="vm.voiceQueue.queue_reporthold">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_reporthold.save_name" ng-repeat="queue_reporthold in vm.sounds">{{ queue_reporthold.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.HOLDTIMEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_reporthold\'].$error" ng-show="announcementsForm[\'queue_reporthold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.HOLDTIMEANNOUNCE_REQUIRED">HoldTimeAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.YOUARENEXTANNOUNCE">YouareNextAnnounce</label>\n <md-select name="queue_youarenext" ng-model="vm.voiceQueue.queue_youarenext">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_youarenext.save_name" ng-repeat="queue_youarenext in vm.sounds">{{ queue_youarenext.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.YOUARENEXTANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_youarenext\'].$error" ng-show="announcementsForm[\'queue_youarenext\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.YOUARENEXTANNOUNCE_REQUIRED">YouareNextAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.THEREAREANNOUNCE">ThereareAnnounce</label>\n <md-select name="queue_thereare" ng-model="vm.voiceQueue.queue_thereare">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thereare.save_name" ng-repeat="queue_thereare in vm.sounds">{{ queue_thereare.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.THEREAREANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_thereare\'].$error" ng-show="announcementsForm[\'queue_thereare\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.THEREAREANNOUNCE_REQUIRED">ThereareAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WAITINGCALLSANNOUNCE">WaitingCallsAnnounce</label>\n <md-select name="queue_callswaiting" ng-model="vm.voiceQueue.queue_callswaiting">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_callswaiting.save_name" ng-repeat="queue_callswaiting in vm.sounds">{{ queue_callswaiting.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.WAITINGCALLSANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_callswaiting\'].$error" ng-show="announcementsForm[\'queue_callswaiting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WAITINGCALLSANNOUNCE_REQUIRED">WaitingCallsAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ESTIMATEDHOLDTIMEANNOUNCE">EstimatedHoldTimeAnnounce</label>\n <md-select name="queue_holdtime" ng-model="vm.voiceQueue.queue_holdtime">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_holdtime.save_name" ng-repeat="queue_holdtime in vm.sounds">{{ queue_holdtime.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ESTIMATEDHOLDTIMEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_holdtime\'].$error" ng-show="announcementsForm[\'queue_holdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ESTIMATEDHOLDTIMEANNOUNCE_REQUIRED">EstimatedHoldTimeAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINUTESANNOUNCE">MinutesAnnounce</label>\n <md-select name="queue_minutes" ng-model="vm.voiceQueue.queue_minutes">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minutes.save_name" ng-repeat="queue_minutes in vm.sounds">{{ queue_minutes.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MINUTESANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_minutes\'].$error" ng-show="announcementsForm[\'queue_minutes\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINUTESANNOUNCE_REQUIRED">MinutesAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINUTEANNOUNCE">MinuteAnnounce</label>\n <md-select name="queue_minute" ng-model="vm.voiceQueue.queue_minute">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minute.save_name" ng-repeat="queue_minute in vm.sounds">{{ queue_minute.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MINUTEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_minute\'].$error" ng-show="announcementsForm[\'queue_minute\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINUTEANNOUNCE_REQUIRED">MinuteAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SECONDSANNOUNCE">SecondsAnnounce</label>\n <md-select name="queue_seconds" ng-model="vm.voiceQueue.queue_seconds">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_seconds.save_name" ng-repeat="queue_seconds in vm.sounds">{{ queue_seconds.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SECONDSANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_seconds\'].$error" ng-show="announcementsForm[\'queue_seconds\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SECONDSANNOUNCE_REQUIRED">SecondsAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.THANKYOUANNOUNCE">ThankYouAnnounce</label>\n <md-select name="queue_thankyou" ng-model="vm.voiceQueue.queue_thankyou">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thankyou.save_name" ng-repeat="queue_thankyou in vm.sounds">{{ queue_thankyou.name }}</md-option>\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.THANKYOUANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_thankyou\'].$error" ng-show="announcementsForm[\'queue_thankyou\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.THANKYOUANNOUNCE_REQUIRED">ThankYouAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ADVANCED">ADVANCED</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="voiceQueue-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.voiceQueue.acw" aria-label="AfterCallWork"><span translate="VOICE.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.voiceQueue.acw" class="md-block">\n <label translate="VOICE.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.voiceQueue.acwTimeout" min="0" ng-required="true">\n <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AUTOPAUSE">AutoPause</label>\n <md-select name="autopause" ng-model="vm.voiceQueue.autopause">\n\n <md-option ng-value="\'all\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.AUTOPAUSE"></span></div>\n <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RINGINUSE">RingInUse</label>\n <md-select name="ringinuse" ng-model="vm.voiceQueue.ringinuse">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RINGINUSE"></span></div>\n <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MEMBERDELAY">MemberDelay</label>\n <input type="number" name="memberdelay" ng-model="vm.voiceQueue.memberdelay" min="0">\n <div class="hint"><span translate="VOICE.HELP.MEMBERDELAY"></span></div>\n <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUTRESTART">TimeoutRestart</label>\n <md-select name="timeoutrestart" ng-model="vm.voiceQueue.timeoutrestart">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.TIMEOUTRESTART"></span></div>\n <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.voiceQueue.monitor_format">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <input type="text" name="context" ng-model="vm.voiceQueue.context">\n <div class="hint"><span translate="VOICE.HELP.CONTEXT"></span></div>\n <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n <md-select name="setinterfacevar" ng-model="vm.voiceQueue.setinterfacevar">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETINTERFACEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETQUEUEVARIABLES">SetQueueVariables</label>\n <md-select name="setqueuevar" ng-model="vm.voiceQueue.setqueuevar">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETQUEUEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n <md-select name="setqueueentryvar" ng-model="vm.voiceQueue.setqueueentryvar">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }}</md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/voiceQueues.html",'<div id="voiceQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEQUEUES">VoiceQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoiceQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoiceQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voiceQueues-count">\n <span>{{vm.selectedVoiceQueues.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICEQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoiceQueues()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoiceQueues()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceQueues" csv-label="true" filename="voiceQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedVoiceQueues($event)" aria-label="delete selected" translate translate-attr-label="VOICEQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- VOICEQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoiceQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'VOICE.STRATEGY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceQueues.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voiceQueue" md-select-id="id" ng-repeat="voiceQueue in vm.voiceQueues.rows">\n <td md-cell ng-if="voiceQueue.userpic"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="api/users/{{voiceQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!voiceQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="id ">{{voiceQueue.id}}</td>\n <td ng-click="vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="name ">{{voiceQueue.name}}</td>\n <td ng-click="vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="strategy ">{{ vm.arraystrategy[voiceQueue.strategy].option }}</td>\n <td ng-click="vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="description ">{{voiceQueue.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editstate(voiceQueue, $event)" translate="VOICE.EDIT_VOICEQUEUE">\n Edit VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(voiceQueue, $event)" translate="VOICE.TEAMADD_VOICEQUEUE">\n teamadd VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(voiceQueue, $event)" translate="VOICE.AGENTADD_VOICEQUEUE">\n agentadd VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(voiceQueue, $event)" translate="VOICE.DELETE_VOICEQUEUE">\n Delete VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(voiceQueue, $event)" translate="VOICE.GOTOREALTIME_VOICEQUEUE">\n goToRealtime VoiceQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.voiceQueues.count}}" md-on-paginate="vm.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEQUEUE BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-voiceQueue-button" ng-click="vm.createOrEditVoiceQueue($event)" aria-label="add voiceQueue" translate translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceRecordings/create/dialog.html",'<md-dialog class="voiceRecording-dialog" aria-label="New VoiceRecording">\n <form name="voiceRecordingForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.RATING">Rating</label>\n <md-select name="rating" ng-model="vm.voiceRecording.rating" autofocus>\n <md-option ng-value="null">{{\'VOICE.NO_RATING\' | translate}}</md-option>\n <md-option value="1">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n </md-option>\n <md-option value="2">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n </md-option>\n <md-option value="3">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n </md-option>\n <md-option value="4">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n </md-option>\n <md-option value="5">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n </md-option>\n </md-select>\n <div ng-messages="voiceRecordingForm[\'rating\'].$error" ng-show="voiceRecordingForm[rating].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RATING_REQUIRED">Rating field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newVoiceRecording" ng-click="vm.saveVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid || voiceRecordingForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newVoiceRecording" ng-click="vm.addNewVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICERECORDING" translate-attr-aria-label="VOICE.ADD_VOICERECORDING">\n ADD VOICERECORDING\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newVoiceRecording" ng-click="vm.deleteVoiceRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",'<div id="voiceRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICERECORDINGS">VoiceRecordings</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n \x3c!-- DATE FILTER --\x3e\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE_RANGE">Select Date Range</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearDateFilter()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.CLEAR\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getVoiceRecordings()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n \x3c!-- /DATE FILTER --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoiceRecordings.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoiceRecordings =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voiceRecordings-count">\n <span>{{vm.selectedVoiceRecordings.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICERECORDINGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoiceRecordings()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoiceRecordings()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceRecordings" csv-label="true" filename="voiceRecordings.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'" ng-click="vm.deleteSelectedVoiceRecordings($event)" aria-label="delete selected" translate translate-attr-label="VOICERECORDINGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- VOICERECORDING TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoiceRecordings" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column md-order-by="membername">{{ \'VOICE.AGENT\' | translate }}</th>\n <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voiceRecording" md-select-id="id" ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n <td md-cell ng-if="voiceRecording.userpic"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="api/users/{{voiceRecording.id}}/avatar" /></td>\n <td md-cell ng-if="!voiceRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="type ">{{voiceRecording.type}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="uniqueid ">{{voiceRecording.uniqueid}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="calleridnum ">{{voiceRecording.calleridnum}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="exten ">{{voiceRecording.exten}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="connectedlinenum ">{{voiceRecording.connectedlinenum}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="queue ">{{voiceRecording.queue}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="membername ">{{voiceRecording.membername}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="rating ">\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span></td>\n <td md-cell class="audio " ng-switch="voiceRecording.format">\n \x3c!-- audio recording directive --\x3e\n <ms-recording ng-switch-when=".wav" id="voiceRecording.id"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n <span ng-switch-when=".gsm|.WAV" ng-switch-when-separator="|">\n <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n </span>\n </td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userDisposition ">{{voiceRecording.userDisposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(voiceRecording, $event)" translate="VOICE.DOWNLOAD_VOICERECORDING">\n Download VoiceRecording\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n <md-button ng-click="vm.deleteconfirm(voiceRecording, $event)" translate="VOICE.DELETE_VOICERECORDING">\n Delete VoiceRecording\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"\n md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICERECORDING TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/navigation/layouts/horizontal-navigation/navigation.html",'<div layout="row" layout-align="start center">\n <ms-navigation-horizontal></ms-navigation-horizontal>\n</div>'),e.put("app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html",'<ms-navigation class="scrollable" folded="vm.folded" ms-scroll="vm.msScrollOptions">\n</ms-navigation>'),e.put("app/navigation/layouts/vertical-navigation/navigation.html",'<md-toolbar class="navigation-header md-whiteframe-1dp" layout="row" layout-align="space-between center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n \x3c!-- <span class="logo-image"><img src="assets/images/logos/whisker_32x32.png" alt="motion_whisker_32x32" /></span> --\x3e\n <span class="logo-text text-truncate">{{vm.getLogo() | uppercase}}</span>\n </div>\n <md-icon class="fold-toggle s18" md-font-icon="icon-backburger" hide show-gt-sm ng-click="vm.toggleMsNavigationFolded()"></md-icon>\n</md-toolbar>\n\n<ms-navigation class="scrollable" folded="vm.folded" ms-scroll="vm.msScrollOptions"></ms-navigation>'),e.put("app/quick-panel/quick-panel.html",'<md-content>\n <md-tabs md-no-pagination md-swipe-content md-stretch-tabs="always">\n <md-tab>\n <md-tab-label>\n <span translate="QUICKPANEL.TODAY">TODAY</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="today-tab scrollable" ms-scroll ng-include="\'app/quick-panel/tabs/today/today-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'" ng-controller="ChatInternalController as vm_ct" ng-init="vm_ct.init(vm.license)" md-on-deselect="vm_ct.user = undefined">\n <md-tab-label>\n <div ng-if="vm.unreadTotalMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalMessages}}</div>\n <span>MESSENGER</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="chat-tab scrollable" ms-scroll ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'" ng-controller="ChatGroupController as vm_cg" ng-init="vm_cg.init(vm.license)" md-on-deselect="vm_cg.group = undefined">\n <md-tab-label>\n <div ng-if="vm.unreadTotalGroupMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalGroupMessages}}</div>\n <span translate="QUICKPANEL.GROUPS">GROUPS</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="group-tab scrollable" ms-scroll ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n</md-content>'),e.put("app/quick-panel/tabs/activity/activity-tab.html",'<md-list class="friends">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.FRIENDS">Friends</span>\n </md-subheader>\n\n <md-list-item class="friend md-3-line" ng-repeat="friend in vm.activities.friends">\n <img ng-src="{{friend.avatar}}" class="md-avatar" alt="{{friend.name}}" />\n\n <div class="status {{friend.status}}"></div>\n\n <div ng-if="contact.unread" class="md-accent-bg unread-message-count">{{contact.unread}}</div>\n\n <div class="md-list-item-text">\n <h3 class="message">{{friend.message}}</h3>\n <p class="time">{{friend.time}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="servers">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.APP_SERVERS">Application Servers</span>\n </md-subheader>\n\n <md-list-item class="server md-3-line" ng-repeat="server in vm.activities.servers">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s16 status" ng-class="server.status"></md-icon>\n\n <div class="md-list-item-text">\n <h3>{{server.location}}</h3>\n <p>{{server.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="stats">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.USER_STATS">User Stats</span>\n </md-subheader>\n\n <md-list-item class="stat md-2-line" ng-repeat="stat in vm.activities.stats">\n <div class="md-list-item-text">\n <span>{{stat.title}} ({{stat.current}} / {{stat.total}})</span>\n <md-progress-linear ng-class="stat.status" md-mode="determinate" value="{{stat.percent}}"></md-progress-linear>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/quick-panel/tabs/chat/chat-tab.html",'<div class="main animate-slide-left" ng-hide="vm_ct.user">\n <md-subheader class="md-no-sticky">\n <div class="search" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n <input class="search-input" ng-model="vm_ct.search.$" type="text" placeholder="Search by fullname.." translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n <md-select ng-model="vm_ct.search.online" class="height-50 no-padding no-margin">\n <md-option ng-value="undefined">All</md-option>\n <md-option ng-value="true">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 green-fg"></md-icon>Online</md-option>\n <md-option ng-value="false">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 red-fg"></md-icon>Offline</md-option>\n </md-select>\n </div>\n </md-subheader>\n \x3c!-- <select ng-model="vm_ct.filterOnline" class="height-50 no-padding no-margin">\n <option ng-value="undefined">All</option>\n <option ng-value="true"><md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 green-fg"></md-icon>Online</option>\n <option ng-value="false"><md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 red-fg"></md-icon>Offline</option>\n </select> --\x3e\n <md-divider></md-divider>\n <md-list class="recent">\n <md-list-item class="contact md-3-line" ng-if="user.id != vm_ct.currentUser.id" ng-repeat="user in vm_ct.users.rows | orderBy: \'-lastMessageAt\' | filter:vm_ct.search" ng-click="vm_ct.toggleChat(user)">\n <md-divider></md-divider>\n <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="md-avatar" alt="{{user.fullname}}" />\n <div class="status" ng-class="{true: \'online\', false: \'offline\'}[user.online]"></div>\n <div ng-if="vm_ct.unreadMessage[user.id]" class="md-accent-bg unread-message-count">{{vm_ct.unreadMessage[user.id]}}</div>\n <div class="md-list-item-text">\n <div layout="row">\n <h3>{{user.fullname}}</h3>\n <md-icon ng-if="!user.allowmessenger && user.role === \'agent\'" class="s16 margin-left-5" ng-style="{\'color\': \'red\' }" md-font-icon="icon-block-helper"></md-icon>\n </div>\n <p>{{user.name}} <{{user.internal}}></p>\n <div layout="row" layout-align="start center">\n <md-icon ng-if="!user.lastMessage.read && user.lastMessage.FromId === vm_ct.currentUser.id" class="s16 no-margin" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="user.lastMessage.read && user.lastMessage.FromId === vm_ct.currentUser.id" class="s16 no-margin" md-font-icon="icon-check-all md-accent"></md-icon>\n <p>{{user.lastMessage.body | limitTo:20 }}{{user.lastMessage.body.length > 20 ? \'...\' : \'\' }}</p>\n <span flex></span>\n <p class="last-message" ng-if="user.lastMessageAt != vm_ct.standardDate">{{user.lastMessageAt | formatdate}}</p>\n </div>\n </div>\n </md-list-item>\n </md-list>\n</div>\n\n<div class="chat animate-slide-right" ng-show="vm_ct.user" layout="column">\n <md-toolbar class="md-accent">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n\n <div layout="row" layout-align="start center">\n <md-button class="md-icon-button" ng-click="vm_ct.toggleChat()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK">\n <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n </md-button>\n <h4>\n <span>{{vm_ct.user.fullname}}</span>\n </h4>\n </div>\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm_ct.license.webrtc && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 2 && vm_ct.user.role === \'agent\'" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="vm_ct.webcall(vm_ct.user.name)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n <md-menu ng-if="vm_ct.currentUser.phoneBarRemoteControl && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 0 && vm_ct.user.role === \'agent\'">\n <md-button class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n <md-button ng-click="vm_ct.call(vm_ct.user.name)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{vm_ct.user.name}})\n </md-button>\n </md-menu-item>\n <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n <md-button ng-click="vm_ct.transfer(vm_ct.user.name)">\n {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} ({{vm_ct.user.name}})\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n\n \x3c!-- <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="QUICKPANEL.MORE">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button> --\x3e\n </div>\n </div>\n\n </md-toolbar>\n <md-content flex layout-paddings ms-scroll id="chat-dialog">\n <div layout="row" ng-repeat="message in vm_ct.user.messages.rows" class="md-padding message-row" ng-class="message.FromId === vm_ct.currentUser.id ? \'user\' : \'contact\'">\n <img ng-if="message.FromId === vm_ct.user.id" ng-src="{{vm_ct.user.userpic ? \'api/users/\' + vm_ct.user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="avatar" alt="{{vm_ct.user.fullname}}" />\n <img ng-if="message.FromId === vm_ct.currentUser.id" class="avatar" ng-src="{{vm_ct.currentUser.userpic ? \'api/users/\' + vm_ct.currentUser.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}">\n <div class="bubble" flex>\n <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n <div layout="row" layout-align="end center">\n <span class="time secondary-text">{{message.createdAt | formatdate }}</span>\n <md-icon ng-if="!message.read && message.FromId === vm_ct.currentUser.id" class="s16 margin-5" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read && message.FromId === vm_ct.currentUser.id" class="s16 margin-5" md-font-icon="icon-check-all md-accent"></md-icon>\n </div>\n </div>\n </div>\n </md-content>\n\n <form ng-submit="vm_ct.reply()" layout="row" class="reply" layout-align="start center">\n <textarea ng-keyup="$event.keyCode == 13 && !vm_ct.disabled? vm_ct.reply() : null" flex ng-model="vm_ct.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n\n <md-button ng-disable="vm_ct.disabled" class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n <md-icon md-font-icon="icon-send"></md-icon>\n </md-button>\n </form>\n</div>'),e.put("app/quick-panel/tabs/groups/create/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n <form name="groupForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n \x3c!--START Error--\x3e\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n \x3c!--END Error--\x3e\n\n \x3c!--START NAME--\x3e\n <md-input-container class="md-block">\n <label translate="QUICKPANEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.group.name" required autofocus>\n <div ng-messages="groupForm[\'name\'].$error" ng-show="groupForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="QUICKPANEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="QUICKPANEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n \x3c!--END NAME--\x3e\n\n \x3c!--START Members--\x3e\n <md-input-container class="md-block">\n <label translate="QUICKPANEL.MEMBERS">Members</label>\n <md-contact-chips ng-model="vm.group.members" md-contacts="vm.querySearch($query)" md-contact-name="name" md-contact-image="image" md-require-match="true" md-highlight-flags="i" placeholder="{{\'QUICKPANEL.MEMBERS\' | translate}}">\n </md-contact-chips>\n <div ng-messages="groupForm[\'strategy\'].$error" ng-show="groupForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="QUICKPANEL.ERRORS.MEMBERS_REQUIRED">Members field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!--END Members--\x3e\n\n \x3c!--START Writing--\x3e\n <md-input-container class="md-block">\n <md-switch ng-model="vm.group.write" aria-label="Write">\n {{\'QUICKPANEL.ENABLE_WRITING\' | translate}}\n </md-switch>\n </md-input-container>\n \x3c!--END Writing--\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.newChatGroup" ng-click="vm.saveChatGroup()" class="send-button md-accent md-raised" ng-disabled="groupForm.$invalid || groupForm.$pristine || (vm.group.members.length < 1)" aria-label="SAVE" translate="QUICKPANEL.SAVE"\n translate-attr-aria-label="QUICKPANEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/groups/group-tab.html",'<div class="main animate-slide-left" ng-if="!vm_cg.group">\n <md-subheader>\n <div layout="row">\n \x3c!-- START Search --\x3e\n <div class="search" layout="row" layout-align="start center" flex>\n <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n <input ng-model="vm_cg.search" type="text" translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n </div>\n \x3c!-- END Search --\x3e\n\n \x3c!-- START New Group --\x3e\n <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-icon-button" aria-label="New" ng-click="vm_cg.addGroup(null, $event)">\n <md-icon md-font-icon="icon-account-multiple-plus" class="icon"></md-icon>\n </md-button>\n \x3c!-- END New Group --\x3e\n </div>\n </md-subheader>\n\n <md-divider></md-divider>\n\n \x3c!-- START Groups --\x3e\n <md-list class="recent no-padding">\n \x3c!-- START Group --\x3e\n <md-list-item class="contact" ng-repeat="group in vm_cg.groupsToArray() | filter:vm_cg.search" ng-click="vm_cg.toggleChat(group)">\n <img src="assets/images/avatars/group.png" class="md-avatar" alt="{{group.name}}" />\n <div ng-if="group.unreadGroupMessages" class="md-accent-bg unread-message-count">{{group.unreadGroupMessages}}</div>\n <div class="md-list-item-text">\n <div layout="row">\n <h3>{{group.name}}</h3>\n </div>\n </div>\n\n <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-secondary md-icon-button" aria-label="Remove" ng-click="vm_cg.deleteGroup(group, $event)">\n <md-icon md-font-icon="icon-delete" class="icon s18"></md-icon>\n </md-button>\n\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n <md-list-item>\n <div ng-if="!vm_cg.groupsToArray().length" layout="row" layout-align="center center" flex>\n <span>{{\'QUICKPANEL.NO_AVAILABLE_GROUPS\' | translate}}</span>\n </div>\n </md-list-item>\n \x3c!-- END Group --\x3e\n </md-list>\n \x3c!-- END Groups --\x3e\n</div>\n\n<div class="chat animate-slide-right" ng-if="vm_cg.group" layout="column">\n <md-toolbar class="md-accent">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n\n <div layout="row" layout-align="start center">\n <md-button class="md-icon-button" ng-click="vm_cg.back()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK">\n <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n </md-button>\n <h4>\n <span translate="QUICKPANEL.YOU" translate-values=\'{participants: vm_cg.participants}\'></span>\n </h4>\n </div>\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm_cg.license.webrtc && vm_cg.currentUser.role === \'agent\' && vm_cg.currentUser.showWebBar === 2 && vm_cg.user.role === \'agent\' && vm_cg.user.showWebBar === 2" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL"\n ng-click="vm_cg.webcall(vm_cg.user.name)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n </div>\n\n </md-toolbar>\n <md-content flex layout-paddings ms-scroll id="chat-group-dialog">\n <div layout="row" ng-repeat="message in vm_cg.group.messages" class="message-row" ng-class="message.FromId === vm_cg.currentUser.id ? \'user\' : \'contact\'">\n <img ng-if="message.FromId !== vm_cg.currentUser.id" ng-src="{{\'api/users/\' + message.FromId + \'/avatar\'}}" class="avatar" alt="{{vm_cg.user.fullname}}" />\n <img ng-if="message.FromId === vm_cg.currentUser.id" class="avatar" ng-src="{{vm_cg.currentUser.userpic ? \'api/users/\' + vm_cg.currentUser.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}">\n <div class="bubble" flex>\n <div ng-if="message.FromId !== vm_cg.currentUser.id">\n <span style="font-size: 12px;">{{vm_cg.group.membersByKeys[message.FromId].fullname}}</span>\n </div>\n <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n <div layout="row" layout-align="end center">\n <span class="time secondary-text" style="margin-top: 0px;">{{message.createdAt | formatdate }}</span>\n <md-icon ng-if="message.FromId === vm_cg.currentUser.id" class="s16 margin-5" style="cursor: pointer;" md-font-icon="icon-information-outline" ng-click="vm_cg.showMessageInfo($event, message)"></md-icon>\n </div>\n </div>\n </div>\n </md-content>\n\n <form ng-if="(vm_cg.currentUser.role !== \'agent\') || vm_cg.group.write" ng-submit="vm_cg.reply()" layout="row" class="reply" layout-align="start center">\n <textarea ng-keyup="$event.keyCode == 13 ? vm_cg.reply() : null" flex ng-model="vm_cg.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n\n <md-button class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n <md-icon md-font-icon="icon-send"></md-icon>\n </md-button>\n </form>\n</div>'),e.put("app/quick-panel/tabs/groups/info/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n <form name="groupForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div ng-if="vm.data.messages[$index].FromId !== vm.data.messages[$index].ToId" ng-repeat="user in vm.data.users" layout-margin>\n <div layout="row">\n <div layout="row" layout-align="start center">\n <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="avatar" alt="{{user.fullname}}" />\n <span>{{user.fullname}}</span>\n </div>\n <div layout="row" layout-align="end center" flex>\n <md-icon class="s16 margin-5" md-font-icon="{{vm.data.messages[$index].read ? \'icon-check-all md-accent\' : \'icon-check\'}}"></md-icon>\n <span class="time secondary-text">{{vm.data.messages[$index].updatedAt | formatdate }}</span>\n </div>\n </div>\n <div>\n <md-divider ng-if="!$last"></md-divider>\n </div>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/today/today-tab.html",'<md-list class="date">\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.TODAY">Today</span></md-subheader>\n <md-list-item class="md-display-1 md-2-line">\n <div class="secondary-text">\n <div translate="QUICKPANEL.{{ (vm.date | date:\'EEEE\').toUpperCase() }}"></div>\n <div layout="row" layout-align="start start">\n <span> {{vm.date | date:\'d\'}}</span>\n <span class="md-subhead">th</span>\n <span translate="QUICKPANEL.{{ (vm.date | date:\'MMMM\').toUpperCase() }}"></span>\n </div>\n </div>\n </md-list-item>\n</md-list>\n\n\x3c!-- <md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.EVENTS">Events</span></md-subheader>\n\n <md-list-item class="md-2-line" ng-repeat="event in vm.events" ng-click="dummyFunction()">\n <div class="md-list-item-text">\n <h3>{{event.title}}</h3>\n\n <p>{{event.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.NOTES">Notes</span></md-subheader>\n <md-list-item class="md-2-line" ng-repeat="note in vm.notes" ng-click="dummyFunction()">\n <div class="md-list-item-text">\n <h3>{{note.title}}</h3>\n\n <p>{{note.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.QUICK_SETTINGS">Quick Settings</span></md-subheader>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.NOTIFICATIONS">Notifications</h3>\n <md-switch class="md-secondary" ng-model="vm.settings.notify" aria-label="Notifications" translate\n translate-attr-aria-label="QUICKPANEL.NOTIFICATIONS"></md-switch>\n </md-list-item>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.CLOUD_SYNC">Cloud Sync</h3>\n <md-switch class="md-secondary" ng-model="vm.settings.cloud" aria-label="Cloud Sync" translate\n translate-attr-aria-label="QUICKPANEL.CLOUD_SYNC"></md-switch>\n </md-list-item>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.RETRO_THRUSTERS">Retro Thrusters</h3>\n <md-switch class="md-secondary md-warn" ng-model="vm.settings.retro" aria-label="Retro Thrusters" translate\n translate-attr-aria-label="QUICKPANEL.RETRO_THRUSTERS"></md-switch>\n </md-list-item>\n</md-list> --\x3e'),e.put("app/reset/reset.html",'<div id="reset-password" class="flex-scrollable" layout="column" ng-init="vm.onInit()" ms-scroll>\n <div id="reset-password-form-wrapper" layout="column" layout-align="center center">\n <div id="reset-password-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n <div class="title" translate="RESETPASSWORD.TITLE">Reset your password</div>\n\n <form name="resetPasswordForm" novalidate>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="password" ng-model="vm.form.password" ng-pattern="vm.passwordPattern" placeholder="Password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD" required>\n <div ng-messages="resetPasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="RESETPASSWORD.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="RESETPASSWORD.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="passwordConfirm" ng-model="vm.form.passwordConfirm" placeholder="Password (Confirm)" match-password="password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD_CONFIRM">\n <div ng-messages="resetPasswordForm.passwordConfirm.$error" role="alert">\n <div ng-message="passwordMatch">\n <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-button type="button" ng-click="vm.resetPassword()" class="md-raised md-accent submit-button" aria-label="UPDATE MY PASSWORD" ng-disabled="resetPasswordForm.$invalid || resetPasswordForm.$pristine" translate="RESETPASSWORD.UPDATE_PASSWORD" translate-attr-aria-label="RESETPASSWORD.UPDATE_PASSWORD">\n RESET MY PASSWORD\n </md-button>\n </form>\n </div>\n </div>\n</div>'),e.put("app/toolbar/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="changePasswordForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="vm.reset" class="title" translate="TOOLBAR.RESETPASSWORD">Reset Password</span>\n <span ng-if="!vm.reset" class="title" translate="TOOLBAR.CHANGEPASSWORD">Change Password</span>\n <md-button ng-if="!vm.reset" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="TOOLBAR.OLD_PASSWORD" required>\n <div ng-messages="changePasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="TOOLBAR.NEW_PASSWORD" required>\n <div ng-messages="changePasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLBAR.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="changePasswordForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="changePasswordForm.$invalid || changePasswordForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/toolbar/layouts/vertical-navigation/toolbar.html",'<div layout="row" layout-align="start center">\n <div layout="row" layout-align="start center" flex>\n <md-button id="navigation-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'navigation\')" hide-gt-sm aria-label="Toggle navigation" translate translate-attr-aria-label="TOOLBAR.TOGGLE_NAVIGATION">\n <md-icon md-font-icon="icon-menu" class="icon"></md-icon>\n </md-button>\n\n <ms-shortcuts ng-if="!vm.isAgent()"></ms-shortcuts>\n\n <div class="toolbar-separator"></div>\n\n <div ng-if="vm.license.demo" class="blink md-padding">\n <span class="md-warn-fg" translate="TOOLBAR.TRIAL_VERSION">Trial Version</span>\n </div>\n\n <div ng-if="vm.isAgent()" class="logo" layout-padding-left-8 layout="row" layout-align="start center">\n <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n <span ng-show="vm.isAgent() && (vm.user.showWebBar != 2)" class="logo-text text-truncate">{{ vm.getLogo() | uppercase }}</span>\n </div>\n\n \x3c!-- phonebar directive WebRtc type--\x3e\n <ms-phonebar class="ms-phonebar" ng-if="vm.isAgent() && (vm.user.showWebBar == 2)" conf="vm.conf" flex></ms-phonebar>\n \x3c!-- phonebar directive --\x3e\n </div>\n\n <div layout="row" layout-align="start center">\n\n <md-progress-circular id="toolbar-progress" ng-if="$root.loadingProgress" class="md-accent" md-diameter="32"></md-progress-circular>\n\n \x3c!-- Pause Management --\x3e\n <div ng-if="vm.isAgent() && (vm.user.showWebBar != 0)" layout="row" layout-align="end center">\n <div class="toolbar-separator"></div>\n\n <div class="border brad-5" layout="row" layout-align="center center" layout-margin>\n <md-button ng-if="vm.user.voicePause" class="md-icon-button no-margin" ng-click="vm.unpause()">\n <md-icon md-font-icon="icon-play-circle-outline" class="icon s24"></md-icon>\n <md-tooltip md-direction="bottom">{{\'TOOLBAR.RESUME\' | translate}}</md-tooltip>\n </md-button>\n\n <md-button ng-disabled="vm.user.voicePause && \'DEFAULT PAUSE\' === vm.user.pauseType" class="md-icon-button no-margin" ng-click="vm.pause()">\n <md-icon md-font-icon="icon-pause-circle-outline" class="icon s24"></md-icon>\n <md-tooltip md-direction="bottom">{{\'TOOLBAR.PAUSE\' | translate}}</md-tooltip>\n </md-button>\n\n <md-menu>\n <md-button aria-label="Pauses" class="md-icon-button no-margin" ng-click="$mdOpenMenu($event)">\n <md-icon md-menu-origin md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="4">\n <md-menu-item ng-if="!vm.pauses.length">\n <md-button disabled="disabled">\n <md-icon md-font-icon="icon-pause-octagon" md-menu-align-target></md-icon>\n {{\'TOOLBAR.NO_PAUSES_AVAILABLE\' | translate}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-repeat="pause in vm.pauses">\n <md-button ng-disabled="vm.user.voicePause && pause.name === vm.user.pauseType" ng-click="vm.pause(pause.name)">\n <md-icon md-font-icon="icon-pause-circle" md-menu-align-target></md-icon>\n {{pause.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n \x3c!-- Pause Management --\x3e\n\n <div class="h5 padding-10" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)">\n <div layout="row" layout-align="space-between center">\n <timer ng-if="vm.user.lastLoginAt" start-time="vm.user.lastLoginAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <md-tooltip>{{\'TOOLBAR.LOGIN_TIME\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-timelapse" class="icon s16"></md-icon>\n </div>\n <div layout="row" layout-align="center center" ng-if="vm.user.voicePause">\n <timer start-time="vm.user.lastPauseAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <md-tooltip>{{\'TOOLBAR.PAUSE_TIME\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-coffee" class="icon s16"></md-icon>\n </div>\n <div ng-if="vm.user.voicePause">\n <span class="blink red-fg">{{vm.user.pauseType || \'default\' | uppercase}}</span>\n </div>\n </div>\n\n <div class="toolbar-separator" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)"></div>\n\n <md-menu-bar id="user-menu">\n <md-menu md-position-mode="left bottom">\n <md-button class="user-button" ng-click="$mdOpenMenu()" aria-label="User settings" translate translate-attr-aria-label="TOOLBAR.USER_SETTINGS">\n <div layout="row" layout-align="space-between center">\n <div class="avatar-wrapper">\n <img md-menu-align-target class="avatar" src="assets/images/avatars/profile.png" ng-if="!vm.user.userpic">\n <img md-menu-align-target class="avatar" ng-src="api/users/{{vm.user.id}}/avatar" ng-if="vm.user.userpic">\n <md-icon md-font-icon ng-class="vm.userStatus.icon" ng-style="{\'color\': vm.userStatus.color }" class="icon status s16"></md-icon>\n </div>\n <div layout="column" layout-align="center center" class="padding-horizontal-5">\n <span class="font-size-14 md-subhead">{{vm.user.fullname}}</span>\n <span class="font-size-12 md-subhead">{{vm.user.name}} <{{vm.user.internal}}></span>\n </div>\n\n <md-icon md-font-icon="icon-chevron-down" class="icon s16" hide-xs></md-icon>\n </div>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.user.showWebBar == 2 && vm.user.phoneBarEnableSettings" class="md-indent">\n <md-icon md-font-icon="icon-cog" class="icon"></md-icon>\n <md-button ng-click="vm.openSettings($event)" ng-disabled="!vm.license.webrtc"><span translate="TOOLBAR.SETTINGS">SETTINGS</span></md-button>\n </md-menu-item>\n\n <md-menu-item class="md-indent">\n <md-icon md-font-icon="icon-key-variant" class="icon"></md-icon>\n <md-button ng-click="vm.changePassword($event)"><span translate="TOOLBAR.CHANGEPASSWORD">Change Password</span></md-button>\n </md-menu-item>\n\n <md-menu-divider></md-menu-divider>\n\n <md-menu-item class="md-indent">\n <md-icon md-font-icon="icon-logout" class="icon"></md-icon>\n <md-button ng-click="vm.logout()">Logout</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-bar>\n\n <div class="toolbar-separator"></div>\n\n <md-button ng-if="vm.user.role === \'agent\' && vm.license.dialer" class="preview-button no-margin" ng-disabled="vm.disable" ng-click="vm.preview($event)" aria-label="Language" md-menu-origin md-menu-align-target>\n <div ng-if="vm.contacts" class="md-accent-bg open-contact-count">{{vm.contacts > 99 ? \'99+\' : vm.contacts}}</div>\n <md-icon md-font-icon="icon-fire" class="icon red-900-fg"></md-icon>\n <md-tooltip><span translate="TOOLBAR.PREVIEW">Preview</span></md-tooltip>\n </md-button>\n\n <ms-search-bar ng-if="vm.user.role !== \'agent\'" on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300" collapse-on-blur="true"></ms-search-bar>\n\n <md-menu id="language-menu" md-offset="0 72" md-position-mode="target-right target" layout="column" layout-align="center center">\n <md-button class="md-icon-button no-margin" ng-click="$mdOpenMenu()" aria-label="Language" md-menu-origin md-menu-align-target>\n <div layout="row" layout-align="center center">\n <img class="flag" ng-src="assets/images/flags/{{vm.selectedLanguage.flag}}.png">\n </div>\n </md-button>\n\n <md-menu-content width="3" id="language-menu-content">\n <md-menu-item ng-repeat="(iso, lang) in vm.languages">\n <md-button ng-click="vm.changeLanguage(lang)" aria-label="{{lang.title}}" translate translate-attr-aria-label="{{lang.title}}">\n <span layout="row" layout-align="start center">\n <img class="flag" ng-src="assets/images/flags/{{lang.flag}}.png">\n <span translate="{{lang.translation}}">{{lang.title}}</span>\n </span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n\n <div class="toolbar-separator"></div>\n\n <md-button ng-if="vm.license.gray && vm.user.role !== \'agent\'" class="md-icon-button" ui-sref="app.settings.license" aria-label="Toggle quick panel">\n <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.gray && vm.user.role === \'agent\'" class="md-icon-button" aria-label="Toggle quick panel">\n <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n </md-button>\n\n <div ng-if="vm.license.gray" class="toolbar-separator"></div>\n\n <md-button id="quick-panel-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'quick-panel\')" aria-label="Toggle quick panel" translate translate-attr-aria-label="TOOLBAR.TOGGLE_QUICK_PANEL">\n <div ng-if="(vm.unreadTotalMessages + vm.unreadTotalGroupMessages)" class="md-accent-bg unread-message-count">{{vm.unreadTotalMessages + vm.unreadTotalGroupMessages}}</div>\n <md-icon md-font-icon="icon-format-list-bulleted" class="icon"></md-icon>\n </md-button>\n </div>\n</div>'),e.put("app/toolbar/preview/dialog.html",'<md-dialog class="preview-dialog" aria-label="preview">\n <form name="previewForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">Preview</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div layout="row" ng-if="vm.preview">\n <div class="md-padding" layout="column" flex="30">\n <md-input-container ng-if="vm.preview.Queue.name" class="md-block">\n <label translate="VOICE.QUEUE">Queue</label>\n <input type="text" ng-model="vm.preview.Queue.name" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.List.name" class="md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <input type="text" ng-model="vm.preview.List.name" disabled="true">\n </md-input-container>\n </div>\n <md-divider></md-divider>\n <div class="md-padding" layout="column" flex="70">\n <md-input-container ng-if="vm.preview.Contact.firstName" class="md-block">\n <label translate="CONTACTMANAGER.FIRSTNAME">FirstName</label>\n <input type="text" ng-model="vm.preview.Contact.firstName" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Contact.lastName" class="md-block">\n <label translate="CONTACTMANAGER.LASTNAME">LastName</label>\n <input type="text" ng-model="vm.preview.Contact.lastName" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Contact.phone" class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input type="text" ng-model="vm.preview.Contact.phone" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Contact.email" class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input type="text" ng-model="vm.preview.Contact.email" disabled="true">\n </md-input-container>\n </div>\n </div>\n <div layout="row" ng-if="!vm.preview">\n <span>no contacts available</span>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" style="padding-right: 16px;">\n <md-button type="submit" ng-disabled="vm.disable" ng-click="vm.originatePreview($event)" class="send-button md-accent md-raised" aria-label="CALL" translate="TOOLS.CALL" translate-attr-aria-label="TOOLS.CALL">\n CALL\n </md-button>\n <md-button type="submit" ng-disabled="vm.disableGetContact" ng-click="vm.nextContact($event)" class="send-button md-accent md-raised" aria-label="NEXTCONTACT" translate="TOOLS.NEXTCONTACT" translate-attr-aria-label="TOOLS.NEXTCONTACT">\n NEXTCONTACT\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>')}]);
\ No newline at end of file